[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#499270: initramfs-tools: postrm.d/update-initramfs breaks removal of old kernel


We can possibly distinguish between /etc/kernel/postinst.d getting called
from kernel-package context, and upstream debpkg context.  debpkg calls
with the following:

  test -d /etc/kernel/postinst.d && run-parts --arg="$version" /etc/kernel/postinst.d

kernel-package's uses:

  system ("run-parts --verbose --exit-on-error --arg=$version " .
          "--arg=$realimageloc$kimage-$version " .

Note that kernel-package's passes two arguments.  In theory, we could have
an /etc/kernel/postinst.d/update-initramfs (or
/etc/kernel/postinst.d/initramfs-tools, if we want to match the package
name) that does:

  # passing the kernel version is required
  [ -z "$1" ] && exit 0
  # kernel-package passes an extra arg; hack to not run under kernel-package
  [ -z "$2" ] || exit 0
  # we're good - create initramfs.  update runs do_bootloader
  update-initramfs -t -u -k "$1"


Reply to: