build-grub: Support setting rootflags from config

The project configuration file can now contain an optional `rootflags`
variable.  If specified, this variable will be used to set the GRUB
environment variable of the same name.  The value will be appended to
the kernel command line.
dev/gentoo
Dustin 2024-12-13 18:58:08 -06:00
parent a244197d3c
commit a51dc99b9b
1 changed files with 5 additions and 3 deletions

View File

@ -39,6 +39,8 @@ grub-mkimage \
echo 'Generating GRUB configuration file ...'
mkdir -p "${O}"/efi-part/EFI/gentoo
cp -uv grub.cfg "${O}"/efi-part/EFI/gentoo
grub-editenv "${O}"/efi-part/EFI/gentoo/grubenv set rootflags='ro'
grub-editenv "${O}"/efi-part/EFI/gentoo/grubenv set default=0
grub-editenv "${O}"/efi-part/EFI/gentoo/grubenv set timeout=5
grub-editenv "${O}"/efi-part/EFI/gentoo/grubenv set \
rootflags="${rootflags-ro}" \
default=0 \
timeout=5 \
&& :