#!/bin/ash
#
# $Id: init.sh 36 2007-05-12 01:01:47Z a $
#
export PATH="/bin:/sbin:/usr/bin:/usr/sbin"
mount -t proc proc /proc 
sysctl -w kernel.panic=10
CMDLINE=`cat /proc/cmdline` 

#echo Creating block devices
#mkdevices /dev
#echo Creating root device
#mkrootdev /dev/root
#echo 0x0100 > /proc/sys/kernel/real-root-dev
#echo "----- Making Device Mapper Nodes."
#/devmap_mknod.sh
#echo "----- /      Device Mapper Nodes."

echo "RAID ..."
mdadm -A -s

#bash

echo "Scanning for volume groups."
vgscan
vgchange -ay
#bash

echo "Mounting root filesystem"
#mount -t xfs -o noatime /dev/mapper/vg-root /mnt/new
mount -t xfs -o noatime /dev/vg/root /mnt/new
#mount -o noatime --rw -t reiserfs /dev/mapper/system-slash /sysroot
#pivot_root /sysroot /sysroot/initrd
#umount /initrd/proc

sync
sync

umount /proc
exec switch_root /mnt/new /sbin/init ${CMDLINE}
