public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
* [PATCH] installer: Fix GRUB installation fallback logic
@ 2026-07-27  1:10 Vincent Li
  0 siblings, 0 replies; only message in thread
From: Vincent Li @ 2026-07-27  1:10 UTC (permalink / raw)
  To: Michael Tremer, Arne Fitzenreiter, Adolf Belka, development; +Cc: Vincent Li

The GRUB installation loop would exit immediately on the first failure,
preventing it from trying alternative installation methods.

This was causing issues on LoongArch64 systems where the initial
installation attempt would fail, but the fallback with --removable
would have succeeded if the script had continued.

With this change, the installer now tries all available installation
methods before failing, improving compatibility across architectures.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
---
 src/installer/install-bootloader | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/installer/install-bootloader b/src/installer/install-bootloader
index 977ed3674..f21578495 100644
--- a/src/installer/install-bootloader
+++ b/src/installer/install-bootloader
@@ -141,10 +141,10 @@ function grub_install() {
 
 		local removable
 		for removable in "" "--removable"; do
-			if ! grub-install ${GRUB_INSTALL_ARGS} ${args} \
+			if grub-install ${GRUB_INSTALL_ARGS} ${args} \
 					${removable} "${device}" &>/dev/null; then
-				echo "Could not install GRUB on ${device}" >&2
-				return 1
+				echo "GRUB installed successfully on ${device}" >&2
+				return 0
 			fi
 
 			# Do not try to install with --removable for non-efi architectures
@@ -152,7 +152,7 @@ function grub_install() {
 		done
 	done
 
-	return 0
+	return 1
 }
 
 function main() {
-- 
2.34.1



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-27  1:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-27  1:10 [PATCH] installer: Fix GRUB installation fallback logic Vincent Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox