Add externs to avoid multiple definitions, and then add missing definitions.
[rrq/maintain_lilo.git] / debian / lilo.postinst
index 11a899f8945986e6549a7d82916a8964622406bc..43116fbb3597b0556e1098d26c4394de917a74ef 100644 (file)
@@ -5,12 +5,24 @@
 
 set -e
 
-LNKS="sarge sid"
-
 if [ -f /usr/share/debconf/confmodule ]; then
   . /usr/share/debconf/confmodule
 fi
 
+# remove old-named config files
+dpkg-maintscript-helper rm_conffile \
+  /etc/kernel/postinst.d/zz-lilo  1:22.8-10 lilo -- "$@"
+
+dpkg-maintscript-helper rm_conffile \
+  /etc/kernel/postrm.d/zz-lilo    1:22.8-10 lilo -- "$@"
+
+dpkg-maintscript-helper rm_conffile \
+  /etc/kernel/postinst.d/zz-lilo  1:22.8-10 lilo -- "$@"
+
+dpkg-maintscript-helper rm_conffile \
+  /etc/initramfs/post-update.d/lilo  1:22.8-10 lilo -- "$@"
+
+
 # targets: configure|abort-upgrade|abort-remove|abort-deconfigure
 
 case "$1" in
@@ -24,7 +36,7 @@ case "$1" in
        # Check whether /boot is on another partition and mount it. See Bug#216250
        if grep "[[:space:]]/boot[[:space:]]" /etc/fstab | grep -vq "^#"; then
           if ! grep -q "[[:space:]]/boot[[:space:]]" /etc/mtab ; then
-               mount /boot 2>&1 > /dev/null
+               mount /boot  > /dev/null 2>&1
 
                if [ $? -ne 0 ]; then
                        echo
@@ -39,17 +51,6 @@ case "$1" in
                rm -f /boot/debian.bmp; fi
 
        install -m 0644  /usr/share/lilo/*.bmp  /boot
-       # stay compatible with old lilo 22.8
-       for i in ${LNKS}; do
-               ln -s debian.bmp /boot/${i}.bmp
-       done
-
-       if test -f /etc/kernel/postinst.d/zz-lilo; then
-               rm -f /etc/kernel/postinst.d/zz-lilo; fi
-       if test -f /etc/kernel/postrm.d/zz-lilo; then
-               rm -f /etc/kernel/postrm.d/zz-lilo; fi
-       if test -f /etc/initramfs/post-update.d/lilo; then
-               rm -f /etc/initramfs/post-update.d/lilo; fi
 
        # Nasty part to create network block devices if needed. Bug#235805.
        if [ `uname -r | sed -e 's/-.*//g' -ne 's/\(^[0-9]\{1\}\.[0-9]\{1,2\}\).*/\1/p'` = "2.6" ] && \