From patchwork Fri Feb 24 14:24:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schmidt, Adriaan" X-Patchwork-Id: 2700 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Fri, 24 Feb 2023 15:24:43 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-lj1-f189.google.com (mail-lj1-f189.google.com [209.85.208.189]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 31OEOg7e025835 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 Feb 2023 15:24:42 +0100 Received: by mail-lj1-f189.google.com with SMTP id b30-20020a05651c0b1e00b002959c2fb94fsf2471905ljr.20; Fri, 24 Feb 2023 06:24:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677248677; cv=pass; d=google.com; s=arc-20160816; b=umYgbtlArGVHzvZVG4ZHCvIviwhVt1mjuhXr53B92jiJb31bL/7ujjGU4nVaF2f//m BtwvF40DUEhBc7D8K4kbrxIWOB+3Dist/AJVWAfkRtmnWNa38zKP4H23phNzYwWsUB9s wH8XQWfHsZ083P4XxiejwIv0LrLQ6zHHvHymXG/XYDobDr3VmKSyAIuTBiIV8qk1ak0E Nn59kMfmlCoO6BHte8C2UgZmq/EN0KTG9LektMdf448hUE/jk4ETNpixsFLbzoGF+c5n TzdTy+PPVAvv6PHrBSuHybVI9idOhETT0e1Xx/qG5+49XcZ+6dffl8RvxypDG68pWFRr b68A== 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=PDy0oYBj9ZJoj8GOu4pmM7SzUqCXxcmimWjjno5MG5M=; b=EmTKFa6e+W1LA8uKaIGMnKIHIlORySxNWcPu30nUL8QmjGazWoWNia+6ujvzQRiRv5 ywjU7xs7lzV2rS3PQgTJgVNphG41A9V8CYo1B9bKrUhi3XQLU6QljlBlSF/XRQiQRh9/ Y7ORaSrhgT/5IAJK/fcQTcJGmLMrsADe0z+1RZehELXL+sqbOYZm9sXgBIRadqbkX08I mB4Yp6ABefnynAtzY0tAvHzuyTKFhOPpZWRMoOGG9vbRTGpQYqwUx54jVL/W76Squ7hV aRMNLIH0MPtECS3btaMQEOM2hT361fX+L1ceFnmHGvAHWNDs58E/jajsIOlXwESXTWNd WQdA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=LWnV9P7v; spf=pass (google.com: domain of fm-526363-20230224142434f49d0face41f4cc11d-wdmouh@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-526363-20230224142434f49d0face41f4cc11d-wdMoUH@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; 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=PDy0oYBj9ZJoj8GOu4pmM7SzUqCXxcmimWjjno5MG5M=; b=F0iEBwOB+ZOXcnlAg8uVbuBLFo7yL2VetdcaeBcnIyBJIjDHtwDciX3N+KqQe6ilEh G67SFr2UlcY2dALAY1dDIixWm/Tnj9ZEy9wrwV9UXvvBMlodzAvpupIITeEN8eOz8/Yg xiD5tx0n/qb60deYIqCVpl7hmJrQbJKkCBQ0UjiFcerjltKpSUg2LP6qYYL9VUPMh6ck vqOMs8HWN2lWl2q5tTSq2NQrRLznlZj7Yv9joplvWGv6l81GSG2YYOV8cZRd2ZfictHw SDMgUAqJDBy1mvLSyoBwSvIneDficEYrZTNrDeolfTtQCpcF/FbYAyG08n9MyFcD3qWA Er/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=PDy0oYBj9ZJoj8GOu4pmM7SzUqCXxcmimWjjno5MG5M=; b=GlBQaAvGhSkG3U9dQbF3zBx5rsozV0ZGUWcBowR9SRFXjtFTCgTCSDxmPsaPN+z6e3 zPti2mW579DGdkc7kbSi5p6PMkxFXSwM0qvr14r+kbJpaLK1zxNYRMHgr1Vo86jNShi4 h34rWzSrJwhJRFWrnDGySoacStUh5yzV9b+AER0VURKghwgODO153pcUM5kZm7DSBnjs s7c3gYRM/OWoaKXK0f7V9DIf1DW6yUelCrz5QsbVh+ZbG+Tuh1AyCOD0FAVJDnWdfjh4 dabvhL3Hgxdeux7AQ9lDyfJeCXexlDvcUgDb2/R6E5OqFCA3F/eVlYi5J5nu9ucGwI+z FKlw== Sender: isar-users@googlegroups.com X-Gm-Message-State: AO0yUKVrMr85151TuSNclQSkCawub25P84I23bfEVG+x+KBcXifXPSfd OUhOQYOrIR5PxvO4XrRzFyE= X-Google-Smtp-Source: AK7set90l4rbI07O9PH+9wb04M0yTyC67isS8IDOB4dckP8c6+ldWJGSWlrNAkz4NeefxiLUobu1hA== X-Received: by 2002:ac2:4a6a:0:b0:4dc:807a:d14a with SMTP id q10-20020ac24a6a000000b004dc807ad14amr4926097lfp.9.1677248676775; Fri, 24 Feb 2023 06:24:36 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:651c:211b:b0:295:a2a6:79c with SMTP id a27-20020a05651c211b00b00295a2a6079cls501122ljq.11.-pod-prod-gmail; Fri, 24 Feb 2023 06:24:35 -0800 (PST) X-Received: by 2002:a05:651c:b28:b0:295:a3a5:3b79 with SMTP id b40-20020a05651c0b2800b00295a3a53b79mr1352241ljr.13.1677248675272; Fri, 24 Feb 2023 06:24:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677248675; cv=none; d=google.com; s=arc-20160816; b=dTJgI4yEIfNEIOa1qrvHsCPdhB4qM+9yqqiCNXRT4R4mDId6Y1ueNXKvTKasg2yI8H NpXlSG0PFyILQ4OD8bOB3p08VIIomtCm32TddF85RBNvEGEygy4iqHK4aVQgchfBVxDL DQBw44WJOYOlRutduDCKi0Hz5en4inw1oD2Izg61iMHsFAq6NwmyTxrtZS4Ymagad9K6 GDFybTUr5f7EwPLgOEcMKmPWZB6Qk5C9COP3ovBXRaH55GrWS0pjpO5ROTRqLO+PLPhp T5PxGKonvOuAeU/R2HfxuzNO7GByh4mDJx+tWfY9C/HhQnZS4M04z3ChTXlevDj9Wolk Qsew== 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=5YzTe7YeTI4jO1O/L6pU9bm/IuPQDXsRgM6p+2Ct11o=; b=IIaTTa+h0k0ZaKn9d1WjeL001X/EdJOlqFcgv19cKy46DBTTelyDbD3lhFghTk7KUs gvWzCTQjIUJ+X1zxkWhqD1AQkX5wxOdI4rvJPLSsjYQPpUGrfYnNbOkIjLPqm0qGxrgT g6ZG0TsGR/T0u23pTYc8Yaj53kRPZTugVsrPJLZMZh2h9KVCkFFnECRwnrjx5DUQnwLi nugNe8RnFDSdpRTwxtiPcx1XpAT5Ofe9cC+jmN5rScsMUFPcCceBKrJa9kWkmtPpb57t 8UfuDbRsZVj+M141QcnclKT1Um0mSAfhMIv83FYWKW9sOhlJiPL2/xiAUQS8L0E4Dg+j F87w== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=LWnV9P7v; spf=pass (google.com: domain of fm-526363-20230224142434f49d0face41f4cc11d-wdmouh@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-526363-20230224142434f49d0face41f4cc11d-wdMoUH@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net. [185.136.64.227]) by gmr-mx.google.com with ESMTPS id z12-20020a2e884c000000b0029599709f7bsi353260ljj.2.2023.02.24.06.24.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Feb 2023 06:24:35 -0800 (PST) Received-SPF: pass (google.com: domain of fm-526363-20230224142434f49d0face41f4cc11d-wdmouh@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) client-ip=185.136.64.227; Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 20230224142434f49d0face41f4cc11d for ; Fri, 24 Feb 2023 15:24:34 +0100 From: Adriaan Schmidt To: isar-users@googlegroups.com Cc: Adriaan Schmidt Subject: [PATCH v3 2/4] add multiarch support Date: Fri, 24 Feb 2023 15:24:30 +0100 Message-Id: <20230224142432.3767746-3-adriaan.schmidt@siemens.com> In-Reply-To: <20230224142432.3767746-1-adriaan.schmidt@siemens.com> References: <20230224142432.3767746-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=LWnV9P7v; spf=pass (google.com: domain of fm-526363-20230224142434f49d0face41f4cc11d-wdmouh@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-526363-20230224142434f49d0face41f4cc11d-wdMoUH@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..1ca3e960 --- /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 +################################################################################ + +# calculate 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', True) + package_arch = d.getVar('PACKAGE_ARCH', True) + overrides = d.getVar('OVERRIDES', True).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', True) + compat_distro_arch = localdata.getVar('COMPAT_DISTRO_ARCH', True) + + 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', True) is not None and + d.getVar('ISAR_ENABLE_COMPAT_ARCH', True) == '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..21a4f610 --- /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', True) == d.getVar('DISTRO_ARCH', True): + pn = d.getVar('PN', True) + if not pn.endswith('-native') and not pn.endswith('-compat'): + provides = (d.getVar('PROVIDES', True) 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, 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, True) + 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, True) or '').split() + packages = [] + compat_distro_arch = d.getVar('COMPAT_DISTRO_ARCH', True) + host_arch = d.getVar('HOST_ARCH', True) + 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 0a98ea04..bfd47d0e 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} \