conf/image-uefi: fix building images for multilib case
PATCH 1/1 conf/image-uefi: fix building images for multilib case
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.
--- 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
meta/conf/image-uefi.conf +5 -6
@@ -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"
meta/conf/image-uefi.inc new file +23 -0
@@ -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) +} + +
Signature · 1 line
2.23.0
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
Quoted 62 lines · 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
meta/conf/image-uefi.conf +5
-6@@ -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"meta/conf/image-uefi.inc new file +23
-0@@ -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) +} + +
PATCH 1/1 multilib.conf: add systemd-boot to non-multilib recipes list
From: Dmitry Eremin-Solenikov <[email protected]>
Add systemd-boot to NON_MULTILIB_RECIPES so that it won't be built for multilib targets.
--- meta/conf/multilib.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/multilib.conf +1 -1
@@ -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"
Signature · 1 line
2.23.0