@ -26,10 +26,14 @@ from libcalamares.utils import check_chroot_call
def install_grub ( boot_loader , fw_type ) :
if fw_type == ' efi ' :
efi_directory = " /boot/efi "
branding = libcalamares . globalstorage . value ( " branding " )
distribution = branding [ " bootloaderEntryName " ]
file_name_sanitizer = str . maketrans ( " / " , " _- " )
check_chroot_call ( [ libcalamares . job . configuration [ " grubInstall " ] , " --target=x86_64-efi " , " --efi-directory= {!s} " . format ( efi_directory ) , " --bootloader-id= {!s} " . format ( distribution . translate ( file_name_sanitizer ) ) ] )
if " efiBootloaderId " in libcalamares . job . configuration :
efi_bootloader_id = libcalamares . job . configuration [ " efiBootloaderId " ]
else :
branding = libcalamares . globalstorage . value ( " branding " )
distribution = branding [ " bootloaderEntryName " ]
file_name_sanitizer = str . maketrans ( " / " , " _- " )
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 ) ] )
else :
install_path = boot_loader [ " installPath " ]
check_chroot_call ( [ libcalamares . job . configuration [ " grubInstall " ] , install_path ] )