Package: sysvinit
Version: 2.86.ds1-38
Severity: wishlist
Tags: patch

Hi,

the attached patch changes the sysvinit init.d script(s) to allow splash scripts to hook into the fsck stage so that special action can be taken (in the case of usplash, this would be to set a high timeout and to let the progressbar reflect that an unknown amount of time will be spent fscking, splashy would probably want something similar).

--
David Härdeman

diff -Nur ./sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/checkfs.sh ./sysvinit-2.86.ds1/debian/initscripts/etc/init.d/checkfs.sh
--- ./sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/checkfs.sh	2007-05-09 19:53:30.000000000 +0200
+++ ./sysvinit-2.86.ds1/debian/initscripts/etc/init.d/checkfs.sh	2007-05-09 19:55:16.000000000 +0200
@@ -19,6 +19,8 @@
 
 . /lib/lsb/init-functions
 
+. /lib/init/splash-functions-base
+
 do_start () {
 	# See if we're on AC Power.  If not, we're not gonna run our
 	# check.  If on_ac_power (in /usr/) is unavailable, behave as
@@ -60,6 +62,7 @@
 		FSCKTYPES_OPT=""
 		[ "$FSCKTYPES" ] && FSCKTYPES_OPT="-t $FSCKTYPES"
 		handle_failed_fsck() {
+			splash_quit
 			log_failure_msg "File system check failed. 
 A log is being saved in ${FSCK_LOGFILE} if that location is writable. 
 Please repair the file system manually."
@@ -73,6 +76,7 @@
 				sleep 5
 			fi
 		}
+		splash_start_fsck
 		if [ "$VERBOSE" = no ]
 		then
 			log_action_begin_msg "Checking file systems"
@@ -102,6 +106,7 @@
 A log is being saved in ${FSCK_LOGFILE} if that location is writable."
 			fi
 		fi
+		splash_stop_fsck
 	fi
 	rm -f /fastboot /forcefsck
 }
diff -Nur ./sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/checkroot.sh ./sysvinit-2.86.ds1/debian/initscripts/etc/init.d/checkroot.sh
--- ./sysvinit-2.86.ds1.orig/debian/initscripts/etc/init.d/checkroot.sh	2007-05-09 19:53:30.000000000 +0200
+++ ./sysvinit-2.86.ds1/debian/initscripts/etc/init.d/checkroot.sh	2007-05-09 19:56:06.000000000 +0200
@@ -20,6 +20,7 @@
 
 . /lib/lsb/init-functions
 . /lib/init/mount-functions.sh
+. /lib/init/splash-functions-base
 
 do_start () {
 	#
@@ -235,6 +236,7 @@
 	#
 	if [ "$rootcheck" = yes ]
 	then
+		splash_start_fsck
 		if [ -f /forcefsck ]
 		then
 			force="-f"
@@ -277,6 +279,7 @@
 			FSCKCODE=$?
 			log_end_msg $FSCKCODE
 		fi
+		splash_stop_fsck $FSCKCODE
 	fi
 
 	#
@@ -289,6 +292,7 @@
 	#
 	if [ "$FSCKCODE" -gt 3 ]
 	then
+		splash_quit
 		# Surprise! Re-directing from a HERE document (as in "cat << EOF")
 		# does not work because the root is currently read-only.
 		log_failure_msg "An automatic file system check (fsck) of the root filesystem failed. 
diff -Nur ./sysvinit-2.86.ds1.orig/debian/initscripts/lib/init/splash-functions-base ./sysvinit-2.86.ds1/debian/initscripts/lib/init/splash-functions-base
--- ./sysvinit-2.86.ds1.orig/debian/initscripts/lib/init/splash-functions-base	1970-01-01 01:00:00.000000000 +0100
+++ ./sysvinit-2.86.ds1/debian/initscripts/lib/init/splash-functions-base	2007-05-09 19:58:55.000000000 +0200
@@ -0,0 +1,5 @@
+splash_start_fsck () { return 0; }
+splash_stop_fsck () { return 0; }
+splash_quit () { return 0; }
+# Allow these to be overridden with custom scripts
+[ -e /lib/init/splash-functions ] && . /lib/init/splash-functions

Reply via email to