From 80e51c3db41463aaac22421e523372446a4bb7d3 Mon Sep 17 00:00:00 2001 From: bezzayet Date: Thu, 6 Apr 2023 12:26:13 +0200 Subject: [PATCH] feat(grub): dynamically set root variable & add startup --- target/linux/x86/image/grub-efi.cfg | 2 +- target/linux/x86/image/startup.nsh | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 target/linux/x86/image/startup.nsh diff --git a/target/linux/x86/image/grub-efi.cfg b/target/linux/x86/image/grub-efi.cfg index 14d30e88..c0fef07c 100644 --- a/target/linux/x86/image/grub-efi.cfg +++ b/target/linux/x86/image/grub-efi.cfg @@ -3,7 +3,7 @@ set default="0" set timeout="@TIMEOUT@" -set root='(hd0,gpt1)' +search --no-floppy --label kernel --set=root menuentry "@TITLE@" { linux /boot/vmlinuz @GPT_ROOTPART@ @CMDLINE@ noinitrd diff --git a/target/linux/x86/image/startup.nsh b/target/linux/x86/image/startup.nsh new file mode 100644 index 00000000..606dca8f --- /dev/null +++ b/target/linux/x86/image/startup.nsh @@ -0,0 +1,8 @@ + +for %d in 9 8 7 6 5 4 3 2 1 0 + set bootapp "fs%d:\efi\boot\bootx64.efi" + if exist %bootapp% then + %bootapp% + endif +endfor +exit \ No newline at end of file