#!/bin/sh
########################################################################
# Begin /rc.sysinit
#
# Description : Modified Bootscript for NFSRoot booting
#
# Authors     : Jim Gifford - jim@linuxfromscratch.org
#
# Version     : 00.00
#
# Notes       :
#
########################################################################

export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin:/tools/sbin

if [ -d "/lib64" ]; then
	udev_libdir=/lib64
else
	udev_libdir=/lib
fi

echo -n "Mounting kernel-based file systems:"
echo -n " proc"
mount -n /proc
echo -n " sys"
mount -n /sys
echo ""

echo "Starting udev"
mount -n -t tmpfs -o mode=0755 udev /dev
cp --preserve=all --recursive --remove-destination  ${udev_libdir}/udev/devices/* /dev
chmod 1777 /dev/shm
echo "" > /sys/kernel/uevent_helper
/sbin/udevd --daemon
mkdir -p /dev/.udev/queue
/sbin/udevtrigger
/sbin/udevsettle

echo "Remounting Root File System"
mount -n -o remount,rw /

echo "Creating mtab"
> /etc/mtab
mount -f /
mount -f /proc
mount -f /sys
mount -a -O no_netdev

echo "Setting System Clock"
hwclock --hctosys --utc
