All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] grub-efi: Add option to include all available modules
@ 2022-03-11 18:07 Diego Sueiro
  0 siblings, 0 replies; only message in thread
From: Diego Sueiro @ 2022-03-11 18:07 UTC (permalink / raw)
  To: openembedded-core; +Cc: nd, Diego Sueiro

Include all available modules If 'all' is present in GRUB_BUILDIN variable.
To achieve this we need to search for all .mod files in ${B}/grub-core/ and
pass them to grub-mkimage command.

Also, add the verbose option to grub-mkimage.

Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
---
 meta/recipes-bsp/grub/grub-efi_2.06.bb | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-bsp/grub/grub-efi_2.06.bb b/meta/recipes-bsp/grub/grub-efi_2.06.bb
index df5f23e22e..9857e8e036 100644
--- a/meta/recipes-bsp/grub/grub-efi_2.06.bb
+++ b/meta/recipes-bsp/grub/grub-efi_2.06.bb
@@ -46,11 +46,21 @@ EXTRA_OECONF += "--enable-efiemu=no"
 
 do_mkimage() {
 	cd ${B}
+
+	GRUB_MKIMAGE_MODULES="${GRUB_BUILDIN}"
+
+	# If 'all' is included in GRUB_BUILDIN we will include all available grub2 modules
+	if [ "${@ bb.utils.contains('GRUB_BUILDIN', 'all', 'True', 'False', d)}" = "True" ]; then
+		bbdebug 1 "Including all available modules"
+		# Get the list of all .mod files in grub-core build directory
+		GRUB_MKIMAGE_MODULES=$(find ${B}/grub-core/ -type f -name "*.mod" -exec basename {} .mod \;)
+	fi
+
 	# Search for the grub.cfg on the local boot media by using the
 	# built in cfg file provided via this recipe
-	grub-mkimage -c ../cfg -p ${EFIDIR} -d ./grub-core/ \
+	grub-mkimage -v -c ../cfg -p ${EFIDIR} -d ./grub-core/ \
 	               -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} \
-	               ${GRUB_BUILDIN}
+	               ${GRUB_MKIMAGE_MODULES}
 }
 
 addtask mkimage before do_install after do_compile
@@ -70,6 +80,7 @@ do_install() {
     install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${D}${EFI_FILES_PATH}/${GRUB_IMAGE}
 }
 
+# To include all available modules, add 'all' to GRUB_BUILDIN
 GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal \
                  efi_gop iso9660 configfile search loadenv test"
 
-- 
2.35.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-11 18:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-11 18:07 [PATCH] grub-efi: Add option to include all available modules Diego Sueiro

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.