diff --git a/configs/baseline/grub/loopback.cfg b/configs/baseline/grub/loopback.cfg index 18d6c77..1b36c9d 100644 --- a/configs/baseline/grub/loopback.cfg +++ b/configs/baseline/grub/loopback.cfg @@ -13,52 +13,63 @@ 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=15 +default=fws +timeout=3 timeout_style=menu -# Menu entries +# Menu entries (same as grub.cfg, booted through GRUB's loopback support) -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% img_dev=UUID=${archiso_img_dev_uuid} img_loop="${iso_path}" + linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux archisobasedir=%INSTALL_DIR% img_dev=UUID=${archiso_img_dev_uuid} img_loop="${iso_path}" 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 { +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% img_dev=UUID=${archiso_img_dev_uuid} img_loop="${iso_path}" nomodeset udev.event_timeout=45 + initrd /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img +} + +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% img_dev=UUID=${archiso_img_dev_uuid} img_loop="${iso_path}" fws.recovery=1 udev.event_timeout=45 + 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% img_dev=UUID=${archiso_img_dev_uuid} img_loop="${iso_path}" 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 + linux /boot/memtest86+/memtest86${uefi_machine_type_lower}.efi } -fi -if [ "${grub_platform}" == 'pc' -a -f '/boot/memtest86+/memtest' ]; then - menuentry 'Run Memtest86+ (RAM test)' --class memtest86 --class gnu --class tool { +elif [ "${grub_platform}" == 'pc' -a -f '/boot/memtest86+/memtest' ]; then + menuentry 'Run Memtest86+ (RAM test)' --class memtest86 --class memtest --class gnu --class tool { set gfxpayload=800x600,1024x768 linux /boot/memtest86+/memtest } 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