]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBUNTU: [Debian] linux-image-extra is additive to linux-image
authorAndy Whitcroft <apw@canonical.com>
Thu, 2 Oct 2014 10:00:45 +0000 (11:00 +0100)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
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 <apw@canonical.com>
debian/control-scripts/extra-post [new file with mode: 0644]
debian/rules.d/2-binary-arch.mk

diff --git a/debian/control-scripts/extra-post b/debian/control-scripts/extra-post
new file mode 100644 (file)
index 0000000..a0c78af
--- /dev/null
@@ -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
index 5ff6a401ad573e960578d162a3967a327806338b..fc61565d8bf673dfca089ecd51fb645fd979d0a5 100644 (file)
@@ -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