Index: Changelog
===================================================================
--- Changelog	(revision 1d02f0151489112521f130508e5f2733c0eaafca)
+++ Changelog	(revision 1680407a0a94e487102c47569de0a9cb65688462)
@@ -1,2 +1,5 @@
+jim - October 24, 2007
+	* Merged Netboot Scripts
+
 jim - October 23, 2007
 	* Merged BLFS changes from SVN
Index: Makefile
===================================================================
--- Makefile	(revision 1d02f0151489112521f130508e5f2733c0eaafca)
+++ Makefile	(revision 1680407a0a94e487102c47569de0a9cb65688462)
@@ -194,4 +194,15 @@
 install-service-pppoe: create-service-dir
 	install -m ${MODE} cblfs/sysconfig/network-devices/services/pppoe    ${EXTDIR}/sysconfig/network-devices/services
+
+install-netboot:
+	install -d -m ${DIRMODE} ${EXTDIR}/rc.d
+	install -m ${MODE} netboot/rc0.d       ${EXTDIR}/rc.d/
+	install -m ${MODE} netboot/rc1.d       ${EXTDIR}/rc.d/
+	install -m ${MODE} netboot/rcsysinit.d ${EXTDIR}/rc.d/
+	ln -sf ../rc.d/rc0.d ${EXTDIR}/rc.d/rc6.d
+	ln -sf ../rc.d/rc1.d ${EXTDIR}/rc.d/rc2.d
+	ln -sf ../rc.d/rc1.d ${EXTDIR}/rc.d/rc3.d
+	ln -sf ../rc.d/rc1.d ${EXTDIR}/rc.d/rc4.d
+	ln -sf ../rc.d/rc1.d ${EXTDIR}/rc.d/rc5.d
 
 install-alsa: create-dirs
Index: cblfs/init.d/dbus
===================================================================
--- cblfs/init.d/dbus	(revision 1d02f0151489112521f130508e5f2733c0eaafca)
+++ cblfs/init.d/dbus	(revision 1680407a0a94e487102c47569de0a9cb65688462)
@@ -34,5 +34,5 @@
 
         status)
-                statusproc /usr/bin/dbus-daemon
+                statusproc -p "$pidfile" /usr/bin/dbus-daemon
                 ;;
 
Index: cblfs/init.d/gdm
===================================================================
--- cblfs/init.d/gdm	(revision 1d02f0151489112521f130508e5f2733c0eaafca)
+++ cblfs/init.d/gdm	(revision 1680407a0a94e487102c47569de0a9cb65688462)
@@ -11,15 +11,17 @@
 . $rc_functions
 
-export PATH=$PATH:/opt/gnome-2.18.3/bin:/opt/gnome-2.18.3/sbin
+pidfile=/var/run/gdm.pid
+
+export PATH=$PATH:/opt/gnome/bin:/opt/gnome/sbin
 
 case "$1" in
 	start)
 		boot_mesg "Starting GDM..."
-		loadproc gdm
+		loadproc -p $pidfile gdm
 		;;
 
 	stop)
 		boot_mesg "Stopping GDM..."
-		if [ -f /var/run/gdm.pid ]; then
+		if [ -f $pidfile ]; then
 			loadproc gdm-stop
 		fi
Index: cblfs/init.d/gpm
===================================================================
--- cblfs/init.d/gpm	(revision 1d02f0151489112521f130508e5f2733c0eaafca)
+++ cblfs/init.d/gpm	(revision 1680407a0a94e487102c47569de0a9cb65688462)
@@ -11,4 +11,6 @@
 . /etc/sysconfig/rc
 . $rc_functions
+
+pidfile=/var/run/gpm.pid
 
 if [ -f /etc/sysconfig/mouse ]
@@ -27,10 +29,10 @@
 	start)
 		boot_mesg "Starting gpm..."
-		loadproc /usr/sbin/gpm -m $MDEVICE -t $PROTOCOL $GPMOPTS
+		loadproc -p $pidfile /usr/sbin/gpm -m $MDEVICE -t $PROTOCOL $GPMOPTS
 		;;
 
 	stop)
 		boot_mesg "Stopping gpm..."
-		killproc /usr/sbin/gpm
+		killproc -p $pidfile /usr/sbin/gpm
 		;;
 
@@ -42,5 +44,5 @@
 
 	status)
-		statusproc /usr/sbin/gpm
+		statusproc -p $pidfile /usr/sbin/gpm
 		;;
 
Index: cblfs/init.d/haldaemon
===================================================================
--- cblfs/init.d/haldaemon	(revision 1d02f0151489112521f130508e5f2733c0eaafca)
+++ cblfs/init.d/haldaemon	(revision 1680407a0a94e487102c47569de0a9cb65688462)
@@ -11,13 +11,15 @@
 . $rc_functions
 
+pidfile=/var/run/hald/pid
+
 case "$1" in
 	start)
 		boot_mesg "Starting the HAL Daemon..."
-		loadproc /usr/sbin/hald --use-syslog
+		loadproc -p $pidfile /usr/sbin/hald --use-syslog
 		;;
 
 	stop)
 		boot_mesg "Stopping the HAL Daemon..."
-		killproc /usr/sbin/hald
+		killproc -p $pidfile /usr/sbin/hald
 		;;
 
@@ -29,5 +31,5 @@
 
 	status)
-		statusproc /usr/sbin/hald
+		statusproc -p $pidfile /usr/sbin/hald
 		;;
 
Index: cblfs/init.d/ntp
===================================================================
--- cblfs/init.d/ntp	(revision 1d02f0151489112521f130508e5f2733c0eaafca)
+++ cblfs/init.d/ntp	(revision 1680407a0a94e487102c47569de0a9cb65688462)
@@ -8,14 +8,16 @@
 . $rc_functions
 
+pidfile=/var/run/ntpd.pid
+
 case "$1" in
 	start)
 		boot_mesg "Starting ntpd..."
 		ntpd -gqx
-		loadproc /usr/sbin/ntpd
+		loadproc -p $pidfile /usr/sbin/ntpd
 		;;
 
 	stop)
 		boot_mesg "Stopping ntpd..."
-		killproc /usr/sbin/ntpd
+		killproc -p $pidfile /usr/sbin/ntpd
 		;;
 
@@ -27,5 +29,5 @@
 
 	status)
-		statusproc /usr/sbin/ntpd
+		statusproc -p $pidfile /usr/sbin/ntpd
 		;;
 
Index: cblfs/init.d/samba
===================================================================
--- cblfs/init.d/samba	(revision 1d02f0151489112521f130508e5f2733c0eaafca)
+++ cblfs/init.d/samba	(revision 1680407a0a94e487102c47569de0a9cb65688462)
@@ -11,27 +11,30 @@
 . $rc_functions
 
+smbdpid=/var/run/smbd.pid
+nmbdpid=/var/run/nmbd.pid
+
 case "$1" in
 	start)
 		boot_mesg "Starting nmbd..."
-		loadproc /usr/sbin/nmbd -D
+		loadproc -p $nmbdpid /usr/sbin/nmbd -D
 
 		boot_mesg "Starting smbd..."
-		loadproc /usr/sbin/smbd -D
+		loadproc -p $smbdpid /usr/sbin/smbd -D
 		;;
 
 	stop)
 		boot_mesg "Stopping smbd..."
-		killproc /usr/sbin/smbd
+		killproc -p $smbdpid /usr/sbin/smbd
 
 		boot_mesg "Stopping nmbd..."
-		killproc /usr/sbin/nmbd
+		killproc -p $nmbdpid /usr/sbin/nmbd
                 ;;
 
 	reload)
 		boot_mesg "Reloading smbd..."
-		reloadproc /usr/sbin/smbd
+		reloadproc -p $smbdpid /usr/sbin/smbd
 
 		boot_mesg "Reloading nmbd..."
-		reloadproc /usr/sbin/nmbd
+		reloadproc -p $nmbdpid /usr/sbin/nmbd
 		;;
 
@@ -43,6 +46,6 @@
 
 	status)
-		statusproc /usr/sbin/nmbd
-		statusproc /usr/sbin/smbd
+		statusproc -p $nmbdpid /usr/sbin/nmbd
+		statusproc -p $smbdpid /usr/sbin/smbd
 		;;
 
Index: cblfs/init.d/sshd
===================================================================
--- cblfs/init.d/sshd	(revision 1d02f0151489112521f130508e5f2733c0eaafca)
+++ cblfs/init.d/sshd	(revision 1680407a0a94e487102c47569de0a9cb65688462)
@@ -11,21 +11,23 @@
 . $rc_functions
 
+pidfile=/var/run/sshd.pid
+
 case "$1" in
     start)
         boot_mesg "Starting SSH Server..."
         # Also prevent ssh from being killed by out of memory conditions
-        loadproc /usr/sbin/sshd 
+        loadproc -p $pidfile /usr/sbin/sshd 
         sleep 1
-        echo "-16" >/proc/`cat /var/run/sshd.pid`/oom_adj
+        echo "-16" >/proc/`cat $pidfile`/oom_adj
         ;;
 
     stop)
         boot_mesg "Stopping SSH Server..."
-        killproc /usr/sbin/sshd
+        killproc -p $pidfile /usr/sbin/sshd
         ;;
 
     reload)
         boot_mesg "Reloading SSH Server..."
-        reloadproc /usr/sbin/sshd
+        reloadproc -p $pidfile /usr/sbin/sshd
         ;;
 
@@ -37,5 +39,5 @@
 
     status)
-        statusproc /usr/sbin/sshd
+        statusproc -p $pidfile /usr/sbin/sshd
         ;;
 
Index: netboot/rc.0
===================================================================
--- netboot/rc.0	(revision 1680407a0a94e487102c47569de0a9cb65688462)
+++ netboot/rc.0	(revision 1680407a0a94e487102c47569de0a9cb65688462)
@@ -0,0 +1,33 @@
+#!/bin/sh
+########################################################################
+# Begin /rc.0
+#
+# 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
+
+echo "Sending all processes the TERM signal"
+killall5 -15
+
+echo "Sending all processes the KILL signal"
+killall5 -9
+
+echo "Syncing file systems"
+sync
+
+echo "Setting System Clock"
+hwclock --systohc --utc
+
+echo "Unmounting all other currently mounted file systems"
+umount -a -d -r &
+
+echo "Halting System"
+halt -d -f -i -p
Index: netboot/rc.1
===================================================================
--- netboot/rc.1	(revision 1680407a0a94e487102c47569de0a9cb65688462)
+++ netboot/rc.1	(revision 1680407a0a94e487102c47569de0a9cb65688462)
@@ -0,0 +1,15 @@
+#!/bin/sh
+########################################################################
+# Begin /rc.1
+#
+# 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
Index: netboot/rc.sysinit
===================================================================
--- netboot/rc.sysinit	(revision 1680407a0a94e487102c47569de0a9cb65688462)
+++ netboot/rc.sysinit	(revision 1680407a0a94e487102c47569de0a9cb65688462)
@@ -0,0 +1,51 @@
+#!/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
