[OE-core] [PATCH 2/3] bootimg/grub-efi.bbclass: allow using a different class for EFI images

Darren Hart dvhart at linux.intel.com
Thu Mar 6 22:31:46 UTC 2014


On 3/6/14, 10:15, "Stefan Stanacar" <stefanx.stanacar at intel.com> wrote:

>Abstract away some names so one can select using EFI_PROVIDER a different
>class than grub-efi for populating live images, basically allowing the use
>of a different bootloader than grub-efi.
>
>Signed-off-by: Stefan Stanacar <stefanx.stanacar at intel.com>
>---
> meta/classes/boot-directdisk.bbclass | 7 ++++---
> meta/classes/bootimg.bbclass         | 9 +++++----
> meta/classes/grub-efi.bbclass        | 6 ++++++
> 3 files changed, 15 insertions(+), 7 deletions(-)
>
>diff --git a/meta/classes/boot-directdisk.bbclass
>b/meta/classes/boot-directdisk.bbclass
>index 42b3415..c35b4bb 100644
>--- a/meta/classes/boot-directdisk.bbclass
>+++ b/meta/classes/boot-directdisk.bbclass
>@@ -32,7 +32,8 @@ BOOTDD_VOLUME_ID   ?= "boot"
> BOOTDD_EXTRA_SPACE ?= "16384"
> 
> EFI = "${@base_contains("MACHINE_FEATURES", "efi", "1", "0", d)}"
>-EFI_CLASS = "${@base_contains("MACHINE_FEATURES", "efi", "grub-efi", "",
>d)}"
>+EFI_PROVIDER ?= "grub-efi"
>+EFI_CLASS = "${@base_contains("MACHINE_FEATURES", "efi",
>"${EFI_PROVIDER}", "", d)}"
> 
> # Include legacy boot if MACHINE_FEATURES includes "pcbios" or if it
>does not
> # contain "efi". This way legacy is supported by default if neither is
>@@ -87,7 +88,7 @@ build_boot_dd() {
> 		syslinux_hddimg_populate $HDDDIR
> 	fi
> 	if [ "${EFI}" = "1" ]; then
>-		grubefi_hddimg_populate $HDDDIR
>+		${EFICLASS_FUNC_PREFIX}_hddimg_populate $HDDDIR

This seems like an odd way to call a function, via a constructed function
name. Would it make more sense to define an efi interface and only one
bbclass that implemented that interface? Such as grub-efi.bbclass or
gummiboot.bbclass?

This isn't my area of expertise, maybe some recipe/bitbake experts can
weigh in here...

-- 
Darren Hart
Yocto Project - Linux Kernel
Intel Open Source Technology Center







More information about the Openembedded-core mailing list