* [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
* [PATCH v3 2/5] multilib.conf: add systemd-boot to non-multilib recipes list
2019-10-14 21:50 [PATCH v3 1/5] conf/image-uefi: fix building images for multilib case dbaryshkov
@ 2019-10-14 21:50 ` dbaryshkov
2019-10-14 21:50 ` [PATCH v3 3/5] grub-efi: replace anonymous function with static configuration dbaryshkov
` (3 subsequent siblings)
4 siblings, 0 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>
Add systemd-boot to NON_MULTILIB_RECIPES so that it won't be built for multilib targets.
Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
---
meta/conf/multilib.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/conf/multilib.conf b/meta/conf/multilib.conf
index cfed3fbbd07f..c734a121e12d 100644
--- a/meta/conf/multilib.conf
+++ b/meta/conf/multilib.conf
@@ -29,4 +29,4 @@ PKG_CONFIG_PATH[vardepvalueexclude] = ":${WORKDIR}/recipe-sysroot/${datadir}/pkg
# These recipes don't need multilib variants, the ${BPN} PROVDES/RPROVDES
# ${MLPREFIX}${BPN}
-NON_MULTILIB_RECIPES = "grub grub-efi make-mod-scripts ovmf"
+NON_MULTILIB_RECIPES = "grub grub-efi systemd-boot make-mod-scripts ovmf"
--
2.23.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v3 3/5] grub-efi: replace anonymous function with static configuration
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 ` dbaryshkov
2019-10-14 21:50 ` [PATCH v3 4/5] systemd-boot: " dbaryshkov
` (2 subsequent siblings)
4 siblings, 0 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>
Replace anonymous function setting GRUB_* variables with static
configuration, since grub-efi.bbclass will use fixed names for grub
bootloader.
Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
---
meta/recipes-bsp/grub/grub-efi_2.04.bb | 40 ++++++++++----------------
1 file changed, 15 insertions(+), 25 deletions(-)
diff --git a/meta/recipes-bsp/grub/grub-efi_2.04.bb b/meta/recipes-bsp/grub/grub-efi_2.04.bb
index b9d6225d2774..29a9a0fe771b 100644
--- a/meta/recipes-bsp/grub/grub-efi_2.04.bb
+++ b/meta/recipes-bsp/grub/grub-efi_2.04.bb
@@ -13,27 +13,13 @@ SRC_URI += " \
S = "${WORKDIR}/grub-${PV}"
-# Determine the target arch for the grub modules
-python __anonymous () {
- import re
- target = d.getVar('TARGET_ARCH')
- prefix = "" if d.getVar('EFI_PROVIDER') == "grub-efi" else "grub-efi-"
- if target == "x86_64":
- grubtarget = 'x86_64'
- elif re.match('i.86', target):
- grubtarget = 'i386'
- elif re.match('aarch64', target):
- grubtarget = 'arm64'
- elif re.match('arm', target):
- grubtarget = 'arm'
- else:
- raise bb.parse.SkipRecipe("grub-efi is incompatible with target %s" % target)
- grubimage = prefix + d.getVar("EFI_BOOT_IMAGE")
- d.setVar("GRUB_TARGET", grubtarget)
- d.setVar("GRUB_IMAGE", grubimage)
- prefix = "grub-efi-" if prefix == "" else ""
- d.setVar("GRUB_IMAGE_PREFIX", prefix)
-}
+GRUB_TARGET = "UNSUPPORTED"
+GRUB_TARGET_x86-64 = "x86_64"
+GRUB_TARGET_x86 = "i386"
+GRUB_TARGET_aarch64 = "arm64"
+GRUB_TARGET_arm = "arm"
+
+GRUB_IMAGE = "grub-efi-${EFI_BOOT_IMAGE}"
inherit deploy
@@ -45,7 +31,7 @@ do_mkimage() {
# Search for the grub.cfg on the local boot media by using the
# built in cfg file provided via this recipe
grub-mkimage -c ../cfg -p ${EFIDIR} -d ./grub-core/ \
- -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} \
+ -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
${GRUB_BUILDIN}
}
@@ -57,7 +43,11 @@ do_mkimage_class-native() {
do_install_append_class-target() {
install -d ${D}${EFI_FILES_PATH}
- install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${D}${EFI_FILES_PATH}/${GRUB_IMAGE}
+ if [ "${EFI_PROVIDER}" = "${BPN}" ] ; then
+ install -m 644 ${B}/${GRUB_IMAGE} ${D}${EFI_FILES_PATH}/${EFI_BOOT_IMAGE}
+ else
+ install -m 644 ${B}/${GRUB_IMAGE} ${D}${EFI_FILES_PATH}/${GRUB_IMAGE}
+ fi
}
do_install_class-native() {
@@ -86,7 +76,7 @@ GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal \
efi_gop iso9660 configfile search loadenv test"
do_deploy() {
- install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${DEPLOYDIR}
+ install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
}
do_deploy_class-native() {
@@ -97,7 +87,7 @@ addtask deploy after do_install before do_build
FILES_${PN} = "${libdir}/grub/${GRUB_TARGET}-efi \
${datadir}/grub \
- ${EFI_FILES_PATH}/${GRUB_IMAGE} \
+ ${EFI_FILES_PATH} \
"
FILES_${PN}_remove_aarch64 = "${libdir}/grub/${GRUB_TARGET}-efi"
--
2.23.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v3 4/5] systemd-boot: replace anonymous function with static configuration
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 ` 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
4 siblings, 0 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>
Replace anonymous function setting GRUB_* variables with static
configuration, since systemd-boot.bbclass will use fixed names for
systemd bootloader.
Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
---
meta/recipes-core/systemd/systemd-boot_243.bb | 23 +++++++------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/meta/recipes-core/systemd/systemd-boot_243.bb b/meta/recipes-core/systemd/systemd-boot_243.bb
index 515abc289bef..5d07177a335c 100644
--- a/meta/recipes-core/systemd/systemd-boot_243.bb
+++ b/meta/recipes-core/systemd/systemd-boot_243.bb
@@ -28,20 +28,9 @@ EXTRA_OEMESON += "-Defi=true \
-Defi-objcopy='${OBJCOPY}' \
"
-# install to the image as boot*.efi if its the EFI_PROVIDER,
-# otherwise install as the full name.
-# This allows multiple bootloaders to coexist in a single image.
-python __anonymous () {
- import re
- target = d.getVar('TARGET_ARCH')
- prefix = "" if d.getVar('EFI_PROVIDER') == "systemd-boot" else "systemd-"
- systemdimage = prefix + d.getVar("EFI_BOOT_IMAGE")
- d.setVar("SYSTEMD_BOOT_IMAGE", systemdimage)
- prefix = "systemd-" if prefix == "" else ""
- d.setVar("SYSTEMD_BOOT_IMAGE_PREFIX", prefix)
-}
+SYSTEMD_BOOT_IMAGE = "systemd-${EFI_BOOT_IMAGE}"
-FILES_${PN} = "${EFI_FILES_PATH}/${SYSTEMD_BOOT_IMAGE}"
+FILES_${PN} = "${EFI_FILES_PATH}"
RDEPENDS_${PN} += "virtual/systemd-bootconf"
@@ -56,12 +45,16 @@ do_compile() {
SYSTEMD_BOOT_EFI_ARCH="x64"
fi
- ninja src/boot/efi/${SYSTEMD_BOOT_IMAGE_PREFIX}${SYSTEMD_BOOT_IMAGE}
+ ninja src/boot/efi/${SYSTEMD_BOOT_IMAGE}
}
do_install() {
install -d ${D}${EFI_FILES_PATH}
- install ${B}/src/boot/efi/systemd-boot*.efi ${D}${EFI_FILES_PATH}/${SYSTEMD_BOOT_IMAGE}
+ if [ "${EFI_PROVIDER}" = "${BPN}" ] ; then
+ install ${B}/src/boot/efi/systemd-boot*.efi ${D}${EFI_FILES_PATH}/${EFI_BOOT_IMAGE}
+ else
+ install ${B}/src/boot/efi/systemd-boot*.efi ${D}${EFI_FILES_PATH}/${SYSTEMD_BOOT_IMAGE}
+ fi
}
do_deploy () {
--
2.23.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v3 5/5] image-uefi.conf: define generic EFI_COMPATIBLE_HOST
2019-10-14 21:50 [PATCH v3 1/5] conf/image-uefi: fix building images for multilib case dbaryshkov
` (2 preceding siblings ...)
2019-10-14 21:50 ` [PATCH v3 4/5] systemd-boot: " dbaryshkov
@ 2019-10-14 21:50 ` dbaryshkov
2019-10-22 19:24 ` [PATCH v3 1/5] conf/image-uefi: fix building images for multilib case Dmitry Eremin-Solenikov
4 siblings, 0 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>
Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
---
meta/conf/image-uefi.conf | 2 ++
1 file changed, 2 insertions(+)
diff --git a/meta/conf/image-uefi.conf b/meta/conf/image-uefi.conf
index 57fd18f02742..6173785d8327 100644
--- a/meta/conf/image-uefi.conf
+++ b/meta/conf/image-uefi.conf
@@ -13,3 +13,5 @@ EFI_FILES_PATH = "${EFI_PREFIX}${EFIDIR}"
require conf/image-uefi.inc
EFI_BOOT_IMAGE ?= "boot${EFI_ARCH}.efi"
+
+EFI_COMPATIBLE_HOST = "(x86_64.*|i.86.*|arm.*|aarch64.*)-linux.*"
--
2.23.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v3 1/5] conf/image-uefi: fix building images for multilib case
2019-10-14 21:50 [PATCH v3 1/5] conf/image-uefi: fix building images for multilib case dbaryshkov
` (3 preceding siblings ...)
2019-10-14 21:50 ` [PATCH v3 5/5] image-uefi.conf: define generic EFI_COMPATIBLE_HOST dbaryshkov
@ 2019-10-22 19:24 ` Dmitry Eremin-Solenikov
4 siblings, 0 replies; 6+ messages in thread
From: Dmitry Eremin-Solenikov @ 2019-10-22 19:24 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer; +Cc: Dmitry Eremin-Solenikov
Hello,
вт, 15 окт. 2019 г. в 00:50, <dbaryshkov@gmail.com>:
>
> 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.
Any updates on these patches? I think all build issues should be fixed now.
--
With best wishes
Dmitry
^ permalink raw reply [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