diff mbox series

[isar-cip-core,3/4] efibootguard: Fix non-x86 builds

Message ID 0d3861a36a20b7934d71608a9de4fa210df1b392.1647849560.git.jan.kiszka@siemens.com (mailing list archive)
State Handled Elsewhere
Headers show
Series Fix EFI Boot Guard for aarch64 | expand

Commit Message

Jan Kiszka March 21, 2022, 7:59 a.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

The libc6-dev-i386 package is obviously x86-only.

Furthermore, the installation path must use DEB_HOST_MULTIARCH in order
to drop libebgenv.a in the right folder. This might have been already
broken for i386. As we still support buster, templating is needed to
translate DEB_HOST_MULTIARCH. This would just work with bullseye and
compat level 13 + dh-exec.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 recipes-bsp/efibootguard/efibootguard_0.10.bb    | 16 +++++++++++++---
 ...dev.install => efibootguard-dev.install.tmpl} |  3 +--
 2 files changed, 14 insertions(+), 5 deletions(-)
 rename recipes-bsp/efibootguard/files/debian/{efibootguard-dev.install => efibootguard-dev.install.tmpl} (50%)
diff mbox series

Patch

diff --git a/recipes-bsp/efibootguard/efibootguard_0.10.bb b/recipes-bsp/efibootguard/efibootguard_0.10.bb
index 7d09c85..b0877d0 100644
--- a/recipes-bsp/efibootguard/efibootguard_0.10.bb
+++ b/recipes-bsp/efibootguard/efibootguard_0.10.bb
@@ -26,12 +26,22 @@  PROVIDES = "${PN}"
 PROVIDES += "${PN}-dev"
 
 DEPENDS = "python3-shtab"
-BUILD_DEB_DEPENDS = "dh-exec,gnu-efi,libpci-dev,check,pkg-config,libc6-dev-i386,python3-shtab"
+BUILD_DEB_DEPENDS = "dh-exec,gnu-efi,libpci-dev,check,pkg-config,python3-shtab"
+BUILD_DEB_DEPENDS_append_amd64 = ",libc6-dev-i386"
+BUILD_DEB_DEPENDS_append_i386 = ",libc6-dev-i386"
 
 inherit dpkg
 
-TEMPLATE_FILES = "debian/control.tmpl"
-TEMPLATE_VARS += "DESCRIPTION_DEV BUILD_DEB_DEPENDS"
+# needed for buster, bullseye could use compat >= 13
+python() {
+    arch = d.getVar('DISTRO_ARCH')
+    cmd = 'dpkg-architecture -a {} -q DEB_HOST_MULTIARCH'.format(arch)
+    with os.popen(cmd) as proc:
+        d.setVar('DEB_HOST_MULTIARCH', proc.read())
+}
+
+TEMPLATE_FILES = "debian/control.tmpl debian/efibootguard-dev.install.tmpl"
+TEMPLATE_VARS += "DESCRIPTION_DEV BUILD_DEB_DEPENDS DEB_HOST_MULTIARCH"
 
 do_prepare_build() {
     cp -R ${WORKDIR}/debian ${S}
diff --git a/recipes-bsp/efibootguard/files/debian/efibootguard-dev.install b/recipes-bsp/efibootguard/files/debian/efibootguard-dev.install.tmpl
similarity index 50%
rename from recipes-bsp/efibootguard/files/debian/efibootguard-dev.install
rename to recipes-bsp/efibootguard/files/debian/efibootguard-dev.install.tmpl
index 7b45bd8..948019a 100644
--- a/recipes-bsp/efibootguard/files/debian/efibootguard-dev.install
+++ b/recipes-bsp/efibootguard/files/debian/efibootguard-dev.install.tmpl
@@ -1,3 +1,2 @@ 
 include/ebgenv.h usr/include/efibootguard
-libebgenv.a usr/lib/x86_64-linux-gnu
-
+libebgenv.a usr/lib/${DEB_HOST_MULTIARCH}