[OE-core] Variable expansion order: bootimg fails with MACHINE_FEATURES += "efi" in local.conf

Darren Hart dvhart at linux.intel.com
Fri Jan 13 05:32:11 UTC 2012


I find that if I want to build a live efi image for testing on qemu, and I add the following to my local.conf:

MACHINE_FEATURES_append_qemux86 = " efi"
KERNEL_FEATURES_append_qemux86 = " cfg/efi-ext.scc"
IMAGE_TYPES += "live"

And then try to build core-image-minimal, I'll get an error like the following during do_bootimg:

| WARNING: Function build_grub_cfg doesn't exist
| ERROR: Function 'build_hddimg' failed (see /build/poky/qemux86/tmp/work/qemux86-poky-linux/core-image-minimal-1.0-r0/temp/log.do_bootimg.16296 for further information)

build_grub_cfg is defined in grub-efi.bbclass, which is inherited by bootimg.bbclass as follows:

EFI = ${@base_contains("MACHINE_FEATURES", "efi", "1", "0", d)}
EFI_CLASS = ${@base_contains("MACHINE_FEATURES", "efi", "grub-efi", "dummy", d)}

inherit ${EFI_CLASS}

Testing with -e reveals:

$ bitbake -e core-image-minimal | grep EFI_CLASS=
# EFI_CLASS=${@base_contains("MACHINE_FEATURES", "efi", "grub-efi", "dummy", d)}
EFI_CLASS="grub-efi"

However, if I add garbage to the grub-efi.bbclass file, the parser doesn't complain. Adding garbage to dummy does cause it to fail, but without pcbios in MACHINE_FEATURES, the PCBIOS_CLASS should cause dummy to be inherited, so this isn't definitive evidence that dummy is being inherited _instead_ of grub-efi.

So, is there a problem with the inline python call to base_contains to get the grub-efi variable if MACHINE_FEATURES is modified in local.conf? Can anyone suggest some rule that I might be missing that would cause this behavior?

Thanks,

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




More information about the Openembedded-core mailing list