public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Vincent Li <vincent.mc.li@gmail.com>
To: Michael Tremer <michael.tremer@ipfire.org>,
	Arne Fitzenreiter <arne.fitzenreiter@ipfire.org>,
	Adolf Belka <adolf.belka@ipfire.org>,
	development@lists.ipfire.org
Cc: Vincent Li <vincent.mc.li@gmail.com>
Subject: [PATCH] installer: Fix GRUB installation fallback logic
Date: Mon, 27 Jul 2026 01:10:34 +0000	[thread overview]
Message-ID: <20260727011034.629367-1-vincent.mc.li@gmail.com> (raw)

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



                 reply	other threads:[~2026-07-27  1:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260727011034.629367-1-vincent.mc.li@gmail.com \
    --to=vincent.mc.li@gmail.com \
    --cc=adolf.belka@ipfire.org \
    --cc=arne.fitzenreiter@ipfire.org \
    --cc=development@lists.ipfire.org \
    --cc=michael.tremer@ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox