]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
kernel-install: when searching for location to place kernel consider /efi
authorLennart Poettering <lennart@poettering.net>
Tue, 19 Jul 2016 19:08:57 +0000 (21:08 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 21 Jul 2016 09:37:59 +0000 (11:37 +0200)
With this change kernel-install will now first look for an existing kernel
installation in /efi, /boot and /boot/efi. If none is found, /efi is used if it
is a mount point, otherwise /boot/efi if it is one. If nothing of that worked
/boot is used without further checking.

This means /boot should be the default unless something was installed before or
something else was explicitly mounted.

src/kernel-install/kernel-install

index 1159dc384d8eae5fd238132188011927de3e1c37..c66bcfc092d31b11ef8895fdcb77564db96ccd5d 100644 (file)
@@ -86,10 +86,15 @@ if [[ ! $COMMAND ]] || [[ ! $KERNEL_VERSION ]]; then
     exit 1
 fi
 
-if [[ -d /boot/loader/entries ]] || [[ -d /boot/$MACHINE_ID ]]; then
+if [[ -d /efi/loader/entries ]] || [[ -d /efi/$MACHINE_ID ]]; then
+    BOOT_DIR_ABS="/efi/$MACHINE_ID/$KERNEL_VERSION"
+elif [[ -d /boot/loader/entries ]] || [[ -d /boot/$MACHINE_ID ]]; then
     BOOT_DIR_ABS="/boot/$MACHINE_ID/$KERNEL_VERSION"
-elif [[ -d /boot/efi/loader/entries ]] || [[ -d /boot/efi/$MACHINE_ID ]] \
-         || mountpoint -q /boot/efi; then
+elif [[ -d /boot/efi/loader/entries ]] || [[ -d /boot/efi/$MACHINE_ID ]]; then
+    BOOT_DIR_ABS="/boot/efi/$MACHINE_ID/$KERNEL_VERSION"
+elif mountpoint -q /efi; then
+    BOOT_DIR_ABS="/efi/$MACHINE_ID/$KERNEL_VERSION"
+elif mountpoint -q /boot/efi; then
     BOOT_DIR_ABS="/boot/efi/$MACHINE_ID/$KERNEL_VERSION"
 else
     BOOT_DIR_ABS="/boot/$MACHINE_ID/$KERNEL_VERSION"