Browse Source

dracut.sh: fix EFI directory if ESP is mounted to /efi

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 5c57209ba5
("dracut.sh: add default path for --uefi") which introduced this feature
as well as the documentation in dracut.8.asc.
master
Jonas Witschel 6 years ago committed by Harald Hoyer
parent
commit
305c6f91bb
  1. 2
      dracut.sh

2
dracut.sh

@ -787,7 +787,7 @@ if ! [[ $outfile ]]; then
[[ $line =~ BUILD_ID\=* ]] && eval "$line" && echo "$BUILD_ID" && break; \ [[ $line =~ BUILD_ID\=* ]] && eval "$line" && echo "$BUILD_ID" && break; \
done) done)
if [[ -d /efi ]] && mountpoint -q /efi; then if [[ -d /efi ]] && mountpoint -q /efi; then
efidir=/efi efidir=/efi/EFI
else else
efidir=/boot/EFI efidir=/boot/EFI
if [[ -d /boot/efi/EFI ]] && mountpoint -q /boot/efi; then if [[ -d /boot/efi/EFI ]] && mountpoint -q /boot/efi; then

Loading…
Cancel
Save