From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7030828924489695232 X-Received: by 2002:a05:6638:1311:: with SMTP id r17mr37532jad.69.1636994688968; Mon, 15 Nov 2021 08:44:48 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a02:3401:: with SMTP id x1ls1693632jae.6.gmail; Mon, 15 Nov 2021 08:44:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwLHrabsmslpc+8f08dO8mqnXrhD4Yaa90NMsJYpJSyViixPcPBiN20HeL9KK+PygdR99f X-Received: by 2002:a05:6638:3899:: with SMTP id b25mr47686jav.39.1636994688588; Mon, 15 Nov 2021 08:44:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636994688; cv=none; d=google.com; s=arc-20160816; b=f+243R7Vyx0OGwBqpInJgu1ILbWPjqsv14RuLlqe89n0t+BHU9s+eBK/xiogp2HWLJ +E1F8VgeJQupYMS6YS+V6QX1EfmDQ0ZIO5pJ/6PrwaZtvs5AWYXyxWnaQBgmRuOJbwhu LkuaMgkOSQEw6B2XYMMQnCCuXiFZZzqIna/pp7CMp9lDWZFFOxcADqmP62+uDen6VsrA QpQi1JjvCDQxMnQhJzkNJekZlJKObgtyVF+qttuPgBd1j/eqf2EzjZsYJeHHkCHzayX8 ucOFzrGxUqOLz2U9wsU1+0XDH9NJTsDXlwKdGk3NBKAtV4pqFVRpSH0GvU813ncUzmhG TqhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject; bh=h4VGiCfM8jfb8sy0rmv1eqKvpmz4KyAQTeg/kP5Na2c=; b=R7KTpgOOkDTXbP2WeQnO0xL4RT7GXzoGfBEq60qk816AFqg8xsIXvwRh+ey6Qyte53 81GvgRyYN74FNV9Ary5MtqIj6rlf+2QspHnUVeGYMfuL/E9NgnVVJYEFhTn0M+rhngEA CkIUIjJBEA0/uz/hWvhUWDYNMUnEG5nSUK7kkQXC8ntKUL9ytAamhYsyb6zE4RdQQziH kzXlRW/YazHDXttdEVLGep12Ep1ZpXvYG3H2BxbUPJ4scX20/DUYhynWxVjXsZHDDWKG 23BVOdFQtsAjGJImJxxc9JcbCWMj8l2izzPO6J3jSJrz4pCHIdL5Nj3tfQG1xE7H870A aCSQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id w27si793201iox.4.2021.11.15.08.44.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Nov 2021 08:44:48 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id 1AFGikIg014696 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Nov 2021 17:44:46 +0100 Received: from [167.87.32.59] ([167.87.32.59]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 1AFGikMu007831; Mon, 15 Nov 2021 17:44:46 +0100 Subject: Re: [RFC PATCH 1/2] u-boot: Switch to use DEB_BUILD_PROFILES To: Vijai Kumar K , isar-users@googlegroups.com References: <20211115160642.765371-1-Vijaikumar_Kanagarajan@mentor.com> <20211115160642.765371-2-Vijaikumar_Kanagarajan@mentor.com> From: Jan Kiszka Message-ID: <287571ee-909f-b7b2-7a7e-27a4495281a5@siemens.com> Date: Mon, 15 Nov 2021 17:44:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211115160642.765371-2-Vijaikumar_Kanagarajan@mentor.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: ZrkTyI2zyvTr On 15.11.21 17:06, Vijai Kumar K wrote: > Use DEB_BUILD_PROFILES to select packages to build. > Nice feature. > This patch drops the U_BOOT_TOOLS_PACKAGE variable and introduces > U_BOOT_BUILD_PROFILES through which we can enable particular > packages like u-boot-tools and u-boot-dev. > > Signed-off-by: Vijai Kumar K > --- > .../u-boot/u-boot-de0-nano-soc_2021.10.bb | 3 +- > .../u-boot/u-boot-stm32mp15x_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 | 29 +++++-------------- > 5 files changed, 32 insertions(+), 24 deletions(-) > > 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..1340362 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,5 @@ > 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" > +U_BOOT_BUILD_PROFILES += "dev" > diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb > index 6d95643..ead6d38 100644 > --- a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb > +++ b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb > @@ -4,3 +4,5 @@ > # SPDX-License-Identifier: MIT > > require u-boot-${PV}.inc > + > +U_BOOT_BUILD_PROFILES += "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 57d4f36..bc92552 100644 > --- a/meta/recipes-bsp/u-boot/u-boot-custom.inc > +++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc > @@ -31,8 +31,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 ?= "" Must be "dev" - we were building the dev package by default before, no? Otherwise, it would be a RECIPE-API-worth change, and it would need argumentation why we need to break the API. > > do_prepare_build() { > cp -r ${WORKDIR}/debian ${S}/ > @@ -42,31 +42,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 Doesn't that profile feature allow to copy that unconditionally? > 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 +61,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}" > } > Jan -- Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux