diff mbox series

[master] grub2: Add GRUB_MKIMAGE_OPTS for configurable grub-mkimage options

Message ID 20250321113904.4137267-1-valeria.petrov@spinetix.com
State Accepted, archived
Commit a6147adefcba7aae3f4eb8ed76d6a94315cafe61
Headers show
Series [master] grub2: Add GRUB_MKIMAGE_OPTS for configurable grub-mkimage options | expand

Commit Message

Valeria March 21, 2025, 11:39 a.m. UTC
Introduce the GRUB_MKIMAGE_OPTS variable to allow additional options
to be passed to grub-mkimage, making its behavior more configurable.
(for example, this allows disabling shim lock when necessary).

Update do_mkimage to use ${GRUB_MKIMAGE_OPTS}. This change reduce the
need for hardcoded modifications and makes future adjustments easier.

Signed-off-by: Valeria Petrov <valeria.petrov@spinetix.com>
---
 meta/recipes-bsp/grub/grub-efi_2.12.bb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-bsp/grub/grub-efi_2.12.bb b/meta/recipes-bsp/grub/grub-efi_2.12.bb
index 6dbc0ccf7f..5b435245ee 100644
--- a/meta/recipes-bsp/grub/grub-efi_2.12.bb
+++ b/meta/recipes-bsp/grub/grub-efi_2.12.bb
@@ -46,6 +46,9 @@  inherit deploy
 CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
 EXTRA_OECONF += "--enable-efiemu=no"
 
+# Define GRUB_MKIMAGE_OPTS variable for additional grub-mkimage options (e.g., disabling shim lock)
+GRUB_MKIMAGE_OPTS ?= ""
+
 do_mkimage() {
 	cd ${B}
 
@@ -62,7 +65,7 @@  do_mkimage() {
 	# built in cfg file provided via this recipe
 	grub-mkimage -v -c ${UNPACKDIR}/cfg -p ${EFIDIR} -d ./grub-core/ \
 	               -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} \
-	               ${GRUB_MKIMAGE_MODULES}
+	               ${GRUB_MKIMAGE_OPTS} ${GRUB_MKIMAGE_MODULES}
 }
 
 addtask mkimage before do_install after do_compile