Thanks Dmitry.

But this patch introduces a minor issue. The lib32-systemd-boot will fail to build when enable multilib and EFI_PROVIDER = "grub-efi":

$ bitbake lib32-systemd-boot

ERROR: lib32-systemd-boot-243+AUTOINC+efb536d0cb-r0 do_compile: Execution of '/buildarea/build/tmp/work/x86-pokymllib32-linux/lib32-systemd-boot/243+AUTOINC+efb536d0cb-r0/temp/run.do_compile.254335' failed with exit code 1:
ninja: error: unknown target 'src/boot/efi/systemd-bootx64.efi'
WARNING: /buildarea/build/tmp/work/x86-pokymllib32-linux/lib32-systemd-boot/243+AUTOINC+efb536d0cb-r0/temp/run.do_compile.254335:1 exit 1 from 'ninja src/boot/efi/systemd-bootx64.efi'

ERROR: Logfile of failure stored in: /buildarea/build/tmp/work/x86-pokymllib32-linux/lib32-systemd-boot/243+AUTOINC+efb536d0cb-r0/temp/log.do_compile.254335
Log data follows:
| DEBUG: Executing shell function do_compile
| ninja: error: unknown target 'src/boot/efi/systemd-bootx64.efi'
| WARNING: /buildarea/build/tmp/work/x86-pokymllib32-linux/lib32-systemd-boot/243+AUTOINC+efb536d0cb-r0/temp/run.do_compile.254335:1 exit 1 from 'ninja src/boot/efi/systemd-bootx64.efi' | ERROR: Execution of '/buildarea/build/tmp/work/x86-pokymllib32-linux/lib32-systemd-boot/243+AUTOINC+efb536d0cb-r0/temp/run.do_compile.254335' failed with exit code 1:
| ninja: error: unknown target 'src/boot/efi/systemd-bootx64.efi'
| WARNING: /buildarea/build/tmp/work/x86-pokymllib32-linux/lib32-systemd-boot/243+AUTOINC+efb536d0cb-r0/temp/run.do_compile.254335:1 exit 1 from 'ninja src/boot/efi/systemd-bootx64.efi'
|
ERROR: Task (virtual:multilib:lib32:/buildarea/poky/meta/recipes-core/systemd/systemd-boot_243.bb:do_compile) failed with exit code '1' NOTE: Tasks Summary: Attempted 1661 tasks of which 1660 didn't need to be rerun and 1 failed.



//Yi


On 10/12/19 10:24 PM, [email protected] wrote:
From: Dmitry Eremin-Solenikov <[email protected]>

Building live images for lib32-core-minimal-image will fail because
image target override won't match grub's override. Fix this by
introducing anonymous python function. A proper fix should be to
introduce multilib overrides, but it will be more intrusive.

Signed-off-by: Dmitry Eremin-Solenikov <[email protected]>
---
  meta/conf/image-uefi.conf | 11 +++++------
  meta/conf/image-uefi.inc  | 23 +++++++++++++++++++++++
  2 files changed, 28 insertions(+), 6 deletions(-)
  create mode 100644 meta/conf/image-uefi.inc

diff --git a/meta/conf/image-uefi.conf b/meta/conf/image-uefi.conf
index aaeff12ccb80..57fd18f02742 100644
--- a/meta/conf/image-uefi.conf
+++ b/meta/conf/image-uefi.conf
@@ -8,9 +8,8 @@ EFI_PREFIX ?= "/boot"
  # Location inside rootfs.
  EFI_FILES_PATH = "${EFI_PREFIX}${EFIDIR}"
-# Determine name of bootloader image
-EFI_BOOT_IMAGE ?= "bootINVALID.efi"
-EFI_BOOT_IMAGE_x86-64 = "bootx64.efi"
-EFI_BOOT_IMAGE_x86 = "bootia32.efi"
-EFI_BOOT_IMAGE_aarch64 = "bootaa64.efi"
-EFI_BOOT_IMAGE_arm = "bootarm.efi"
+# Parsing python anonymous functions in .conf files does not work, so move it
+# to .inc file
+require conf/image-uefi.inc
+
+EFI_BOOT_IMAGE ?= "boot${EFI_ARCH}.efi"
diff --git a/meta/conf/image-uefi.inc b/meta/conf/image-uefi.inc
new file mode 100644
index 000000000000..94c5813494cb
--- /dev/null
+++ b/meta/conf/image-uefi.inc
@@ -0,0 +1,23 @@
+# Determine name of bootloader image
+python () {
+    import re
+    if d.getVar("MLPREFIX") != "":
+        target = d.getVar("TARGET_ARCH_MULTILIB_ORIGINAL")
+    else:
+        target = d.getVar("TARGET_ARCH")
+
+    if target == "x86_64":
+        arch = "x64"
+    elif re.match('i.86', target):
+        arch = "ia32"
+    elif re.match('aarch64', target):
+        arch = "aa64"
+    elif re.match('arm', target):
+        arch = "arm"
+    else:
+        raise bb.parse.SkipRecipe("image-uefi is incompatible with target %s" 
% target)
+
+    d.setVar("EFI_ARCH", arch)
+}
+
+
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to