4 # see: dh_installdeb(1)
10 if [ -f /usr/share/debconf/confmodule ]; then
11 . /usr/share/debconf/confmodule
14 # remove old-named config files
15 dpkg-maintscript-helper rm_conffile \
16 /etc/kernel/postinst.d/zz-lilo 1:22.8-10 lilo -- "$@"
18 dpkg-maintscript-helper rm_conffile \
19 /etc/kernel/postrm.d/zz-lilo 1:22.8-10 lilo -- "$@"
21 dpkg-maintscript-helper rm_conffile \
22 /etc/kernel/postinst.d/zz-lilo 1:22.8-10 lilo -- "$@"
24 dpkg-maintscript-helper rm_conffile \
25 /etc/initramfs/post-update.d/lilo 1:22.8-10 lilo -- "$@"
28 # targets: configure|abort-upgrade|abort-remove|abort-deconfigure
31 configure|reconfigure)
33 # if a new install then we create the link and exit
34 if grep -q "^# UNCONFIGURED FSTAB FOR BASE SYSTEM" /etc/fstab ; then
38 # Check whether /boot is on another partition and mount it. See Bug#216250
39 if grep "[[:space:]]/boot[[:space:]]" /etc/fstab | grep -vq "^#"; then
40 if ! grep -q "[[:space:]]/boot[[:space:]]" /etc/mtab ; then
41 mount /boot 2>&1 > /dev/null
45 echo "WARNING: /boot is in another partition but could not be mounted."
46 echo "LILO may fail in the next steps!"
51 # copy all background images to the right place
52 if [ -L /boot/debian.bmp ]; then
53 rm -f /boot/debian.bmp; fi
55 install -m 0644 /usr/share/lilo/*.bmp /boot
56 # stay compatible with old lilo 22.8
58 ln -s debian.bmp /boot/${i}.bmp
61 # Nasty part to create network block devices if needed. Bug#235805.
62 if [ `uname -r | sed -e 's/-.*//g' -ne 's/\(^[0-9]\{1\}\.[0-9]\{1,2\}\).*/\1/p'` = "2.6" ] && \
63 [ `uname -r | sed -e 's/-.*//g' -ne 's/.*\.\([0-9]\{1,3\}\).*/\1/p'` -ge "3" ]; then
65 garbage=$(cat /proc/partitions | sed -ne 's/^[ \t]*//pg' | sed -ne '/^43/p')
67 if [ x"$garbage" != "x" ]; then
68 # Create the missing devices
69 echo -n "Creating network block devices... "
70 (cd /dev; ./MAKEDEV nb) > /dev/null
75 db_get lilo/add_large_memory || true;
76 if [ x"$RET" = x"true" -a -e /etc/lilo.conf ]; then
77 if ! grep -q "^[[:space:]]*large-memory" /etc/lilo.conf; then
78 sed -i -e '1i\# Automatically added by lilo postinst script\nlarge-memory\n' /etc/lilo.conf
79 echo "WARNING: Added option 'large-memory', please run 'lilo' before you reboot."
83 db_get lilo/diskid_uuid || true;
84 if [ x"$RET" = x"true" -a -e /etc/lilo.conf ]; then
85 if [ `grep -c -E "dev/disk/by-|UUID=" /etc/lilo.conf` -lt 2 ]; then
86 if test -x /usr/sbin/lilo-uuid-diskid; then
88 echo "WARNING: If boot / root options were converted, please run 'lilo' before you reboot."
93 db_get lilo/runme || true;
94 if [ x"$RET" = x"true" ]; then
95 echo "Running lilo..."
100 abort-upgrade|abort-remove|abort-deconfigure)
104 echo "postinst called with unknown argument \`$1'" >&2
109 # dh_installdeb will replace this with shell code automatically
110 # generated by other debhelper scripts.