From patchwork Mon Nov 22 05:26:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijai Kumar K X-Patchwork-Id: 1102 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3) with LMTPA; Mon, 22 Nov 2021 16:26:35 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-lf1-f64.google.com (mail-lf1-f64.google.com [209.85.167.64]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPS id 1AMFQY6n005141 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 22 Nov 2021 16:26:34 +0100 Received: by mail-lf1-f64.google.com with SMTP id z1-20020a056512308100b003ff78e6402bsf12496924lfd.4 for ; Mon, 22 Nov 2021 07:26:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1637594789; cv=pass; d=google.com; s=arc-20160816; b=n97eTZTjxyeCMqg26n7sVNa2Berl9lvwId9HCr2Dl67hpzylnqVf7EixLUydMHN8KD IHblzCwrnnpU5oSZz5M8pmLu7Ui9999kIkRCHlI30rFLYXTiVxxoqwp49ZSaVsRZHlto urAxpkcbWv2pxPUpYHI+d+mcXVjwEyo2aoSQftaqWJSSWqggeRm8LDfBF8KT1c9kIP5Y egcJgEbtbM8k1jhSGL7EfoY3jT+bds55Fq8aN+DRF2MFwFDYDzVr1YM25Cty41rXoU7m 3wqnEP1yJZpsRuDxZWlEDqNSh7hKblvG+B9Mlyfne7qUWzG+XMlsB3cSjwJUOnbSR3Fn rZxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr:sender :dkim-signature; bh=WvzZetq8cvArfoSxvCqMpIPYBCev2wH7Vg+NkY+CjOo=; b=UCUYBtYsTeKL5+sIUFSGScdUHwC4yEyjbnT1Hjqjvro/B1PTi/BFWNkeJWDwiWD+c0 a82/X60JOSjhbKp8twEib00JIGJ3zfWEXgQY3YRZIl1aemJeZWvcpq1Sk6yQx3wFpfuG i8XqbCRs/3mUr4m7fT5pOCzllOnZLUt460g2+f8kcdB7w2IPK0FVbKQIBcrCvkZqR0vq HC2Zvgkmx3z5B+ZHxxPBV3zm//dEc9ZOqumnNGjQoh+NUWxNpIxObYARWMg7BPhQ4iJm 3Vwtv7NZX9omHaty3G0fK/plvaCzIDeTgWA/+rBNbxzLwjQVJhZNGnKjN1tBmZP0yeam EVhg== ARC-Authentication-Results: i=2; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:ironport-sdr:ironport-sdr:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=WvzZetq8cvArfoSxvCqMpIPYBCev2wH7Vg+NkY+CjOo=; b=tQpfpo1l+FItUNl8nJRFZ4FbSfAOm5uJiDLnTV9RHCAmR4szOq0bgpOzGONYaHCt21 MyDYorTVLJzpjj8PaOJumbQ6mYgdmNIz7BRlOxo4rr2FOvZ7VkfX3qphU+qj9oujIUka efGyieitYIi6Er0LWnDVclWZI+a0AUnaR6zeo6O/RuBYnHcc+VKtp13F+UlJ9CNaIB+o MWtXVwjge8Cqt++snZOqXPZypWnB1L5HG+u896pph0NlQ5gmt2lgSBCQxzzjqbfoMqbx ZLWae/E9kjDxv4cDJWEGvB5WueJ16AoARjeSlo+e2MeKPMQ+P8vI/4N9/NQ6TqCosdee dVQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:ironport-sdr:ironport-sdr:from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=WvzZetq8cvArfoSxvCqMpIPYBCev2wH7Vg+NkY+CjOo=; b=DIyzwJx5D8L2Fsq6mWpiU0sBjDCEJ+DYkD0cRAiuMhRo4QAh8mOTv9qA+7rKUcwarZ QR0KFdKxTVRS5wzbkRqPZ94OTHPbZRs77AamMQvPHK8tXhMLN7eLIcU5U0Vk5UnMMo2z PD3/kVJQ/flDZW1cLjKiL8FsTmmjVtU+TjJvkKs8hR8C1gUmlp6SfauWJjn0RqYAD5EI SekTqQ8B3R0D5ZXK0eXKFxvFYSG8K4MZUSjjcXzYpnsCeeb7LXe00zZnsUhu7K8vCbK8 y0STwvUsursaqKUMcIOmeb8ai2G9l1n5xy4NQ8aORfa9t5FnnXE0DlpAS5GJul4W7y5d yktQ== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM5321Jjz38LrF8wpjSXMML1y96AVFbLur7nijgfcqZhwSCDSef3fF TiI+oNPtUM8znGfNj2CegSw= X-Google-Smtp-Source: ABdhPJykbwavTHOWGSwaEEZKV0FAzwqIPvv/xDmRrsmUIq6etJ4UGO/Zy9m5E1PQYje4D3ly5V1VMQ== X-Received: by 2002:a2e:8554:: with SMTP id u20mr53286585ljj.70.1637594789270; Mon, 22 Nov 2021 07:26:29 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:3d9e:: with SMTP id k30ls821601lfv.1.gmail; Mon, 22 Nov 2021 07:26:28 -0800 (PST) X-Received: by 2002:ac2:5d2a:: with SMTP id i10mr55778043lfb.207.1637594788081; Mon, 22 Nov 2021 07:26:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637594788; cv=none; d=google.com; s=arc-20160816; b=JYvL13+/G4WIWuDBz8GWqQVDKX8tSMe1axHl0i/WmPZj2LGwcdun3QudRZr8rTM10q U4FDfs93a0ijfgfwgqrSLJunamsYLqf+PIrBHrJDyAku0uB3S/kCJVXUW6paecofmQsw 3HlcZMqqdkaw7xlMuzcIkfIz3NzydGGQHRl9uRz9A/WFouKzNyfQWUiJMAUMadpc1bgD kBYe3la9B00QJXKS68YZa+FcvhsNgWhVsWnD4bbrWOgmbO+XdVUlxsMLMuwLPFey7PjW uxpZeQLECWh/705MSN+iOvPc+WGTyN4tKzQxnV5EbojEvlV3gszUMXQc93FumPAlzb7z oa6g== 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=b39mV7N6ct+ti2edmhH/pohiKSyvMHt6dafFtioV6+U=; b=IjO463QkHc4DFjvb5R+sjpweyAXtZxllHzD+GOWk0I6rE92AixkdsTz+zGX9/cXkKA ygqYF/fxrMUvecHeyhhHLxsO7+ZKo+EFQRvhzVSGvQb0y1/U44z3g9FpehdDeU35kZz3 dmcNljIOKMO8esxsYzLjbJj7zq4v1O/gSIVBocPV15axjMOe1OL9XuMeDiVZeuv4j6wa +xnmmux8XLVrxFMPdlsOmcaxeVSO7uWTqE+eGHNggodu1Unhz4/Vbpwq/DKL/8f9mj7/ dR4iVd39wxVY8y1bublrIsn9Z06MOA9ggZ5aoJnYgN+Am3Gyc/EtcYWxzLp9a+YJ8nDw +fGA== 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 Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com. [68.232.137.252]) by gmr-mx.google.com with ESMTPS id b29si607674ljf.6.2021.11.22.07.26.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Nov 2021 07:26:28 -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; IronPort-SDR: WTWOfjEinefIfIQ2RXbxqvWww+od5XsMSNFrQJqrEf7DDbBuHQUGpjT/t0ub5oYl45sDceaHb6 wdrqiphpNV9jEDNnEj3kALUwDNMSgappLYSH6dE70ilEfQlREc/PZVPL3+krDwxjWSvlgFQ7nG vR+0TYEhGNy7eZ5iEiIotJ+kIyB1OEz2VxX+p8g1qE9KqBLxHail8UbR7ymhFCRZezsUK3dIhc FpOa4LGMuDoAguEFFtjKC4qAAJZrYHHEPOE72/zNr6g5c35Hz2Aai0EZ6q5WzyvN3gjbNsGIio pG/VHcIKNRMNFrGR5oYDCHLi X-IronPort-AV: E=Sophos;i="5.87,255,1631606400"; d="scan'208";a="68789234" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 22 Nov 2021 07:26:26 -0800 IronPort-SDR: p79fU6lF0+9lM2RcsDVYa9uWU5l5MxzaYSf1P9PrJmvl53kF2kc00Rc73NHUULeIJf0dKfyd8/ KO+EMJB9Kx7tenJi+b2V6/ywIR7xoys68RmI9tU5f+bMPPbQAPRECTcBZqjGnjyzGH7aXb48YL IWjZ37rSkP+w6edFwcUwT9IQuD00TDC03ijEdkncwdykMhYGIPh1VU4VWDVJOPpuYJ2U2AiLH4 qSr6I1jN8wD3slMykRFoDZ7hRThsmR0/8slbgnoo9pQVSacO9yA5YMz0oZmysmehbL0SPV6ySH clA= From: Vijai Kumar K To: CC: Vijai Kumar K Subject: [PATCH v2 1/4] u-boot: Switch to use DEB_BUILD_PROFILES Date: Mon, 22 Nov 2021 20:56:04 +0530 Message-ID: <20211122152607.2125422-2-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211122152607.2125422-1-Vijaikumar_Kanagarajan@mentor.com> References: <20211122152607.2125422-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-05.mgc.mentorg.com (147.34.90.205) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-Original-Sender: vijaikumar_kanagarajan@mentor.com X-Original-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 Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: INBOX 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 | 12 +++++ .../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, 60 insertions(+), 26 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/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}" }