From a51dc99b9b0d49862ecd03c88f94ec0fed0caadb Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Fri, 13 Dec 2024 18:58:08 -0600 Subject: [PATCH] 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. --- build-grub.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build-grub.sh b/build-grub.sh index 2bdabf6..26e9022 100755 --- a/build-grub.sh +++ b/build-grub.sh @@ -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 \ + && :