]> git.proxmox.com Git - pve-kernel-jessie.git/blob - proxmox-ve/postinst
baf3d293c955241f401cebdd6b22464821faaff4
[pve-kernel-jessie.git] / proxmox-ve / postinst
1 #! /bin/sh
2
3 # Abort if any command returns an error value
4 set -e
5
6 # This script is called as the last step of the installation of the
7 # package. All the package's files are in place, dpkg has already
8 # done its automatic conffile handling, and all the packages we depend
9 # of are already fully installed and configured.
10
11 # The following idempotent stuff doesn't generally need protecting
12 # against being run in the abort-* cases.
13
14 case "$1" in
15 configure)
16 # Configure this package. If the package must prompt the user for
17 # information, do it here.
18
19 # cleanup - remove Proxmox Release Key key from /etc/apt/trusted.gpg
20 /usr/bin/apt-key --keyring /etc/apt/trusted.gpg del 9887F95A >/dev/null 2>&1 || /bin/true
21
22 # setup kernel links for installation CD (rescue boot)
23 mkdir -p /boot/pve
24 ln -sf /boot/vmlinuz-@KVNAME@ /boot/pve/vmlinuz
25 ln -sf /boot/initrd.img-@KVNAME@ /boot/pve/initrd.img
26
27 # There are three sub-cases:
28 if test "${2+set}" != set; then
29 # We're being installed by an ancient dpkg which doesn't remember
30 # which version was most recently configured, or even whether
31 # there is a most recently configured version.
32 :
33
34 elif test -z "$2" -o "$2" = "<unknown>"; then
35 # The package has not ever been configured on this system, or was
36 # purged since it was last configured.
37 :
38
39 else
40 # Version $2 is the most recently configured version of this
41 # package.
42 :
43
44 fi ;;
45 abort-upgrade)
46 # Back out of an attempt to upgrade this package FROM THIS VERSION
47 # to version $2. Undo the effects of "prerm upgrade $2".
48 :
49
50 ;;
51 abort-remove)
52 if test "$2" != in-favour; then
53 echo "$0: undocumented call to \`postinst $*'" 1>&2
54 exit 0
55 fi
56 # Back out of an attempt to remove this package, which was due to
57 # a conflict with package $3 (version $4). Undo the effects of
58 # "prerm remove in-favour $3 $4".
59 :
60
61 ;;
62 abort-deconfigure)
63 if test "$2" != in-favour -o "$5" != removing; then
64 echo "$0: undocumented call to \`postinst $*'" 1>&2
65 exit 0
66 fi
67 # Back out of an attempt to deconfigure this package, which was
68 # due to package $6 (version $7) which we depend on being removed
69 # to make way for package $3 (version $4). Undo the effects of
70 # "prerm deconfigure in-favour $3 $4 removing $6 $7".
71 :
72
73 ;;
74 *) echo "$0: didn't understand being called with \`$1'" 1>&2
75 exit 0;;
76 esac
77
78 exit 0