From 6b738a8023e8089993a93cc22d7abbcf02ea51a3 Mon Sep 17 00:00:00 2001 From: Steev Klimaszewski Date: Fri, 17 Jul 2026 17:20:28 -0500 Subject: [PATCH] Support aarch64 for GRUB and Limine EFI installation On aarch64 both the GRUB and Limine installers assume x86 and fail. GRUB names its EFI target 'arm64', but platform.machine() returns 'aarch64', so passing --target=aarch64-efi is rejected. Map aarch64 to the arm64 target name expected by grub-install. Limine ships architecture-specific default EFI binaries: BOOTAA64.EFI on aarch64 versus BOOTIA32.EFI and BOOTX64.EFI on x86. Select the correct binaries in the three places that reference them: when copying them into the ESP, when building the pacman hook that refreshes them on update, and when choosing the 64-bit EFI boot menu loader path. --- archinstall/lib/installer.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 985e16cde8..757ff1ae6b 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -1359,7 +1359,7 @@ def _add_grub_bootloader( boot_dir = boot_partition.mountpoint add_options = [ - f'--target={platform.machine()}-efi', + f'--target={"arm64" if platform.machine() == "aarch64" else platform.machine()}-efi', f'--efi-directory={efi_partition.mountpoint}', *boot_dir_arg, '--bootloader-id=GRUB', @@ -1480,6 +1480,11 @@ def _add_limine_bootloader( parent_dev_path = get_parent_device_path(efi_partition.safe_dev_path) + if platform.machine() == 'aarch64': + efi_binaries = ('BOOTAA64.EFI',) + else: + efi_binaries = ('BOOTIA32.EFI', 'BOOTX64.EFI') + try: efi_dir_path = self.target / efi_partition.mountpoint.relative_to('/') / 'EFI' efi_dir_path_target = efi_partition.mountpoint / 'EFI' @@ -1494,14 +1499,12 @@ def _add_limine_bootloader( efi_dir_path.mkdir(parents=True, exist_ok=True) - for file in ('BOOTIA32.EFI', 'BOOTX64.EFI'): + for file in efi_binaries: (limine_path / file).copy_into(efi_dir_path) except Exception as err: raise DiskError(f'Failed to install Limine in {self.target}{efi_partition.mountpoint}: {err}') - hook_command = ( - f'/usr/bin/cp /usr/share/limine/BOOTIA32.EFI {efi_dir_path_target}/ && /usr/bin/cp /usr/share/limine/BOOTX64.EFI {efi_dir_path_target}/' - ) + hook_command = ' && '.join(f'/usr/bin/cp /usr/share/limine/{file} {efi_dir_path_target}/' for file in efi_binaries) if not bootloader_removable: # Create EFI boot menu entry for Limine. @@ -1512,7 +1515,7 @@ def _add_limine_bootloader( raise OSError(f'Could not open or read /sys/firmware/efi/fw_platform_size to determine EFI bitness: {err}') if efi_bitness == '64': - loader_path = '\\EFI\\arch-limine\\BOOTX64.EFI' + loader_path = f'\\EFI\\arch-limine\\{"BOOTAA64.EFI" if platform.machine() == "aarch64" else "BOOTX64.EFI"}' elif efi_bitness == '32': loader_path = '\\EFI\\arch-limine\\BOOTIA32.EFI' else: