Imported Debian patch 3.4-9
[debian/elilo] / debian / postinst
1 #!/bin/sh -e
2
3 # don't bother with debconf for this, since very few systems are likely to
4 # be affected by this upgrade, and it's a one-shot deal.  this postinst can
5 # probably be safely removed for the woody+1 release.
6
7 case "$1" in
8     configure)
9         # continue below
10     ;;
11
12     abort-upgrade|abort-remove|abort-deconfigure)
13         exit 0
14     ;;
15
16     *)
17         echo "postinst called with unknown argument \`$1'" >&2
18         exit 0
19     ;;
20 esac
21
22 if [ "$2" ] && dpkg --compare-versions $2 lt 3.2-1
23 then
24   echo ""
25   echo "You appear to be upgrading from an old (pre-3.2) version of the elilo"
26   echo "package.  The structure of files in the EFI partition is different"
27   echo "now, and the EFI boot manager entry for Debian needs to be updated."
28   echo ""
29   echo "If you have not made any manual changes to the EFI partition content"
30   echo "that you want to preserve, we can reformat and reload that partition"
31   echo "for you, and rewrite the boot manager entry to be correct."
32   echo ""
33   echo "Do you want me to reformat and reload the EFI partition and write an"
34   echo -n "updated boot manager entry for you [Ny]? "
35
36   read answer
37   case "$answer" in
38     [Yy]*)
39         echo -n "Working... "
40         /usr/sbin/elilo --format --efiboot
41         echo "done."
42         ;;
43     *)
44         echo "No action taken.  See /usr/share/doc/elilo/* for more info."
45         ;;
46   esac
47   echo ""
48 fi
49
50 #DEBHELPER#
51
52 exit 0