~ubuntu-branches/ubuntu/karmic/sysvinit/karmic-updates

« back to all changes in this revision

Viewing changes to debian/initscripts.preinst

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2009-09-07 19:56:53 UTC
  • mfrom: (1.1.4 upstream) (2.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20090907195653-2i6t0j91wfbf1f0d
Tags: 2.87dsf-4ubuntu1
* Merge from debian unstable, remaining changes:
  - Support Cell processor:
    + debian/initscripts/postinst: Create spu system group and /spu mount
      point if we are running on a Cell processor.
    + debian/initscripts/etc/init.d/mountkernfs.sh: Mount spufs if Cell
      processor is detected.
    + debian/initscripts/lib/init/mount-functions.sh: Modprobe spufs
      if not available.
    + debian/control: Add initscripts dependency 'passwd' for groupadd.
    (Forwarded to Debian #483399)
  - Use tmpfs mounts for /var/lock and /var/run:
    + debian/initscripts/share/default.rcS: Enable RAMRUN and RAMLOCK by
      default.
    + debian/initscripts.postinst: Enable RAMRUN and RAMLOCK in
      /etc/default/rcS on upgrades. This needs to be kept until the next
      LTS.
    + debian/initscripts/etc/init.d/mountkernfs.sh: Propagate files from the
      initramfs to our new /var/run, so that we can populate
      /var/run/sendsigs.omit from initramfs.
  - Boot ordering differences:
    + mountkernfs.sh: 02 -> 01
    + mountdevsubfs.sh: 04 -> 11
    + bootlogd: disabled by default
    + checkroot.sh: 10 -> 20
    + mtab.sh: 12 -> 22
  - debian/patches/91_sulogin_lockedpw.dpatch: Disable "root account is
    locked" warning, since this is the default in Ubuntu. Document this in
    sulogin.8.
  - debian/control: Drop Essential: yes from packages since we use Upstart.
  - debian/control: Conflict/Replace sysvconfig which has also previously
    provided service(8).
  - debian/control, debian/rules: Previous name for sysvinit-utils was
    'sysvutils' in Ubuntu, so Conflict/Replace/Provide it. Also create a
    dummy sysvutils package, since Hardy has reverse versioned dependencies
    to it. This needs to be kept until after the next LTS.
  - debian/control: Depend on lsb-base (>= 3.2-14) for status_of_proc()
    function.
  - debian/initscripts/etc/init.d/checkfs.sh: Don't depend on hwclockfirst
    which Ubuntu does not have.
  - debian/initscripts/etc/init.d/mountkernfs.sh: Always mount devpts, and
    do not touch /dev/ptmx (which is already managed by udev).
  - debian/initscripts/etc/init.d/mountkernfs.sh: mount fusectl if it is
    available
  - debian/initscripts/etc/init.d/mountkernfs.sh: mount securityfs if it is
    available. This allows for easier AppArmor confinement of applications
    early in the boot process. LP: #399954
  - debian/initscripts/etc/init.d/mountkernfs.sh: mount debugfs if it is
    available.
  - debian/initscripts/etc/init.d/ondemand: Sleep for 60 seconds, then
    set CPU Frequency Scaling governor to "ondemand".   LP: #341573.
  - debian/initscripts/etc/init.d/umountfs: Don't unmount filesystems
    that precede root or use force for some mountpoints.
  - debian/initscripts/etc/network/if-up.d/mountnfs: Rename ifstate
    file to /var/run/network/ifstate
  - ./debian/initscripts/lib/init/usplash-fsck-functions.sh: Use blkid,
    vol_id is gone.
  - debian/initscripts.{pre,postinst}: waitnfs.sh -> mountnfs.sh renaming
    transition. This needs to be kept until after the next LTS.

LP: #32455, #94120, #160197, #382097 (amongst others).

* debian/sysv-rc/sbin/update-rc.d: Dropped support for "multiuser"
  command-line option.
* debian/rules: Compat symlink from /usr/bin/service to /usr/sbin/service
* debian/initscripts.postinst: Transition from bootlogs.sh to bootlogs

* debian/sysv-rc.postinst: Don't try and use insserv by default, though
  everything's in place for you to try if you like.  It can be activated
  with:
      USEINSSERV=yes dpkg-reconfigure sysv-rc

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
#
 
3
# initscripts preinst
 
4
#
 
5
 
 
6
set -e
 
7
 
 
8
# Remove a no-longer used conffile
 
9
#
 
10
# $1: conffile
 
11
#
 
12
# If the argument was not listed as a conffile, silently do nothing.
 
13
# Adapted from code obtained from http://wiki.debian.org/DpkgConffileHandling
 
14
eliminate_conffile() {
 
15
        PKGNAME="initscripts"
 
16
        CONFFILE="$1"
 
17
 
 
18
        if [ -e "$CONFFILE" ]; then
 
19
                CURRENT_MD5SUM="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
 
20
                FACTORY_MD5SUM="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`"
 
21
                if [ "$CURRENT_MD5SUM" != "$FACTORY_MD5SUM" ]; then
 
22
                        echo "Obsolete conffile $CONFFILE has been modified by you."
 
23
                        echo "Saving as $CONFFILE.dpkg-old ..."
 
24
                        mv -f "$CONFFILE" "$CONFFILE".dpkg-old
 
25
                else
 
26
                        echo "Removing unmodified and obsolete conffile $CONFFILE ..."
 
27
                        rm -f "$CONFFILE"
 
28
                fi
 
29
        fi
 
30
}
 
31
 
 
32
# Compares a file to the "factory md5sum", and if it matches, removes it.
 
33
# This is useful for when converting from to a conffile *and* changing
 
34
# its contents at the same time.
 
35
convert_to_conffile() {
 
36
       CONFFILE="$1"
 
37
       FACTORY_MD5SUM="$2"
 
38
 
 
39
       if [ -e "$CONFFILE" ]; then
 
40
               CURRENT_MD5SUM="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
 
41
               if [ "$CURRENT_MD5SUM" = "$FACTORY_MD5SUM" ]; then
 
42
                       rm -f "$CONFFILE"
 
43
               fi
 
44
       fi
 
45
}
 
46
 
 
47
 
 
48
case "$1" in
 
49
  install|upgrade)
 
50
        #
 
51
        # /etc/init.d/stop-bootlogd used to be a symlink to bootlogd;
 
52
        # now it is a separate script.  We need to remove the symlink here,
 
53
        # before dpkg installs the /etc/init.d/stop-bootlogd file.
 
54
        #
 
55
        [ -L /etc/init.d/stop-bootlogd ] && rm -f /etc/init.d/stop-bootlogd
 
56
        #
 
57
        # Remove obsolete conffiles
 
58
        #
 
59
        if [ "$2" ] && dpkg --compare-versions "$2" lt "2.86.ds1-10" ; then
 
60
                eliminate_conffile "/etc/init.d/bootclean.sh"
 
61
        fi
 
62
        #
 
63
        # The /etc/init.d/bootclean script fragment was moved to
 
64
        # /lib/init/ in version 2.86.ds1-39
 
65
        #
 
66
        if [ "$2" ] && dpkg --compare-versions "$2" lt "2.86.ds1-54" ; then
 
67
                eliminate_conffile "/etc/init.d/bootclean"
 
68
        fi
 
69
        #
 
70
        # The /etc/init.d/waitnfs.sh script was replaced by mountnfs.sh
 
71
        #
 
72
        if [ "$2" ] && dpkg --compare-versions "$2" lt "2.86.ds1-56ubuntu1" ; then
 
73
                eliminate_conffile "/etc/init.d/waitnfs.sh"
 
74
        fi
 
75
        #
 
76
        # The /etc/init.d/bootlogs.sh script was replaced by bootlogs
 
77
        #
 
78
        if [ "$2" ] && dpkg --compare-versions "$2" lt "2.87dsf-4ubuntu1" ; then
 
79
                eliminate_conffile "/etc/init.d/bootlogs.sh"
 
80
        fi
 
81
        #
 
82
        # The /etc/init.d/rc.local was made a conffile in 2.86.ds1-18,
 
83
        # which for Ubuntu translates into "on upgrades to Intrepid and
 
84
        # onwards". The only valid upgrade path to Intrepid is from Hardy,
 
85
        # so we just check against the md5sum from there.
 
86
        if [ "$2" ] && dpkg --compare-versions "$2" lt "2.86.ds1-18" ; then
 
87
                convert_to_conffile "/etc/init.d/rc.local" e3756487011471f7753d5d94ce4b6af4
 
88
        fi
 
89
        #
 
90
        # Move conflicting log _file_ if present
 
91
        #
 
92
        [ -f /var/log/fsck ] && mv -f /var/log/fsck /var/log/fsck.dpkg-old
 
93
        ;;
 
94
  abort-upgrade)
 
95
        exit 0
 
96
        ;;
 
97
esac
 
98
 
 
99
: