fix: embed grub finder configuration

Helps GRUB find the ShredOS volume when it otherwise cannot (such as when the IMG is used with Ventoy in BIOS)

Signed-off-by: desertwitch <24509509+desertwitch@users.noreply.github.com>
This commit is contained in:
desertwitch
2025-11-19 10:25:07 +01:00
parent 39cb0dd4f7
commit 66e7c16de3
13 changed files with 34 additions and 5 deletions

View File

@@ -0,0 +1,16 @@
This file is embedded into the GRUB bootloaders at build-time
Helps GRUB find our ShredOS volume when it cannot (Ventoy BIOS)
There is no point to put it anywhere on the USB - so don't do that.
Keep consistent with BR2_TARGET_ROOTFS_ISO9660_GRUB2_EFI_IDENT_FILE
when building any configurations that build both an ISO and the IMG.
Do not use the version file as identification file though, because
the ISO9660 filesystem does not have it (but has the needed grub.cfg),
so you should always use a unique file not otherwise used for anything.
Also ensure it is in a location where users cannot delete it by accident.
Note that contrary to the GNU manual the BIOS bootloader seems to need an
explicit "configfile" directive, otherwise the Buildroot static prefix takes
precedence over the actual found volume path (which may be entirely different).

View File

@@ -0,0 +1,3 @@
search --file --set=root /boot/buildroot
set prefix=($root)/boot/grub
configfile $prefix/grub.cfg

View File

@@ -4,6 +4,7 @@ image boot.vfat {
file boot/bzImage { image = 'bzImage' }
file boot/grub/grub.cfg { image = 'grub.cfg' }
file boot/version.txt { image = 'version.txt' }
file boot/buildroot { image = '/dev/null' }
file EFI/BOOT/bootx64.efi { image = 'bootx64.efi' }
file EFI/BOOT/grub.cfg { image = 'grub.cfg' }
file shredos.ico { image = 'shredos.ico' }

View File

@@ -4,6 +4,7 @@ image boot.vfat {
file boot/bzImage { image = 'bzImage' }
file boot/grub/grub.cfg { image = 'grub.cfg' }
file boot/version.txt { image = 'version.txt' }
file boot/buildroot { image = '/dev/null' }
file EFI/BOOT/bootia32.efi { image = 'bootia32.efi' }
file EFI/BOOT/grub.cfg { image = 'grub.cfg' }
file shredos.ico { image = 'shredos.ico' }