[Pkg-sysvinit-commits] r303 - sysvinit/trunk/debian/initscripts/etc/init.d

Thomas Hood jdthood-guest at costa.debian.org
Sun Nov 27 22:24:34 UTC 2005


Author: jdthood-guest
Date: 2005-11-27 22:24:34 +0000 (Sun, 27 Nov 2005)
New Revision: 303

Modified:
   sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh
Log:
Use $(...) instead of the antiquated `...` ; add some quotation marks ; apply Cameron Hutchison patch from #275680

Modified: sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh	2005-11-27 13:02:37 UTC (rev 302)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh	2005-11-27 22:24:34 UTC (rev 303)
@@ -27,9 +27,9 @@
 	#
 	[ "$SULOGIN" = yes ] && sulogin -t 30 $CONSOLE
 
-	KERNEL=`uname -s`
-	RELEASE=`uname -r`
-	MACHINE=`uname -m`
+	KERNEL="$(uname -s)"
+	RELEASE="$(uname -r)"
+	MACHINE="$(uname -m)"
 
 	#
 	# Ensure that bdflush (update) is running before any major I/O is
@@ -46,7 +46,12 @@
 	fi
 
 	#
-	# Read /etc/fstab.
+	# Read /etc/fstab, looking for:
+	# 1) The root filesystem, resolving LABEL=*|UUID=* entries to the
+	# 	device node,
+	# 2) Swap that is on a md device or a file that may be on a md 
+	# 	device,
+	# 3) The mount parameters for a devfs filesystem.
 	#
 exec 9>&0 </etc/fstab
 	fstabroot=/dev/root
@@ -65,30 +70,33 @@
 			;;
 		  /dev/md*)
 			# Swap on md device.
-			[ "$type" = swap ] && swap_on_md=yes
+			[ "$type" = "swap" ] && swap_on_md=yes
 			;;
 		  /dev/*)
 			;;
-	 	  LABEL=*|UUID=*)
-	 		[ -x /sbin/findfs ] && dev="`/sbin/findfs \"$dev\"`"
+		  LABEL=*|UUID=*)
+			if [ "$mnt" = "/" ] && which findfs >/dev/null 2>&1
+			then
+				dev="$(findfs "$dev")"
+			fi
 			;;
 		  *)
 			# Devfs definition ?
-			if [ "$type" = "devfs" ] && [ "$mnt" = /dev ] && mountpoint -q /dev
+			if [ "$type" = "devfs" ] && [ "$mnt" = "/dev" ] && mountpoint -q /dev
 			then
 				devfs="-t $type $dev $mnt"
 			fi
 			# Might be a swapfile.
-			[ "$type" = swap ] && swap_on_md=yes
+			[ "$type" = "swap" ] && swap_on_md=yes
 			;;
 		esac
-		[ "$mnt" != / ] && continue
+		[ "$mnt" != "/" ] && continue
 		rootdev="$dev"
 		fstabroot="$dev"
 		rootopts="$opts"
 		roottype="$type"
 		( [ "$pass" != 0 ] && [ "$pass" != "" ]   ) && rootcheck=yes
-		( [ "$type" = nfs ] || [ "$type" = nfs4 ] ) && rootcheck=no
+		( [ "$type" = "nfs" ] || [ "$type" = "nfs4" ] ) && rootcheck=no
 		case "$opts" in
 		  ro|ro,*|*,ro|*,ro,*)
 			rootmode=ro
@@ -142,11 +150,11 @@
 	#
 	if [ "$rootcheck" = yes ]
 	then
-		ddev=`mountpoint -qx $rootdev`
-		rdev=`mountpoint -d /`
+		ddev="$(mountpoint -qx $rootdev)"
+		rdev="$(mountpoint -d /)"
 		if [ "$ddev" != "$rdev" ] && [ "$ddev" != "4:0" ]
 		then
-			if [ "`mountpoint -qx /dev/root`" = "4:0" ]
+			if [ "$(mountpoint -qx /dev/root)" = "4:0" ]
 			then
 				rootdev=/dev/root
 			else
@@ -324,7 +332,7 @@
 	# then it is not writable.
 	#
 	init_mtab=no
-	MTAB_PATH="`readlink -f /etc/mtab || :`"
+	MTAB_PATH="$(readlink -f /etc/mtab || :)"
 	case "$MTAB_PATH" in
 	  /proc/*)
 		;;
@@ -337,7 +345,7 @@
 		fi
 		;;
 	  "")
-		[ -L /etc/mtab ] && MTAB_PATH="`readlink /etc/mtab`"
+		[ -L /etc/mtab ] && MTAB_PATH="$(readlink /etc/mtab)"
 		if [ "$MTAB_PATH" ] ; then
 			log_failure_msg "Cannot initialize ${MTAB_PATH}."
 		else




More information about the Pkg-sysvinit-commits mailing list