]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
kernel-install: fix uki-copy deinstall
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 18 Mar 2024 16:04:22 +0000 (17:04 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 20 Mar 2024 02:35:13 +0000 (11:35 +0900)
For "kernel-install remove ..." only the kernel version is passed, not
the kernel image.  So auto-detecting KERNEL_INSTALL_IMAGE_TYPE and
setting KERNEL_INSTALL_LAYOUT does not work for uninstall.

The 90-uki-copy.install plugin must consider this and *not* exit early
for the "remove" command, otherwise $BOOT_ROOT will be filled with stale
kernel images.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
src/kernel-install/90-uki-copy.install

index c66c09719cac10857afb9632afa0d24c6fa4b34d..d443c4b40113acfd5756c061c38f8d1db6160e40 100755 (executable)
@@ -26,8 +26,6 @@ KERNEL_VERSION="${2:?}"
 ENTRY_DIR_ABS="$3"
 KERNEL_IMAGE="$4"
 
-[ "$KERNEL_INSTALL_LAYOUT" = "uki" ] || exit 0
-
 ENTRY_TOKEN="$KERNEL_INSTALL_ENTRY_TOKEN"
 BOOT_ROOT="$KERNEL_INSTALL_BOOT_ROOT"
 
@@ -48,6 +46,8 @@ case "$COMMAND" in
         ;;
 esac
 
+[ "$KERNEL_INSTALL_LAYOUT" = "uki" ] || exit 0
+
 if ! [ -d "$UKI_DIR" ]; then
     [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "creating $UKI_DIR"
     mkdir -p "$UKI_DIR"