r4196 - in trunk/bootscripts: . contrib/init.d contrib/sysconfig/network-devices/services lfs/init.d lfs/sysconfig/network-devices lfs/sysconfig/network-devices/services

nathan at linuxfromscratch.org nathan at linuxfromscratch.org
Thu Sep 23 00:02:02 PDT 2004


Author: nathan
Date: 2004-09-23 01:01:58 -0600 (Thu, 23 Sep 2004)
New Revision: 4196

Modified:
   trunk/bootscripts/CHANGELOG
   trunk/bootscripts/contrib/init.d/hotplug
   trunk/bootscripts/contrib/init.d/syslog-ng
   trunk/bootscripts/contrib/sysconfig/network-devices/services/mtu
   trunk/bootscripts/lfs/init.d/checkfs
   trunk/bootscripts/lfs/init.d/cleanfs
   trunk/bootscripts/lfs/init.d/console
   trunk/bootscripts/lfs/init.d/localnet
   trunk/bootscripts/lfs/init.d/modules
   trunk/bootscripts/lfs/init.d/mountfs
   trunk/bootscripts/lfs/init.d/mountkernfs
   trunk/bootscripts/lfs/init.d/rc
   trunk/bootscripts/lfs/init.d/sendsignals
   trunk/bootscripts/lfs/init.d/setclock
   trunk/bootscripts/lfs/init.d/swap
   trunk/bootscripts/lfs/init.d/sysklogd
   trunk/bootscripts/lfs/init.d/template
   trunk/bootscripts/lfs/init.d/udev
   trunk/bootscripts/lfs/sysconfig/network-devices/ifdown
   trunk/bootscripts/lfs/sysconfig/network-devices/ifup
   trunk/bootscripts/lfs/sysconfig/network-devices/services/ipv4-static
   trunk/bootscripts/lfs/sysconfig/network-devices/services/ipv4-static-route
Log:
All scripts have been converted to boot_mesg

Modified: trunk/bootscripts/CHANGELOG
===================================================================
--- trunk/bootscripts/CHANGELOG	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/CHANGELOG	2004-09-23 07:01:58 UTC (rev 4196)
@@ -7,6 +7,7 @@
 	  next line
 	* boot_log has been added.  the echo_ functions commit the log,
 	  and then clear the BOOTMSG variable
+	* All scriptes have been converted to use boot_mesg
 
 n/a - September 21, 2004
 	* boot_mesg has been enhanced.  Subsequent calls will overwrite previous text,

Modified: trunk/bootscripts/contrib/init.d/hotplug
===================================================================
--- trunk/bootscripts/contrib/init.d/hotplug	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/contrib/init.d/hotplug	2004-09-23 07:01:58 UTC (rev 4196)
@@ -14,7 +14,7 @@
 		# Set hotplug as the default manager of hotplug events
 		echo /sbin/hotplug > /proc/sys/kernel/hotplug
 
-		echo "Loading modules for system devices..."
+		boot_mesg "Loading modules for system devices..."
 		for rc in /etc/hotplug/*.rc; do
 			$rc $1
 		done

Modified: trunk/bootscripts/contrib/init.d/syslog-ng
===================================================================
--- trunk/bootscripts/contrib/init.d/syslog-ng	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/contrib/init.d/syslog-ng	2004-09-23 07:01:58 UTC (rev 4196)
@@ -9,17 +9,17 @@
 
 case "$1" in
 	start)
-		echo "Starting system log daemon..."
+		boot_mesg "Starting system log daemon..."
 		loadproc syslog-ng
 		;;
 
 	stop)
-		echo "Stopping system log daemon..."
+		boot_mesg "Stopping system log daemon..."
 		killproc syslog-ng
 		;;
 
 	reload)
-		echo "Reloading system log daemon config file..."
+		boot_mesg "Reloading system log daemon config file..."
 		reloadproc syslog-ng 1
 		;;
 

Modified: trunk/bootscripts/contrib/sysconfig/network-devices/services/mtu
===================================================================
--- trunk/bootscripts/contrib/sysconfig/network-devices/services/mtu	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/contrib/sysconfig/network-devices/services/mtu	2004-09-23 07:01:58 UTC (rev 4196)
@@ -12,13 +12,14 @@
 . $IFCONFIG
 
 if [ -z "$MTU" ]; then
-	echo "MTU variable missing from $IFCONFIG, cannot continue"
+	boot_mesg "MTU variable missing from $IFCONFIG, cannot continue"
+	print_status failure
 	exit 1
 fi
 
 case "$2" in
 	up)
-		echo "Setting the MTU for $1 to $MTU"
+		boot_mesg "Setting the MTU for $1 to $MTU"
 		echo "$MTU" > "/sys/class/net/$1/mtu"
 		evaluate_retval
 	;;

Modified: trunk/bootscripts/lfs/init.d/checkfs
===================================================================
--- trunk/bootscripts/lfs/init.d/checkfs	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/init.d/checkfs	2004-09-23 07:01:58 UTC (rev 4196)
@@ -22,11 +22,12 @@
 	start)
 		if [ -f /fastboot ]
 		then
-			echo "Fast boot requested, will not perform file system checks"
+			boot_mesg "Fast boot requested, will not perform file system checks"
+			print_status warning
 			exit 0
 		fi
 
-		echo "Mounting root file system in read-only mode..."
+		boot_mesg "Mounting root file system in read-only mode..."
 		mount -n -o remount,ro /
 		evaluate_retval
 
@@ -47,23 +48,25 @@
 
 		if [ -f /forcefsck ]
 		then
-			echo "/forcefsck exists, forcing file system check"
+			boot_mesg "/forcefsck exists, forcing file system check"
+			print_status warning
 			options="-f"
-			else
+		else
 			options=""
 		fi
 
-		echo "Checking file systems..."
+		boot_mesg "Checking file systems..."
 		#Note: -a option used to be -p; but this fails e.g. on fsck.minix
 		fsck $options -a -A -C -T
 		error_value=$?
 
 		if [ "$error_value" = 1 ]
 		then
+			
 			echo -n -e $WARNING
-			echo "File system errors were found and have been corrected."
-			echo "You may want to double-check that everything was fixed"
-			echo -n "properly"
+			boot_mesg "\nFile system errors were found and have been corrected."
+			boot_mesg "  You may want to double-check that everything was fixed"
+			boot_mesg " properly"
 			echo -n -e $NORMAL
 			print_status warning
 		fi
@@ -76,7 +79,7 @@
 		if [ "$error_value" = 2 -o "$error_value" = 3 ]
 		then
 			echo -n -e $WARNING
-			echo "File system errors were found and have been corrected, but"
+			echo "\nFile system errors were found and have been corrected, but"
 			echo "the nature of the errors require this system to be rebooted."
 			echo
 			echo -n "When you press Enter, this system will be rebooted."
@@ -108,7 +111,7 @@
 		if [ "$error_value" -ge 16 ]
 		then 
 			echo -n -e $FAILURE
-			echo "Unexpected Failure running fsck. Exited with "$error_value
+			boot_mesg "\nUnexpected Failure running fsck. Exited with "$error_value
 			echo -n -e $NORMAL
 			print_status failure
 			exit $error_value

Modified: trunk/bootscripts/lfs/init.d/cleanfs
===================================================================
--- trunk/bootscripts/lfs/init.d/cleanfs	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/init.d/cleanfs	2004-09-23 07:01:58 UTC (rev 4196)
@@ -27,9 +27,9 @@
 						char)   mknod "$name" c $maj $min	;;
 						block)  mknod "$name" b $maj $min	;;
 						pipe)   mknod "$name" p			;;
-						*) echo "Unknown device type: $dtype"   ;;
+						*) boot_mesg "\nUnknown device type: $dtype"   ;;
 						esac            ;;
-					*)      echo "Unknown type: $type" >&2
+					*) boot_mesg "\nUnknown type: $type" >&2
 						continue        ;;
 				esac
 
@@ -43,18 +43,18 @@
 
 case "$1" in
 	start)
-		echo -n "Cleaning file systems:"
+		boot_mesg "Cleaning file systems:"
 
-		echo -n " /tmp"
+		boot_mesg " /tmp"
 		cd /tmp &&
 		find . -depth -xdev -mindepth 1 ! -name lost+found \
 			-exec rm -rf {} \; || failed=1
 
-		echo -n " /var/lock"
+		boot_mesg " /var/lock"
 		cd /var/lock &&
 		find . -type f ! -newer /proc -exec rm -f {} \; || failed=1
 
-		echo " /var/run"
+		boot_mesg " /var/run"
 		cd /var/run &&
 		find . ! -type d ! -name utmp ! -newer /proc \
 			-exec rm -f {} \; || failed=1
@@ -68,7 +68,7 @@
 		evaluate_retval
 
 		if egrep -qv '^(#|$)' /etc/sysconfig/createfiles 2>/dev/null; then
-			echo "Creating files and directories..."
+			boot_mesg "Creating files and directories..."
 			create_files
 			evaluate_retval
 		fi

Modified: trunk/bootscripts/lfs/init.d/console
===================================================================
--- trunk/bootscripts/lfs/init.d/console	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/init.d/console	2004-09-23 07:01:58 UTC (rev 4196)
@@ -16,17 +16,19 @@
 case "$1" in
 	start)
 		if [ -n "$KEYMAP" ]; then
-			loadkeys $KEYMAP
+			boot_mesg "Loading keymap: $KEYMAP"
+			loadkeys $KEYMAP &> /dev/null
 			evaluate_retval
 		fi
 
 		if [ -n "$KEYMAP_CORRECTIONS" ]; then
-			loadkeys $KEYMAP_CORRECTIONS
+			boot_mesg "Loading keymap corrections: $KEYMAP_CORRECTIONS"
+			loadkeys $KEYMAP_CORRECTIONS &> /dev/null
 			evaluate_retval
 		fi
 
 		if [ -n "$FONT" ]; then
-			echo "Setting screen font to $FONT..."
+			boot_mesg "Setting screen font to $FONT..."
 			setfont $FONT
 			evaluate_retval
 		fi

Modified: trunk/bootscripts/lfs/init.d/localnet
===================================================================
--- trunk/bootscripts/lfs/init.d/localnet	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/init.d/localnet	2004-09-23 07:01:58 UTC (rev 4196)
@@ -10,18 +10,18 @@
 
 case "$1" in
 	start)
-		echo "Bringing up the loopback interface..."
+		boot_mesg "Bringing up the loopback interface..."
 		ip link set lo up
 		ip addr add 127.0.0.1/8 label lo dev lo
 		evaluate_retval
 
-		echo "Setting hostname to $HOSTNAME..."
+		boot_mesg "Setting hostname to $HOSTNAME..."
 		hostname $HOSTNAME
 		evaluate_retval
 	;;
 
 	stop)
-		echo "Bringing down the loopback interface..."
+		boot_mesg "Bringing down the loopback interface..."
 		ip link set lo down
 		evaluate_retval
 	;;

Modified: trunk/bootscripts/lfs/init.d/modules
===================================================================
--- trunk/bootscripts/lfs/init.d/modules	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/init.d/modules	2004-09-23 07:01:58 UTC (rev 4196)
@@ -18,7 +18,7 @@
 			# Read in the configuration file.
 			exec 9>&0 < /etc/sysconfig/modules
 
-				echo -n "Loading modules:"
+				boot_mesg "Loading modules:"
 
 				while read module args ; do
 					# Ignore comments and blank lines.
@@ -33,7 +33,7 @@
 					# Print the module name if successful,
 					# otherwise take note.
 					if [ $? -eq 0 ]; then
-						echo -n " $module"
+						boot_mesg " $module"
 					else
 						failedmod="$failedmod $module"
 					fi
@@ -41,12 +41,12 @@
 
 				# Print a message about successfully loaded
 				# modules on the correct line.
-				echo ; print_status success
+				 print_status success
 
 				# Print a failure message with a list of any
 				# modules that may have failed to load.
 				if [ "$failedmod" ]; then
-					echo "Failed to load modules:$failedmod"
+					boot_mesg "Failed to load modules:$failedmod"
 					print_status failure
 				fi
 

Modified: trunk/bootscripts/lfs/init.d/mountfs
===================================================================
--- trunk/bootscripts/lfs/init.d/mountfs	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/init.d/mountfs	2004-09-23 07:01:58 UTC (rev 4196)
@@ -9,14 +9,14 @@
 
 case "$1" in
 	start)
-		echo "Remounting root file system in read-write mode..."
+		boot_mesg "Remounting root file system in read-write mode..."
 		mount -n -o remount,rw /
 		evaluate_retval
 
 		# Remove fsck-related file system watermarks.
 		rm -f /fastboot /forcefsck
 
-		echo "Recording existing mounts in /etc/mtab..."
+		boot_mesg "Recording existing mounts in /etc/mtab..."
 		> /etc/mtab
 		mount -f / || failed=1
 		mount -f /proc || failed=1
@@ -28,13 +28,13 @@
 
 		# This will mount all filesystems that do not have _netdev in
 		# their option list.  _netdev denotes a network filesystem.
-		echo "Mounting remaining file systems..."
+		boot_mesg "Mounting remaining file systems..."
 		mount -a -O no_netdev
 		evaluate_retval
 		;;
 
 	stop)
-		echo "Unmounting all other currently mounted file systems..."
+		boot_mesg "Unmounting all other currently mounted file systems..."
 		umount -a -d -r -t noramfs
 		evaluate_retval
 		;;

Modified: trunk/bootscripts/lfs/init.d/mountkernfs
===================================================================
--- trunk/bootscripts/lfs/init.d/mountkernfs	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/init.d/mountkernfs	2004-09-23 07:01:58 UTC (rev 4196)
@@ -8,17 +8,17 @@
 
 case "$1" in
 	start)
-		echo -n "Mounting kernel-based file systems:"
+		boot_mesg "Mounting kernel-based file systems:"
 
 		if [ ! -e /proc/mounts ]; then
-			echo -n " /proc"
+			boot_mesg " /proc"
 			mount -n /proc || failed=1
 		fi
 
 		# This should be mounted on a 2.6 kernel.
 		if grep -q '[[:space:]]sysfs' /proc/filesystems; then
 			if [ -d /sys -a ! -d /sys/block ]; then
-				echo -n " /sys"
+				boot_mesg " /sys"
 				mount -n /sys || failed=1
 			fi
 		fi

Modified: trunk/bootscripts/lfs/init.d/rc
===================================================================
--- trunk/bootscripts/lfs/init.d/rc	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/init.d/rc	2004-09-23 07:01:58 UTC (rev 4196)
@@ -17,8 +17,8 @@
 
 if [ "$runlevel" = "" ]
 then
-        echo "Usage: $0 <runlevel>" >&2
-        exit 1
+	echo "Usage: $0 <runlevel>" >&2
+	exit 1
 fi
 
 previous=$PREVLEVEL
@@ -26,68 +26,62 @@
 
 if [ ! -d $rc_base/rc$runlevel.d ]
 then
-        echo "$rc_base/rc$runlevel.d does not exist"
-        exit 1
+	echo "$rc_base/rc$runlevel.d does not exist"
+	exit 1
 fi
 
 # Attempt to stop all service started by previous runlevel,
 # and killed in this runlevel
 if [ "$previous" != "N" ]
 then
-        for i in $(ls -v $rc_base/rc$runlevel.d/K* 2> /dev/null)
-        do
+	for i in $(ls -v $rc_base/rc$runlevel.d/K* 2> /dev/null); do
+		check_script_status
 
-                check_script_status
+		suffix=${i#$rc_base/rc$runlevel.d/K[0-9][0-9]}
+		prev_start=$rc_base/rc$previous.d/S[0-9][0-9]$suffix
+		sysinit_start=$rc_base/rcsysinit.d/S[0-9][0-9]$suffix
 
-                suffix=${i#$rc_base/rc$runlevel.d/K[0-9][0-9]}
-                prev_start=$rc_base/rc$previous.d/S[0-9][0-9]$suffix
-                sysinit_start=$rc_base/rcsysinit.d/S[0-9][0-9]$suffix
+		if [ "$runlevel" != "0" ] && [ "$runlevel" != "6" ]; then
+			if [ ! -f $prev_start ] && [ ! -f $sysinit_start ]; then
+				boot_log "$i cant be started in runlevel ${runlevel}, because it was not started in runlevel ${previous}"
+				echo -n -e $WARNING
+				echo "$i can't be executed because it was"
+				echo "not started in the previous runlevel ($previous)"
+				echo -n -e $NORMAL
+				continue
+			fi
+		fi
+		$i stop
+		error_value=$?
 
-                if [ "$runlevel" != "0" ] && [ "$runlevel" != "6" ]
-                then
-                        if [ ! -f $prev_start ] && [ ! -f $sysinit_start ]
-                        then
-                                echo -n -e $WARNING
-                                echo "$i can't be executed because it was"
-                                echo "not started in the previous runlevel ($previous)"
-                                echo -n -e $NORMAL
-                                continue
-                        fi
-                fi
-                $i stop
-                error_value=$?
-
-                if [ "$error_value" != "0" ]
-                then
-                        print_error_msg
-                fi
-        done
+		if [ "$error_value" != "0" ]
+		then
+			print_error_msg
+		fi
+	done
 fi
 
 #Start all functions in this runlevel
-for i in $( ls -v $rc_base/rc$runlevel.d/S* 2> /dev/null)
-do
-        if [ "$previous" != "N" ]
-        then
-                suffix=${i#$rc_base/rc$runlevel.d/S[0-9][0-9]}
-                stop=$rc_base/rc$runlevel.d/K[0-9][0-9]$suffix
-                prev_start=$rc_base/rc$previous.d/S[0-9][0-9]$suffix
+for i in $( ls -v $rc_base/rc$runlevel.d/S* 2> /dev/null); do
+	if [ "$previous" != "N" ]; then
+		suffix=${i#$rc_base/rc$runlevel.d/S[0-9][0-9]}
+		stop=$rc_base/rc$runlevel.d/K[0-9][0-9]$suffix
+		prev_start=$rc_base/rc$previous.d/S[0-9][0-9]$suffix
 
-                [ -f $prev_start ] && [ ! -f $stop ] && continue
-        fi
+		[ -f $prev_start ] && [ ! -f $stop ] && continue
+	fi
 
-        check_script_status
+	check_script_status
 
 	case $runlevel in
-                0|6) $i stop	;;
+		0|6) $i stop	;;
 		*)   $i start	;;
 	esac
-        error_value=$?
+	error_value=$?
 
-        if [ "$error_value" != "0" ]
-        then
-                print_error_msg
-        fi
+	if [ "$error_value" != "0" ]; then
+		print_error_msg
+	fi
 done
 
 # End $rc_base/init.d/rc

Modified: trunk/bootscripts/lfs/init.d/sendsignals
===================================================================
--- trunk/bootscripts/lfs/init.d/sendsignals	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/init.d/sendsignals	2004-09-23 07:01:58 UTC (rev 4196)
@@ -9,7 +9,7 @@
 
 case "$1" in
 	stop)
-		echo "Sending all processes the TERM signal..."
+		boot_mesg "Sending all processes the TERM signal..."
 		killall5 -15
 		error_value=$?
 
@@ -22,7 +22,7 @@
 			print_status failure
 		fi
 
-		echo "Sending all processes the KILL signal..."
+		boot_mesg "Sending all processes the KILL signal..."
 		killall5 -9
 		error_value=$?
 

Modified: trunk/bootscripts/lfs/init.d/setclock
===================================================================
--- trunk/bootscripts/lfs/init.d/setclock	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/init.d/setclock	2004-09-23 07:01:58 UTC (rev 4196)
@@ -23,13 +23,13 @@
 
 case $1 in
 	start)
-		echo "Setting system clock..."
+		boot_mesg "Setting system clock..."
 		hwclock --hctosys $CLOCKPARAMS
 		evaluate_retval
 		;;
 
 	stop)
-		echo "Setting hardware clock..."
+		boot_mesg "Setting hardware clock..."
 		hwclock --systohc $CLOCKPARAMS
 		evaluate_retval
 		;;

Modified: trunk/bootscripts/lfs/init.d/swap
===================================================================
--- trunk/bootscripts/lfs/init.d/swap	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/init.d/swap	2004-09-23 07:01:58 UTC (rev 4196)
@@ -8,13 +8,13 @@
 
 case "$1" in
 	start)
-		echo "Activating all swap files/partitions..."
+		boot_mesg "Activating all swap files/partitions..."
 		swapon -a
 		evaluate_retval
 		;;
 
 	stop)
-		echo "Deactivating all swap files/partitions..."
+		boot_mesg "Deactivating all swap files/partitions..."
 		swapoff -a
 		evaluate_retval
 		;;

Modified: trunk/bootscripts/lfs/init.d/sysklogd
===================================================================
--- trunk/bootscripts/lfs/init.d/sysklogd	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/init.d/sysklogd	2004-09-23 07:01:58 UTC (rev 4196)
@@ -12,23 +12,23 @@
 
 case "$1" in
 	start)
-		echo "Starting system log daemon..."
+		boot_mesg "Starting system log daemon..."
 		loadproc syslogd $SYSLOGD_OPTIONS
 
-		echo "Starting kernel log daemon..."
+		boot_mesg "Starting kernel log daemon..."
 		loadproc klogd $KLOGD_OPTIONS
 		;;
 
 	stop)
-		echo "Stopping kernel log daemon..."
+		boot_mesg "Stopping kernel log daemon..."
 		killproc klogd
 
-		echo "Stopping system log daemon..."
+		boot_mesg "Stopping system log daemon..."
 		killproc syslogd
 		;;
 
 	reload)
-		echo "Reloading system log daemon config file..."
+		boot_mesg "Reloading system log daemon config file..."
 		reloadproc syslogd 1
 		;;
 

Modified: trunk/bootscripts/lfs/init.d/template
===================================================================
--- trunk/bootscripts/lfs/init.d/template	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/init.d/template	2004-09-23 07:01:58 UTC (rev 4196)
@@ -9,17 +9,17 @@
 
 case "$1" in
 	start)
-		echo "Starting..."
+		boot_mesg "Starting..."
 		loadproc
 		;;
 
 	stop)
-		echo "Stopping..."
+		boot_mesg "Stopping..."
 		killproc
 		;;
 
 	reload)
-		echo "Reloading..."
+		boot_mesg "Reloading..."
 		reloadproc
 		;;
 

Modified: trunk/bootscripts/lfs/init.d/udev
===================================================================
--- trunk/bootscripts/lfs/init.d/udev	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/init.d/udev	2004-09-23 07:01:58 UTC (rev 4196)
@@ -27,7 +27,7 @@
 		# else has already set it up.
 		[ -f /dev/.udev.tdb ] && exit 0
 
-		echo "Populating /dev with device nodes..."
+		boot_mesg "Populating /dev with device nodes..."
 
 		# Mount a temporary file system over /dev, so that any devices
 		# made or removed during this boot don't affect the next one.
@@ -37,6 +37,7 @@
 		if [ $? != 0 ]
 		then
 			print_status failure
+			boot_log "Unable to mount a ramfs onto /dev"
 			echo -n -e $FAILURE
 			echo
 			echo "Cannot mount a ramfs onto /dev, this system will be halted."
@@ -67,6 +68,7 @@
 		(exit $failed)
 		evaluate_retval
 		;;
+
 	*)
 		echo "Usage $0 {start}"
 		exit 1

Modified: trunk/bootscripts/lfs/sysconfig/network-devices/ifdown
===================================================================
--- trunk/bootscripts/lfs/sysconfig/network-devices/ifdown	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/sysconfig/network-devices/ifdown	2004-09-23 07:01:58 UTC (rev 4196)
@@ -30,7 +30,8 @@
 		continue
 	fi
 	if [ ! -f "$file" ]; then
-		echo "$file is not a network configuration file or directory"
+		boot_mesg "$file is not a network configuration file or directory"
+		print_status warn
 		continue
 	fi
 	(
@@ -51,13 +52,14 @@
 		if [ -n "$SERVICE" -a -x "$network_devices/services/$SERVICE" ]; then
 			if ip link show $1 > /dev/null 2>&1; then
 				IFCONFIG=$file $network_devices/services/${SERVICE} $1 down
-                        else
-                                echo "Interface $1 doesn't exist"
-                                print_status warning not_available
-                        fi
+			else
+				boot_mesg "Interface $1 doesn't exist"
+				print_status warning not_available
+			fi
 		else
-			echo -n "Unable to process $file, Either the SERVICE variable was not set, "
-			echo "or the specified service cannot be executed"
+			boot_mesg "Unable to process $file, Either the SERVICE variable was not set, "
+			boot_mesg "or the specified service cannot be executed"
+			print_status failure
 			continue
 		fi
 	)
@@ -67,7 +69,7 @@
 	link_status=`ip link show $1 2> /dev/null`
 	if [ -n "$link_status" ]; then
 		if echo "$link_status" | grep -q UP ; then
-			echo "Taking down the $1 interface..."
+			boot_mesg "Taking down the $1 interface..."
 			ip link set $1 down
 			evaluate_retval
 		fi

Modified: trunk/bootscripts/lfs/sysconfig/network-devices/ifup
===================================================================
--- trunk/bootscripts/lfs/sysconfig/network-devices/ifup	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/sysconfig/network-devices/ifup	2004-09-23 07:01:58 UTC (rev 4196)
@@ -15,7 +15,7 @@
 	link_status=`ip link show $1 2> /dev/null`
 	if [ -n "$link_status" ]; then
 		if ! echo "$link_status" | grep -q UP ; then
-			echo "Bringing up the $1 interface..."
+			boot_mesg "Bringing up the $1 interface..."
 			ip link set $1 up
 			evaluate_retval
 		fi
@@ -38,7 +38,8 @@
 		continue
 	fi
 	if [ ! -f "$file" ]; then
-		echo "$file is not a network configuration file or directory"
+		boot_mesg "$file is not a network configuration file or directory"
+		print_status warning
 		continue
 	fi
 	(
@@ -59,12 +60,13 @@
 				bring_link_up $1
 				IFCONFIG=$file $network_devices/services/${SERVICE} $1 up
 			else
-				echo "Interface $1 doesn't exist"
+				boot_mesg "Interface $1 doesn't exist"
 				print_status warning not_available
 			fi
 		else
-			echo -n "Unable to process $file, Either the SERVICE variable was not set, "
-			echo "or the specified service cannot be executed"
+			boot_mesg "Unable to process $file, Either the SERVICE variable was not set, "
+			boot_mesg "or the specified service cannot be executed"
+			print_status failure
 			continue
 		fi
 	)

Modified: trunk/bootscripts/lfs/sysconfig/network-devices/services/ipv4-static
===================================================================
--- trunk/bootscripts/lfs/sysconfig/network-devices/services/ipv4-static	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/sysconfig/network-devices/services/ipv4-static	2004-09-23 07:01:58 UTC (rev 4196)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin $network_devices/services/ipv4-static
+4# Begin $network_devices/services/ipv4-static
 
 # Based upon lfs-bootscripts-1.12 $network_devices/if{down,up}
 # Rewritten by Nathan Coulson <nathan at linuxfromscratch.org>
@@ -10,17 +10,20 @@
 . $IFCONFIG
 
 if [ -z "$IP" ]; then
-	echo "IP variable missing from $IFCONFIG, cannot continue"
+	boot_mesg "IP variable missing from $IFCONFIG, cannot continue"
+	print_status failure
 	exit 1
 fi
 
 if [ -z "$PREFIX" -a -z "$PEER" ]; then
-	echo -n "PREFIX variable missing from $IFCONFIG, "
-	echo    "assuming 24"
+	boot_mesg "PREFIX variable missing from $IFCONFIG, "
+	boot_mesg "assuming 24"
+	print_status warning
 	PREFIX=24
 	args="$args $IP/$PREFIX"
 elif [ -n "$PREFIX" -a -n "$PEER" ]; then
-	echo "PREFIX and PEER both specified in $IFCONFIG, cannot continue"
+	boot_mesg "PREFIX and PEER both specified in $IFCONFIG, cannot continue"
+	print_status failure
 	exit 1
 elif [ -n "$PREFIX" ]; then
 	args="$args $IP/$PREFIX"
@@ -38,16 +41,16 @@
 
 case "$2" in
 	up)
-		echo "Adding IPV4 address $IP to the $1 interface..."
+		boot_mesg "Adding IPV4 address $IP to the $1 interface..."
 		ip addr add $args dev $1
 		evaluate_retval
 	
 		if [ -n "$GATEWAY" ]; then
 			if ip route | grep -q default; then
-				echo "Gateway already setup; skipping..."
+				boot_mesg "Gateway already setup; skipping..."
 				print_status warning
 			else
-				echo "Setting up default gateway..."
+				boot_mesg "Setting up default gateway..."
 				ip route add default via $GATEWAY dev $1
 				evaluate_retval
 			 fi
@@ -56,12 +59,12 @@
 	
 	down)
 		if [ -n "$GATEWAY" ]; then
-			echo "Removing default gateway..."
+			boot_mesg "Removing default gateway..."
 			ip route del default
 			evaluate_retval
 		fi
 	
-		echo "Removing IPV4 address $IP from the $1 interface..."
+		boot_mesg "Removing IPV4 address $IP from the $1 interface..."
 		ip addr del $args dev $1
 		evaluate_retval
 	;;

Modified: trunk/bootscripts/lfs/sysconfig/network-devices/services/ipv4-static-route
===================================================================
--- trunk/bootscripts/lfs/sysconfig/network-devices/services/ipv4-static-route	2004-09-23 06:18:26 UTC (rev 4195)
+++ trunk/bootscripts/lfs/sysconfig/network-devices/services/ipv4-static-route	2004-09-23 07:01:58 UTC (rev 4196)
@@ -30,19 +30,22 @@
 	;;
 
 	(*)
-		echo "Unknown route type ($TYPE) in $IFCONFIG, cannot continue"
+		boot_mesg "Unknown route type ($TYPE) in $IFCONFIG, cannot continue"
+		print_status failure
 		exit 1
 	;;
 esac
 
 if [ -n "$need_ip" ]; then
 	if [ -z "$IP" ]; then
-		echo "IP variable missing from $IFCONFIG, cannot continue"
+		boot_mesg "IP variable missing from $IFCONFIG, cannot continue"
+		print_status failure
 		exit 1
 	fi
 
 	if [ -z "$PREFIX" ]; then
-		echo "PREFIX variable missing from $IFCONFIG, cannot continue"
+		boot_mesg "PREFIX variable missing from $IFCONFIG, cannot continue"
+		print_status failure
 		exit 1
 	fi
 	
@@ -52,7 +55,8 @@
 
 if [ -n "$need_gateway" ]; then
 	if [ -z "$GATEWAY" ]; then
-		echo "GATEWAY variable missing from $IFCONFIG, cannot continue"
+		boot_mesg "GATEWAY variable missing from $IFCONFIG, cannot continue"
+		print_status failure
 		exit 1
 	fi
 	args="$args via $GATEWAY"
@@ -60,13 +64,13 @@
 
 case "$2" in
 	up)
-		echo "Adding '$desc' route to the $1 interface..."
+		boot_mesg "Adding '$desc' route to the $1 interface..."
 		ip route add $args dev $1
 		evaluate_retval
 	;;
 	
 	down)
-		echo "Removing '$desc' route from the $1 interface..."
+		boot_mesg "Removing '$desc' route from the $1 interface..."
 		ip route del $args dev $1
 		evaluate_retval
 	;;




More information about the lfs-book mailing list