]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - debian/templates/extra.postrm.in
UBUNTU: [Packaging] switch to triggers for postinst.d postrm.d handling
authorAndy Whitcroft <apw@canonical.com>
Tue, 24 Oct 2017 12:41:57 +0000 (13:41 +0100)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thu, 19 Apr 2018 21:04:05 +0000 (18:04 -0300)
commit0b151c7602d4b9ffe36aa75f89d5b280ba3718b4
tree82e75e6274feb3c382223449c9ad884ae9fd109d
parentfbf2867282ee880215dd01a18727333d51fb5034
UBUNTU: [Packaging] switch to triggers for postinst.d postrm.d handling

When we install linux-image we have to run kernel postinst.d support in
case this kernel has no linux-image-extra.  Should it have an extra and
we install we then have to assume that is being installed cold
and that the same processing is neeed.  If we are installing both at the
same time, we necessarily trigger kernel postinst.d twice.  As this
includes rebuilding the initramfs and reconfiguring the boot loader this
is very inefficient.

For removal of linux-image-extra when we remove the package we also
need to run postinst.d handling in order to pare down the initramfs to
linux-image contents only.  However when we are removing both packages
we immediatly remove the rebuilt initramfs.  Doubly annoying.

This patch switches us to using a trigger against the linux-image package
for all postinst.d and postrm.d handling.  On installation postinst.d
gets triggered twice once by linux-image and once by linux-image-extra.
As triggers are non-cumulative we will only run this processing
once.  When removing both packages we will trigger postinst.d from
linux-image-extra and then in linux-image postrm.d we effectivly ignore
the pending trigger and simply run the postrm.d.  This prevents us from
rebuilding the initramfs.

BugLink: http://bugs.launchpad.net/bugs/1764794
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
debian/rules.d/2-binary-arch.mk
debian/templates/extra.postinst.in
debian/templates/extra.postrm.in
debian/templates/image.postinst.in
debian/templates/image.postrm.in