]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - debian/templates/image.postinst.in
4 version
=@abiname@@localversion@
5 image_path
=/boot
/@image-stem@
-$version
8 # When we install linux-image we have to run kernel postinst.d support to
9 # generate the initramfs, create links etc. Should it have an associated
10 # linux-image-extra package and we install that we also need to run kernel
11 # postinst.d, to regenerate the initramfs. If we are installing both at the
12 # same time, we necessarily trigger kernel postinst.d twice. As this includes
13 # rebuilding the initramfs and reconfiguring the boot loader this is very time
16 # Similarly for removal when we remove the linux-image-extra package we need to
17 # run kernel postinst.d handling in order to pare down the initramfs to
18 # linux-image contents only. When we remove the linux-image need to remove the
19 # now redundant initramfs. If we are removing both at the same time, then
20 # we will rebuilt the initramfs and then immediatly remove it.
22 # Switches to using a trigger against the linux-image package for all
23 # postinst.d and postrm.d handling. On installation postinst.d gets triggered
24 # twice once by linux-image and once by linux-image-extra. As triggers are
25 # non-cumulative we will only run this processing once. When removing both
26 # packages we will trigger postinst.d from linux-image-extra and then in
27 # linux-image postrm.d we effectivly ignore the pending trigger and simply run
28 # the postrm.d. This prevents us from rebuilding the initramfs.
30 if [ "$1" = triggered
]; then
31 trigger
=/usr
/lib
/linux
/triggers
/$version
32 if [ -f "$trigger" ]; then
39 if [ "$1" != configure
]; then
45 if [ -f /lib
/modules
/$version/.fresh-install
]; then
50 linux-update-symlinks
$change $version $image_path
51 rm -f /lib
/modules
/$version/.fresh-install
53 if [ -d /etc
/kernel
/postinst.d
]; then
54 mkdir
-p /usr
/lib
/linux
/triggers
55 cat - >/usr
/lib
/linux
/triggers
/$version <<EOF
56 DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \
57 --arg=$image_path /etc/kernel/postinst.d
59 dpkg-trigger
--no-await linux-update-
$version