From 6fc0bc3671aba6c0c39257bf59721da7c1c5ee78 Mon Sep 17 00:00:00 2001 From: Mintsuki <36459316+mintsuki@users.noreply.github.com> Date: Sat, 29 Nov 2025 01:10:04 +0100 Subject: [PATCH] Fix GRUB fallback-from-removable logic introduced in c095eb56d8 (#3950) Commit c095eb56d878b51a80d49cdef3c82950bcfcdecd was supposed to introduce logic such that if the `grub-install` command failed with a `--removable` flag, then another attempt would be made with such flag removed. This was broken because the `--removable` flag was kept in both cases (likely a copy-paste mistake). This has been an issue since, in all future iterations of the code. What this commit does is fix this logic, but also invert the cases tested: first test without `--removable`, then add it should that case fail, as this is the most sensible thing to do. --- archinstall/lib/installer.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 92188987..3de0ec7d 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -1320,11 +1320,15 @@ class Installer: try: SysCommand(command, peek_output=True) - except SysCallError: - try: - SysCommand(command, peek_output=True) - except SysCallError as err: - raise DiskError(f'Could not install GRUB to {self.target}{efi_partition.mountpoint}: {err}') + except SysCallError as err: + if not bootloader_removable: + command.append('--removable') + try: + SysCommand(command, peek_output=True) + except SysCallError: + pass + + raise DiskError(f'Could not install GRUB to {self.target}{efi_partition.mountpoint}: {err}') from err else: info(f'GRUB boot partition: {boot_partition.dev_path}')