Bootscript patches

Dan Nicholson dbn.lists at gmail.com
Sat Jun 16 11:32:17 PDT 2007


Don't suppress stderr for some utilities. This can hide critical errors
during boot. For instance, I had an issue where mountfs was returning
with critical errors, but I couldn't see this issue. It turns out it was
just a missing mountpoint in /etc/fstab. This would have been easy to
spot of stderr from mount hadn't been suppressed.

--
Dan

 bootscripts/ChangeLog              |    5 +++++
 bootscripts/lfs/init.d/mountfs     |    6 +++---
 bootscripts/lfs/init.d/mountkernfs |    4 ++--
 bootscripts/lfs/init.d/setclock    |    4 ++--
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/bootscripts/ChangeLog b/bootscripts/ChangeLog
index 417ade3..05a9ce3 100644
--- a/bootscripts/ChangeLog
+++ b/bootscripts/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-16	Dan Nicholson	<dnicholson at linuxfromscratch.org>
+	* lfs/init.d/mountfs, lfs/init.d/mountkernfs, lfs/init.d/setclock:
+	  Don't suppress stderr during bootscripts unless necessary. This
+	  would prevent potentially critical messages from reaching the screen.
+
 2007-04-24	Dan Nicholson	<dnicholson at linuxfromscratch.org>
 	* lfs/init.d/functions: When killproc is executed, it checks that
 	  the process is still running, sleeps if it is, then checks again.
diff --git a/bootscripts/lfs/init.d/mountfs b/bootscripts/lfs/init.d/mountfs
index de3f0ba..3d92624 100644
--- a/bootscripts/lfs/init.d/mountfs
+++ b/bootscripts/lfs/init.d/mountfs
@@ -18,7 +18,7 @@
 case "${1}" in
 	start)
 		boot_mesg "Remounting root file system in read-write mode..."
-		mount -n -o remount,rw / >/dev/null 2>&1
+		mount -n -o remount,rw / >/dev/null
 		evaluate_retval
 
 		# Remove fsck-related file system watermarks.
@@ -35,13 +35,13 @@ case "${1}" in
 		# 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..."
-		mount -a -O no_netdev >/dev/null 2>&1
+		mount -a -O no_netdev >/dev/null
 		evaluate_retval
 		;;
 
 	stop)
 		boot_mesg "Unmounting all other currently mounted file systems..."
-		umount -a -d -r >/dev/null 2>&1
+		umount -a -d -r >/dev/null
 		evaluate_retval
 		;;
 
diff --git a/bootscripts/lfs/init.d/mountkernfs b/bootscripts/lfs/init.d/mountkernfs
index e17d50d..10b165a 100644
--- a/bootscripts/lfs/init.d/mountkernfs
+++ b/bootscripts/lfs/init.d/mountkernfs
@@ -19,12 +19,12 @@ case "${1}" in
 	start)
 		boot_mesg -n "Mounting kernel-based file systems:" ${INFO}
 
-		if ! mountpoint /proc >/dev/null 2>&1; then
+		if ! mountpoint /proc >/dev/null; then
 			boot_mesg -n " /proc" ${NORMAL}
 			mount -n /proc || failed=1
 		fi
 
-		if ! mountpoint /sys >/dev/null 2>&1; then
+		if ! mountpoint /sys >/dev/null; then
 			boot_mesg -n " /sys" ${NORMAL}
 			mount -n /sys || failed=1
 		fi
diff --git a/bootscripts/lfs/init.d/setclock b/bootscripts/lfs/init.d/setclock
index d4b8f56..2110590 100644
--- a/bootscripts/lfs/init.d/setclock
+++ b/bootscripts/lfs/init.d/setclock
@@ -32,13 +32,13 @@ esac
 case ${1} in
 	start)
 		boot_mesg "Setting system clock..."
-		hwclock --hctosys ${CLOCKPARAMS} >/dev/null 2>&1
+		hwclock --hctosys ${CLOCKPARAMS} >/dev/null
 		evaluate_retval
 		;;
 
 	stop)
 		boot_mesg "Setting hardware clock..."
-		hwclock --systohc ${CLOCKPARAMS} >/dev/null 2>&1
+		hwclock --systohc ${CLOCKPARAMS} >/dev/null
 		evaluate_retval
 		;;
 
-- 
1.5.1.6






More information about the lfs-dev mailing list