tags 599241 patch
thanks

Am 05.04.2011 13:19, schrieb Kel Modderman:
> No progress, and yeah, a patch is kinda what I was hinting at when you first
> approached. Please do not hesitate for sysvinit maintainers to make first move
> on this, am not aware of any work being done.

patch attached.

> I'm pretty sure all the listed sysvinit maintainers are currently not very
> active when it comes to maintaining sysvinit, at the moment.

I don't have commit access to the pkg-sysvinit svn, but I can offer sponsoring
an upload in case pere is busy.

It would be nice having a new sysvinit release soonish including the /run bits
and this patch seems simple and straight forward enough to apply.

Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
From 0c929c565594c4b1a1981bfae35e00e59cb1558b Mon Sep 17 00:00:00 2001
From: Michael Biebl <bi...@debian.org>
Date: Thu, 7 Apr 2011 10:21:59 +0200
Subject: [PATCH] Remove dead usplash code

---
 debian/src/initscripts/etc/init.d/checkfs.sh       |   18 +--
 debian/src/initscripts/etc/init.d/checkroot.sh     |   18 +--
 .../initscripts/lib/init/usplash-fsck-functions.sh |  178 --------------------
 3 files changed, 8 insertions(+), 206 deletions(-)
 delete mode 100644 debian/src/initscripts/lib/init/usplash-fsck-functions.sh

diff --git a/debian/src/initscripts/etc/init.d/checkfs.sh b/debian/src/initscripts/etc/init.d/checkfs.sh
index a290672..e5f718b 100755
--- a/debian/src/initscripts/etc/init.d/checkfs.sh
+++ b/debian/src/initscripts/etc/init.d/checkfs.sh
@@ -19,7 +19,6 @@ FSCK_LOGFILE=/var/log/fsck/checkfs
 
 . /lib/lsb/init-functions
 . /lib/init/splash-functions-base
-. /lib/init/usplash-fsck-functions.sh
 . /lib/init/swap-functions.sh
 
 do_start () {
@@ -95,19 +94,10 @@ Continuing with system boot in 5 seconds."
 		if [ "$VERBOSE" = no ]
 		then
 			log_action_begin_msg "Checking file systems"
-			if usplash_running; then
-			    PROGRESS_FILE=`mktemp` || exit 1
-			    set -m
-			    logsave -s $FSCK_LOGFILE fsck -C3 -R -A $fix $force $FSCKTYPES_OPT >/dev/console 2>&1 3>$PROGRESS_FILE &
-			    set +m
-			    usplash_progress "$PROGRESS_FILE"
-			    rm -f $PROGRESS_FILE
-			else
-			    splash_start_indefinite
-			    logsave -s $FSCK_LOGFILE fsck $spinner -R -A $fix $force $FSCKTYPES_OPT
-			    FSCKCODE=$?
-			    splash_stop_indefinite
-			fi
+			splash_start_indefinite
+			logsave -s $FSCK_LOGFILE fsck $spinner -R -A $fix $force $FSCKTYPES_OPT
+			FSCKCODE=$?
+			splash_stop_indefinite
 
 			if [ "$FSCKCODE" -gt 1 ]
 			then
diff --git a/debian/src/initscripts/etc/init.d/checkroot.sh b/debian/src/initscripts/etc/init.d/checkroot.sh
index df84d22..9b01183 100755
--- a/debian/src/initscripts/etc/init.d/checkroot.sh
+++ b/debian/src/initscripts/etc/init.d/checkroot.sh
@@ -22,7 +22,6 @@ FSCK_LOGFILE=/var/log/fsck/checkroot
 . /lib/lsb/init-functions
 . /lib/init/mount-functions.sh
 . /lib/init/splash-functions-base
-. /lib/init/usplash-fsck-functions.sh
 
 do_start () {
 	#
@@ -267,19 +266,10 @@ Will restart in 5 seconds."
 		if [ "$VERBOSE" = no ]
 		then
 			log_action_begin_msg "Checking root file system"
-			if [ "$roottype" = "ext2" -o "$roottype" = "ext3" -o "$roottype" = "ext4" ] && usplash_running; then
-			    PROGRESS_FILE=`mktemp -p /lib/init/rw` || PROGRESS_FILE=/lib/init/rw/checkroot_fsck
-			    set -m
-			    logsave -s $FSCK_LOGFILE fsck -C3 $force $fix -t $roottype $rootdev >/dev/console 2>&1 3>$PROGRESS_FILE &
-			    set +m
-			    usplash_progress "$PROGRESS_FILE"
-			    rm -f $PROGRESS_FILE
-			else
-			    splash_start_indefinite
-			    logsave -s $FSCK_LOGFILE fsck $spinner $force $fix -t $roottype $rootdev
-			    FSCKCODE=$?
-			    splash_stop_indefinite
-			fi
+			splash_start_indefinite
+			logsave -s $FSCK_LOGFILE fsck $spinner $force $fix -t $roottype $rootdev
+			FSCKCODE=$?
+			splash_stop_indefinite
 			if [ "$FSCKCODE" = 0 ]
 			then
 				log_action_end_msg 0
diff --git a/debian/src/initscripts/lib/init/usplash-fsck-functions.sh b/debian/src/initscripts/lib/init/usplash-fsck-functions.sh
deleted file mode 100644
index 7235e20..0000000
--- a/debian/src/initscripts/lib/init/usplash-fsck-functions.sh
+++ /dev/null
@@ -1,178 +0,0 @@
-#
-# Functions for reporting fsck progress in usplash
-#
-# (C) 2008 Canonical Ltd.
-# Author: Martin Pitt <martin.p...@ubuntu.com>
-#
-
-# convert a "pass cur max" progress triple from fsck to a progress percentage
-# based on calc_percent() from e2fsck
-fsck_progress_to_percent() {
-    if [ $1 = 1 ]; then
-        PERCENT=$(($2 * 70 / $3))
-    elif [ $1 = 2 ]; then
-        PERCENT=$(($2 * 20 / $3 + 70))
-    elif [ $1 = 3 ]; then
-        PERCENT=$(($2 * 2 / $3 + 90))
-    elif [ $1 = 4 ]; then
-        PERCENT=$(($2 * 3 / $3 + 92))
-    elif [ $1 = 5 ]; then
-        PERCENT=$(($2 * 5 / $3 + 95))
-    else
-        PERCENT=100
-    fi
-}
-
-# read current fsck status ($PASS, $CUR, $MAX) from file descriptor 4
-# this assumes that fsck was started in the background ($!)
-get_fsck_status()
-{
-        local a b c S
-
-        unset a
-        # only consider the last line
-        while true; do
-            PASS=$a
-            CUR=$b
-            MAX=$c
-            read a b c rest <&4
-            if [ -n "$PASS" ] && [ -z "$a" ]; then
-                break;
-            fi
-
-            # if we did not read anything, check if the process is still
-            # actually running, or just waiting to be reaped
-            if [ -z "$PASS" ] && [ -z "$a" ]; then
-                S=`ps -o state --no-headers -p $!` || break
-                [ "$S" != "Z" ] || break
-                # do not spin while waiting for fsck to start up
-                sleep 0.1
-            fi
-        done
-}
-
-# Set $NAME to a human readable description of which partitions are currently
-# being checked. Set $CLEAN if this is only a routine check on clean
-# partitions which can be skipped.
-get_checked_names ()
-{
-        local DEVS DUMP LABEL
-
-        FSCKPROCS=$(ps --no-headers -C 'fsck.ext2 fsck.ext3 fsck.ext4 fsck.ext4dev' -o pid,args | grep /dev)
-        DEVS=$(echo "$FSCKPROCS" | sed 's_^.*\(/dev/[^[:space:]]*\).*$_\1_')
-        FSCKPIDS=$(echo "$FSCKPROCS" | sed 's_^[[:space:]]*\([[:digit:]]\+\).*$_\1_')
-
-        if [ -z "$DEVS" ]; then
-            unset NAME
-            return 0
-        fi
-
-        CLEAN=1
-        unset NAME
-        for DEV in $DEVS; do
-            DUMP=$(dumpe2fs -h $DEV)
-            if ! echo "$DUMP" | grep -q 'state:[[:space:]]*clean$'; then
-                unset CLEAN
-            fi
-
-            LABEL=$(blkid $DEV | sed -rn '/LABEL="([^"]+)"/ { s/^.*LABEL="//; s/".*$//; p }')
-            [ -z "$NAME" ] || NAME="$NAME, "
-            if [ -n "$LABEL" ]; then
-                NAME="$NAME$LABEL ($DEV)"
-            else
-                NAME="$NAME$DEV"
-            fi
-        done
-}
-
-# Return true if usplash is active
-usplash_running() {
-    if pidof usplash ; then
-	return 0
-    else
-	return 1
-    fi
-}
-
-# Read fsck progress from file $1 and display progress in usplash.
-usplash_progress() {
-        exec 4<$1
-        unset CANCEL
-        ESCAPE=`/bin/echo -ne "\x1B"`
-        FIRST=1
-        PREVPERCENT=0
-
-        while true; do
-            sleep 0.5
-            get_fsck_status
-            [ -n "$PASS" ] || break
-
-            fsck_progress_to_percent "$PASS" "$CUR" "$MAX"
-
-            # check if fsck advanced to the next drive
-            if [ "$PREVPERCENT" -gt "$PERCENT" ]; then
-                if [ -n "$CANCEL" ]; then
-                    usplash_write "STATUS skip                                                        "
-                else
-                    usplash_write "STATUS                                                             "
-                fi
-                FIRST=1
-            fi
-            PREVPERCENT=$PERCENT
-
-            # lazy initialization of output and progress report on the first
-            # progress line that we receive; this avoids starting the output
-            # for clean or non-ext[234] partitions
-            if [ -n "$FIRST" ]; then
-                usplash_write "TIMEOUT 0"
-
-                # show which device is being checked
-                get_checked_names
-                [ -n "$NAME" ] || break
-
-                usplash_write "VERBOSE on"
-                if [ "$CLEAN" ]; then
-                    usplash_write "TEXT Routine check of drives: $NAME..."
-                    usplash_write "TEXT Press ESC to skip"
-                else
-                    usplash_write "TEXT Unclean shutdown, checking drives:"
-                    usplash_write "TEXT $NAME..."
-                fi
-
-                unset FIRST
-            fi
-
-            usplash_write "STATUS $PERCENT% (stage $PASS/5, $CUR/$MAX)                       "
-            echo "Checking drive $NAME: $PERCENT% (stage $PASS/5, $CUR/$MAX)" >/dev/console
-
-            # ESC interrupts check for clean drives
-            if [ -n "$CLEAN" ]; then
-                if FAIL_NO_USPLASH=1 usplash_write "INPUTCHAR"; then
-                    read ch < /dev/.initramfs/usplash_outfifo
-                    if [ "$ch" = "$ESCAPE" ]; then
-                        kill $FSCKPIDS
-                        CANCEL=1
-                        continue # there might be more drives, so do not break
-                    fi
-                fi
-            fi
-        done
-
-        if [ -n "$CANCEL" ]; then
-            usplash_write "STATUS skip                                                        "
-        else
-            usplash_write "STATUS                                                             "
-        fi
-        usplash_write "VERBOSE default"
-        usplash_write "TEXT Drive checks finished."
-        usplash_write "TIMEOUT 15"
-        wait %1 # to collect fsck's exit code
-        EXITCODE=$?
-        [ -n "$CANCEL" ] && FSCKCODE=0 || FSCKCODE=$EXITCODE
-        if [ "$FSCKCODE" -gt 1 ]; then
-            # non-correctable failure which requires sulogin: quit usplash and
-            # restore stdin/out/err
-            usplash_write "QUIT"
-            exec </dev/console >/dev/console 2>/dev/console
-        fi
-}
-- 
1.7.4.1

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to