]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut.sh: fix EFI directory if ESP is mounted to /efi
authorJonas Witschel <diabonas@gmx.de>
Wed, 22 May 2019 13:09:28 +0000 (15:09 +0200)
committerHarald Hoyer <harald@hoyer.xyz>
Fri, 19 Jul 2019 14:23:24 +0000 (16:23 +0200)
The EFI executables produced by dracut --uefi must be placed in the
subdirectory /EFI/Linux of the EFI system partition (ESP) according to
the Boot Loader Specification, see
https://systemd.io/BOOT_LOADER_SPECIFICATION#logic

This is done correctly for the mount points /boot and /boot/efi, but for
the mount point /efi, the files are placed in /efi/Linux instead of the
correct /efi/EFI/Linux. This commit fixes the directory so that the EFI
executables are picked up correctly by conforming boot loaders.

Apart from complying to the specification, the change is also in line
with the commit message of 5c57209ba5ef36f8856b4ea1694de8e1da508b71
("dracut.sh: add default path for --uefi") which introduced this feature
as well as the documentation in dracut.8.asc.

dracut.sh

index b85d06001b531ba8e4ed09251d9c2d6720ba5cc6..183b892fb93138b8e9f7a46a5576bb239f46c81f 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -787,7 +787,7 @@ if ! [[ $outfile ]]; then
                        [[ $line =~ BUILD_ID\=* ]] && eval "$line" && echo "$BUILD_ID" && break; \
                    done)
         if [[ -d /efi ]] && mountpoint -q /efi; then
-            efidir=/efi
+            efidir=/efi/EFI
         else
             efidir=/boot/EFI
             if [[ -d /boot/efi/EFI ]] && mountpoint -q /boot/efi; then