public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] sdk: Fix build with custom DISTRO when host==target
@ 2024-03-14  7:54 Jan Kiszka
  2024-03-15  8:42 ` Florian Bezdeka
  2024-04-15  9:21 ` Uladzimir Bely
  0 siblings, 2 replies; 6+ messages in thread
From: Jan Kiszka @ 2024-03-14  7:54 UTC (permalink / raw)
  To: isar-users; +Cc: Fabian Scheler

From: Jan Kiszka <jan.kiszka@siemens.com>

HOST_DISTRO is not always the right choice for building an SDK. If the
host arch is identical to the target and DISTRO was customized, there is
no HOST_DISTRO to get the bootstrap from. Account for that.

This issue could have been reproduced e.g by xenomai-images when
selecting an x86 target and requesting to build the SDK for it.

Reported-by: Fabian Scheler <fabian.scheler@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/classes/sdk.bbclass | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
index 74c0acb9..71db6f3a 100644
--- a/meta/classes/sdk.bbclass
+++ b/meta/classes/sdk.bbclass
@@ -44,9 +44,17 @@ SDK_PREINSTALL += " \
     devscripts \
     equivs"
 
+def get_rootfs_distro(d):
+    host_arch = d.getVar('HOST_ARCH')
+    distro_arch = d.getVar('DISTRO_ARCH')
+    if host_arch == distro_arch:
+        return d.getVar('DISTRO')
+    else:
+        return d.getVar('HOST_DISTRO')
+
 # rootfs/image overrides for the SDK
 ROOTFS_ARCH:class-sdk = "${HOST_ARCH}"
-ROOTFS_DISTRO:class-sdk = "${HOST_DISTRO}"
+ROOTFS_DISTRO:class-sdk = "${@get_rootfs_distro(d)}"
 ROOTFS_PACKAGES:class-sdk = "sdk-files ${SDK_TOOLCHAIN} ${SDK_PREINSTALL} ${@isar_multiarch_packages('SDK_INSTALL', d)}"
 ROOTFS_FEATURES:append:class-sdk = " clean-package-cache generate-manifest export-dpkg-status"
 ROOTFS_MANIFEST_DEPLOY_DIR:class-sdk = "${DEPLOY_DIR_SDKCHROOT}"
-- 
2.35.3

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

end of thread, other threads:[~2024-04-15  9:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-14  7:54 [PATCH] sdk: Fix build with custom DISTRO when host==target Jan Kiszka
2024-03-15  8:42 ` Florian Bezdeka
2024-03-22 13:14   ` Uladzimir Bely
2024-04-02 14:58   ` Anton Mikanovich
2024-04-09  6:13     ` Jan Kiszka
2024-04-15  9:21 ` Uladzimir Bely

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