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