From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7059709284601298944 X-Received: by 2002:a05:6512:3e07:: with SMTP id i7mr16421951lfv.283.1643716658312; Tue, 01 Feb 2022 03:57:38 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:bc08:: with SMTP id b8ls2088566ljf.0.gmail; Tue, 01 Feb 2022 03:57:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJzor8DsBBZ76rxQ+US8NqjskrXPLx2AuW3f75EA3XWeWh4ebm/Mug0AlJGjpO48SE7ZahTI X-Received: by 2002:a05:651c:160d:: with SMTP id f13mr16605328ljq.510.1643716657207; Tue, 01 Feb 2022 03:57:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643716657; cv=none; d=google.com; s=arc-20160816; b=BczNB5cEYiMZHVeSlUS+4scKcZzRkgA4jCBV0+3dEWJk9mcCYol2xJ/fyB7QJxW148 LM02mysZ314oPc8BvBuJyiQN13qtnnX0nwDeuypJ0XApBAIVGNeUonZPyOMVScmqRXt4 MIJ8Y6Ytsboeev061YLRPtD4HDneKQlffW7raxKptFBl+E1ynLkdGS2BgOJasPa12Eeb KlYm5lDCXizfWXPid+k5lrOGX4ovfj6nmALb90TpmbRJWLgGm0FwrG890rtHLLTXiX3t zuKHHPW0v75hNnmP1Ir+8lgM5gK5idztsNdTViP0gCU3vlaMs2YyIF0Jp/KcSL6YnEei Z+Yg== 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=OwfrxR6mLPSdiwjAuIWhGmvUzqy5WXSBAZF4yTxeWuU=; b=qGryYAnQQpRe/yQbU80sL8y2PZM/5kUm/T2CJ9gPYvLdBEH34AtihwXeOaJCd5sZsJ QIdNhHXlnL7p2GcG0xrdzpyUrDcD2FBV7wuvEy3nPLwKqJUID2ARDL1vCh965V2vA6yq MSgtyf0gBEt8Ee8uILdFw8BLy3LkmJ/+mKmNVp9LhSNZGKbPEyXgX9dVdzOeu4lNKmng SGDz7/uAucVQGO4M3F7kCBL5jF7DWvVGvIq6tI56XJqd3sBGS3DXkSMn2gm0KVCQaKba yNt3tSfB2ryoYvAQlru2xO+rzZ47+bF5O17E7B0DoLi0eAyZjLPhWwU8aNUNZJOvf92S qj5g== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com. [68.232.137.180]) by gmr-mx.google.com with ESMTPS id l17si102917lje.5.2022.02.01.03.57.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Feb 2022 03:57:37 -0800 (PST) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.180 as permitted sender) client-ip=68.232.137.180; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com IronPort-SDR: xEnp2t9i0izwjbbSU5rpqNVAxOBEpVGenOikVMhN5OwNtx3h3rNrPxbdDBRFDu45d3uRb6H0eS hnTyz6CYqmSWgDu/lbVlSoqaEAIM5V+yozjSJ2RmkNthxqFAYIyeg53QxR06g4GxYmthl4zKT3 e0IkuyINwpnTRckCRtj2aPb7+miXr3Vg/MqR9xQAfBq/MO/WnNTr+VmGjL7/7B7sYXqEtZc/UN lU5cn4FUFYjZGnYpSl5YmMXANta9Qd5KcQv5QAc0wDI42A8NAF6aVZvxZhOM1zQaTFxLqa5oKP FUOjH12PGRmj7doC+vPEy28V X-IronPort-AV: E=Sophos;i="5.88,333,1635235200"; d="scan'208";a="71289690" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 01 Feb 2022 03:57:36 -0800 IronPort-SDR: MxALAZ2alrJ50H+RqGojweVmZHB30BlCG8GWzIJIaRAsBI3ta5j/ZuamxEGy87ZTaozY+GkYwN r6iAoV0THB/ZU1OM4IP9v1GtFKl5iK0V/J6Dv5Gt+d25OYZPG6jf4W5iU6FY37XnG3e2JP1aaG g06ZFub3ygX5CVqh4vBXGxdzm+wsXk9Jr5vCOJmUbXv969YpFX5Ldb2s15w6wBkgsmN+rPM2+4 1p+Y8i72m9dFnvUgsJpnlKXYRoR0cUXyXVOr8oo6J7t0yvlyFO7XF0bnFuuJW5S/Ri5Xuk9Wax ntE= From: Vijai Kumar K To: , CC: Vijai Kumar K Subject: [PATCH v5 1/4] u-boot: Switch to use DEB_BUILD_PROFILES Date: Tue, 1 Feb 2022 17:27:10 +0530 Message-ID: <20220201115713.3062835-2-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220201115713.3062835-1-Vijaikumar_Kanagarajan@mentor.com> References: <20220201115713.3062835-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-14.mgc.mentorg.com (147.34.90.214) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-TUID: xyJaExssjIpL 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. Signed-off-by: Vijai Kumar K --- RECIPE-API-CHANGELOG.md | 11 ++++ .../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 ++++++++++--------- 4 files changed, 59 insertions(+), 26 deletions(-) diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md index ce0a6da..118b328 100644 --- a/RECIPE-API-CHANGELOG.md +++ b/RECIPE-API-CHANGELOG.md @@ -335,3 +335,14 @@ names for kernel/headers. Changes in next --------------- +### 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/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..5198809 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" @@ -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" + +U_BOOT_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('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 @@ -75,4 +76,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