Hi folks,
I've attached a set of changes for your consideration. These are
also available from
git://git.debian.org/git/users/rleigh/sysvinit
(branch 2.88dsf-13.12) which follows on from
git://git.debian.org/git/collab-maint/sysvinit (master)commit 6650fe79c37f147115fa530d880ebb86bb3651d7 Author: Roger Leigh <[email protected]> Date: Fri Jul 22 22:31:04 2011 +0100 mtab: Make /etc/mtab a symlink to /proc/mounts on Linux [Should not impact debian-installer. We're waiting on #622693 at the moment, unless this is deemed unimportant] commit d31b3f3bfef0c4ba71c269e01ff59bd1d3ad608a Author: Roger Leigh <[email protected]> Date: Fri Jul 22 21:35:05 2011 +0100 mtab.sh: Remove unused DO_MTAB [Cleanup] commit 750421a7fdd5e53f058601df9014fbacefceac99 Author: Roger Leigh <[email protected]> Date: Fri Jul 22 21:24:27 2011 +0100 Move /tmp symlink handling to mountall [This was being done at a point where the symlink destination might not be mounted or writable, so move until after everything is mounted and writable] commit cac68d30c85d86424062c45969005f7d61ecea23 Author: Roger Leigh <[email protected]> Date: Fri Jul 22 21:29:08 2011 +0100 debian: Use linux-any in Build-Depends and Close #634514 [As reported a few days ago] commit a82bfbb752f1a859f5b8e1a20463f0edca3d035d Author: Michael Biebl <[email protected]> Date: Thu Jul 14 08:46:26 2011 +0200 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. [As discussed last week; has there been any further feedback about the suitability of this patch? Are there any current or prospective users?] Regards, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/ `- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
From a82bfbb752f1a859f5b8e1a20463f0edca3d035d Mon Sep 17 00:00:00 2001 From: Michael Biebl <[email protected]> Date: Thu, 14 Jul 2011 08:46:26 +0200 Subject: [PATCH 1/5] 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(-) delete mode 100644 debian/src/initscripts/lib/init/splash-functions-base 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
From cac68d30c85d86424062c45969005f7d61ecea23 Mon Sep 17 00:00:00 2001 From: Roger Leigh <[email protected]> Date: Fri, 22 Jul 2011 21:29:08 +0100 Subject: [PATCH 2/5] debian: Use linux-any in Build-Depends and Close #634514 --- debian/changelog | 8 ++++++++ debian/control | 2 +- 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/debian/changelog b/debian/changelog index aace715..7ce002c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +sysvinit (2.88dsf-13.12) unstable; urgency=low + + * Non-maintainer upload. + * Use [linux-any] in place of [!hurd-i386 !kfreebsd-i386 + !kfreebsd-amd64] (Closes: #634514). + + -- Roger Leigh <[email protected]> Fri, 22 Jul 2011 08:46:05 +0100 + sysvinit (2.88dsf-13.11) unstable; urgency=low * Non-maintainer upload. diff --git a/debian/control b/debian/control index b7e674f..4a68573 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: admin Priority: required Maintainer: Debian sysvinit maintainers <[email protected]> Uploaders: Petter Reinholdtsen <[email protected]>, Henrique de Moraes Holschuh <[email protected]>, Kel Modderman <[email protected]> -Build-Depends: debhelper (>= 7), po-debconf, quilt (>= 0.40), libselinux1-dev (>= 1.14) [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], libsepol1-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64] +Build-Depends: debhelper (>= 7), po-debconf, quilt (>= 0.40), libselinux1-dev (>= 1.14) [linux-any], libsepol1-dev [linux-any] Standards-Version: 3.9.1 Homepage: http://savannah.nongnu.org/projects/sysvinit Vcs-Svn: svn://svn.debian.org/pkg-sysvinit/sysvinit/trunk -- 1.7.5.4
From 750421a7fdd5e53f058601df9014fbacefceac99 Mon Sep 17 00:00:00 2001 From: Roger Leigh <[email protected]> Date: Fri, 22 Jul 2011 21:24:27 +0100 Subject: [PATCH 3/5] Move /tmp symlink handling to mountall --- debian/changelog | 6 +++++- debian/src/initscripts/etc/init.d/mountkernfs.sh | 7 ------- debian/src/initscripts/lib/init/mount-functions.sh | 7 +++++++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7ce002c..8d335a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,12 @@ sysvinit (2.88dsf-13.12) unstable; urgency=low * Non-maintainer upload. * Use [linux-any] in place of [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64] (Closes: #634514). + * If /tmp is a symlink, create linked-to directory after mounting + all filesystems, rather than in mountkernfs, since doing it in + mountkernfs could fail due to the path not yet being mounted, or + being on a read only filesystem. - -- Roger Leigh <[email protected]> Fri, 22 Jul 2011 08:46:05 +0100 + -- Roger Leigh <[email protected]> Fri, 22 Jul 2011 11:20:10 +0100 sysvinit (2.88dsf-13.11) unstable; urgency=low diff --git a/debian/src/initscripts/etc/init.d/mountkernfs.sh b/debian/src/initscripts/etc/init.d/mountkernfs.sh index 644aed1..75a3ee5 100755 --- a/debian/src/initscripts/etc/init.d/mountkernfs.sh +++ b/debian/src/initscripts/etc/init.d/mountkernfs.sh @@ -58,13 +58,6 @@ mount_filesystems () { [ -f /run/lock/.ramfs ] || touch /run/lock/.ramfs - # If /tmp is a symlink, make sure the linked-to directory exists. - if [ -L /tmp ] && [ ! -d /tmp ]; then - TMPPATH="$(readlink /tmp)" - mkdir -p --mode=755 "$TMPPATH" - [ -x /sbin/restorecon ] && /sbin/restorecon "$TMPPATH" - fi - # If root is read only, default to mounting a tmpfs on /tmp, # unless one is due to be mounted from fstab. if [ rw != "$rootmode" ]; then diff --git a/debian/src/initscripts/lib/init/mount-functions.sh b/debian/src/initscripts/lib/init/mount-functions.sh index 3c97ed5..b6b9abb 100644 --- a/debian/src/initscripts/lib/init/mount-functions.sh +++ b/debian/src/initscripts/lib/init/mount-functions.sh @@ -355,4 +355,11 @@ post_mountall () run_migrate /var/run /run run_migrate /var/lock /run/lock run_migrate /dev/shm /run/shm + + # If /tmp is a symlink, make sure the linked-to directory exists. + if [ -L /tmp ] && [ ! -d /tmp ]; then + TMPPATH="$(readlink /tmp)" + mkdir -p --mode=755 "$TMPPATH" + [ -x /sbin/restorecon ] && /sbin/restorecon "$TMPPATH" + fi } -- 1.7.5.4
From d31b3f3bfef0c4ba71c269e01ff59bd1d3ad608a Mon Sep 17 00:00:00 2001 From: Roger Leigh <[email protected]> Date: Fri, 22 Jul 2011 21:35:05 +0100 Subject: [PATCH 4/5] mtab.sh: Remove unused DO_MTAB --- debian/src/initscripts/etc/init.d/mtab.sh | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/debian/src/initscripts/etc/init.d/mtab.sh b/debian/src/initscripts/etc/init.d/mtab.sh index 65ad2d2..50d398f 100644 --- a/debian/src/initscripts/etc/init.d/mtab.sh +++ b/debian/src/initscripts/etc/init.d/mtab.sh @@ -33,7 +33,6 @@ do_start () { # Needed to determine if root is being mounted read-only. read_fstab - DO_MTAB="" MTAB_PATH="$(readlink -f /etc/mtab || :)" case "$MTAB_PATH" in /proc/*) -- 1.7.5.4
From 6650fe79c37f147115fa530d880ebb86bb3651d7 Mon Sep 17 00:00:00 2001 From: Roger Leigh <[email protected]> Date: Fri, 22 Jul 2011 22:31:04 +0100 Subject: [PATCH 5/5] mtab: Make /etc/mtab a symlink to /proc/mounts on Linux --- debian/changelog | 5 +++- debian/src/initscripts/etc/init.d/mtab.sh | 35 +++++++++++++++++++++++----- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8d335a1..d5db5eb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,8 +7,11 @@ sysvinit (2.88dsf-13.12) unstable; urgency=low all filesystems, rather than in mountkernfs, since doing it in mountkernfs could fail due to the path not yet being mounted, or being on a read only filesystem. + * If /etc/mtab is not a symlink to /proc/mounts (i.e. is a regular + file or symlink to somewhere else) on Linux, then make /etc/mtab + a symbolic link to /proc/mounts. - -- Roger Leigh <[email protected]> Fri, 22 Jul 2011 11:20:10 +0100 + -- Roger Leigh <[email protected]> Fri, 22 Jul 2011 22:29:53 +0100 sysvinit (2.88dsf-13.11) unstable; urgency=low diff --git a/debian/src/initscripts/etc/init.d/mtab.sh b/debian/src/initscripts/etc/init.d/mtab.sh index 50d398f..6961c04 100644 --- a/debian/src/initscripts/etc/init.d/mtab.sh +++ b/debian/src/initscripts/etc/init.d/mtab.sh @@ -36,17 +36,19 @@ do_start () { MTAB_PATH="$(readlink -f /etc/mtab || :)" case "$MTAB_PATH" in /proc/*) - # Assume that /proc/ is not writable + # Symbolic link somewhere under /proc, presumably + # /proc/mounts or /proc/self/mounts or a canonicalised + # version thereof. Do nothing. ;; /*) - # Only update mtab if it is known to be writable - # Note that the touch program is in /usr/bin - #if ! touch "$MTAB_PATH" >/dev/null 2>&1 - #then - # return - #fi + # Symbolic link to somewhere nonstandard. No longer + # supported under Linux (it will be migrated to link + # to /proc/mounts, below) ;; "") + # Symbolic link to somewhere nonstandard or a regular + # file. No longer supported under Linux (it will be + # migrated to link to /proc/mounts, below) [ -L /etc/mtab ] && MTAB_PATH="$(readlink /etc/mtab)" if [ "$MTAB_PATH" ] then @@ -61,6 +63,25 @@ do_start () { esac # + # On Linux, migrate to a symlink if currently a regular file, + # or non-standard symlink. + # + if [ "$KERNEL" = Linux ]; then + LINK=no + if [ ! -L /etc/mtab ]; then + LINK=yes + else + MTAB_PATH="$(readlink /etc/mtab || :)" + if [ "$MTAB_PATH" != "/proc/mounts" ]; then + LINK=yes + fi + fi + if [ "$LINK" = yes ]; then + rm -f /etc/mtab && ln -s /proc/mounts /etc/mtab + fi + fi + + # # Initialize mtab file if necessary # if [ ! -f /etc/mtab ] -- 1.7.5.4
signature.asc
Description: Digital signature
_______________________________________________ Pkg-sysvinit-devel mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-sysvinit-devel

