public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
* [PATCH] cdrom: Use uppercase EFI boot filename on LoongArch
@ 2026-11-06  5:36 Vincent Li
  2026-11-18 14:41 ` Michael Tremer
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Li @ 2026-11-06  5:36 UTC (permalink / raw)
  To: development; +Cc: michael.tremer, Vincent Li

Some Loongson 3A6000 firmware reads the ISO9660 filesystem
case-sensitively and fails to find bootLOONGARCH64.efi. The
uppercase BOOTLOONGARCH64.EFI is valid UEFI naming and works
on unaffected firmware too, so use it on LoongArch only.
x86, ARM and RISC-V are unchanged.

Tested on a Morefine M700S (Loongson 3A6000).

Tested-by: Vincent Li <vincent.mc.li@gmail.com>
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
---
 lfs/cdrom | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lfs/cdrom b/lfs/cdrom
index 11604b722..20d067613 100644
--- a/lfs/cdrom
+++ b/lfs/cdrom
@@ -66,6 +66,12 @@ ISO_ARGS += \
 
 ISO_FILE = $(IMAGES_DIR)/$(SNAME)-$(VERSION)-core$(CORE)-$(BUILD_ARCH).iso
 
+ifeq "$(EFI_ARCH)" "LOONGARCH64"
+	EFI_BOOT_FILE = BOOT$(EFI_ARCH).EFI
+else
+	EFI_BOOT_FILE = boot$(EFI_ARCH).efi
+endif
+
 # Dracut modules that the installer does not need
 INSTALLER_OMIT_MODULES = \
 	cifs \
@@ -185,7 +191,7 @@ endif
 
 	# Build a GRUB EFI image
 	mkdir -pv $(DIR_TMP)/cdrom/EFI/BOOT
-	$(call GRUB_MKIMAGE,$(GRUB_ARCH)-efi,/EFI/BOOT,$(DIR_TMP)/grub-efi.cfg,$(DIR_TMP)/cdrom/EFI/BOOT/boot$(EFI_ARCH).efi)
+	$(call GRUB_MKIMAGE,$(GRUB_ARCH)-efi,/EFI/BOOT,$(DIR_TMP)/grub-efi.cfg,$(DIR_TMP)/cdrom/EFI/BOOT/$(EFI_BOOT_FILE))
 
 	# Install GRUB configuration
 	mkdir -pv $(DIR_TMP)/cdrom/EFI/BOOT
@@ -199,7 +205,7 @@ endif
 	# Copy the bootloader into the image
 	mmd -i $(DIR_TMP)/cdrom/boot/isolinux/efiboot.img ::/EFI ::/EFI/BOOT
 	mcopy -i $(DIR_TMP)/cdrom/boot/isolinux/efiboot.img \
-		$(DIR_TMP)/cdrom/EFI/BOOT/boot$(EFI_ARCH).efi ::/EFI/BOOT/boot$(EFI_ARCH).efi
+		$(DIR_TMP)/cdrom/EFI/BOOT/$(EFI_BOOT_FILE) ::/EFI/BOOT/$(EFI_BOOT_FILE)
 
 	# Show what has been copied
 	mdir -/ -i $(DIR_TMP)/cdrom/boot/isolinux/efiboot.img ::
-- 
2.38.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] cdrom: Use uppercase EFI boot filename on LoongArch
  2026-11-06  5:36 [PATCH] cdrom: Use uppercase EFI boot filename on LoongArch Vincent Li
@ 2026-11-18 14:41 ` Michael Tremer
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Tremer @ 2026-11-18 14:41 UTC (permalink / raw)
  To: development; +Cc: Vincent Li

Hello Vincent,

Thank you for the patch and for testing it on real hardware. I have
merged it, and added a small follow-up on top.

I did not want to special-case LoongArch, because the uppercase name is
the correct one everywhere. ISO9660 itself only knows uppercase names.
The lowercase name only exists through the Rock Ridge/Joliet extensions,
and firmware that reads those compares names exactly. The UEFI spec
calls the fallback loader \EFI\BOOT\BOOT<ARCH>.EFI. Most firmware is
case-insensitive and does not care, which is why only your Loongson
board noticed. lfs/flash-images already uses the uppercase name, so the
ISO was the odd one out.

So the follow-up drops the ifeq and uses the uppercase name on all
architectures. EFI_ARCH is "x64" on x86, so a plain BOOT$(EFI_ARCH).EFI
would still have given BOOTx64.EFI. The name is now run through tr to
get BOOTX64.EFI.

Your commit is kept as it was, with you as the author, so the history
shows where the change came from. Thanks for tracking this down. Would
you mind testing the final result on the M700S once more?

Best regards,
-Michael


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-18 14:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06  5:36 [PATCH] cdrom: Use uppercase EFI boot filename on LoongArch Vincent Li
2026-11-18 14:41 ` Michael Tremer

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