[grub] add efi_directory_firmware

main
Philip Müller 10 years ago
parent 1e1aa8151c
commit 7ed0558471

@ -4,8 +4,9 @@
grubInstall: "grub-install"
grubMkconfig: "grub-mkconfig"
grubCfg: "/boot/grub/grub.cfg"
# While some distributions require a /boot/efi or /boot/EFI directory, Arch does not.
# Some distributions require a /boot/efi or /boot/EFI directory. Configure as needed.
efiDirectory: "/boot"
efiDirectoryFirmware: "/boot/EFI"
# Optionally set the --bootloader-id to use for EFI. If not set, this defaults
# to the bootloaderEntryName from branding.desc with problematic characters
# replaced. If an efiBootloaderId is specified here, it is taken to already be a

@ -27,6 +27,7 @@ from libcalamares.utils import check_chroot_call
def install_grub(boot_loader, fw_type):
if fw_type == 'efi':
efi_directory = libcalamares.job.configuration["efiDirectory"]
efi_directory_firmware = libcalamares.job.configuration["efiDirectoryFirmware"]
chroot_call(["mkdir", "-p", "{!s}".format(efi_directory)])
if "efiBootloaderId" in libcalamares.job.configuration:
efi_bootloader_id = libcalamares.job.configuration["efiBootloaderId"]
@ -37,8 +38,8 @@ def install_grub(boot_loader, fw_type):
efi_bootloader_id = distribution.translate(file_name_sanitizer)
check_chroot_call([libcalamares.job.configuration["grubInstall"], "--target=x86_64-efi", "--efi-directory={!s}".format(efi_directory), "--bootloader-id={!s}".format(efi_bootloader_id)])
# Workaround for some UEFI firmwares
chroot_call(["mkdir", "-p", "{!s}/EFI/boot".format(efi_directory)])
chroot_call(["cp", "{!s}/EFI/{!s}/grubx64.efi".format(efi_directory,efi_bootloader_id), "{!s}/EFI/boot/bootx64.efi".format(efi_directory)])
chroot_call(["mkdir", "-p", "{!s}/boot".format(efi_directory_firmware)])
chroot_call(["cp", "{!s}/{!s}/grubx64.efi".format(efi_directory_firmware,efi_bootloader_id), "{!s}/boot/bootx64.efi".format(efi_directory_firmware)])
else:
install_path = boot_loader["installPath"]
check_chroot_call([libcalamares.job.configuration["grubInstall"], "--target=i386-pc", install_path])

Loading…
Cancel
Save