~ubuntu-branches/debian/experimental/sysvinit/experimental

« back to all changes in this revision

Viewing changes to debian/initscripts/lib/init/splash-functions-base

  • Committer: Bazaar Package Importer
  • Author(s): Petter Reinholdtsen
  • Date: 2009-09-13 00:13:49 UTC
  • Revision ID: james.westby@ubuntu.com-20090913001349-c4hnvhp0titxdpw9
Tags: 2.87dsf-5
* Uploading to experimental, to test the new build rules.

* Make sysv-rc postinst report detected problems to stderr too when
  failing to migrate.
* Fix typo in error message from postinst (Closes: #545409).
* Make initscripts depend on sysvinit-utils (>= 2.86.ds1-64), to
  make sure the fstab-decode program is available (Closes: #545356).
* Make sure the calls to 'update-rc.d X remove' in initscripts
  postinst do not ignore errors (Closes: #406361).
* Make sysvinit depend on sysvinit-utils (>= 2.86.ds1-66) to avoid
  that bootlogd disappear during partial upgrades (Closes: #545368).
* Restructure source package to make it possible to use debhelper in
  the common way to build the source, by moving debian/initscripts/
  and debian/sysv-rc/ into debian/src/.  Restructure build rules to
  use debhelper more, and migrate to debhelper 7.
* New patch 98_installtarget.patch to improve the sysvinit install
  target.
* Remove /etc/init.d/.depend.* in prerm, not postrm, to avoid
  surprises.
* Remove /var/lib/update-rc.d/* when the package is purged.
* Change cut-off point for the trimmed changelog entries in
  sysvinit-utils, initscripts and sysv-rc from version 2.84-3 to
  version 2.86.ds1-47, to reduce the package sizes.
* Drop hurd specific dependency on libc0.3 (>= 2.3.2.ds1-12).  It is
  no longer needed according to Michael Bunk.  Patch from Michael
  Biebl.
* Remove information about scripts in /var/lib/update-rc.d/ when
  their runlevel symlinks are removed (Closes: #545949).  Remove
  such files left behind earlier during upgrade.
* Bootlogd now starts as late as possible (Closes: #265801)
* Drop the binary /lib/init/readlink from initscripts and depend on
  coreutils (>= 5.93) instead.  Adjust scripts to use the program
  from coreutils from now on (Closes: #239342).
* Make sure insserv exit values propagate through update-rc.d to make
  sure packages with errors fail to install.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# This script contains hooks to allow init scripts to control
2
 
# a splash program during boot and shutdown.
3
 
#
4
 
# To override these, provide a /lib/init/splash-functions scripts
5
 
# with new functions (it is sourced at the end of this file)
6
 
#
7
 
# Note that scripts have a number of constraints:
8
 
#  1) Should avoid using any binaries not found in the initramfs so that 
9
 
#     the same hooks can be used there.
10
 
#  2) This also means that bashisms can't be used.
11
 
#  3) Scripts must work when running under "set -e".
12
 
#  4) "local" should be used to avoid overwriting global variables.
13
 
 
14
 
 
15
 
# Detects whether a splash is running
16
 
splash_running() { return 1; }
17
 
 
18
 
# Tells the splash to quit
19
 
splash_stop() { return 0; }
20
 
 
21
 
# Tells the splash to start if not already running
22
 
splash_start() { return 1; }
23
 
 
24
 
# Tells the splash the current boot/shutdown progress
25
 
# $1 contains the progress as a percentage value between -100 and 100
26
 
# Positive values indicate boot progress
27
 
# Negative values indicate shutdown progress
28
 
splash_progress()
29
 
{
30
 
        local progress tmp
31
 
        progress="$1"
32
 
 
33
 
        splash_running || return 0
34
 
 
35
 
        # Sanity check step 1 - must match ^-[0-9]*$
36
 
        tmp="$progress"
37
 
 
38
 
        # Strip trailing numbers
39
 
        while [ "${tmp%[0-9]}" != "$tmp" ]; do
40
 
                tmp="${tmp%[0-9]}"
41
 
        done
42
 
 
43
 
        # Now "-" or no characters should remain
44
 
        if [ -n "$tmp" ] && [ "$tmp" != "-" ]; then
45
 
                return 1
46
 
        fi
47
 
 
48
 
        #  Sanity check step 2 - check for values >= -100 and <= 100
49
 
        if [ "$progress" != "${progress#-}" ]; then
50
 
                # Negative value
51
 
                if [ "$progress" -lt -100 ]; then
52
 
                        return 1
53
 
                fi
54
 
        else
55
 
                # Positive value
56
 
                if [ "$progress" -gt 100 ]; then
57
 
                        return 1
58
 
                fi
59
 
        fi
60
 
 
61
 
        # Sanity checks passed
62
 
        custom_splash_progress "$progress" || return 1
63
 
        return 0
64
 
}
65
 
 
66
 
# Customizations should replace this function instead of splash_progress above
67
 
custom_splash_progress() { return 0; }
68
 
 
69
 
 
70
 
# Tells the splash that a task which may take an unknown amount of
71
 
# time has started (such as a fsck). This is useful to make sure the
72
 
# splash doesn't time out and to give visual feedback to the user.
73
 
splash_start_indefinite() { return 0; }
74
 
 
75
 
# Tells the splash that an indefinite task is done
76
 
splash_stop_indefinite() { return 0; }
77
 
 
78
 
# Gets user input from a splash
79
 
# $1 contains the text for the user prompt
80
 
# $2 describes the type of input:
81
 
#     regular  = regular input, e.g. a user name
82
 
#     password = input which should not be echoed to screen, e.g. a password
83
 
#     enter    = A "press enter to continue" type of prompt
84
 
#
85
 
# Returns 1 if no user input is possible
86
 
# Should be called with an alternative non-splash input fallback:
87
 
#   INPUT="$(splash_user_input "Enter password:" password)" || \
88
 
#   INPUT="$(manual_method)"
89
 
splash_user_input() { return 1; }
90
 
 
91
 
# Allow these functions to be overridden with custom scripts.  This is
92
 
# the official API hook.
93
 
if [ -e /lib/init/splash-functions ] ; then . /lib/init/splash-functions ; fi