SVN: rc-scripts/trunk/rc.d: init.d/functions rc.sysinit

glen glen at pld-linux.org
Tue Sep 19 01:09:08 CEST 2006


Author: glen
Date: Tue Sep 19 01:09:07 2006
New Revision: 7794

Modified:
   rc-scripts/trunk/rc.d/init.d/functions
   rc-scripts/trunk/rc.d/rc.sysinit
Log:
Allow /usr being mounted afterwards.

Modified: rc-scripts/trunk/rc.d/init.d/functions
==============================================================================
--- rc-scripts/trunk/rc.d/init.d/functions	(original)
+++ rc-scripts/trunk/rc.d/init.d/functions	Tue Sep 19 01:09:07 2006
@@ -61,25 +61,6 @@
 	unset _ctx
 fi
 
-if [ -z "$GETTEXT" ]; then
-	if [ -x /bin/gettext -o -x /usr/bin/gettext ]; then
-		GETTEXT=yes
-	else
-		GETTEXT=no
-	fi
-fi
-
-if [ -z "$TPUT" ]; then
-	if [ -d /usr/share/terminfo ] && [ -x /usr/bin/tput -o -x /bin/tput ] ; then
-		TPUT=yes
-		# check if we are on proper terminal
-		tput longname >/dev/null 2>&1 || TPUT=no
-	else
-		TPUT=no
-	fi
-fi
-
-
 is_yes()
 {
 	# Test syntax
@@ -937,7 +918,28 @@
 EOF
 }
 
+rc_init_gettext() {
+	if [ -z "$GETTEXT" ]; then
+		if [ -x /bin/gettext -o -x /usr/bin/gettext ]; then
+			GETTEXT=yes
+		else
+			GETTEXT=no
+		fi
+	fi
+
+	if [ -z "$TPUT" ]; then
+		if [ -d /usr/share/terminfo ] && [ -x /usr/bin/tput -o -x /bin/tput ] ; then
+			TPUT=yes
+			# check if we are on proper terminal
+			tput longname >/dev/null 2>&1 || TPUT=no
+		else
+			TPUT=no
+		fi
+	fi
+}
+
 msg_cache_init
+rc_init_gettext
 
 #/*
 # * Local variables:

Modified: rc-scripts/trunk/rc.d/rc.sysinit
==============================================================================
--- rc-scripts/trunk/rc.d/rc.sysinit	(original)
+++ rc-scripts/trunk/rc.d/rc.sysinit	Tue Sep 19 01:09:07 2006
@@ -694,6 +694,13 @@
 
 	run_cmd "Mounting local filesystems" mount -a -t nonfs,smbfs,ncpfs,proc,cifs -O no_netdev
 
+	# now we have /usr mounted, recheck if we have gettext and tput available.
+	if is_no "$TPUT"; then
+		GETTEXT=
+	   	TPUT=
+		rc_init_gettext
+	fi
+
 	# Now do some workaround - encrypted filesystems couldn't have been fsck-ed
 	# before mount - that's where the password is entered.
 	# mount is buggy - when remounting loopback filesystem, loop=XXX
@@ -756,7 +763,7 @@
 		ok
 	fi
 
-	# /var/log should be writable now, so starting saving the boot output
+	# /var/log should be writable now, so start saving the boot output
 	if [ "$RC_BOOTLOG" ]; then
 		echo > /var/log/boot.msg
 		killall -IO blogd
@@ -796,7 +803,7 @@
 	# ... and here finish configuring parameters
 	/sbin/sysctl -e -p /etc/sysctl.conf > /dev/null 2>&1
 else
-	# /var/log should be writable now, so starting saving the boot output
+	# /var/log should be writable now, so star saving the boot output
 	if [ "$RC_BOOTLOG" ]; then
 		echo > /var/log/boot.msg
 		killall -IO blogd


More information about the pld-cvs-commit mailing list