From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7065369477208080384 X-Received: by 2002:a5d:64ce:0:b0:1e4:9b8d:4ccd with SMTP id f14-20020a5d64ce000000b001e49b8d4ccdmr3216910wri.37.1645034524817; Wed, 16 Feb 2022 10:02:04 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:fec3:0:b0:1e3:3e51:b38d with SMTP id q3-20020adffec3000000b001e33e51b38dls30543wrs.1.gmail; Wed, 16 Feb 2022 10:02:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5Un4i9k/IhVTr6UkSw5NSZdDSxjRKSDJ3F1Vd2TzmkGeDsvsq9nRboDcmPsdRIx+B0aFa X-Received: by 2002:adf:82af:0:b0:1e6:80a3:4782 with SMTP id 44-20020adf82af000000b001e680a34782mr3325873wrc.362.1645034523626; Wed, 16 Feb 2022 10:02:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645034523; cv=none; d=google.com; s=arc-20160816; b=S4PbCoDy6txJtNbYILdzTPPhI8iWxJBnnfs3KIgP//ZMZ/cnKQHX98xxMnyrriEj0z TvUJuuH6KZsXYiYvbdV8NbcCpONbxRPYct9IPcN1wj5/K9T52W5XZms12RrjiDY2FCG/ LfnhwfeZDXgle1VfILOWi7UTj72/o7tEbtY5P1ahtdHVp6wivk2maj3DSbOQD0xqFfmQ gwG1e4BWxsEDpuxSF0haHx/4IYVp/HoHqarU1TEmGSUbNYm76BfPTw1GO9BVIZU3MMD9 hyc06wtYU7SrHvBN8YxrpTMwh5mKyNgXMvRL1abYQFdkUQjshmIi0pONMwJlcT/pWBU3 6ZFA== 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=BxWo6aLt4x3v8lpR4TK8C1LuIMpbGVn+73MwFNCsRbo=; b=GvLNPW7c6lNYUy5rsu+bGabEFah4GqNWS49txiY87lDTX4Imr2uX4ZgeC5xVxVdtCK HAzBrkXvR2n9B4zyDQYI27+x3Xr+VvYuucVqjyp0FDScTfiUJwgaYLnlYxs12/whc9n2 Xquae9Ar9jLpSppjQgFP3T5THiTyp+4isao6e+MOomjvmt3Sil4I736NS/Y56JgO5amK N3ahj2k3N30J2Rx4W/E1jib0qwgJZvvxy8u6L3ZMCY9OhaT1xvgwSqp74+VI+bI5ganw +RN5GNRZ94qSISQl7V7tycWrGuplyuXaSSz+VLLZnR9iQ3cXfQkeW3yBz+F2lxqmG/M/ aNEw== 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 m7si106494wrj.1.2022.02.16.10.02.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Feb 2022 10:02:03 -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: I5hkcdgNnJRNDLlNLprBHqNQ/cxigBfST4GbzaXxINm3tVWHt3k8i+bFgUouPChNG4yMKaxX5Z wBQ17zLtYL2b11B8Cbn/Oy/N9B3QMgGDzr6ZAKE97M3VKOuA39ICRhZ+UZyqaYfx18YRYy8xt9 1F2KY6xKRYmgTW1V7AQ9//ym/yq6mkAd50IwYaCsWN6PjCYFmzyb5dhu6mZ08/XRzF7vr6d2mE HuL5yg6O6PWSGlqlsblhia+CNJI8dc1ejB/sSDtJwEmz9665Yp8WR8PJGKLix9zaXGW7DaaQx8 /Ty5iKPUVIAHafIeS89q+GKg X-IronPort-AV: E=Sophos;i="5.88,374,1635235200"; d="scan'208";a="71917944" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 16 Feb 2022 10:02:02 -0800 IronPort-SDR: FYeW8oeuJfg9H2XkuIsZ70aYKu9vE8JKd1GRLKyqWPNCEZD9rc2RTWLbhwKUWK7CeD1R/9Iw8I ZBR+CGEHpZgsQXUGBUM/IvzRJa96ZlfVChJ6I+Eb8NH8E5fI1BdkZ1+URAnb/Lec2+Hxl4IjTx PF5f2lBaZxdf5ltgWUWJR2LtJ8dT2jOKeDQ74vpzR25QRHaj8V4IrqxcYOsG+kpsbhqZ+oqwmO 92yMGEBEHAiEfYm5ajr4gkIitR8qt1DZdKQV9JesTLBy7J0K4UcdDVeAiQzzBD/IJ0HZZ2C73W Bz8= From: Vijai Kumar K To: CC: Vijai Kumar K Subject: [PATCH 1/2] u-boot: Switch to use DEB_BUILD_PROFILES Date: Wed, 16 Feb 2022 23:31:41 +0530 Message-ID: <20220216180142.1074548-2-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220216180142.1074548-1-Vijaikumar_Kanagarajan@mentor.com> References: <20220216180142.1074548-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-10.mgc.mentorg.com (147.34.90.210) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-TUID: vtefEkFrMdId 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" + +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 -- 2.25.1