Submitted By: Jim Gifford (patches at jg555 dot com)
Date: 2005-01-14
Initial Package Version: 3.1.x
Origin: Jim Gifford
Upstream Status: In Contrib
Description: Modifies Bootscripts to work with the RaQ2

diff -Naur lfs-bootscripts-3.1.0.orig/Makefile lfs-bootscripts-3.1.0/Makefile
--- lfs-bootscripts-3.1.0.orig/Makefile	2004-11-25 01:35:34.000000000 -0800
+++ lfs-bootscripts-3.1.0/Makefile	2005-01-13 17:04:34.000000000 -0800
@@ -29,6 +29,7 @@
 	install -m ${MODE} lfs/init.d/halt          ${EXTDIR}/rc.d/init.d/
 	install -m ${MODE} lfs/init.d/console       ${EXTDIR}/rc.d/init.d/
 	install -m ${MODE} lfs/init.d/hotplug       ${EXTDIR}/rc.d/init.d
+	install -m ${MODE} lfs/init.d/laststart          ${EXTDIR}/rc.d/init.d/
 	install -m ${MODE} lfs/init.d/localnet      ${EXTDIR}/rc.d/init.d/
 	install -m ${MODE} lfs/init.d/modules       ${EXTDIR}/rc.d/init.d
 	install -m ${MODE} lfs/init.d/mountfs       ${EXTDIR}/rc.d/init.d/
@@ -38,10 +39,12 @@
 	install -m ${MODE} lfs/init.d/reboot        ${EXTDIR}/rc.d/init.d/
 	install -m ${MODE} lfs/init.d/sendsignals   ${EXTDIR}/rc.d/init.d/
 	install -m ${MODE} lfs/init.d/setclock      ${EXTDIR}/rc.d/init.d/
-	install -m ${MODE} lfs/init.d/syslog-ng	    ${EXTDIR}/rc.d/init.d
+	install -m ${MODE} lfs/init.d/sshd          ${EXTDIR}/rc.d/init.d/
+	install -m ${MODE} lfs/init.d/syslog-ng	    ${EXTDIR}/rc.d/init.d/
 	install -m ${MODE} lfs/init.d/swap          ${EXTDIR}/rc.d/init.d/
 	install -m ${MODE} lfs/init.d/template      ${EXTDIR}/rc.d/init.d/
-	install -m ${MODE} lfs/init.d/udev          ${EXTDIR}/rc.d/init.d
+	install -m ${MODE} lfs/init.d/udev          ${EXTDIR}/rc.d/init.d/
+	ln -sf ../init.d/sshd        ${EXTDIR}/rc.d/rc0.d/K30sshd
 	ln -sf ../init.d/network     ${EXTDIR}/rc.d/rc0.d/K80network
 	ln -sf ../init.d/syslog-ng   ${EXTDIR}/rc.d/rc0.d/K90syslog-ng
 	ln -sf ../init.d/hotplug     ${EXTDIR}/rc.d/rc0.d/S50hotplug
@@ -50,16 +53,27 @@
 	ln -sf ../init.d/swap        ${EXTDIR}/rc.d/rc0.d/S80swap
 	ln -sf ../init.d/localnet    ${EXTDIR}/rc.d/rc0.d/S90localnet
 	ln -sf ../init.d/halt        ${EXTDIR}/rc.d/rc0.d/S99halt
+	ln -sf ../init.d/sshd        ${EXTDIR}/rc.d/rc1.d/K30sshd
+	ln -sf ../init.d/laststart   ${EXTDIR}/rc.d/rc1.d/S99laststart
 	ln -sf ../init.d/network     ${EXTDIR}/rc.d/rc1.d/K80network
 	ln -sf ../init.d/syslog-ng   ${EXTDIR}/rc.d/rc1.d/K90syslog-ng
+	ln -sf ../init.d/sshd        ${EXTDIR}/rc.d/rc1.d/K30sshd
+	ln -sf ../init.d/laststart   ${EXTDIR}/rc.d/rc2.d/S99laststart
 	ln -sf ../init.d/network     ${EXTDIR}/rc.d/rc2.d/K80network
 	ln -sf ../init.d/syslog-ng   ${EXTDIR}/rc.d/rc2.d/K90syslog-ng
+	ln -sf ../init.d/sshd        ${EXTDIR}/rc.d/rc3.d/S30sshd
 	ln -sf ../init.d/syslog-ng   ${EXTDIR}/rc.d/rc3.d/S10syslog-ng
+	ln -sf ../init.d/laststart   ${EXTDIR}/rc.d/rc3.d/S99laststart
 	ln -sf ../init.d/network     ${EXTDIR}/rc.d/rc3.d/S20network
+	ln -sf ../init.d/sshd        ${EXTDIR}/rc.d/rc4.d/S30sshd
 	ln -sf ../init.d/syslog-ng   ${EXTDIR}/rc.d/rc4.d/S10syslog-ng
+	ln -sf ../init.d/laststart   ${EXTDIR}/rc.d/rc4.d/S99laststart
 	ln -sf ../init.d/network     ${EXTDIR}/rc.d/rc4.d/S20network
+	ln -sf ../init.d/sshd        ${EXTDIR}/rc.d/rc5.d/S30sshd
 	ln -sf ../init.d/syslog-ng   ${EXTDIR}/rc.d/rc5.d/S10syslog-ng
+	ln -sf ../init.d/laststart   ${EXTDIR}/rc.d/rc5.d/S99laststart
 	ln -sf ../init.d/network     ${EXTDIR}/rc.d/rc5.d/S20network
+	ln -sf ../init.d/sshd        ${EXTDIR}/rc.d/rc6.d/K30sshd
 	ln -sf ../init.d/network     ${EXTDIR}/rc.d/rc6.d/K80network
 	ln -sf ../init.d/syslog-ng   ${EXTDIR}/rc.d/rc6.d/K90syslog-ng
 	ln -sf ../init.d/hotplug     ${EXTDIR}/rc.d/rc6.d/S50hotplug
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/init.d/cleanfs lfs-bootscripts-3.1.0/lfs/init.d/cleanfs
--- lfs-bootscripts-3.1.0.orig/lfs/init.d/cleanfs	2004-12-30 21:23:29.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/init.d/cleanfs	2005-01-13 17:07:02.000000000 -0800
@@ -73,17 +73,21 @@
 case "${1}" in
 	start)
 		boot_mesg -n "Cleaning file systems:" ${INFO}
+		putlcd "Cleaning file" "systems:"
 
 		boot_mesg -n " /tmp" ${NORMAL}
+		putlcd "Cleaning:" "/tmp"
 		cd /tmp &&
 		find . -xdev -mindepth 1 ! -name lost+found \
 			-delete || failed=1
 
 		boot_mesg -n " /var/lock" ${NORMAL}
+		putlcd "Cleaning:" "/var/lock"
 		cd /var/lock &&
 		find . -type f ! -newer /proc -exec rm -f {} \; || failed=1
 
 		boot_mesg " /var/run" ${NORMAL}
+		putlcd "Cleaning:" "/var/run"
 		cd /var/run &&
 		find . ! -type d ! -name utmp ! -newer /proc \
 			-exec rm -f {} \; || failed=1
@@ -99,6 +103,7 @@
 		if egrep -qv '^(#|$)' /etc/sysconfig/createfiles 2>/dev/null
 		then
 			boot_mesg "Creating files and directories..."
+			putlcd "Creating files" "and directories"
 			create_files
 			evaluate_retval
 		fi
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/init.d/console lfs-bootscripts-3.1.0/lfs/init.d/console
--- lfs-bootscripts-3.1.0.orig/lfs/init.d/console	2004-12-20 22:45:11.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/init.d/console	2005-01-13 17:04:34.000000000 -0800
@@ -27,6 +27,7 @@
 		if [ -n "${KEYMAP}" ]
 		then
 			boot_mesg "Loading keymap: ${KEYMAP}..."
+			putlcd "Loading keymap:" "${KEYMAP}"
 			loadkeys ${KEYMAP} &>/dev/null
 			evaluate_retval
 		fi
@@ -34,6 +35,7 @@
 		if [ -n "${KEYMAP_CORRECTIONS}" ]
 		then
 			boot_mesg "Loading keymap corrections: ${KEYMAP_CORRECTIONS}..."
+			putlcd "Loading keymap" "corrections"
 			loadkeys ${KEYMAP_CORRECTIONS} &>/dev/null
 			evaluate_retval
 		fi
@@ -41,6 +43,7 @@
 		if [ -n "${FONT}" ]
 		then
 			boot_mesg "Setting screen font to ${FONT}..."
+			putlcd "Setting font" "to $FONT"
 			setfont $FONT &>/dev/null
 			evaluate_retval
 		fi
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/init.d/halt lfs-bootscripts-3.1.0/lfs/init.d/halt
--- lfs-bootscripts-3.1.0.orig/lfs/init.d/halt	2004-12-20 22:45:11.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/init.d/halt	2005-01-13 17:04:34.000000000 -0800
@@ -17,6 +17,7 @@
 
 case "${1}" in
 	stop)
+		putlcd "Shutdown" "Completed"
 		halt -d -f -i -p
 		;;
 	*)
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/init.d/hotplug lfs-bootscripts-3.1.0/lfs/init.d/hotplug
--- lfs-bootscripts-3.1.0.orig/lfs/init.d/hotplug	2004-12-20 22:45:11.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/init.d/hotplug	2005-01-13 17:04:34.000000000 -0800
@@ -18,6 +18,7 @@
 case "${1}" in
 	start|restart)
 		boot_mesg "Loading modules for system devices..."
+		putlcd "Loading modules" "for devices"
 		for rc in /etc/hotplug/*.rc
 		do
 			${rc} ${1}
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/init.d/laststart lfs-bootscripts-3.1.0/lfs/init.d/laststart
--- lfs-bootscripts-3.1.0.orig/lfs/init.d/laststart	1969-12-31 16:00:00.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/init.d/laststart	2005-01-13 17:04:34.000000000 -0800
@@ -0,0 +1,31 @@
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/laststart
+#
+# Description : Show IP Addresses on LCD Screen
+#
+# Author      : Jim Gifford - jim@linuxfromscratch.org
+#
+# Version     : 00.00
+#
+# Notes       :
+#
+########################################################################
+
+. /etc/sysconfig/rc
+. $rc_functions
+
+case "$1" in
+	start)
+		IFACE1_IP="`ip addr show dev eth0 | grep inet | cut -d / -f 1 | cut -d t  -f 2 | cut -d' ' -f 2 `"
+		IFACE2_IP="`ip addr show dev eth1 | grep inet | cut -d / -f 1 | cut -d t  -f 2 | cut -d' ' -f 2 `"
+		putlcd "1 $IFACE1_IP" "2 $IFACE2_IP"
+	;;
+	*)
+		echo "Usage: {start}"
+		exit 1
+		;;
+esac
+
+# End $rc_base/init.d/laststart
+
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/init.d/mountfs lfs-bootscripts-3.1.0/lfs/init.d/mountfs
--- lfs-bootscripts-3.1.0.orig/lfs/init.d/mountfs	2004-12-20 22:45:11.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/init.d/mountfs	2005-01-13 17:04:34.000000000 -0800
@@ -18,6 +18,7 @@
 case "${1}" in
 	start)
 		boot_mesg "Remounting root file system in read-write mode..."
+		putlcd "Remounting /" "in rw mode"
 		mount -n -o remount,rw / &>/dev/null
 		evaluate_retval
 
@@ -25,6 +26,7 @@
 		rm -f /fastboot /forcefsck
 
 		boot_mesg "Recording existing mounts in /etc/mtab..."
+		putlcd "Recording mounts" "in /etc/mtab"
 		> /etc/mtab
 		mount -f / || failed=1
 		mount -f /proc || failed=1
@@ -38,12 +40,14 @@
 		# This will mount all filesystems that do not have _netdev in
 		# their option list.  _netdev denotes a network filesystem.
 		boot_mesg "Mounting remaining file systems..."
+		putlcd "Mounting" "file systems"
 		mount -a -O no_netdev &>/dev/null
 		evaluate_retval
 		;;
 
 	stop)
 		boot_mesg "Unmounting all other currently mounted file systems..."
+		putlcd "Unmounting" "file systems"
 		umount -a -d -r -t noramfs &>/dev/null
 		evaluate_retval
 		;;
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/init.d/rc lfs-bootscripts-3.1.0/lfs/init.d/rc
--- lfs-bootscripts-3.1.0.orig/lfs/init.d/rc	2004-12-30 21:23:29.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/init.d/rc	2005-01-13 17:04:34.000000000 -0800
@@ -35,6 +35,7 @@
 if [ ! -d ${rc_base}/rc${runlevel}.d ]
 then
 	boot_mesg "${rc_base}/rc${runlevel}.d does not exist." ${WARNING}
+	putlcd "${rc_base}/rc${runlevel}.d" "does not exist."
 	boot_mesg_flush
 	exit 1
 fi
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/init.d/reboot lfs-bootscripts-3.1.0/lfs/init.d/reboot
--- lfs-bootscripts-3.1.0.orig/lfs/init.d/reboot	2004-12-20 22:45:11.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/init.d/reboot	2005-01-13 17:04:34.000000000 -0800
@@ -18,6 +18,7 @@
 case "${1}" in
 	stop)
 		boot_mesg "Restarting system..."
+		putlcd "Restarting" "system..."
 		reboot -d -f -i
 		;;
 
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/init.d/sendsignals lfs-bootscripts-3.1.0/lfs/init.d/sendsignals
--- lfs-bootscripts-3.1.0.orig/lfs/init.d/sendsignals	2004-12-20 22:45:11.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/init.d/sendsignals	2005-01-13 17:04:34.000000000 -0800
@@ -18,6 +18,7 @@
 case "${1}" in
 	stop)
 		boot_mesg "Sending all processes the TERM signal..."
+		putlcd "Sending TERM" "signal"
 		killall5 -15
 		error_value=${?}
 
@@ -31,6 +32,7 @@
 		fi
 
 		boot_mesg "Sending all processes the KILL signal..."
+		putlcd "Sending KILL" "signal"
 		killall5 -9
 		error_value=${?}
 
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/init.d/setclock lfs-bootscripts-3.1.0/lfs/init.d/setclock
--- lfs-bootscripts-3.1.0.orig/lfs/init.d/setclock	2004-12-20 22:45:11.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/init.d/setclock	2005-01-13 17:04:34.000000000 -0800
@@ -32,12 +32,14 @@
 case ${1} in
 	start)
 		boot_mesg "Setting system clock..."
+		putlcd "Setting:" "system clock"
 		hwclock --hctosys ${CLOCKPARAMS} &>/dev/null
 		evaluate_retval
 		;;
 
 	stop)
 		boot_mesg "Setting hardware clock..."
+		putlcd "Setting:" "hardware clock"
 		hwclock --systohc ${CLOCKPARAMS} &>/dev/null
 		evaluate_retval
 		;;
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/init.d/sshd lfs-bootscripts-3.1.0/lfs/init.d/sshd
--- lfs-bootscripts-3.1.0.orig/lfs/init.d/sshd	1969-12-31 16:00:00.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/init.d/sshd	2005-01-13 17:04:34.000000000 -0800
@@ -0,0 +1,54 @@
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/sshd
+#
+# Description : SSH Server
+#
+# Author      :
+#
+# Version     : 00.01
+#
+# Notes       :
+#
+########################################################################
+
+. /etc/sysconfig/rc
+. $rc_functions
+
+case "$1" in
+	start)
+		echo "Starting SSH Server..."
+		putlcd "Starting:" "SSH Server"
+		loadproc /usr/sbin/sshd
+		;;
+
+	stop)
+		echo "Stopping SSH Server..."
+		putlcd "Stopping:" "SSH Server"
+		killproc /usr/sbin/sshd
+		;;
+
+	reload)
+		echo "Reloading SSH Server..."
+		reloadproc /usr/sbin/sshd
+		;;
+
+	restart)
+		$0 stop
+		sleep 1
+		$0 start
+		;;
+
+	status)
+		statusproc /usr/sbin/sshd
+		;;
+
+	*)
+		echo "Usage: $0 {start|stop|reload|restart|status}"
+		exit 1
+		;;
+esac
+
+# End $rc_base/init.d/sshd
+
+
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/init.d/swap lfs-bootscripts-3.1.0/lfs/init.d/swap
--- lfs-bootscripts-3.1.0.orig/lfs/init.d/swap	2004-12-20 22:45:11.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/init.d/swap	2005-01-13 17:04:34.000000000 -0800
@@ -18,12 +18,14 @@
 case "${1}" in
 	start)
 		boot_mesg "Activating all swap files/partitions..."
+		putlcd "Activating" "swap"
 		swapon -a
 		evaluate_retval
 		;;
 
 	stop)
 		boot_mesg "Deactivating all swap files/partitions..."
+		putlcd "Deactivating" "swap"
 		swapoff -a
 		evaluate_retval
 		;;
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/init.d/syslog-ng lfs-bootscripts-3.1.0/lfs/init.d/syslog-ng
--- lfs-bootscripts-3.1.0.orig/lfs/init.d/syslog-ng	2004-12-20 22:45:11.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/init.d/syslog-ng	2005-01-13 17:04:34.000000000 -0800
@@ -18,11 +18,13 @@
 case "${1}" in
 	start)
 		boot_mesg "Starting system log daemon..."
+		putlcd "Starting:" "system log"
 		loadproc syslog-ng
 		;;
 
 	stop)
 		boot_mesg "Stopping system log daemon..."
+		putlcd "Stopping:" "system log"
 		killproc syslog-ng
 		;;
 
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/sysconfig/network-devices/ifdown lfs-bootscripts-3.1.0/lfs/sysconfig/network-devices/ifdown
--- lfs-bootscripts-3.1.0.orig/lfs/sysconfig/network-devices/ifdown	2004-12-30 21:23:29.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/sysconfig/network-devices/ifdown	2005-01-13 17:04:34.000000000 -0800
@@ -73,6 +73,7 @@
 				IFCONFIG=${file} ${network_devices}/services/${SERVICE} ${1} down
 			else
 				boot_mesg "Interface ${1} doesn't exist." ${WARNING}
+				putlcd "Interface ${1}" "doesn't exist."
 				echo_warning
 			fi
 		else
@@ -93,6 +94,7 @@
 		if echo "${link_status}" | grep -q UP
 		then
 			boot_mesg "Bringing down the ${1} interface..."
+			putlcd "Bringing down" "${1} interface"
 			ip link set ${1} down
 			evaluate_retval
 		fi
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/sysconfig/network-devices/ifup lfs-bootscripts-3.1.0/lfs/sysconfig/network-devices/ifup
--- lfs-bootscripts-3.1.0.orig/lfs/sysconfig/network-devices/ifup	2004-12-20 22:45:11.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/sysconfig/network-devices/ifup	2005-01-13 17:04:34.000000000 -0800
@@ -81,6 +81,7 @@
 				IFCONFIG=${file} ${network_devices}/services/${SERVICE} ${1} up
 			else
 				boot_mesg "Interface ${1} doesn't exist." ${WARNING}
+				putlcd "Interface ${1}" "doesn't exist."
 				echo_warning
 			fi
 		else
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/sysconfig/network-devices/services/ipv4-static lfs-bootscripts-3.1.0/lfs/sysconfig/network-devices/services/ipv4-static
--- lfs-bootscripts-3.1.0.orig/lfs/sysconfig/network-devices/services/ipv4-static	2004-12-30 21:23:29.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/sysconfig/network-devices/services/ipv4-static	2005-01-13 17:04:34.000000000 -0800
@@ -57,6 +57,7 @@
 case "${2}" in
 	up)
 		boot_mesg "Adding IPv4 address ${IP} to the ${1} interface..."
+		putlcd "Setting" "${1} IP - ${IP}"
 		ip addr add ${args} dev ${1}
 		evaluate_retval
 	
@@ -68,6 +69,7 @@
 				echo_warning
 			else
 				boot_mesg "Setting up default gateway..."
+				putlcd "Setting up" "default gateway"
 				ip route add default via ${GATEWAY} dev ${1}
 				evaluate_retval
 			 fi
@@ -78,11 +80,13 @@
 		if [ -n "${GATEWAY}" ]
 		then
 			boot_mesg "Removing default gateway..."
+			putlcd "Removing" "default gateway"
 			ip route del default
 			evaluate_retval
 		fi
 	
 		boot_mesg "Removing IPv4 address ${IP} from the ${1} interface..."
+		putlcd "Unsetting" "${1} IP - ${IP}"
 		ip addr del ${args} dev ${1}
 		evaluate_retval
 	;;
diff -Naur lfs-bootscripts-3.1.0.orig/lfs/sysconfig/network-devices/services/ipv4-static-route lfs-bootscripts-3.1.0/lfs/sysconfig/network-devices/services/ipv4-static-route
--- lfs-bootscripts-3.1.0.orig/lfs/sysconfig/network-devices/services/ipv4-static-route	2004-12-20 22:45:11.000000000 -0800
+++ lfs-bootscripts-3.1.0/lfs/sysconfig/network-devices/services/ipv4-static-route	2005-01-13 17:04:34.000000000 -0800
@@ -79,12 +79,14 @@
 case "${2}" in
 	up)
 		boot_mesg "Adding '${desc}' route to the ${1} interface..."
+		putlcd "Adding route" "${desc}"
 		ip route add ${args} dev ${1}
 		evaluate_retval
 	;;
 	
 	down)
 		boot_mesg "Removing '${desc}' route from the ${1} interface..."
+		putlcd "Removing route" "${desc}"
 		ip route del ${args} dev ${1}
 		evaluate_retval
 	;;
