From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7065369477208080384 X-Received: by 2002:a2e:a270:0:b0:245:f51f:354 with SMTP id k16-20020a2ea270000000b00245f51f0354mr5700620ljm.497.1645185661362; Fri, 18 Feb 2022 04:01:01 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:651c:1a29:b0:241:e1a:5f4f with SMTP id by41-20020a05651c1a2900b002410e1a5f4fls1324850ljb.6.gmail; Fri, 18 Feb 2022 04:01:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyigBCvZqfZcyo+937xTcKG8/H7XR8aublZTtLA18TnsJZD7d/i1KIGHzjSCEY4XchVD8Wu X-Received: by 2002:a2e:8798:0:b0:244:d49b:956a with SMTP id n24-20020a2e8798000000b00244d49b956amr5434324lji.420.1645185660201; Fri, 18 Feb 2022 04:01:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645185660; cv=none; d=google.com; s=arc-20160816; b=ALT8MhADPv4VCXbd0lL+KCuZsxnibLYsayyzXPL36nBTDXFc2L4sRe0IXXFI7plb0z K0NDCk3+W9y63a58IRKy/zk8P5ZkPWSnnA9v6s8IhfYZ5yQU3bodWeQ1z51/IH+pfkd/ iJiA4LWOoiCEJYa23uAoUM1/ZCowWVMpLyiaqjwTvv5p1RGBk2DhcwOZBVGo2HiPS02v RXSvcOontXDNcrGLP/A966hHmP1XXUWZBYZbopo0EPvA2g9vu25wSPm9Lgo8J9MFiAv/ tUvSyJBI2Lf79XGVjU2h883J+ZGpF8LgC8gOBDwFHkB70K9mzkQsUzBWuxtY30+5z2DG MwYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=NXmHiI985KGPKY9IIn06BclyIYLc4eZpRXzayhrdebk=; b=qX3zwcTRVoBaYcMvVmGe/vr+7OWSkJGZPx5shHqkNivqztGK0BaR3+Zm/0gRGpfakT wgMhdjAVuN5AWDUXp/lFIL7/DwC7aB27ttzc6OUwdIcLNZBHd/xs3CPugwUCtUVVY6dC Mk45/UDzlXOdcr7XOD1k00Imr1XJcm5pM1fzQa5cGLCTYd2tffNC5Dgdno99m4BVadl2 vDFgfdUj3Zpz0ZKlS8JKOkxMoSqHD9OC5X2Bpfr+i0/r7WDj4Z5b7nB1s4XvSbO5KSCX rJWlcXk86aHqhms5L24tU2V/wtTu78J60Rs+IdJkf7KWhd9vm1WO0SfjSESseRFvjxU7 xhYw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=S8iCfGWS; spf=pass (google.com: domain of vijaikumar.kanagarajan@gmail.com designates 2a00:1450:4864:20::431 as permitted sender) smtp.mailfrom=vijaikumar.kanagarajan@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com. [2a00:1450:4864:20::431]) by gmr-mx.google.com with ESMTPS id u2si139934lfo.11.2022.02.18.04.01.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 04:01:00 -0800 (PST) Received-SPF: pass (google.com: domain of vijaikumar.kanagarajan@gmail.com designates 2a00:1450:4864:20::431 as permitted sender) client-ip=2a00:1450:4864:20::431; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=S8iCfGWS; spf=pass (google.com: domain of vijaikumar.kanagarajan@gmail.com designates 2a00:1450:4864:20::431 as permitted sender) smtp.mailfrom=vijaikumar.kanagarajan@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: by mail-wr1-x431.google.com with SMTP id d27so14180089wrc.6 for ; Fri, 18 Feb 2022 04:01:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NXmHiI985KGPKY9IIn06BclyIYLc4eZpRXzayhrdebk=; b=S8iCfGWSZ4CAFdpAv99QjDv/fkXK7uE8bJ6FJjTRVcFLqeHwu1KmjvPxJBBAG10lQZ xaqKdOqsNJa3DaUDqYY7QQqKQQQwlsvV0FOKWwcAa4SDZhmcFbUirvGAylJIV9iPoqhr 5SvGM9nna3KdpIrTu4/l+0kFC5Os2kHalo/zu+1Mm/mq7UwtmRipcMTtAtZ65d7oAx9P G1yc2rVcFQ6DyXgJbzucC/4a9uuY8bSJyhPZlmYlfRwI6h04lxM9US6VsaloOPPMS+8u SWXe9s1V7vnMWiv7iw+t6Lt6IGkXF1Yo0ALLyBFr95v/M/+wdpEZUw8ZmjCyp5MmPiaH XAag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NXmHiI985KGPKY9IIn06BclyIYLc4eZpRXzayhrdebk=; b=xrL1+QKkXmUc00q0MkzMlC+SJOr5AYOuiLujyXOEBVC8Co0PFTERaivhVF37+I6IJy wbqcfa0t6f4+QznvUc5t7eGM7YgEMqLms17HOSfmvh0Yjv7HFki23/NDk5+/RTJgjXSa /i7YX/AUgGDKVdVmtGF5ZCh+09pJhtIrubJKWjQKpZGHYuciRgwZSeEcwlTtSMTwSFuD eaLVr4LY2KgK3EkMu167M48ywR3wjqaeca8Zbj23kD2EG9wLxb76PK5wdmqZAkhxkSc5 6NNxkgyyJe7mvstXpbji16aQD2rv0FrxH9IpnlvL+96JJfK2dSfvVXMImE3zyHd+A7HH 6WWA== X-Gm-Message-State: AOAM531R8a6gkWp5sjOC8RuQVZ2PR8NC0Dbmi/f8GFirfc2bhQvJ1dhZ kDEJtFORkrD2EbFX+JWkHaDcxZTV9AoWzkE460EWBlwKR30= X-Received: by 2002:adf:e78a:0:b0:1e6:3524:e135 with SMTP id n10-20020adfe78a000000b001e63524e135mr6077307wrm.601.1645185659259; Fri, 18 Feb 2022 04:00:59 -0800 (PST) MIME-Version: 1.0 References: <20220216180142.1074548-1-Vijaikumar_Kanagarajan@mentor.com> <20220216180142.1074548-2-Vijaikumar_Kanagarajan@mentor.com> In-Reply-To: From: vijai kumar Date: Fri, 18 Feb 2022 17:30:48 +0530 Message-ID: Subject: Re: [PATCH 1/2] u-boot: Switch to use DEB_BUILD_PROFILES To: Jan Kiszka Cc: Vijai Kumar K , isar-users Content-Type: text/plain; charset="UTF-8" X-TUID: d5epcZbc5LP5 On Fri, Feb 18, 2022 at 5:23 PM Jan Kiszka wrote: > > On 16.02.22 19:01, Vijai Kumar K wrote: > > Use DEB_BUILD_PROFILES to select packages to build. > > > > This patch drops the U_BOOT_TOOLS_PACKAGE and U_BOOT_CONFIG_PACKAGE > > variables and uses DEB_BUILD_PROFILES to enable particular packages > > like u-boot-tools, u-boot-dev and u-boot-config. > > > > Also, provide backward compatibility with U_BOOT_*_PACKAGES > > variable and prompt a deprecation warning to user. > > > > Signed-off-by: Vijai Kumar K > > --- > > RECIPE-API-CHANGELOG.md | 14 ++++- > > .../u-boot/files/debian/control.tmpl | 13 +++++ > > meta/recipes-bsp/u-boot/files/debian/rules | 9 +++- > > meta/recipes-bsp/u-boot/u-boot-custom.inc | 51 ++++++++++--------- > > 4 files changed, 60 insertions(+), 27 deletions(-) > > > > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md > > index cad15a8..c135bd0 100644 > > --- a/RECIPE-API-CHANGELOG.md > > +++ b/RECIPE-API-CHANGELOG.md > > @@ -342,4 +342,16 @@ The bitbake variable defines the respective environment variable which is availa > > When cross compiling, `cross` is added to the `DEB_BUILD_PROFILES` environment variable. > > Please note, that manually exported versions of the variables are overwritten. > > > > -For a list of well-known Debian build profiles and common practices, we refer to Debian's BuildProfileSpec. > > \ No newline at end of file > > +For a list of well-known Debian build profiles and common practices, we refer to Debian's BuildProfileSpec. > > + > > +### Deprecate U_BOOT_TOOLS_PACKAGE and U_BOOT_CONFIG_PACKAGE > > + > > +Use DEB_BUILD_PROFILES instead of U_BOOT_TOOLS_PACKAGE and U_BOOT_CONFIG_PACKAGE > > + > > +U_BOOT_TOOLS_PACKAGE = "1" is achieved by DEB_BUILD_PROFILES += "tools" > > +U_BOOT_CONFIG_PACKAGE = "1" is achieved by DEB_BUILD_PROFILES += "config" > > This is actually not an equivalent interface: So far, we also had layers > setting U_BOOT_*_PACKAGE at distro or even layer-level. Now you need to > patch that into the respective U-Boot recipes because the variable is > shared with other recipes. We need to check if that actually addresse > all use cases. Ah. Yes indeed. > > Did you have a look at the usual suspects already, specifically > isar-cip-core? I'm even seeing the SWUpdate package doing things > differently there depending on the availability of U_BOOT_CONFIG_PACKAGE. Let me have a look again into this and get back. Thanks, Vijai Kumar K > > Jan > > > + > > +u-boot-${MACHINE}-dev package build can also be controlled now. Enabled by default > > +in u-boot-custom.inc. To remove use the below code in your recipe. > > + > > +DEB_BUILD_PROFILES_remove = "dev" > > diff --git a/meta/recipes-bsp/u-boot/files/debian/control.tmpl b/meta/recipes-bsp/u-boot/files/debian/control.tmpl > > index 9379be7..7ac11ad 100644 > > --- a/meta/recipes-bsp/u-boot/files/debian/control.tmpl > > +++ b/meta/recipes-bsp/u-boot/files/debian/control.tmpl > > @@ -11,4 +11,17 @@ Description: ${DESCRIPTION}, bootloader binaries > > > > Package: u-boot-${MACHINE}-dev > > Architecture: ${DISTRO_ARCH} > > +Build-Profiles: > > Description: ${DESCRIPTION}, bootloader libraries > > + > > +Package: u-boot-tools > > +Architecture: linux-any > > +Build-Profiles: > > +Depends: ${shlibs:Depends}, ${misc:Depends} > > +Description: ${DESCRIPTION}, companion tools > > + > > +Package: u-boot-${MACHINE}-config > > +Build-Profiles: > > +Provides: u-boot-config > > +Architecture: ${DISTRO_ARCH} > > +Description: ${DESCRIPTION}, environment configuration > > diff --git a/meta/recipes-bsp/u-boot/files/debian/rules b/meta/recipes-bsp/u-boot/files/debian/rules > > index 3d66762..121b00e 100755 > > --- a/meta/recipes-bsp/u-boot/files/debian/rules > > +++ b/meta/recipes-bsp/u-boot/files/debian/rules > > @@ -20,10 +20,17 @@ override_dh_auto_build: > > else \ > > ./scripts/get_default_envs.sh >u-boot-initial-env; \ > > fi > > - $(MAKE) $(PARALLEL_MAKE) $(SET_CROSS_BUILD_TOOLS) NO_SDL=1 tools-only envtools > > +ifneq (,$(filter dev,$(DEB_BUILD_PROFILES))) > > + $(MAKE) $(PARALLEL_MAKE) $(SET_CROSS_BUILD_TOOLS) NO_SDL=1 envtools > > +endif > > +ifneq (,$(filter tools,$(DEB_BUILD_PROFILES))) > > + $(MAKE) $(PARALLEL_MAKE) $(SET_CROSS_BUILD_TOOLS) NO_SDL=1 tools-only > > +endif > > > > override_dh_auto_install: > > +ifneq (,$(filter dev,$(DEB_BUILD_PROFILES))) > > mv tools/env/lib.a tools/env/libubootenv.a > > +endif > > > > override_dh_auto_test: > > > > diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc > > index 9984d8c..3d53356 100644 > > --- a/meta/recipes-bsp/u-boot/u-boot-custom.inc > > +++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc > > @@ -9,10 +9,13 @@ FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/files:" > > > > DESCRIPTION ?= "Custom U-Boot" > > > > -PROVIDES += "u-boot-${MACHINE} u-boot-${MACHINE}-dev" > > -PROVIDES += "${@'u-boot-tools' if d.getVar('U_BOOT_TOOLS_PACKAGE') == '1' else ''}" > > +PROVIDES += "u-boot-${MACHINE}" > > +PROVIDES += "${@'u-boot-tools' \ > > + if bb.utils.contains('DEB_BUILD_PROFILES', 'tools', 1, 0, d) else ''}" > > PROVIDES += "${@('u-boot-config u-boot-' + d.getVar('MACHINE') + '-config') \ > > - if d.getVar('U_BOOT_CONFIG_PACKAGE') == '1' else ''}" > > + if bb.utils.contains('DEB_BUILD_PROFILES', 'config', 1, 0, d) else ''}" > > +PROVIDES += "${@('u-boot-' + d.getVar('MACHINE') + '-dev') \ > > + if bb.utils.contains('DEB_BUILD_PROFILES', 'dev', 1, 0, d) else ''}" > > > > inherit dpkg > > > > @@ -22,6 +25,20 @@ python() { > > if d.getVar('BUILD_DEPENDS'): > > bb.warn("u-boot-custom: Deprecated use of BUILD_DEPENDS, please switch to DEBIAN_BUILD_DEPENDS") > > d.setVar('DEBIAN_BUILD_DEPENDS', d.getVar('BUILD_DEPENDS')) > > + > > + if d.getVar('U_BOOT_TOOLS_PACKAGE') is not None: > > + bb.warn("u-boot-custom: Deprecated use of U_BOOT_TOOLS_PACKAGE, please switch to DEB_BUILD_PROFILES") > > + if d.getVar('U_BOOT_TOOLS_PACKAGE') == "1": > > + d.appendVar('DEB_BUILD_PROFILES', " tools") > > + else: > > + d.setVar('DEB_BUILD_PROFILES_remove', "tools") > > + > > + if d.getVar('U_BOOT_CONFIG_PACKAGE') is not None: > > + bb.warn("u-boot-custom: Deprecated use of U_BOOT_CONFIG_PACKAGE, please switch to DEB_BUILD_PROFILES") > > + if d.getVar('U_BOOT_CONFIG_PACKAGE') == "1": > > + d.appendVar('DEB_BUILD_PROFILES', " config") > > + else: > > + d.setVar('DEB_BUILD_PROFILES_remove', "config") > > } > > > > DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git" > > @@ -29,8 +46,8 @@ DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git" > > TEMPLATE_FILES = "debian/control.tmpl" > > TEMPLATE_VARS += "MACHINE DEBIAN_BUILD_DEPENDS" > > > > -U_BOOT_TOOLS_PACKAGE ?= "0" > > -U_BOOT_CONFIG_PACKAGE ?= "0" > > + > > +DEB_BUILD_PROFILES = "dev" > > > > do_prepare_build() { > > cp -r ${WORKDIR}/debian ${S}/ > > @@ -40,31 +57,15 @@ do_prepare_build() { > > echo "${U_BOOT_BIN} /usr/lib/u-boot/${MACHINE}" > \ > > ${S}/debian/u-boot-${MACHINE}.install > > > > - echo "tools/env/libubootenv.a usr/lib" > \ > > - ${S}/debian/u-boot-${MACHINE}-dev.install > > - > > - if [ "${U_BOOT_TOOLS_PACKAGE}" = "1" ]; then > > - cat <>${S}/debian/control > > - > > -Package: u-boot-tools > > -Architecture: linux-any > > -Depends: \${shlibs:Depends}, \${misc:Depends} > > -Description: ${DESCRIPTION}, companion tools > > -EOF > > + if [ "${@bb.utils.contains('DEB_BUILD_PROFILES', 'dev', 'yes', 'no', d)}" = "yes" ];then > > + echo "tools/env/libubootenv.a usr/lib" > \ > > + ${S}/debian/u-boot-${MACHINE}-dev.install > > fi > > > > - if [ "${U_BOOT_CONFIG_PACKAGE}" = "1" ]; then > > + if [ "${@bb.utils.contains('DEB_BUILD_PROFILES', 'config', 'yes', 'no', d)}" = "yes" ];then > > cp ${WORKDIR}/fw_env.config ${S}/ || \ > > die "U_BOOT_CONFIG_PACKAGE requires a fw_env.config in SRC_URI" > > > > - cat <>${S}/debian/control > > - > > -Package: u-boot-${MACHINE}-config > > -Provides: u-boot-config > > -Architecture: ${DISTRO_ARCH} > > -Description: ${DESCRIPTION}, environment configuration > > -EOF > > - > > cat <>${S}/debian/u-boot-${MACHINE}-config.install > > u-boot-initial-env /etc > > fw_env.config /etc > > -- > Siemens AG, Technology > Competence Center Embedded Linux > > -- > You received this message because you are subscribed to the Google Groups "isar-users" group. > To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/a8eb3b33-a3c5-285a-9fd8-a6b96403662a%40siemens.com.