From: Vincent Davis Jr <vince@underview.tech>
To: openembedded-core@lists.openembedded.org
Cc: Vincent Davis Jr <vince@underview.tech>
Subject: [OE-core][PATCH v3 6/8] grub-efi: support custom embedded grub configs
Date: Fri, 5 Sep 2025 12:41:34 -0400 [thread overview]
Message-ID: <20250905164136.2896809-6-vince@underview.tech> (raw)
In-Reply-To: <20250905164136.2896809-1-vince@underview.tech>
Commit:
Adds support for including custom
embedded grub configs. The default one
provided in OE-core is limited to everything
being in the /EFI/BOOT directory.
Adds an embedded grub config that sets
root and prefix based upon the /boot/grub
directory.
Adds probe to the list of default builtin
grub modules. Probe is required by the
bootimg_pcbios wic plugin generated
grub config.
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
---
meta/recipes-bsp/grub/files/cfg-boot-grub | 3 +++
meta/recipes-bsp/grub/grub-efi_2.12.bb | 6 ++++--
2 files changed, 7 insertions(+), 2 deletions(-)
create mode 100644 meta/recipes-bsp/grub/files/cfg-boot-grub
diff --git a/meta/recipes-bsp/grub/files/cfg-boot-grub b/meta/recipes-bsp/grub/files/cfg-boot-grub
new file mode 100644
index 0000000000..ab370479af
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/cfg-boot-grub
@@ -0,0 +1,3 @@
+search.file /boot/grub/grub.cfg root
+set prefix=($root)
+configfile ($root)/boot/grub/grub.cfg
diff --git a/meta/recipes-bsp/grub/grub-efi_2.12.bb b/meta/recipes-bsp/grub/grub-efi_2.12.bb
index 6354b43989..91748c8d04 100644
--- a/meta/recipes-bsp/grub/grub-efi_2.12.bb
+++ b/meta/recipes-bsp/grub/grub-efi_2.12.bb
@@ -9,6 +9,7 @@ RDEPENDS:${PN} = "grub-common virtual-grub-bootconf"
SRC_URI += " \
file://cfg \
+ file://cfg-boot-grub \
"
S = "${UNPACKDIR}/grub-${PV}"
@@ -48,6 +49,7 @@ EXTRA_OECONF += "--enable-efiemu=no"
# Define GRUB_MKIMAGE_OPTS variable for additional grub-mkimage options (e.g., disabling shim lock)
GRUB_MKIMAGE_OPTS ?= ""
+EMBEDDED_GRUB_CONFIG ?= "${UNPACKDIR}/cfg"
do_mkimage() {
cd ${B}
@@ -63,7 +65,7 @@ do_mkimage() {
# Search for the grub.cfg on the local boot media by using the
# built in cfg file provided via this recipe
- grub-mkimage -v -c ${UNPACKDIR}/cfg -p ${EFIDIR} -d ./grub-core/ \
+ grub-mkimage -v -c ${EMBEDDED_GRUB_CONFIG} -p ${EFIDIR} -d ./grub-core/ \
-O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} \
${GRUB_MKIMAGE_OPTS} ${GRUB_MKIMAGE_MODULES}
}
@@ -87,7 +89,7 @@ do_install() {
# 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"
+ efi_gop iso9660 configfile search probe loadenv test"
# 'xen_boot' is a module valid only for aarch64
GRUB_BUILDIN:append:aarch64 = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' xen_boot', '', d)}"
--
2.43.0
next prev parent reply other threads:[~2025-09-05 16:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-05 16:41 [OE-core][PATCH v3 1/8] bootimg_pcbios: support grub hybrid boot Vincent Davis Jr
2025-09-05 16:41 ` [OE-core][PATCH v3 2/8] bootimg_efi: " Vincent Davis Jr
2025-09-05 16:41 ` [OE-core][PATCH v3 3/8] bootimg_efi: copy grub modules Vincent Davis Jr
2025-09-05 16:41 ` [OE-core][PATCH v3 4/8] bootimg_pcbios: update default boot timeout to zero Vincent Davis Jr
2025-09-05 16:41 ` [OE-core][PATCH v3 5/8] bootimg_biosplusefi: add grub only examples Vincent Davis Jr
2025-09-05 16:41 ` Vincent Davis Jr [this message]
2025-09-05 16:41 ` [OE-core][PATCH v3 7/8] oe-selftest[wic]: add test_grub_install_biosplusefi Vincent Davis Jr
2025-09-05 16:41 ` [OE-core][PATCH v3 8/8] oe-selftest[wic]: add test_grub_install_biosplusefi_qemu Vincent Davis Jr
2025-09-07 14:02 ` [OE-core][PATCH v3 1/8] bootimg_pcbios: support grub hybrid boot Mathieu Dubois-Briand
2025-09-07 15:47 ` Vincent Davis
2025-09-08 12:25 ` Mathieu Dubois-Briand
2025-09-13 4:29 ` [PATCH " Vincent Davis Jr
2025-09-15 12:17 ` [OE-core] " Mathieu Dubois-Briand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250905164136.2896809-6-vince@underview.tech \
--to=vince@underview.tech \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox