Package: initscripts
Version: 2.88dsf-13.11
Severity: normal
Tags: patch

Neither splashy nor plymouth is using this API.
So it only adds unnecessary complexity and slows down boot.
It also uses a deprecated /dev/.initramfs/ directory which has gone awol
with the switch to /run.

The patch has been tested with CONCURRENCY none and makefile.

Michael


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.39-2-486
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages initscripts depends on:
ii  coreutils         8.5-1                  GNU core utilities
ii  debianutils       4.0.2                  Miscellaneous utilities specific t
ii  libc6             2.13-10                Embedded GNU C Library: Shared lib
ii  lsb-base          3.2-27                 Linux Standard Base 3.2 init scrip
ii  mount             2.19.1-2               Tools for mounting and manipulatin
ii  sysv-rc           2.88dsf-13.11          System-V-like runlevel change mech
ii  sysvinit-utils    2.88dsf-13.11          System-V-like utilities

Versions of packages initscripts recommends:
ii  e2fsprogs          1.42~WIP-2011-07-02-1 ext2/ext3/ext4 file system utiliti
ii  psmisc             22.14-1               utilities that use the proc file s

initscripts suggests no packages.

-- no debconf information
>From 588bd71af26da2c906828f3ee7e03b02773379a0 Mon Sep 17 00:00:00 2001
From: Michael Biebl <bi...@debian.org>
Date: Thu, 14 Jul 2011 08:46:26 +0200
Subject: [PATCH] Remove dead splash code

Neither splashy nor plymouth is using this splash API.
So it only adds unnecessary complexity and slows down boot.
It also uses a deprecated /dev/.initramfs/ directory which has gone awol
with the switch to /run.
---
 debian/src/initscripts/etc/init.d/checkfs.sh       |    5 -
 debian/src/initscripts/etc/init.d/checkroot.sh     |    5 -
 .../src/initscripts/lib/init/splash-functions-base |   93 --------------------
 debian/src/sysv-rc/etc/init.d/rc                   |   82 -----------------
 4 files changed, 0 insertions(+), 185 deletions(-)

diff --git a/debian/src/initscripts/etc/init.d/checkfs.sh 
b/debian/src/initscripts/etc/init.d/checkfs.sh
index 1744db0..7129cc1 100755
--- a/debian/src/initscripts/etc/init.d/checkfs.sh
+++ b/debian/src/initscripts/etc/init.d/checkfs.sh
@@ -18,7 +18,6 @@ FSCK_LOGFILE=/var/log/fsck/checkfs
 . /lib/init/vars.sh
 
 . /lib/lsb/init-functions
-. /lib/init/splash-functions-base
 . /lib/init/swap-functions.sh
 
 do_start () {
@@ -97,10 +96,8 @@ Continuing with system boot in 5 seconds."
                if [ "$VERBOSE" = no ]
                then
                        log_action_begin_msg "Checking file systems"
-                       splash_start_indefinite
                        logsave -s $FSCK_LOGFILE fsck $spinner -R -A $fix 
$force $FSCKTYPES_OPT
                        FSCKCODE=$?
-                       splash_stop_indefinite
 
                        if [ "$FSCKCODE" -eq 32 ]
                        then
@@ -120,10 +117,8 @@ Continuing with system boot in 5 seconds."
                        else
                                log_action_msg "Will now check all file systems"
                        fi
-                       splash_start_indefinite
                        logsave -s $FSCK_LOGFILE fsck $spinner -V -R -A $fix 
$force $FSCKTYPES_OPT
                        FSCKCODE=$?
-                       splash_stop_indefinite
                        if [ "$FSCKCODE" -eq 32 ]
                        then
                                log_warning_msg "File system check was 
interrupted by user"
diff --git a/debian/src/initscripts/etc/init.d/checkroot.sh 
b/debian/src/initscripts/etc/init.d/checkroot.sh
index c5bd3c5..7d3ccc3 100755
--- a/debian/src/initscripts/etc/init.d/checkroot.sh
+++ b/debian/src/initscripts/etc/init.d/checkroot.sh
@@ -21,7 +21,6 @@ FSCK_LOGFILE=/var/log/fsck/checkroot
 
 . /lib/lsb/init-functions
 . /lib/init/mount-functions.sh
-. /lib/init/splash-functions-base
 
 do_start () {
        # Trap SIGINT so that we can handle user interrupt of fsck.
@@ -213,10 +212,8 @@ Will restart in 5 seconds."
                if [ "$VERBOSE" = no ]
                then
                        log_action_begin_msg "Checking root file system"
-                       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
@@ -224,12 +221,10 @@ Will restart in 5 seconds."
                                log_action_end_msg 1 "code $FSCKCODE"
                        fi
                else
-                       splash_start_indefinite
                        log_daemon_msg "Will now check root file system"
                        logsave -s $FSCK_LOGFILE fsck $spinner $force $fix -V 
-t $roottype $rootdev
                        FSCKCODE=$?
                        log_end_msg $FSCKCODE
-                       splash_stop_indefinite
                fi
        fi
 
diff --git a/debian/src/initscripts/lib/init/splash-functions-base 
b/debian/src/initscripts/lib/init/splash-functions-base
deleted file mode 100644
index 8319dab..0000000
--- a/debian/src/initscripts/lib/init/splash-functions-base
+++ /dev/null
@@ -1,93 +0,0 @@
-# This script contains hooks to allow init scripts to control
-# a splash program during boot and shutdown.
-#
-# To override these, provide a /lib/init/splash-functions scripts
-# with new functions (it is sourced at the end of this file)
-#
-# Note that scripts have a number of constraints:
-#  1) Should avoid using any binaries not found in the initramfs so that 
-#     the same hooks can be used there.
-#  2) This also means that bashisms can't be used.
-#  3) Scripts must work when running under "set -e".
-#  4) "local" should be used to avoid overwriting global variables.
-
-
-# Detects whether a splash is running
-splash_running() { return 1; }
-
-# Tells the splash to quit
-splash_stop() { return 0; }
-
-# Tells the splash to start if not already running
-splash_start() { return 1; }
-
-# Tells the splash the current boot/shutdown progress
-# $1 contains the progress as a percentage value between -100 and 100
-# Positive values indicate boot progress
-# Negative values indicate shutdown progress
-splash_progress()
-{
-       local progress tmp
-       progress="$1"
-
-       splash_running || return 0
-
-       # Sanity check step 1 - must match ^-[0-9]*$
-       tmp="$progress"
-
-       # Strip trailing numbers
-       while [ "${tmp%[0-9]}" != "$tmp" ]; do
-               tmp="${tmp%[0-9]}"
-       done
-
-       # Now "-" or no characters should remain
-       if [ -n "$tmp" ] && [ "$tmp" != "-" ]; then
-               return 1
-       fi
-
-       #  Sanity check step 2 - check for values >= -100 and <= 100
-       if [ "$progress" != "${progress#-}" ]; then
-               # Negative value
-               if [ "$progress" -lt -100 ]; then
-                       return 1
-               fi
-       else
-               # Positive value
-               if [ "$progress" -gt 100 ]; then
-                       return 1
-               fi
-       fi
-
-       # Sanity checks passed
-       custom_splash_progress "$progress" || return 1
-       return 0
-}
-
-# Customizations should replace this function instead of splash_progress above
-custom_splash_progress() { return 0; }
-
-
-# Tells the splash that a task which may take an unknown amount of
-# time has started (such as a fsck). This is useful to make sure the
-# splash doesn't time out and to give visual feedback to the user.
-splash_start_indefinite() { return 0; }
-
-# Tells the splash that an indefinite task is done
-splash_stop_indefinite() { return 0; }
-
-# Gets user input from a splash
-# $1 contains the text for the user prompt
-# $2 describes the type of input:
-#     regular  = regular input, e.g. a user name
-#     password = input which should not be echoed to screen, e.g. a password
-#     enter    = A "press enter to continue" type of prompt
-#
-# Returns 1 if no user input is possible
-# Should be called with an alternative non-splash input fallback:
-#   INPUT="$(splash_user_input "Enter password:" password)" || \
-#   INPUT="$(manual_method)"
-splash_user_input() { return 1; }
-
-# Allow these functions to be overridden with custom scripts.  This is
-# the official API hook.
-if [ -e /lib/init/splash-functions ] ; then . /lib/init/splash-functions ; fi
diff --git a/debian/src/sysv-rc/etc/init.d/rc b/debian/src/sysv-rc/etc/init.d/rc
index fdb8ac7..0d1a17a 100644
--- a/debian/src/sysv-rc/etc/init.d/rc
+++ b/debian/src/sysv-rc/etc/init.d/rc
@@ -46,15 +46,6 @@ trap ":" INT QUIT TSTP
 # Set onlcr to avoid staircase effect.
 stty onlcr 0>&1
 
-# Functions for splash progress bars
-if [ -e /lib/init/splash-functions-base ] ; then
-       . /lib/init/splash-functions-base
-else
-       # Quiet down script if old initscripts version without 
/lib/init/splash-functions-base is used.
-       splash_progress() { return 1; }
-       splash_stop() { return 1; }
-fi
-
 # Now find out what the current and what the previous runlevel are.
 
 runlevel=$RUNLEVEL
@@ -84,18 +75,6 @@ else
 fi
 
 #
-# Stub to do progress bar ticks (for splash programs) on startup
-#
-startup_progress() {
-       # Avoid divide by zero if anyone moved xdm/kdm/gdm first in a runlevel.
-       if [ 0 -eq "$num_steps" ] ; then return; fi
-
-       step=$(($step + $step_change))
-       progress=$(($step * $progress_size / $num_steps + $first_step))
-       $debug splash_progress "$progress" || true
-}
-
-#
 # Check if we are able to use make like booting.  It require the
 # insserv package to be enabled. Boot concurrency also requires
 # startpar to be installed.
@@ -117,15 +96,7 @@ case "$CONCURRENCY" in
        makefile|startpar|shell) # startpar and shell are obsolete
                CONCURRENCY=makefile
                log_action_msg "Using makefile-style concurrent boot in 
runlevel $runlevel"
-               # The splash API is not handled with this CONCURRENCY mode.
-               # It need to be implented in startpar.  Until that is done
-               # stop the splash screen before starting services, to avoid
-               # usplash and X to confuse each other during boot.
                startup() {
-                       if [ start = "$1" ] || [ boot = "$1" ]
-                       then
-                               $debug splash_stop || true
-                       fi
                        eval "$(startpar -p 4 -t 20 -T 3 -M $1 -P $previous -R 
$runlevel)"
 
                        if [ -n "$failed_service" ]
@@ -148,73 +119,26 @@ case "$CONCURRENCY" in
                        scripts="$@"
                        for script in $scripts ; do
                                $debug "$script" $action
-                               startup_progress
                        done
                }
                ;;
 esac
 
-# Check if the splash screen should be stopped before the given
-# script.
-is_splash_stop_scripts() {
-       scriptname=$1
-       case "$scriptname" in
-               # killprocs is used in runlevel 1
-               gdm|xdm|kdm|ltsp-client|ltsp-client-core|reboot|halt|killprocs)
-                       return 0
-                       ;;
-       esac
-       return 1
-}
-
 # Is there an rc directory for this new runlevel?
 if [ -d /etc/rc$runlevel.d ]
 then
-       # Find out where in the progress bar the initramfs got to.
-       PROGRESS_STATE=0
-       if [ -f /dev/.initramfs/progress_state ]; then
-               . /dev/.initramfs/progress_state
-       fi
-
-       # Split the remaining portion of the progress bar into thirds
-       progress_size=$(((100 - $PROGRESS_STATE) / 3))
-
        case "$runlevel" in
                0|6)
                        ACTION=stop
-                       # Count down from 0 to -100 and use the entire bar
-                       first_step=0
-                       progress_size=100
-                       step_change=-1
                        ;;
                S)
                        ACTION=start
-                       # Begin where the initramfs left off and use 2/3
-                       # of the remaining space
-                       first_step=$PROGRESS_STATE
-                       progress_size=$(($progress_size * 2))
-                       step_change=1
                        ;;
                *)
                        ACTION=start
-                       # Begin where rcS left off and use the final 1/3 of
-                       # the space (by leaving progress_size unchanged)
-                       first_step=$(($progress_size * 2 + $PROGRESS_STATE))
-                       step_change=1
                        ;;
        esac
 
-       # Count the number of scripts we need to run
-       # (for progress bars)
-       num_steps=0
-       for s in /etc/rc$runlevel.d/[SK]*; do
-               if is_splash_stop_scripts "${s##/etc/rc$runlevel.d/S??}" ; then
-                       break
-               fi
-               num_steps=$(($num_steps + 1))
-       done
-       step=0
-
        # First, run the KILL scripts.
        if [ makefile = "$CONCURRENCY" ]
        then
@@ -258,9 +182,6 @@ then
 
                                # Stop the service.
                                SCRIPTS="$SCRIPTS $i"
-                               if is_splash_stop_scripts "$suffix" ; then
-                                       $debug splash_stop || true
-                               fi
                        done
                        startup stop $SCRIPTS
                done
@@ -323,9 +244,6 @@ then
 
                                fi
                                SCRIPTS="$SCRIPTS $i"
-                               if is_splash_stop_scripts "$suffix" ; then
-                                       $debug splash_stop || true
-                               fi
                        done
                        startup $ACTION $SCRIPTS
                done
-- 
1.7.5.4

Reply via email to