From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7030828924489695232 X-Received: by 2002:a2e:a553:: with SMTP id e19mr26844569ljn.341.1637341775016; Fri, 19 Nov 2021 09:09:35 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:2610:: with SMTP id bt16ls321037lfb.2.gmail; Fri, 19 Nov 2021 09:09:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJyY8RmGa7HwRgSB+v4fDzhB5HyNcdbqirieaUImDKX0dFS/TBCbkEHK3oJ6BILhJHmnSw81 X-Received: by 2002:a05:6512:6d1:: with SMTP id u17mr34386006lff.402.1637341773855; Fri, 19 Nov 2021 09:09:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637341773; cv=none; d=google.com; s=arc-20160816; b=jq33m7yO9GV4F4zfz9aUTkTkZreiRVpeR5Cpra/3n+ur6VNgy0gtSo9chKW3qgmbER sIO1CbZfFAYinDYzqCKxesYtfEFazyCFG7DKa3oU7j15o1CAeCY3NDjWrJHqDFIgndaU h7MsxngPBF6FRcepredc9Fjm+59bE/1CSYNkR/l1It2J6zQQsvXzxxxEfpi+Yuc+TC0s fXqge8aAJ6ukCOBb0/5aFRPsbl6shK3zRieMlWtqhfER2XuFUVBnu4nF45abk1gh4I/9 Si2CikiAqd84mQMeJgbT7VCXhY4MZEHiOYkOsaoHqLrfgs1Y8sErtCWI/2/9mU/pj+uZ BBiw== 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=A5GXn9p8HVD2XsroLAYuK7pYbSJYCHWfLMy2ihjm88U=; b=utSF313VF6BGH+PfoN8UqF/duCcqx2smO8013CLnR/zVw81NyHSMWMBJQ9HMb4o+uR m6r1rgwObydpxUaSuExMg95wx7aP+UeC+qBvr2J2Ne16FyJ716drmPXjuhK28aNyif1A t1do5L5++P8VyNE4Yb/6d2jOmp2BtCwgx2p1Y72U3McLquaSyPFptt8bgHfjLehc9bCz fR/kbvwcWye5Me246zonPswxN9VdzRDQKjk5ZTdN5dvHosMuGu2VHpw06hg8C+J0LR1R OJEEo96BmIyWtm6SNv18WK4FtOUwFeFk6FsS5x8g46LWs5hJIKWqKZMs4NwNpOLKpIg9 uOug== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jRsWZBkG; spf=pass (google.com: domain of vijaikumar.kanagarajan@gmail.com designates 2a00:1450:4864:20::32e 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-wm1-x32e.google.com (mail-wm1-x32e.google.com. [2a00:1450:4864:20::32e]) by gmr-mx.google.com with ESMTPS id i16si34233lfv.2.2021.11.19.09.09.33 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Nov 2021 09:09:33 -0800 (PST) Received-SPF: pass (google.com: domain of vijaikumar.kanagarajan@gmail.com designates 2a00:1450:4864:20::32e as permitted sender) client-ip=2a00:1450:4864:20::32e; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jRsWZBkG; spf=pass (google.com: domain of vijaikumar.kanagarajan@gmail.com designates 2a00:1450:4864:20::32e as permitted sender) smtp.mailfrom=vijaikumar.kanagarajan@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: by mail-wm1-x32e.google.com with SMTP id r9-20020a7bc089000000b00332f4abf43fso8135095wmh.0 for ; Fri, 19 Nov 2021 09:09:33 -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=A5GXn9p8HVD2XsroLAYuK7pYbSJYCHWfLMy2ihjm88U=; b=jRsWZBkGGmPg2X9rac9paGfrMBi6G65Y9ws2OqvKNmCZ1syTj1jzbvp8Tw5bIEvW9G wCHGAz1xzuQVyZdKcyW25OON9S6gp6rCQw8M5lCcPajrTfqZuN74KMrcaCO6TGSkcDxF In6aPf4Ds5HTlnV9Udv3uCwUSh3RGArVaxEMTQNr2IEzrLBT76F/eBqlw5/+merniwF3 z4hmb3fhUrnNat7r6dNr4yXQ/q0nTOKr7y1kKFP3QtlWVhAbnZ3AZxFDHZaofMEUG105 Lv0A3jUPme3cg9QYCcZxbvFnU0wVltVLzihidTtuyv28s19vjSc20+LAMIIFHiqg82Di i/zA== 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=A5GXn9p8HVD2XsroLAYuK7pYbSJYCHWfLMy2ihjm88U=; b=LQdCe6i9Vpmk06IDZGzKu6sH/Z0bIyzQJIpLyYEEBZkWI8Uem9t//Xmeq85r5TKfQk d1xc4lDCBM6xR+7iSDgjLEhSBeLDTcjDN9AMkMgxDIIFDiKqb6oADqOezTBFCNz0zq1J jfm+gp5Dvc+Nh0LRwb53tWZYSX476EgT7QtdvWon5y3Y1pCQbYKqTLBpXhv0J/gKpaYq H53yzIwJ5l54Pj+Na1UJO7lJGoZl9dV78wshpO9DK+ISSeCxn7fRuaGvomEngO0EF7V0 3ajaUutNva/RQiIHIzHkNYz0OjIehmWaTljdhf0oRMwnH/Rlo1RVUGqxthBjPVHyuLZS XVaw== X-Gm-Message-State: AOAM532tejLp4T3LIuuUzATN/9RsnWGHPOYUR2xqEhLYVN3AyKsQjojh 9NNd2gRwmYY/9sQuyjRecHdKlagAuuXON5nd8pDuczhxPGc= X-Received: by 2002:a1c:8002:: with SMTP id b2mr1535317wmd.2.1637341773129; Fri, 19 Nov 2021 09:09:33 -0800 (PST) MIME-Version: 1.0 References: <20211117073515.773106-1-Vijaikumar_Kanagarajan@mentor.com> <20211117073515.773106-2-Vijaikumar_Kanagarajan@mentor.com> In-Reply-To: <20211117073515.773106-2-Vijaikumar_Kanagarajan@mentor.com> From: vijai kumar Date: Fri, 19 Nov 2021 22:39:22 +0530 Message-ID: Subject: Re: [PATCH v3 1/2] u-boot: Switch to use DEB_BUILD_PROFILES To: Vijai Kumar K Cc: isar-users Content-Type: text/plain; charset="UTF-8" X-TUID: mkNHxBM3DiVw On Wed, Nov 17, 2021 at 1:05 PM 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 introduces U_BOOT_BUILD_PROFILES through which we can > 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. Will send a v4 with a reorder. > > Signed-off-by: Vijai Kumar K > --- > RECIPE-API-CHANGELOG.md | 12 +++++ > .../u-boot/u-boot-de0-nano-soc_2021.10.bb | 2 +- > .../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 | 52 ++++++++++--------- > 5 files changed, 61 insertions(+), 27 deletions(-) > > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md > index 7312d4d..3b926bd 100644 > --- a/RECIPE-API-CHANGELOG.md > +++ b/RECIPE-API-CHANGELOG.md > @@ -301,3 +301,15 @@ Kernel update with "apt-get" will not work since bootloader configuration will > not be updated. It used to "kind of work" for grub and efi, that hack is gone. > > When using the plugins it is advised to name the partition "/boot" and to exclude boot from the follwing rootfs to not waste space. > + > +### Deprecate U_BOOT_TOOLS_PACKAGE and U_BOOT_CONFIG_PACKAGE > + > +Use U_BOOT_BUILD_PROFILES instead of U_BOOT_TOOLS_PACKAGE and U_BOOT_CONFIG_PACKAGE > + > +U_BOOT_TOOLS_PACKAGE = "1" is achieved by U_BOOT_BUILD_PROFILES += "tools" > +U_BOOT_CONFIG_PACKAGE = "1" is achieved by U_BOOT_BUILD_PROFILES += "config" > + > +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. > + > +U_BOOT_BUILD_PROFILES_remove = "dev" > diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb b/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb > index dcb76c5..640b7ea 100644 > --- a/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb > +++ b/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb > @@ -6,4 +6,4 @@ > require u-boot-${PV}.inc > > # Just for testing purposes, distro package would be recent enough > -U_BOOT_TOOLS_PACKAGE = "1" > +U_BOOT_BUILD_PROFILES += "tools" > 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 57d4f36..f7a7dac 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('U_BOOT_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('U_BOOT_BUILD_PROFILES', 'config', 1, 0, d) else ''}" > +PROVIDES += "${@('u-boot-' + d.getVar('MACHINE') + '-dev') \ > + if bb.utils.contains('U_BOOT_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 U_BOOT_BUILD_PROFILES") > + if d.getVar('U_BOOT_TOOLS_PACKAGE') == "1": > + d.appendVar('U_BOOT_BUILD_PROFILES', " tools") > + else: > + d.setVar('U_BOOT_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 U_BOOT_BUILD_PROFILES") > + if d.getVar('U_BOOT_CONFIG_PACKAGE') == "1": > + d.appendVar('U_BOOT_BUILD_PROFILES', " config") > + else: > + d.setVar('U_BOOT_BUILD_PROFILES_remove', "config") > } > > DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git, libssl-dev:native" > @@ -31,8 +48,8 @@ DEBIAN_BUILD_DEPENDS += "${@', libssl-dev' if d.getVar('ISAR_CROSS_COMPILE') == > TEMPLATE_FILES = "debian/control.tmpl" > TEMPLATE_VARS += "MACHINE DEBIAN_BUILD_DEPENDS" > > -U_BOOT_TOOLS_PACKAGE ?= "0" > -U_BOOT_CONFIG_PACKAGE ?= "0" > + > +U_BOOT_BUILD_PROFILES ?= "dev" > > do_prepare_build() { > cp -r ${WORKDIR}/debian ${S}/ > @@ -42,31 +59,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('U_BOOT_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('U_BOOT_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 > @@ -77,4 +78,5 @@ EOF > dpkg_runbuild_prepend() { > export U_BOOT_CONFIG="${U_BOOT_CONFIG}" > export U_BOOT_BIN="${U_BOOT_BIN}" > + export DEB_BUILD_PROFILES="${U_BOOT_BUILD_PROFILES}" > } > -- > 2.25.1 > > -- > 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/20211117073515.773106-2-Vijaikumar_Kanagarajan%40mentor.com.