From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7030828924489695232 X-Received: by 2002:a2e:a553:: with SMTP id e19mr5493604ljn.341.1637056311600; Tue, 16 Nov 2021 01:51:51 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:2610:: with SMTP id bt16ls1555949lfb.2.gmail; Tue, 16 Nov 2021 01:51:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJym9OyJmxk8A9LJ9h9tLT055DZu3RPoONI2jBdCdsOtE2f8awHxFuMZF7I39yatBBSbJ64e X-Received: by 2002:ac2:51b0:: with SMTP id f16mr5517788lfk.20.1637056310337; Tue, 16 Nov 2021 01:51:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637056310; cv=none; d=google.com; s=arc-20160816; b=uoNoPxHtjNoo7wg+QVxA0GfmKJFU535RcwxgtHkbvPVv3PKgAFjRA/nf108J6wnJ0E v+LM7Vkfs4vmT8Be+9jf1sEhcX2USHmZiC2RfnAut8HXdN3YCBFNp7MFwWUp/W8LWMny Lr7xZHsIRHy7OJNyIdRqSHnE1sFs6XVplpkq0vFffZuLbDEa/WArfzAHI78hDjcglVfF Lrq+XB0pXse4gPi4W1OM2dHnSH4osJE2dngG8gTyRBGb3lMSSB7tOsFuUBK6o4zOt0Jv wQT4pQo7FS0Qnl3xnxMfvY4tWSKsMwP5LQz4T/WynBpGZ8492ZvRYHK3uGqpCyzTF7E3 HM2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=EVTPxZM5FLk1ct1oKTKCaOJAm0MuuDhPZwHb7m0xcPs=; b=IWtXB8zHwtYZ4azP1RY1u3hNMi0EET9FMxCDAN/2kKQaPjNglbmxGWHJsj8hOuwLaE VfmZHGlw2ljPMEoT2hRsishXqJPyTGZzMeu5G3ex1Ai7s8qgfQAn9oXSbpKcmpma6AVW GnqQonh1yiAGkVatt+7lukkvS/nJ2YDXL8gZHho0AGXvIpu1FfHHRGHtpCI8w6RI/xyl 0On7F7jISGOWMHtv8Gq/VMKvrhUP3/pwFKfp/Tbz8G2JoDPfATjcjeMNaYayel9iBOMt 7s2TYv8un9b7OzZ7UInHPafiq4D9Yki6oPBjOTSLC6ROIr4UKrjg/JBoc+EXwUwRaAEK WBrw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com. [68.232.137.252]) by gmr-mx.google.com with ESMTPS id c15si1222479lfv.8.2021.11.16.01.51.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Nov 2021 01:51:50 -0800 (PST) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) client-ip=68.232.137.252; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com IronPort-SDR: kcz2zRsYPOjv2ZrZJwOWJpLCHrKkBRVcbdwfsn0qej83eahsDsVjaxN5M3y7zuZOz5E3Fs4h+Y aKqzaPPEv2kYvTXz74KrRkCqXHa4Md1vEPGo8kGFn8ssHPgFE0hWmoeaOWe20h5+P/YZ6OkJYE BZR9M6OrL2h+YzKY4Ob+PtCs+uCXh5XjALwyTLIf+lTK2UDngPz2raxpD+/qM4r5BMng+g+sk/ CJXRuqThFJpaflvfnKR2XGACPMzXPfFxMF1UlXpgwQXiXcQzCrjY4nK0M5iWwEV0lCAAmDspuB oQuKwMnawx2bp9IZR0cOe0YZ X-IronPort-AV: E=Sophos;i="5.87,238,1631606400"; d="scan'208";a="68544455" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 16 Nov 2021 01:51:49 -0800 IronPort-SDR: 9QRXWJJoXSb1yBBHgiM25GjXLszmYevQyOHIOls0WxTHblaav+31fFq18fNjE5Cqc1o/Gw6OIr +MRW+BzHFdwpQYshbCvX1h0lMrYJnx42y/gU0+8OPnl8M1xppDhYWAfSsqiZArbj6zQsVqOtRJ biNEkQehpl4/2CHETxqUTdOFjBA6ZLOWfgY+qV0u3td1quJhFr4eH9VJMiHLY3Sag4N48MqcU0 pL1YRUV/fy0NeMaYyJ9Gea7A5JzZgBTWneYxLAkgsVoiOJ923EsBXp+vvE5s4EQO4jFudEodbA vsQ= From: Vijai Kumar K To: CC: Vijai Kumar K Subject: [PATCH v2 1/2] u-boot: Switch to use DEB_BUILD_PROFILES Date: Tue, 16 Nov 2021 15:21:19 +0530 Message-ID: <20211116095120.769193-2-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211116095120.769193-1-Vijaikumar_Kanagarajan@mentor.com> References: <20211115160642.765371-1-Vijaikumar_Kanagarajan@mentor.com> <20211116095120.769193-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com X-ClientProxiedBy: svr-orw-mbx-13.mgc.mentorg.com (147.34.90.213) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-TUID: LekNWU4xlUGi Use DEB_BUILD_PROFILES to select packages to build. 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 | 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 | 38 +++++++------------ 4 files changed, 35 insertions(+), 27 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..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..60dc1c9 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 @@ -31,8 +34,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 +45,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 +64,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