From patchwork Fri Mar 3 10:20:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schmidt, Adriaan" X-Patchwork-Id: 2713 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Fri, 03 Mar 2023 11:20:57 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-wm1-f62.google.com (mail-wm1-f62.google.com [209.85.128.62]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 323AKv17028312 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 3 Mar 2023 11:20:57 +0100 Received: by mail-wm1-f62.google.com with SMTP id u19-20020a05600c00d300b003eb24ce58cesf734135wmm.9; Fri, 03 Mar 2023 02:20:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677838852; cv=pass; d=google.com; s=arc-20160816; b=RBqbEUpBjrRLb9nuemXcBA9USJjTYalJtxDW5DiyO0drrMK7HHUC1r6wjdQj1CjKHE Rz70wFsJeDmMug4CZKKT2mTR3/cI/+pmqwVof+WtU3XxsA+VPSKKtwvQEHRMUSA5I2mN 1chw1wpoDWx6T9ZvJJBPlIO2cI4sr91a6SaCP1/kbDC9y/4XE6Ypcfz/9g0c2ZBPech6 PY3EzGA7ANCONcIS4/oBCbZeFeWMoCmP6vV+hWmpzvG/Xv41t2kSDL9UHqdSRyTcmbds kb6tOy+QSimtumAncKKRH9BXhO0YUbuAYrHW2w6Hilfhaqaz18Bm0l2XAXQ+p2mJQieW /rTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:feedback-id:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=BKFrtsK4AjFthCc17/jyTcGN6cvYYXtEbxpB7cx6jeg=; b=xkmW9S7cNQX1gEsWYhKafJlbWWbvUYGsxwKCflRcK2YpAN7Lj8VFcIv51UtTBKxmPE YQ2A+DSyLg6FCf6SrYi0W88gtqolFw5fxL6VKn8eG3KOfd4DB5b4mrzVmlv+kfikKjbm HCxbWwxT7QgiLjxIgtw7GscJhz7IOTEIwOzDj9BQ4I9Y96u6emLiQRd1uEV12GRxYjTF JJ4aM/9imIeFJ3p69VwarXECG0iqq6wdmqNbulPqwnhcEIql9jst3RP4FuEo/6uP7G7E hRgaW0oI/yeKwIBipkJp6mpoRcSB6vbcH2Q5Hqa/LEe3PI0D5+SGnGhtWYyIY04toSy/ du7w== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b="WvZCN9d/"; spf=pass (google.com: domain of fm-526363-202303031020474ff111b8856d67bf42-uvd6ra@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-526363-202303031020474ff111b8856d67bf42-UVD6Ra@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; t=1677838852; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:feedback-id:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=BKFrtsK4AjFthCc17/jyTcGN6cvYYXtEbxpB7cx6jeg=; b=E0WU/AP1fSfSbric5MGaIuwNK8lWt1qehfISS4ye0lCykLewablKBe3mHLyHOPfV8x KZB7XKR2SDtsQ3eRzHERZFbbE4rf9FE7VXOpkaeFiB7IjNrhi33CCyoH43I7lBpXl28i 3orUeoM6CZKFx4RGffQAEcyaIKISeyhkNKwKiKNIg1zl1yT0DCwjy95WpaSv60zjtUQi UiGt+YuQfxNFZum5S8RxBl7czuzwIX0JXsXX1RYwAbGkpYJx1oc9m1BvzLX5fDMwGmhv iIbluclSu7byvaEAof4PjCtDWyISp6Is/d2EabB61DbWTaGGTnD0xtS2FxoiU9ciLkMq eFxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677838852; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=BKFrtsK4AjFthCc17/jyTcGN6cvYYXtEbxpB7cx6jeg=; b=o2C8VNTJwet/xrhPQAs7nJOHAFSPrqBkt5qCZbpuFK5Vh43sZyA6wZCN4PwO9jsjDG /yqwieOyA9h78U5nzVNwkUE7u7FYQIx28Nim1chsnMfc249azJZ5HsuitSthA5w2O8Qy VEzWE8nWDYHBSjrh08Py4NilWCLKdCmEzU9isbpPe4fM0y9uNRJly3M13SbNmldIleYz Pe3v/Yk8Y5ytnvm9oqvPMUyK+zuySAexwbjzssFj9RFGcyGNqKiblG5JZs+9/UXWEdSZ s6yHrydbtV4iXQQ9XKaKASp/u19rXmGSdn5gf+tDDWJUaUpUbH0ilSTgj4DKhpWcbw2+ nAdA== Sender: isar-users@googlegroups.com X-Gm-Message-State: AO0yUKUSACrzF4ByuDDubNOzCNlIYUE5LQ7W45fTEuJQJZUS5MSxaevI k1dMTEi6AlIDqBAsnQpBsjw= X-Google-Smtp-Source: AK7set8WwVzjh2Y5PDMIY81xqP3rwYV7o6Smb/ozqdKRtSbyw7Ix8FQpR0AG07A929kCTrh5RmSl5Q== X-Received: by 2002:a05:600c:a695:b0:3e2:1a3f:4ea2 with SMTP id ip21-20020a05600ca69500b003e21a3f4ea2mr272405wmb.7.1677838851944; Fri, 03 Mar 2023 02:20:51 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6000:1842:b0:2c5:55ca:3a3b with SMTP id c2-20020a056000184200b002c555ca3a3bls3607622wri.1.-pod-prod-gmail; Fri, 03 Mar 2023 02:20:50 -0800 (PST) X-Received: by 2002:a5d:4001:0:b0:2cc:be:be0 with SMTP id n1-20020a5d4001000000b002cc00be0be0mr848713wrp.41.1677838850532; Fri, 03 Mar 2023 02:20:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677838850; cv=none; d=google.com; s=arc-20160816; b=MY+If5z+vvWH/AgCxCIpuCw1V1sn4YyKdxQsJV6tK2iLRV1ZnOyloMrTIfd3BzKYHc 8kXwfkFvrnVOme9z6UVSGHuezIPzk7zJmD63i9WNMFWv71vUhqnZ+SZ818brXFg7rhKF Ii3KwklMzHiUUvfH0Ls7HOOX6xW47Q8j/SIaiFQ+1xyAcd5mAkkrydITKoRDo18J45P7 Ky0+50Ftms6XYdaVURA9Hc+h5cPeZt3GKIDs2jHOADC7meUD0EJHzsHL/a9NWY1S32Bp N5LWp9bnteQtY8Dof7Dor4POKGg7tqbwg6YcgPdK8tOPI4yPA/paHkTdw0XNK2hzQFH2 FRxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=af3spI14J16s5Kw4UXhT7+eK2OnfoHm7r7HjqaghG4w=; b=V8eENIxrLuFnQJOxpv5ar7Qo9KBcsLLPDQWvpzZhySiDlfc/ssTKTrciU0mI/xQ2Or ZdodpnESqwZXeLVv2eA7I51qZiUckJ/5OrZsDSEe7D41rHD60cTPVxKzTAJ6SdJCa7FW n1G0L72jmKyh93LhKKcKTInkaueH6XfadxzUwnEaUYZGaP1bI9vJfwMDQ6NVdw+Xacqo hRrK7vTe25Qf6oWzD0EXM5dHKhRy2qHdDb+E0UL55HiTC/Qiv7+tpBLbsxxWj6XV4oIQ aQeQvpoVIBAOF/IYxZUPIE0k3iOxgvbF1m6FTu3nBJAtNyME2zqj58eiJIAZ7Ov1rOMP qfXA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b="WvZCN9d/"; spf=pass (google.com: domain of fm-526363-202303031020474ff111b8856d67bf42-uvd6ra@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-526363-202303031020474ff111b8856d67bf42-UVD6Ra@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mta-64-225.siemens.flowmailer.net (mta-64-225.siemens.flowmailer.net. [185.136.64.225]) by gmr-mx.google.com with ESMTPS id ba19-20020a0560001c1300b002c6eaaaac82si71944wrb.7.2023.03.03.02.20.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Mar 2023 02:20:50 -0800 (PST) Received-SPF: pass (google.com: domain of fm-526363-202303031020474ff111b8856d67bf42-uvd6ra@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) client-ip=185.136.64.225; Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 202303031020474ff111b8856d67bf42 for ; Fri, 03 Mar 2023 11:20:48 +0100 From: Adriaan Schmidt To: isar-users@googlegroups.com Cc: Adriaan Schmidt Subject: [PATCH v4 2/4] add multiarch support Date: Fri, 3 Mar 2023 11:20:43 +0100 Message-Id: <20230303102045.4140027-3-adriaan.schmidt@siemens.com> In-Reply-To: <20230303102045.4140027-1-adriaan.schmidt@siemens.com> References: <20230303102045.4140027-1-adriaan.schmidt@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-526363:519-21489:flowmailer X-Original-Sender: adriaan.schmidt@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b="WvZCN9d/"; spf=pass (google.com: domain of fm-526363-202303031020474ff111b8856d67bf42-uvd6ra@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-526363-202303031020474ff111b8856d67bf42-UVD6Ra@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= This adds support for building packages for native and compat architectures to dpdk-base.bbclass. Thus, all package recipes automatically have a *-native and *-compat target, which can be used in DEPENDS/RDEPENDS definitions. Additionally those targets can be used in IMAGE_INSTALL, where they are automatically converted to install the correct debian package: foo-compat -> foo:${COMPAT_DISTRO_ARCH} foo-native -> foo:${HOST_ARCH} Note that the switch ISAR_ENABLE_COMPAT_ARCH still exist and controls addition of the compat architecture during bootstrapping. Signed-off-by: Adriaan Schmidt --- .../recipes-app/samefile/samefile_2.14.bb | 2 +- meta/classes/compat.bbclass | 40 +++++++++ meta/classes/debianize.bbclass | 2 +- meta/classes/dpkg-base.bbclass | 1 + meta/classes/image.bbclass | 4 +- meta/classes/multiarch.bbclass | 88 +++++++++++++++++++ meta/classes/native.bbclass | 10 +++ meta/classes/sdk.bbclass | 2 +- meta/conf/bitbake.conf | 1 + .../isar-bootstrap/isar-bootstrap.inc | 2 + .../sbuild-chroot/sbuild-chroot.inc | 14 +-- 11 files changed, 156 insertions(+), 10 deletions(-) create mode 100644 meta/classes/compat.bbclass create mode 100644 meta/classes/multiarch.bbclass create mode 100644 meta/classes/native.bbclass diff --git a/meta-isar/recipes-app/samefile/samefile_2.14.bb b/meta-isar/recipes-app/samefile/samefile_2.14.bb index 5e36a2ac..c53c9445 100644 --- a/meta-isar/recipes-app/samefile/samefile_2.14.bb +++ b/meta-isar/recipes-app/samefile/samefile_2.14.bb @@ -21,7 +21,7 @@ do_prepare_build() { # deb_debianize. Pre-exisiting files will not be recreated, changelog # will be prepended unless its latest entry is for CHANGELOG_V. cat << EOF > ${WORKDIR}/changelog -${PN} (0.1) unstable; urgency=low +${BPN} (0.1) unstable; urgency=low * a long long time ago there was an early version diff --git a/meta/classes/compat.bbclass b/meta/classes/compat.bbclass new file mode 100644 index 00000000..f0a23b6b --- /dev/null +++ b/meta/classes/compat.bbclass @@ -0,0 +1,40 @@ +# This software is a part of ISAR. +# Copyright (C) 2023 Siemens AG +# +# SPDX-License-Identifier: MIT + +# this class is "dual-use": it can be inherited (e.g., by bootstrap and image +# classes) to access variables and functions, and it's also added via BBCLASSEXTEND +# when inheriting multiconfig.bbclass. + +################################################################################ +# generic functions +################################################################################ + +# determine COMPAT_DISTRO_ARCH and ISAR_ENABLE_COMPAT_ARCH +# this must always use the DISTRO_ARCH override (not PACKAGE_ARCH), so needs +# to happen in a modified environment +python() { + distro_arch = d.getVar('DISTRO_ARCH') + package_arch = d.getVar('PACKAGE_ARCH') + overrides = d.getVar('OVERRIDES').split(':') + + localdata = bb.data.createCopy(d) + new_overrides = [distro_arch] + [o for o in overrides if not o == package_arch] + localdata.setVar('OVERRIDES', ':'.join(new_overrides)) + isar_enable_compat_arch = localdata.getVar('ISAR_ENABLE_COMPAT_ARCH') + compat_distro_arch = localdata.getVar('COMPAT_DISTRO_ARCH') + + d.setVar('COMPAT_DISTRO_ARCH', compat_distro_arch) + d.setVar('ISAR_ENABLE_COMPAT_ARCH', isar_enable_compat_arch) +} + +def isar_can_build_compat(d): + return (d.getVar('COMPAT_DISTRO_ARCH') is not None and + d.getVar('ISAR_ENABLE_COMPAT_ARCH') == '1') + +################################################################################ +# package recipe modifications when building *-compat: +################################################################################ + +PACKAGE_ARCH:class-compat = "${COMPAT_DISTRO_ARCH}" diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass index a6694a00..1b98c02d 100644 --- a/meta/classes/debianize.bbclass +++ b/meta/classes/debianize.bbclass @@ -31,7 +31,7 @@ deb_add_changelog() { date=$(LANG=C date -R -d @${timestamp}) cat < ${S}/debian/changelog -${PN} (${changelog_v}) UNRELEASED; urgency=low +${BPN} (${changelog_v}) UNRELEASED; urgency=low * generated by Isar diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass index ad28f7b3..55cc6655 100644 --- a/meta/classes/dpkg-base.bbclass +++ b/meta/classes/dpkg-base.bbclass @@ -5,6 +5,7 @@ # SPDX-License-Identifier: MIT inherit sbuild +inherit multiarch inherit debianize inherit terminal inherit repository diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index ef7d5a2a..ce7c549c 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -79,9 +79,11 @@ image_do_mounts() { buildchroot_do_mounts } +inherit multiarch + ROOTFSDIR = "${IMAGE_ROOTFS}" ROOTFS_FEATURES += "clean-package-cache clean-pycache generate-manifest export-dpkg-status clean-log-files clean-debconf-cache" -ROOTFS_PACKAGES += "${IMAGE_PREINSTALL} ${IMAGE_INSTALL}" +ROOTFS_PACKAGES += "${IMAGE_PREINSTALL} ${@isar_multiarch_packages('IMAGE_INSTALL', d)}" ROOTFS_MANIFEST_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}" ROOTFS_DPKGSTATUS_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}" ROOTFS_PACKAGE_SUFFIX ?= "${PN}-${DISTRO}-${MACHINE}" diff --git a/meta/classes/multiarch.bbclass b/meta/classes/multiarch.bbclass new file mode 100644 index 00000000..c1846ab0 --- /dev/null +++ b/meta/classes/multiarch.bbclass @@ -0,0 +1,88 @@ +# This software is a part of ISAR. +# Copyright (C) 2021-2022 Siemens AG +# +# SPDX-License-Identifier: MIT + +BPN = "${PN}" + +inherit compat +python() { + # provide compat only when we can build it + if isar_can_build_compat(d): + d.appendVar('BBCLASSEXTEND', ' compat') + + # build native separately only when it differs from the target variant + if d.getVar('HOST_ARCH') == d.getVar('DISTRO_ARCH'): + pn = d.getVar('PN') + if not pn.endswith('-native') and not pn.endswith('-compat'): + provides = (d.getVar('PROVIDES') or '').split() + for p in provides: + d.appendVar('PROVIDES', f' {p}-native') + d.appendVar('PROVIDES', f' {pn}-native') + else: + d.appendVar('BBCLASSEXTEND', ' native') +} + +python multiarch_virtclass_handler() { + # In compat/native builds, ${PN} includes the -compat/-native suffix, + # so recipe-writers need to be careful when using it. Most of the time, + # they probably want to use ${BPN}, and in general, it's their responsibility + # to do so. If they don't, then it's ok for the build of the compat/native + # variant to fail. However, some variables are evaluated at parse time, + # and this will break the recipe even when compat/native is not requested. + # e.g., SRC_URI="file://${PN}" will try to checksum the local file at + # parse time, and parsing always happens for all build variants. So in those + # few variables, we automatically replace ${PN} with ${BPN}. + def fixup_pn_in_vars(d): + vars = 'SRC_URI FILESPATH'.split() + for var in vars: + v = d.getVar(var, expand=False) + if v is not None: + d.setVar(var, v.replace('${PN}', '${BPN}')) + + # When building compat/native, the corresponding suffix needs to be + # propagated to all bitbake dependency definitions. + def fixup_depends(suffix, d): + vars = 'PROVIDES RPROVIDES DEPENDS RDEPENDS'.split() + for var in vars: + multiarch_var = [] + val = d.getVar(var) + if val is None: + continue + for v in val.split(): + if v.endswith('-compat') or v.endswith('-native'): + multiarch_var.append(v) + else: + multiarch_var.append(v + suffix) + d.setVar(var, ' '.join(multiarch_var)) + + pn = e.data.getVar('PN') + if pn.endswith('-compat'): + e.data.setVar('BPN', pn[:-len('-compat')]) + e.data.appendVar('OVERRIDES', ':class-compat') + fixup_pn_in_vars(e.data) + fixup_depends('-compat', e.data) + elif pn.endswith('-native'): + e.data.setVar('BPN', pn[:-len('-native')]) + e.data.appendVar('OVERRIDES', ':class-native') + fixup_pn_in_vars(e.data) + fixup_depends('-native', e.data) +} +addhandler multiarch_virtclass_handler +multiarch_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise" + +# function to convert bitbake targets to installable debian packages, +# e.g., "hello-compat" to "hello:i386". +def isar_multiarch_packages(var, d): + bb_targets = (d.getVar(var) or '').split() + packages = [] + compat_distro_arch = d.getVar('COMPAT_DISTRO_ARCH') + host_arch = d.getVar('HOST_ARCH') + for t in bb_targets: + if t.endswith('-compat') and compat_distro_arch is not None: + packages.append(t[:-len('-compat')] + ':' + compat_distro_arch) + elif t.endswith('-native'): + packages.append(t[:-len('-native')] + ':' + host_arch) + else: + packages.append(t) + return ' '.join(packages) diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass new file mode 100644 index 00000000..d2581ac1 --- /dev/null +++ b/meta/classes/native.bbclass @@ -0,0 +1,10 @@ +# This software is a part of ISAR. +# Copyright (C) 2023 Siemens AG +# +# SPDX-License-Identifier: MIT + +################################################################################ +# package recipe modifications when building *-native: +################################################################################ + +PACKAGE_ARCH:class-native = "${HOST_ARCH}" diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass index 01eb3a67..da8f6c89 100644 --- a/meta/classes/sdk.bbclass +++ b/meta/classes/sdk.bbclass @@ -58,7 +58,7 @@ python __anonymous() { # rootfs/image overrides for the SDK ROOTFS_ARCH:class-sdk = "${HOST_ARCH}" ROOTFS_DISTRO:class-sdk = "${HOST_DISTRO}" -ROOTFS_PACKAGES:class-sdk = "sdk-files ${TOOLCHAIN} ${SDK_PREINSTALL} ${SDK_INSTALL}" +ROOTFS_PACKAGES:class-sdk = "sdk-files ${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}" ROOTFS_DPKGSTATUS_DEPLOY_DIR:class-sdk = "${DEPLOY_DIR_SDKCHROOT}" diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 05ccb7b8..dd21319a 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -81,6 +81,7 @@ QEMU_ARCH:riscv64 = "riscv64" # Codename of the repository created by the caching class DEBDISTRONAME ?= "isar" +NATIVELSBSTRING ?= "isarnative" # Strings used in sstate signature files TARGET_VENDOR = "" diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index 99d75e21..21a2d92f 100644 --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -274,6 +274,8 @@ do_bootstrap[dirs] = "${DEPLOY_DIR_BOOTSTRAP}" do_bootstrap[depends] = "base-apt:do_cache isar-apt:do_cache_config" do_bootstrap[network] = "${TASK_USE_NETWORK_AND_SUDO}" +inherit compat + do_bootstrap() { if [ "${ISAR_ENABLE_COMPAT_ARCH}" = "1" ]; then if [ -z "${COMPAT_DISTRO_ARCH}" ]; then diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc index fb061dac..fd8bb648 100644 --- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc +++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc @@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://${LAYERDIR_core}/licenses/COPYING.GPLv2;md5=751419260 PV = "1.0" inherit rootfs +inherit compat python() { distro_gcc = d.getVar('DISTRO_GCC') @@ -20,18 +21,19 @@ python() { d.appendVar('SBUILD_CHROOT_PREINSTALL_COMMON', ' libstdc++-{}-dev:{}'.format(distro_gcc, distro_arch)) - if d.getVar('ISAR_ENABLE_COMPAT_ARCH') == '1': - compat_arch = d.getVar('COMPAT_DISTRO_ARCH') + if d.getVar('ISAR_ENABLE_COMPAT_ARCH') == '1': + compat_arch = d.getVar('COMPAT_DISTRO_ARCH') + d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL', + ' libc6-dev:{}'.format(compat_arch)) + d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL', + ' crossbuild-essential-{}'.format(compat_arch)) + if d.getVar('DISTRO_GCC'): d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL', ' libgcc-{}-dev:{}'.format(distro_gcc, compat_arch)) d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL', ' libstdc++-{}-dev:{}'.format(distro_gcc, compat_arch)) } -SBUILD_CHROOT_COMPAT_PREINSTALL:compat-arch = " \ - libc6-dev:${COMPAT_DISTRO_ARCH} \ - crossbuild-essential-${COMPAT_DISTRO_ARCH}" - SBUILD_CHROOT_PREINSTALL_COMMON = " \ ${SBUILD_CHROOT_COMPAT_PREINSTALL} \ libc6-dev:${DISTRO_ARCH} \