Simple configuration (dunfell)

One might think so, yes but I just changed the order in bblayers.conf to:

${TOPDIR}/../sources/meta-mender/meta-mender-core \
${TOPDIR}/../sources/meta-security \
${TOPDIR}/../sources/meta-intel \

But bitbake -e now shows EFI_PROVIDER="systemd-boot" again. Don’t know why tbh. Thanks for your help, though.

It’s probably the layer priority. Just reordering them in bblayers.conf won’t change that. You can use bitbake-layers show-layers to dump out all the layers and their priorities.

Drew

1 Like

You’re right, but mender has a higher priority:

meta-mender-core      /root/build_dir/build/../sources/meta-mender/meta-mender-core  6
meta-intel            /root/build_dir/build/../sources/meta-intel  5
meta-up-board         /root/build_dir/build/../sources/meta-up-board  6

Ok, then I propose you post the output of the command I suggested earlier, so we can see how it’s actually calculated:

bitbake -e core-image-minimal | grep -B100 EFI_PROVIDER=

Sure, here you go:

#
# $DPKG_ARCH [2 operations]
#   set? /root/build_dir/build/../sources/poky/meta/classes/package_deb.bbclass:11
#     "${@debian_arch_map(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'))}"
#   set /root/build_dir/build/../sources/poky/meta/classes/package_deb.bbclass:12
#     [vardepvalue] "${DPKG_ARCH}"
# pre-expansion value:
#   "${@debian_arch_map(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'))}"
DPKG_ARCH="amd64"
#
# $DPKG_BUILDCMD
#   set /root/build_dir/build/../sources/poky/meta/classes/package_deb.bbclass:9
#     [_defaultval] "dpkg-deb"
DPKG_BUILDCMD="dpkg-deb"
#
# $EFI
#   set /root/build_dir/build/../sources/poky/meta/classes/live-vm-common.bbclass:14
#     "${@bb.utils.contains("MACHINE_FEATURES", "efi", "1", "0", d)}"
EFI="1"
#
# $EFIDIR
#   set? /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:2
#     "/EFI/BOOT"
EFIDIR="/EFI/BOOT"
#
# $EFIIMGDIR
#   set /root/build_dir/build/../sources/poky/meta/classes/image-live.bbclass:62
#     "${S}/efi_img"
EFIIMGDIR="/root/build_dir/build/tmp/work/up_squared-poky-linux/core-image-minimal/1.0-r0/core-image-minimal-1.0/efi_img"
#
# $EFI_BOOT_IMAGE [5 operations]
#   set? /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:12
#     "bootINVALID.efi"
#   override[x86-64]:set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:13
#     "bootx64.efi"
#   override[x86]:set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:14
#     "bootia32.efi"
#   override[aarch64]:set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:15
#     "bootaa64.efi"
#   override[arm]:set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:16
#     "bootarm.efi"
# pre-expansion value:
#   "bootx64.efi"
EFI_BOOT_IMAGE="bootx64.efi"
#
# $EFI_BOOT_IMAGE_aarch64
#   set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:15
#     "bootaa64.efi"
EFI_BOOT_IMAGE_aarch64="bootaa64.efi"
#
# $EFI_BOOT_IMAGE_arm
#   set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:16
#     "bootarm.efi"
EFI_BOOT_IMAGE_arm="bootarm.efi"
#
# $EFI_BOOT_IMAGE_x86
#   set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:14
#     "bootia32.efi"
EFI_BOOT_IMAGE_x86="bootia32.efi"
#
# $EFI_BOOT_IMAGE_x86-64
#   set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:13
#     "bootx64.efi"
EFI_BOOT_IMAGE_x86-64="bootx64.efi"
#
# $EFI_CLASS
#   set /root/build_dir/build/../sources/poky/meta/classes/live-vm-common.bbclass:16
#     "${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", "", d)}"
EFI_CLASS="systemd-boot"
#
# $EFI_FILES_PATH
#   set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:9
#     "${EFI_PREFIX}${EFIDIR}"
EFI_FILES_PATH="/boot/efi/EFI/BOOT"
#
# $EFI_PREFIX [2 operations]
#   set? /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:6
#     "/boot"
#   override[mender-image]:set /root/build_dir/build/../sources/meta-mender/meta-mender-core/classes/mender-setup-image.inc:26
#     "${MENDER_BOOT_PART_MOUNT_LOCATION}"
# pre-expansion value:
#   "${MENDER_BOOT_PART_MOUNT_LOCATION}"
EFI_PREFIX="/boot/efi"
#
# $EFI_PREFIX_mender-image
#   set /root/build_dir/build/../sources/meta-mender/meta-mender-core/classes/mender-setup-image.inc:26
#     "${MENDER_BOOT_PART_MOUNT_LOCATION}"
EFI_PREFIX_mender-image="/boot/efi"
#
# $EFI_PROVIDER [4 operations]
#   set? /root/build_dir/build/../sources/meta-intel/conf/machine/include/meta-intel.inc:44
#     "systemd-boot"
#   set? /root/build_dir/build/../sources/meta-mender/meta-mender-core/classes/mender-setup-grub.inc:14
#     "${_MENDER_EFI_PROVIDER_DEFAULT}"
#   set? /root/build_dir/build/../sources/poky/meta/classes/live-vm-common.bbclass:15
#     "grub-efi"
#   override[x86-x32]:set /root/build_dir/build/../sources/meta-intel/conf/machine/include/meta-intel.inc:45
#     "grub-efi"
# pre-expansion value:
#   "systemd-boot"
EFI_PROVIDER="systemd-boot"

I guess it has to do with ordering of the ‘?=’ operations. I think you may just have to force it set in your local.conf.

Yes, that’s what I’m doing currently. Not perfect, but it works.

Interesting, so the priority of ?= is reverse, it’s the first one that stands, instead of the last one. This almost seems like a bug in Bitbake, it breaks layer priority.

I’m thinking it means that maybe it’s better if meta-mender does not mess with the default, but instead sets it only when it’s really needed. Does the patch below work for you?

diff --git a/meta-mender-core/classes/mender-setup-grub.inc b/meta-mender-core/classes/mender-setup-grub.inc
index 140ffb83..4909e0ef 100644
--- a/meta-mender-core/classes/mender-setup-grub.inc
+++ b/meta-mender-core/classes/mender-setup-grub.inc
@@ -11,10 +11,8 @@ PREFERRED_RPROVIDER_virtual/grub-bootconf ?= "grub-mender-grubenv"
 
 # Set EFI_PROVIDER.  Not all MACHINE configs use it but notably
 # intel-corei7-64 does and without this we use the default of systemd-boot.
-EFI_PROVIDER ?= "${_MENDER_EFI_PROVIDER_DEFAULT}"
-_MENDER_EFI_PROVIDER_DEFAULT = ""
-_MENDER_EFI_PROVIDER_DEFAULT_mender-grub = "grub-efi"
-_MENDER_EFI_PROVIDER_DEFAULT_mender-grub_mender-bios = ""
+EFI_PROVIDER_mender-grub = "grub-efi"
+EFI_PROVIDER_mender-grub_mender-bios = ""
 
 python() {
     if d.getVar('MENDER_GRUB_STORAGE_DEVICE'):

Yeah, seems to work:

#   set? /root/build_dir/build/../sources/poky/meta/classes/package_deb.bbclass:11
#     "${@debian_arch_map(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'))}"
#   set /root/build_dir/build/../sources/poky/meta/classes/package_deb.bbclass:12
#     [vardepvalue] "${DPKG_ARCH}"
# pre-expansion value:
#   "${@debian_arch_map(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'))}"
DPKG_ARCH="amd64"
#
# $DPKG_BUILDCMD
#   set /root/build_dir/build/../sources/poky/meta/classes/package_deb.bbclass:9
#     [_defaultval] "dpkg-deb"
DPKG_BUILDCMD="dpkg-deb"
#
# $EFI
#   set /root/build_dir/build/../sources/poky/meta/classes/live-vm-common.bbclass:14
#     "${@bb.utils.contains("MACHINE_FEATURES", "efi", "1", "0", d)}"
EFI="1"
#
# $EFIDIR
#   set? /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:2
#     "/EFI/BOOT"
EFIDIR="/EFI/BOOT"
#
# $EFIIMGDIR
#   set /root/build_dir/build/../sources/poky/meta/classes/image-live.bbclass:62
#     "${S}/efi_img"
EFIIMGDIR="/root/build_dir/build/tmp/work/up_squared-poky-linux/core-image-minimal/1.0-r0/core-image-minimal-1.0/efi_img"
#
# $EFI_BOOT_IMAGE [5 operations]
#   set? /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:12
#     "bootINVALID.efi"
#   override[x86-64]:set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:13
#     "bootx64.efi"
#   override[x86]:set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:14
#     "bootia32.efi"
#   override[aarch64]:set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:15
#     "bootaa64.efi"
#   override[arm]:set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:16
#     "bootarm.efi"
# pre-expansion value:
#   "bootx64.efi"
EFI_BOOT_IMAGE="bootx64.efi"
#
# $EFI_BOOT_IMAGE_aarch64
#   set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:15
#     "bootaa64.efi"
EFI_BOOT_IMAGE_aarch64="bootaa64.efi"
#
# $EFI_BOOT_IMAGE_arm
#   set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:16
#     "bootarm.efi"
EFI_BOOT_IMAGE_arm="bootarm.efi"
#
# $EFI_BOOT_IMAGE_x86
#   set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:14
#     "bootia32.efi"
EFI_BOOT_IMAGE_x86="bootia32.efi"
#
# $EFI_BOOT_IMAGE_x86-64
#   set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:13
#     "bootx64.efi"
EFI_BOOT_IMAGE_x86-64="bootx64.efi"
#
# $EFI_CLASS
#   set /root/build_dir/build/../sources/poky/meta/classes/live-vm-common.bbclass:16
#     "${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", "", d)}"
EFI_CLASS="grub-efi"
#
# $EFI_FILES_PATH
#   set /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:9
#     "${EFI_PREFIX}${EFIDIR}"
EFI_FILES_PATH="/boot/efi/EFI/BOOT"
#
# $EFI_PREFIX [2 operations]
#   set? /root/build_dir/build/../sources/poky/meta/conf/image-uefi.conf:6
#     "/boot"
#   override[mender-image]:set /root/build_dir/build/../sources/meta-mender/meta-mender-core/classes/mender-setup-image.inc:26
#     "${MENDER_BOOT_PART_MOUNT_LOCATION}"
# pre-expansion value:
#   "${MENDER_BOOT_PART_MOUNT_LOCATION}"
EFI_PREFIX="/boot/efi"
#
# $EFI_PREFIX_mender-image
#   set /root/build_dir/build/../sources/meta-mender/meta-mender-core/classes/mender-setup-image.inc:26
#     "${MENDER_BOOT_PART_MOUNT_LOCATION}"
EFI_PREFIX_mender-image="/boot/efi"
#
# $EFI_PROVIDER [5 operations]
#   set? /root/build_dir/build/../sources/meta-intel/conf/machine/include/meta-intel.inc:44
#     "systemd-boot"
#   set? /root/build_dir/build/../sources/poky/meta/classes/live-vm-common.bbclass:15
#     "grub-efi"
#   override[x86-x32]:set /root/build_dir/build/../sources/meta-intel/conf/machine/include/meta-intel.inc:45
#     "grub-efi"
#   override[mender-grub]:set /root/build_dir/build/../sources/meta-mender/meta-mender-core/classes/mender-setup-grub.inc:14
#     "grub-efi"
#   override[mender-grub_mender-bios]:set /root/build_dir/build/../sources/meta-mender/meta-mender-core/classes/mender-setup-grub.inc:15
#     ""
# pre-expansion value:
#   "grub-efi"
EFI_PROVIDER="grub-efi"

Thanks for confirming. Then I propose this fix.

1 Like