]>
Commit | Line | Data |
---|---|---|
8514874f DM |
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 | ||
a121627e DM |
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 | |
8514874f | 21 | |
9eeead76 FG |
22 | # cleanup - remove old stretch-incompatible variant of installing release key |
23 | rm -f /etc/apt/trusted.gpg.d/proxmox-ve.gpg /etc/apt/trusted.gpg.d/proxmox-ve.gpg~ | |
24 | ||
81c0c4aa DM |
25 | # setup kernel links for installation CD (rescue boot) |
26 | mkdir -p /boot/pve | |
27 | ln -sf /boot/vmlinuz-@KVNAME@ /boot/pve/vmlinuz | |
28 | ln -sf /boot/initrd.img-@KVNAME@ /boot/pve/initrd.img | |
29 | ||
8514874f DM |
30 | # There are three sub-cases: |
31 | if test "${2+set}" != set; then | |
32 | # We're being installed by an ancient dpkg which doesn't remember | |
33 | # which version was most recently configured, or even whether | |
34 | # there is a most recently configured version. | |
35 | : | |
36 | ||
37 | elif test -z "$2" -o "$2" = "<unknown>"; then | |
38 | # The package has not ever been configured on this system, or was | |
39 | # purged since it was last configured. | |
40 | : | |
41 | ||
42 | else | |
43 | # Version $2 is the most recently configured version of this | |
44 | # package. | |
45 | : | |
46 | ||
47 | fi ;; | |
48 | abort-upgrade) | |
49 | # Back out of an attempt to upgrade this package FROM THIS VERSION | |
50 | # to version $2. Undo the effects of "prerm upgrade $2". | |
51 | : | |
52 | ||
53 | ;; | |
54 | abort-remove) | |
55 | if test "$2" != in-favour; then | |
56 | echo "$0: undocumented call to \`postinst $*'" 1>&2 | |
57 | exit 0 | |
58 | fi | |
59 | # Back out of an attempt to remove this package, which was due to | |
60 | # a conflict with package $3 (version $4). Undo the effects of | |
61 | # "prerm remove in-favour $3 $4". | |
62 | : | |
63 | ||
64 | ;; | |
65 | abort-deconfigure) | |
66 | if test "$2" != in-favour -o "$5" != removing; then | |
67 | echo "$0: undocumented call to \`postinst $*'" 1>&2 | |
68 | exit 0 | |
69 | fi | |
70 | # Back out of an attempt to deconfigure this package, which was | |
71 | # due to package $6 (version $7) which we depend on being removed | |
72 | # to make way for package $3 (version $4). Undo the effects of | |
73 | # "prerm deconfigure in-favour $3 $4 removing $6 $7". | |
74 | : | |
75 | ||
76 | ;; | |
77 | *) echo "$0: didn't understand being called with \`$1'" 1>&2 | |
78 | exit 0;; | |
79 | esac | |
80 | ||
81 | exit 0 |