From 49e489f4c3e75e13f92bd14075cc5b8dd10f9cee Mon Sep 17 00:00:00 2001 From: Joachim Wiedorn Date: Fri, 19 Nov 2010 16:30:05 +0100 Subject: [PATCH] Update lilo.postinst, lilo.postrm, lilo.preinst; remove old hook scripts. Update scripts lilo.postinst, lilo.postrm, lilo.preinst. Add link creation for menu background sarge.bmp and sid.bmp for compatibility in file debian/lilo.postinst. Remove hook scripts for kernel and initramfs and use upstream scripts. --- debian/changelog | 5 ++ debian/lilo.initramfs-post-update | 15 ----- debian/lilo.kernel-postinst | 6 -- debian/lilo.kernel-postrm | 5 -- debian/lilo.postinst | 93 ++++++++++++++++--------------- debian/lilo.postrm | 48 +++++++++++----- debian/lilo.preinst | 45 +++++++++------ 7 files changed, 118 insertions(+), 99 deletions(-) delete mode 100644 debian/lilo.initramfs-post-update delete mode 100644 debian/lilo.kernel-postinst delete mode 100644 debian/lilo.kernel-postrm diff --git a/debian/changelog b/debian/changelog index ff0ebb0..78ed92d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -31,6 +31,11 @@ lilo (1:23.1-1) unstable; urgency=low * Add new script update-lilo and its manual page. * Add new script lilo-uuid-diskid for ID conversion and its manual page. + * Update scripts lilo.postinst, lilo.postrm, lilo.preinst. + * Add link creation for menu background sarge.bmp and sid.bmp + for compatibility in file debian/lilo.postinst. + * Remove hook scripts for kernel and initramfs and use upstream scripts. + -- Joachim Wiedorn Thu, 18 Nov 2010 20:32:02 +0100 lilo (1:22.8-8.3) unstable; urgency=high diff --git a/debian/lilo.initramfs-post-update b/debian/lilo.initramfs-post-update deleted file mode 100644 index 7843b3c..0000000 --- a/debian/lilo.initramfs-post-update +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -case "$DPKG_MAINTSCRIPT_PACKAGE" in - linux-image-*) - # lilo will be updated later by the kernel postinst hook; no - # need to update it now. - exit 0 - ;; - *) - if [ -e /etc/lilo.conf ]; then - lilo &2 - else - echo >&2 "Warning: Not updating LILO; /etc/lilo.conf not found" - fi - ;; -esac diff --git a/debian/lilo.kernel-postinst b/debian/lilo.kernel-postinst deleted file mode 100644 index 88053d4..0000000 --- a/debian/lilo.kernel-postinst +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -if [ -e /etc/lilo.conf ]; then - lilo &2 -else - echo >&2 "Warning: Not updating LILO; /etc/lilo.conf not found" -fi diff --git a/debian/lilo.kernel-postrm b/debian/lilo.kernel-postrm deleted file mode 100644 index f54df3b..0000000 --- a/debian/lilo.kernel-postrm +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -if [ -e /etc/lilo.conf ]; then - # Do not abort kernel removal in case of error - lilo &2 || true -fi diff --git a/debian/lilo.postinst b/debian/lilo.postinst index df04115..11a899f 100644 --- a/debian/lilo.postinst +++ b/debian/lilo.postinst @@ -1,12 +1,18 @@ -#!/bin/sh +#!/bin/sh +# postinst script lilo +# +# see: dh_installdeb(1) set -e +LNKS="sarge sid" + if [ -f /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule fi -#DEBHELPER# +# targets: configure|abort-upgrade|abort-remove|abort-deconfigure + case "$1" in configure|reconfigure) @@ -16,87 +22,86 @@ case "$1" in fi # 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 "[[:space:]]/boot[[:space:]]" /etc/fstab | grep -vq "^#"; then if ! grep -q "[[:space:]]/boot[[:space:]]" /etc/mtab ; then mount /boot 2>&1 > /dev/null if [ $? -ne 0 ]; then echo echo "WARNING: /boot is in another partition but could not be mounted." - echo "LILO may fail in the next steps." + echo "LILO may fail in the next steps!" fi fi fi - cp /usr/share/lilo/*.bmp /boot - + # copy all background images to the right place if [ -L /boot/debian.bmp ]; then - if [ x`readlink /boot/debian.bmp | cut -d/ -f 2` != x"boot" ]; then - ln -sf /boot/sid.bmp /boot/debian.bmp - fi - fi + rm -f /boot/debian.bmp; fi - if [ ! -e /boot/debian.bmp ]; then - ln -sf /boot/sarge.bmp /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" ] && \ [ `uname -r | sed -e 's/-.*//g' -ne 's/.*\.\([0-9]\{1,3\}\).*/\1/p'` -ge "3" ]; then - garbage=$(cat /proc/partitions | sed -ne 's/^[ \t]*//pg' | sed -ne '/^43/p') + garbage=$(cat /proc/partitions | sed -ne 's/^[ \t]*//pg' | sed -ne '/^43/p') - if [ x"$garbage" != "x" ]; then - + if [ x"$garbage" != "x" ]; then # Create the missing devices echo -n "Creating network block devices... " (cd /dev; ./MAKEDEV nb) > /dev/null echo "done." - fi + fi fi db_get lilo/add_large_memory || true; if [ x"$RET" = x"true" -a -e /etc/lilo.conf ]; then if ! grep -q "^[[:space:]]*large-memory" /etc/lilo.conf; then sed -i -e '1i\# Automatically added by lilo postinst script\nlarge-memory\n' /etc/lilo.conf - echo "WARNING: Added large-memory option, please run lilo before you reboot" + echo "WARNING: Added option 'large-memory', please run 'lilo' before you reboot." fi - elif [ -e /vmlinuz -a -e /initrd.img -a -e /etc/lilo.conf ]; then - kernel_size=$(stat -L -c %s /vmlinuz) - initrd_size=$(stat -L -c %s /initrd.img) - size=$(($kernel_size+$initrd_size)) - large_mem=$(grep -c "^[[:space:]]*large-memory" /etc/lilo.conf) || true - if [ $large_mem -eq 0 -a $size -ge 8388608 ]; then - echo - echo "WARNING: You have a large kernel+initrd and large-memory is not set in lilo.conf." - echo "WARNING: Do NOT reboot or LILO may fail to boot." - echo "WARNING: Please read /usr/share/doc/lilo/README.Debian" - echo + fi + + db_get lilo/diskid_uuid || true; + if [ x"$RET" = x"true" -a -e /etc/lilo.conf ]; then + if [ `grep -c -E "dev/disk/by-|UUID=" /etc/lilo.conf` -lt 2 ]; then + if test -x /usr/sbin/lilo-uuid-diskid; then + lilo-uuid-diskid + echo "WARNING: If boot / root options were converted, please run 'lilo' before you reboot." + fi fi - else - echo - echo "WARNING: kernel & initrd not found in the root directory (/vmlinuz & /initrd.img)" - echo "WARNING: Do NOT reboot or LILO may fail to boot if your kernel+initrd is large." - echo "WARNING: Please read /usr/share/doc/lilo/README.Debian" - echo fi db_get lilo/runme || true; if [ x"$RET" = x"true" ]; then echo "Running lilo..." - /sbin/lilo -H + lilo -H fi ;; - abort-upgrade|abort-remove|abort-deconfigure) - - ;; + abort-upgrade|abort-remove|abort-deconfigure) + ;; - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; esac +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + exit 0 diff --git a/debian/lilo.postrm b/debian/lilo.postrm index 255bcbe..48396ba 100644 --- a/debian/lilo.postrm +++ b/debian/lilo.postrm @@ -1,18 +1,40 @@ -#!/bin/sh -e +#!/bin/sh +# postrm script lilo +# +# see: dh_installdeb(1) -#DEBHELPER# +set -e + +CONF="/etc/lilo.conf" +MMAP="/boot/map" +BMPS="coffee debian debian-de inside onlyblue tuxlogo debianlilo" +LNKS="sarge sid" -for i in sid.bmp sarge.bmp debianlilo.bmp coffee.bmp; do - rm -f /boot/$i; -done +# targets: purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear -if [ "$1" = "purge" ]; then - rm -f /etc/lilo.conf /boot/map /boot/boot.b /boot/boot.0[0-9][0-9][0-9] - - if [ -d /usr/share/lilo ]; then - rm -rf /usr/share/lilo - fi +case "$1" in + purge) + test -f ${CONF} && mv ${CONF} ${CONF}_backup + test -f ${MMAP} && rm -f ${MMAP} + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + for i in ${BMPS}; do + rm -f /boot/${i}.bmp /boot/${i}.dat; + done + # stay compatible with old lilo 22.8 + for i in ${LNKS}; do + test -L /boot/${i}.bmp && rm -f /boot/${i}.bmp; + done + ;; + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac - rm -f /usr/share/lilo/*.conf +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# -fi +exit 0 diff --git a/debian/lilo.preinst b/debian/lilo.preinst index 2620238..556cbce 100644 --- a/debian/lilo.preinst +++ b/debian/lilo.preinst @@ -1,19 +1,32 @@ -#!/bin/sh -e +#!/bin/sh +# preinst script lilo +# +# see: dh_installdeb(1) -#DEBHELPER# +set -e + +BMPS="sarge sid" + +# targets: install|upgrade|abort-upgrade -if [ -d /usr/share/lilo/contrib ]; then - echo - echo "WARNING:" - echo "The use of /usr/share/lilo/contrib as the directory of the" - echo "bitmaps is deprecated and may be removed later." - echo "You may want to put your bitmaps on /usr/share/lilo instead." - echo "I will remove the packaged bitmaps but you must move yours" - echo "to other place." - echo - rm -f /usr/share/lilo/contrib/sid.bmp - rm -f /usr/share/lilo/contrib/sarge.bmp - rm -f /usr/share/lilo/contrib/debianlilo.bmp - rm -f /usr/share/lilo/contrib/coffee.bmp -fi +case "$1" in + install|upgrade|abort-upgrade) + if test -L /boot/debian.bmp; then + rm -f /boot/debian.bmp; + fi + for i in ${BMPS}; do + rm -f /boot/${i}.bmp /boot/${i}.dat /boot/${i}*bmp.conf; + done + ;; + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# +exit 0 -- 2.39.2