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>