Tidied up bitness check
This commit is contained in:
parent
055d416321
commit
d179a9e3b1
@ -235,10 +235,18 @@ def install_grub(efi_directory, fw_type):
|
|||||||
# if the kernel is older than 4.0, the UEFI bitness likely isn't
|
# if the kernel is older than 4.0, the UEFI bitness likely isn't
|
||||||
# exposed to the userspace so we assume a 64 bit UEFI here
|
# exposed to the userspace so we assume a 64 bit UEFI here
|
||||||
efi_bitness = "64"
|
efi_bitness = "64"
|
||||||
bitness_translate = {"32": "--target=i386-efi",
|
|
||||||
"64": "--target=x86_64-efi"}
|
if efi_bitness == "32":
|
||||||
|
efi_target = "i386-efi"
|
||||||
|
efi_grub_file = "grubia32.efi"
|
||||||
|
efi_boot_file = "bootia32.efi"
|
||||||
|
elif efi_bitness == "64":
|
||||||
|
efi_target = "x86_64-efi"
|
||||||
|
efi_grub_file = "grubx64.efi"
|
||||||
|
efi_boot_file = "bootx64.efi"
|
||||||
|
|
||||||
check_target_env_call([libcalamares.job.configuration["grubInstall"],
|
check_target_env_call([libcalamares.job.configuration["grubInstall"],
|
||||||
bitness_translate[efi_bitness],
|
"--target=" + efi_target,
|
||||||
"--efi-directory=" + efi_directory,
|
"--efi-directory=" + efi_directory,
|
||||||
"--bootloader-id=" + efi_bootloader_id,
|
"--bootloader-id=" + efi_bootloader_id,
|
||||||
"--force"])
|
"--force"])
|
||||||
@ -260,19 +268,13 @@ def install_grub(efi_directory, fw_type):
|
|||||||
os.makedirs(install_efi_boot_directory)
|
os.makedirs(install_efi_boot_directory)
|
||||||
|
|
||||||
# Workaround for some UEFI firmwares
|
# Workaround for some UEFI firmwares
|
||||||
efi_file_source = {"32": os.path.join(install_efi_directory_firmware,
|
efi_file_source = os.path.join(install_efi_directory_firmware,
|
||||||
efi_bootloader_id,
|
efi_bootloader_id,
|
||||||
"grubia32.efi"),
|
efi_grub_file),
|
||||||
"64": os.path.join(install_efi_directory_firmware,
|
efi_file_target = os.path.join(install_efi_boot_directory,
|
||||||
efi_bootloader_id,
|
efi_boot_file),
|
||||||
"grubx64.efi")}
|
|
||||||
|
|
||||||
efi_file_target = {"32": os.path.join(install_efi_boot_directory,
|
shutil.copy2(efi_file_source, efi_file_target)
|
||||||
"bootia32.efi"),
|
|
||||||
"64": os.path.join(install_efi_boot_directory,
|
|
||||||
"bootx64.efi")}
|
|
||||||
|
|
||||||
shutil.copy2(efi_file_source[efi_bitness], efi_file_target[efi_bitness])
|
|
||||||
else:
|
else:
|
||||||
print("Bootloader: grub (bios)")
|
print("Bootloader: grub (bios)")
|
||||||
if libcalamares.globalstorage.value("bootLoader") is None:
|
if libcalamares.globalstorage.value("bootLoader") is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user