feat(boot): mirror the BIOS menu entries in the UEFI GRUB menu

This commit is contained in:
nocode committed 2026-11-26 14:00:07 +01:00
1 parent 70b64754af
commit 70cfa68743
1 file changed
+48 -31
+48 -31
View File
@@ -1,3 +1,8 @@
# UEFI boot menu of the ISO (bootmode uefi.grub). GRUB reads the kernel and
# initramfs straight from the ISO 9660 file system, so the EFI system
# partition only carries GRUB itself instead of a second copy of both.
# Entries mirror the BIOS menu (syslinux/archiso_sys-linux.cfg).
# Load partition table and file system modules
insmod part_gpt
insmod part_msdos
@@ -36,52 +41,60 @@ else
archiso_platform="${grub_cpu}-${grub_platform}"
fi
# Get the lowercase UEFI machine type short-name to use for architecture-specific tools
if [ "${grub_platform}" == 'efi' ]; then
if [ "${grub_cpu}" == 'x86_64' ]; then
uefi_machine_type_lower='x64'
elif [ "${grub_cpu}" == 'i386' ]; then
uefi_machine_type_lower='ia32'
fi
fi
# Set default menu entry
default=fwslinux
timeout=20
default=fws
timeout=3
timeout_style=menu
# Menu entries
menuentry "FWS Linux (%ARCH%, ${archiso_platform})" --class arch --class gnu-linux --class gnu --class os --id 'fwslinux' {
menuentry "FWS install medium (%ARCH%, ${archiso_platform})" --class fws --class gnu-linux --class gnu --class os --id 'fws' {
set gfxpayload=keep
linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisosearchuuid=%ARCHISO_UUID%
linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisosearchuuid=%ARCHISO_UUID% udev.event_timeout=45
initrd /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img
}
if [ "${grub_platform}" == 'efi' -a "${grub_cpu}" == 'x86_64' -a -f '/boot/memtest86+/memtest.efi' ]; then
menuentry 'Run Memtest86+ (RAM test)' --class memtest86 --class gnu --class tool {
# Safe graphics: no KMS, X falls back to the firmware framebuffer.
menuentry "FWS install medium (%ARCH%, ${archiso_platform}, safe graphics)" --class fws --class gnu-linux --class gnu --class os --id 'fws-nomodeset' {
set gfxpayload=keep
linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisosearchuuid=%ARCHISO_UUID% nomodeset udev.event_timeout=45
initrd /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img
}
# Boots the live without the installer and starts fws-recovery (fws.recovery=1).
menuentry "FWS - Reparer une installation (recovery)" --class fws --class gnu-linux --class gnu --class os --id 'fws-recovery' {
set gfxpayload=keep
linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisosearchuuid=%ARCHISO_UUID% udev.event_timeout=45 fws.recovery=1
initrd /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img
}
menuentry "FWS install medium (%ARCH%, ${archiso_platform}) with speech" --hotkey s --class fws --class gnu-linux --class gnu --class os --id 'fws-accessibility' {
set gfxpayload=keep
linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisosearchuuid=%ARCHISO_UUID% accessibility=on udev.event_timeout=45
initrd /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img
}
if [ "${grub_platform}" == 'efi' -a -f "/boot/memtest86+/memtest86${uefi_machine_type_lower}.efi" ]; then
menuentry 'Run Memtest86+ (RAM test)' --class memtest86 --class memtest --class gnu --class tool {
set gfxpayload=800x600,1024x768
linux /boot/memtest86+/memtest.efi
}
fi
if [ "${grub_platform}" == 'pc' -a -f '/boot/memtest86+/memtest' ]; then
menuentry 'Run Memtest86+ (RAM test)' --class memtest86 --class gnu --class tool {
set gfxpayload=800x600,1024x768
linux /boot/memtest86+/memtest
linux /boot/memtest86+/memtest86${uefi_machine_type_lower}.efi
}
fi
if [ "${grub_platform}" == 'efi' ]; then
if [ "${grub_cpu}" == 'x86_64' -a -f '/shellx64.efi' ]; then
if [ -f "/shell${uefi_machine_type_lower}.efi" ]; then
menuentry 'UEFI Shell' --class efi {
chainloader /shellx64.efi
}
elif [ "${grub_cpu}" == 'i386' -a -f '/shellia32.efi' ]; then
menuentry 'UEFI Shell' --class efi {
chainloader /shellia32.efi
}
elif [ "${grub_cpu}" == 'arm64' -a -f '/shellaa64.efi' ]; then
menuentry 'UEFI Shell' --class efi {
chainloader /shellaa64.efi
}
elif [ "${grub_cpu}" == 'riscv64' -a -f '/shellriscv64.efi' ]; then
menuentry 'UEFI Shell' --class efi {
chainloader /shellriscv64.efi
}
elif [ "${grub_cpu}" == 'loongarch64' -a -f '/shellloongarch64.efi' ]; then
menuentry 'UEFI Shell' --class efi {
chainloader /shellloongarch64.efi
chainloader /shell${uefi_machine_type_lower}.efi
}
fi
@@ -99,3 +112,7 @@ menuentry 'System restart' --class reboot --class restart {
echo 'System rebooting...'
reboot
}
# Audible cue that the menu is up, for users of the speech entry.
play 600 988 1 1319 4