Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v3 1/5] conf/image-uefi: fix building images for multilib case
@ 2019-10-14 21:50 dbaryshkov
  2019-10-14 21:50 ` [PATCH v3 2/5] multilib.conf: add systemd-boot to non-multilib recipes list dbaryshkov
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dbaryshkov @ 2019-10-14 21:50 UTC (permalink / raw)
  To: openembedded-core; +Cc: Dmitry Eremin-Solenikov

From: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>

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 <dmitry_eremin-solenikov@mentor.com>
---
 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)
+}
+
+
-- 
2.23.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-22 19:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-14 21:50 [PATCH v3 1/5] conf/image-uefi: fix building images for multilib case dbaryshkov
2019-10-14 21:50 ` [PATCH v3 2/5] multilib.conf: add systemd-boot to non-multilib recipes list dbaryshkov
2019-10-14 21:50 ` [PATCH v3 3/5] grub-efi: replace anonymous function with static configuration dbaryshkov
2019-10-14 21:50 ` [PATCH v3 4/5] systemd-boot: " dbaryshkov
2019-10-14 21:50 ` [PATCH v3 5/5] image-uefi.conf: define generic EFI_COMPATIBLE_HOST dbaryshkov
2019-10-22 19:24 ` [PATCH v3 1/5] conf/image-uefi: fix building images for multilib case Dmitry Eremin-Solenikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox