Package: lilo
Version: 1:22.8-8.3
Severity: wishlist

The lilo hook scripts, /etc/kernel/postinst.d/zz-lilo and
/etc/kernel/postrm.d/zz-lilo, invoke lilo multiple times.  It would be good
to incorporate logic similar to that included in the initramfs-tools hook
scripts so that lilo only gets invoked once.  For example,
/etc/kernel/postinst.d/zz-lilo is called both for pre-configuration (of a
kernel image package) and for configuration (of a kernel image package),
causing lilo to be invoked twice.  Consider instead the following logic:

-----

   #!/bin/sh
   set -e

   # Avoid executing multiple times.
   if [ -n "$DEB_MAINT_PARAMS" ];then
       eval set -- "$DEB_MAINT_PARAMS"
       if [ -z "$1" ] || [ "$1" != "configure" ];then
           exit 0
       fi
   fi

  
   if [ -f /etc/lilo.conf ];then
      lilo >&2
   else
      echo "WARNING, not invoking lilo: /etc/lilo.conf not found" >&2
   fi

-----

This script exits without invoking lilo when invoked during pre-configuration,
but does invoke lilo during configuration.  Similarly,
/etc/kernel/postrm.d/zz-lilo gets invoked twice: once for a remove (of a
kernel image package) and once for a purge (of a kernel image package).
Consider instead the following logic:

-----

   #!/bin/sh

   # Avoid executing multiple times.
   if [ -n "$DEB_MAINT_PARAMS" ];then
       eval set -- "$DEB_MAINT_PARAMS"
       if [ -z "$1" ] || [ "$1" != "remove" ];then
           exit 0
       fi
   fi

   if [ -f /etc/lilo.conf ];then
      lilo >&2
   else
      echo "WARNING, not invoking lilo: /etc/lilo.conf not found" >&2
   fi
   exit 0

-----

This logic causes the script to exit without invoking lilo
when called for purge processing, but allows lilo to be invoked
during remove processing.

-- 
  .''`.     Stephen Powell    
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to