#!/bin/sh # postinst script lilo # # see: dh_installdeb(1) set -e 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 configure|reconfigure) # if a new install then we create the link and exit if grep -q "^# UNCONFIGURED FSTAB FOR BASE SYSTEM" /etc/fstab ; then exit 0 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 -q "[[:space:]]/boot[[:space:]]" /etc/mtab ; then mount /boot > /dev/null 2>&1 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!" fi fi fi # copy all background images to the right place if [ -L /boot/debian.bmp ]; then rm -f /boot/debian.bmp; fi install -m 0644 /usr/share/lilo/*.bmp /boot # 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') 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 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 option 'large-memory', please run 'lilo' before you reboot." fi 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 fi db_get lilo/runme || true; if [ x"$RET" = x"true" ]; then echo "Running lilo..." lilo -H fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) 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