]> git.proxmox.com Git - pve-kernel-meta.git/blobdiff - efiboot/zz-pve-efiboot
efiboot: call on kernel removal as well
[pve-kernel-meta.git] / efiboot / zz-pve-efiboot
index 06a1926b8cfa3ce8286771211ed5d6ae3b7f04c2..954dbecbb881c02cdc1894d8e7f5195bd8569113 100755 (executable)
@@ -31,8 +31,6 @@ trap cleanup EXIT INT TERM QUIT
 
 . /usr/share/pve-kernel-helper/scripts/functions
 
-BOOT_KVERS="$(boot_kernel_list "$@")"
-
 potential_esps(){
        lsblk --list -o PATH,UUID,FSTYPE,PARTTYPE,MOUNTPOINT |
        awk '$3 == "vfat" && $4 == "c12a7328-f81f-11d2-ba4b-00a0c93ec93b" && $5 == "" {print $1,$2}'
@@ -152,8 +150,14 @@ case $0:$mode in
        # time by calling update-grub multiple times on upgrade and removal.
        # Also run if we have no DEB_MAINT_PARAMS, in order to work with old
        # kernel packages.
-       */postinst.d/*:|*/postinst.d/*:configure|*/postrm.d/*:|*/postrm.d/*:remove)
-       update_esps
+       */postinst.d/*:|*/postinst.d/*:configure)
+               BOOT_KVERS="$(boot_kernel_list "$@")"
+               update_esps
+       ;;
+        */postrm.d/*:|*/postrm.d/*:remove)
+               # no newly installed kernel
+               BOOT_KVERS="$(boot_kernel_list)"
+               update_esps
        ;;
 esac