~ubuntu-branches/ubuntu/maverick/cryptsetup/maverick

« back to all changes in this revision

Viewing changes to debian/cryptsetup.postinst

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2010-06-14 21:47:28 UTC
  • mfrom: (0.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20100614214728-tm8kdwg6chjejlbq
Tags: 2:1.1.2-1ubuntu1
* Merge from Debian unstable (LP: #594365).  Remaining changes:
  - debian/control:
    + Bump initramfs-tools Suggests to Depends: so system is not
      potentially rendered unbootable.
    + Depend on plymouth.   
  - Add debian/cryptdisks-{enable,udev}.upstart.
  - debian/cryptdisks.functions:
    + new function, crypttab_start_one_disk, to look for the named source
      device in /etc/crypttab (by device name, UUID, or label) and start it
      if configured to do so
    + wrap the call to /lib/cryptsetup/askpass with watershed, to make sure
      we only ever have one of these running at a time; otherwise multiple
      invocations could steal each other's input and/or write over each
      other's output
    + initially create the device under a temporary name and rename it only
      at the end using 'dmsetup rename', to ensure that upstart/mountall
      doesn't see our device before it's ready to go.
    + do_tmp should mount under /var/run/cryptsetup for changing the
      permissions of the filesystem root, not directly on /tmp, since
      mounting on /tmp a) is racy, b) confuses mountall something fierce.
    + when called by cryptdisks-enable, check that we don't already have a
      corresponding cryptdisks-udev job running (probably waiting for a
      passphrase); if there is, wait until it's finished before continuing.
  - debian/cryptdisks{,-early}.init: Make the 'start' action of the init
    script a no-op, this should be handled entirely by the upstart job;
    and fix the LSB header to not declare this should be started in
    runlevel 'S'
  - debian/cryptsetup.postinst: Remove any symlinks from /etc/rcS.d on
    upgrade. 
  - debian/rules: Do not install start symlinks for init scripts, and
    install debian/cryptdisks-{enable,udev}.upstart scripts.
  - Add debian/cryptsetup.apport: Apport package hook. Install in
    debian/rules and create dir in debian/cryptsetup.dirs.
  - debian/rules: link dynamically against libgcrypt and libgpg-error.
  - debian/cryptsetup.postrm: call update-initramfs on package removal.
* Dropped changes, merged/superseded in Debian:
  - Add ext4 support to passdev.
  - cryptroot-hook: don't call copy_modules_dir with empty arguments when
    archcrypto isn't found
  - Set USPLASH=y and FRAMEBUFFER=y in the hook config to pull plymouth into
    the initramfs.
  - change interaction to use plymouth directly if present, and if not, to
    fall back to /lib/cryptsetup/askpass as before
  - cryptdisks.functions: replace 'echo -e' bashism with 'printf'.
  - debian/initramfs/cryptroot-script: if plymouth is present in the
    initramfs, use this directly, bypassing the cryptsetup askpass script
  - debian/initramfs/cryptroot-hook: Properly anchor our regexps when
    grepping /etc/crypttab so that we don't incorrectly match device names
    that are substrings of one another.
  - debian/initramfs/cryptroot-script: Don't leak /conf/conf.d/cryptroot
    file descriptor to subprocesses.
  - Fix grammar error in debian/initramfs/cryptroot-script
    ("setup" -> "set up")
  - debian/initramfs/cryptroot-script: Fix this to work with current
    initramfs-tools:
    + Source /scripts/functions after checking for prerequisites.
    + prereqs(): Do not assume we are running within initramfs, and
      calculate relative path correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
        fi
24
24
 
25
25
        # Do a number of checks on the currently installed crypttab
 
26
        
26
27
        egrep -v "^[[:space:]]*(#|$)" /etc/crypttab | while read dst src key opts; do
27
28
                if [ -z "$dst" ]; then
28
29
                        continue
31
32
                        echo "WARNING: $dst in /etc/crypttab is missing some arguments, see man cryptab(5)." >&2
32
33
                        continue
33
34
                else
34
 
                        # Some options are deprecated
35
 
                        while [ -n "$opts" ]; do
36
 
                                opt=$(echo $opts | sed "s/,.*//")
37
 
                                opts=${opts##$opt}
38
 
                                opts=${opts##,}
39
 
 
40
 
                                if [ "$opt" = "ssl" ]; then
 
35
                        # Strip comments - https://bugs.launchpad.net/bugs/185380
 
36
                        opts=$(echo -n $opts | sed 's/ *#.*//')
 
37
                        plainopts="0"
 
38
                        IFS=','
 
39
                        for opt in $opts; do
 
40
                                PARAM=$(echo "$opt" | sed 's/=.*//')
 
41
                                case "$PARAM" in
 
42
                                # Some options are deprecated
 
43
                                gpg)
 
44
                                        echo "WARNING: $dst in /etc/crypttab uses the deprecated gpg option, see man crypttab(5)." >&2
 
45
                                        ;;
 
46
                                ssl)
41
47
                                        echo "WARNING: $dst in /etc/crypttab uses the deprecated ssl option, see man crypttab(5)." >&2
42
 
                                elif [ "$opt" = "gpg" ]; then
43
 
                                        echo "WARNING: $dst in /etc/crypttab uses the deprecated gpg option, see man crypttab(5)." >&2
44
 
                                fi
 
48
                                        ;;
 
49
                                luks)
 
50
                                        plainopts="3"
 
51
                                        ;;
 
52
                                cipher|hash|size)
 
53
                                        plainopts="$(($plainopts+1))"
 
54
                                        ;;
 
55
                                esac
45
56
                        done
 
57
                        if [ "$plainopts" -lt "3" ]; then
 
58
                                echo "WARNING: you need to set all of cipher, hash and size for the plain dm-crypt mapping $dst in /etc/crypttab." >&2
 
59
                        fi
 
60
                        unset IFS
46
61
                fi
47
62
 
48
63
        done