From: Andy Whitcroft Date: Thu, 2 Oct 2014 10:00:45 +0000 (+0100) Subject: UBUNTU: [Debian] linux-image-extra is additive to linux-image X-Git-Tag: Ubuntu-4.10.0-9.11~586 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=ed79bb032968510039a7b57a94329e72162f89c1;p=mirror_ubuntu-zesty-kernel.git UBUNTU: [Debian] linux-image-extra is additive to linux-image linux-image-extra is special, it is only additive to linux-image, this means really cannot use the standard kernel postinst/postrm for this package. As it also depends on linux-image we know that linux-image will have been installed before it, and will be removed after it. On change (installation/update/removal) of linux-image-extra we want to run the kernel postinst to rebuilt the initramfs and update the bootloader as necessary. To this end switch to package specific postinst/postrm which trigger the /etc/kernel/postinst.d hooks. We need to do it this way to get the specially parameterised incantations of update-initramfs, to ensure we trigger the correct build rather than mearly dpkg triggering a rebuild of the running kernel. BugLink: http://bugs.launchpad.net/bugs/1375310 Signed-off-by: Andy Whitcroft --- diff --git a/debian/control-scripts/extra-post b/debian/control-scripts/extra-post new file mode 100644 index 000000000000..a0c78af0e17b --- /dev/null +++ b/debian/control-scripts/extra-post @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + +case "$0::$1" in +*.postinst::configure|*.postrm::remove|*.postrm::purge) + depmod -a -F /boot/System.map-=V =V || true + for dir in "/etc/kernel/postinst.d" "/etc/kernel/postinst.d/=V" + do + if [ -d "$dir" ]; then + run-parts --verbose --exit-on-error --arg="=V" --arg="/boot/=K-=V" "$dir" + fi + done + ;; +esac diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index 5ff6a401ad57..fc61565d8bf6 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -174,7 +174,7 @@ ifeq ($(do_extras_package),true) for script in postinst postrm ; do \ sed -e 's/=V/$(abi_release)-$*/g' -e 's/=K/$(instfile)/g' \ -e 's/=L/$(loader)/g' -e 's@=B@$(build_arch)@g' \ - debian/control-scripts/$$script > $(pkgdir_ex)/DEBIAN/$$script; \ + debian/control-scripts/extra-post > $(pkgdir_ex)/DEBIAN/$$script; \ chmod 755 $(pkgdir_ex)/DEBIAN/$$script; \ done; \ fi