From patchwork Sun Nov 21 21:28:02 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: 1097 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 08:28:34 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-pg1-f186.google.com (mail-pg1-f186.google.com [209.85.215.186]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPS id 1AM7SWla003141 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 22 Nov 2021 08:28:34 +0100 Received: by mail-pg1-f186.google.com with SMTP id o11-20020a635a0b000000b00320daef2ad6sf1643292pgb.3 for ; Sun, 21 Nov 2021 23:28:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1637566107; cv=pass; d=google.com; s=arc-20160816; b=F8nQ/efaHmcno2xqDnYGX5qVjLVHZdLUSi3daXkRAdH/sv3+i598Mc+4WnjaAzp8ow r40U5z7TjEvV0+OJC/WlvukPPiG/jxtFPJQGGg5zcJZKPdne8ncorlKQdGBIgCvQ2y4e 7yHbQSBbCP8/+n5Jc0B+dfIwoHyuUEcV4pYiWR3k48kDYJ2MnzynKfuK6wif7shM6MWZ lSKei0JpW79FNjMl8+h40hjmOKQE8NTfNmpraxjvZ8c0ZIE3P1tmzPwQ5gGUveRisxo0 LukIBPISbWK4YQuH+Ypeajwv+iIqHYiZuoWQcjDF0jb+N3kiQrjX7mYQWGvKro5PtMTO EBfA== 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=h2JcvB0MBrCuBCE40Sr+MNSTOOpVOY/EJ/MBH8/G7zk=; b=YYS4cRGQuxJ8ZgnghFDQtQUXaCB5ptjTdDbVTXQpI7TVNQtiOCEB6RgHmz3rjl3HpM wskI7TpSjSVn3VdYxeXChWuUQurndeBPEOUklk/lC2J4hN7B5ulKhzBQUFJ1iHcx4wVb rdj2EIl2u1T+UEliVfCz0C0rbcek5g07t/QCw21d1lBPUKNlQU3gqg96Odb88hd/f/WX +COmfzRr5nMwO7JsHJVw8RIKaQRORAexfPvHmxWL15/dTAhPYpkHgk5iLbutE9OwZKqL xIBivQXLYh81P0rqnpdQedoJKH3TTfSy3J08eUHx6uG8GxlIzuZQ3Zhe0GtVlBPAKzq1 wGnA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 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=h2JcvB0MBrCuBCE40Sr+MNSTOOpVOY/EJ/MBH8/G7zk=; b=o02R7ovLtNHrQckiw+I6K8zcDcGKnvV3tP5JI8wKJuYtYO2idFBlwpWbXGoWNdgjCE h+wRsKHWO1pAtKafLxKQM9qQVtbzL+pe+deILCcu04SmH4+VtpjmtQhS/Jbkpc0y5BeN 0PKz/z1y75AntV6pmfPvySoyy0swilE3u8NKe749eu7uM5Broq9uxTfH1b/gx56/dybo xuq7HDJVfsYZqeR4MD5hCHfQNOxL3e27qTrXqSfxnMx1m7EGxvWyWzCJt3bPZ73giTez U1sEirxpRS0IGX46Q++HoAmEyhgwWdYLVZDGvgtks4p7OqtI4tT2FNWctq90q/8n+06d LlGw== 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=h2JcvB0MBrCuBCE40Sr+MNSTOOpVOY/EJ/MBH8/G7zk=; b=0/M+nIGm9/9S7lAbFhb0h3CzxO67n/MYD4aG72gWChL4ugjAn+LDszUJd2wgF1LZZd nAmQYUREMAR5caStLPfxvt6ggmdxc40GJo2oN4Nf8vow0s46pJhEZnt5g0D3HCJB3tF1 dGaJlD5qBeWPQBfk+ZomRo4Aj4mx4nPxcQZgxuPvXtd/K7+B8wivQOpGpu4yzVTP14eu E4aTIM7EDZ7Cgw4R/LWh9hOd92o+l+HxeK71Pdd/BVoa03L2iRiJI1Gu0LhGhMxf0G+0 atBiwpd9KLIrkSdltvGf1KgMgoRXMbUFxoJKAlwxoyyMaYLcIsKz+CWZAAXv0CYtviWi Ep1A== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM533kef2IYcqfuQzjs7KCUEsF9ruem/E/D6ZojG6dC6DPFQZXTOqt EespBYP1I1YTezUcuUwMzXU= X-Google-Smtp-Source: ABdhPJxem60ECqKbsx1H2NcRf8uQfBfLpeR09swzXGNMQUjaQTubu5YkEZMsAuLc86Mc4BzYmpEbfw== X-Received: by 2002:a17:903:22cc:b0:142:d31:bd9 with SMTP id y12-20020a17090322cc00b001420d310bd9mr104365139plg.64.1637566107366; Sun, 21 Nov 2021 23:28:27 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:90b:1a8a:: with SMTP id ng10ls9851117pjb.1.canary-gmail; Sun, 21 Nov 2021 23:28:26 -0800 (PST) X-Received: by 2002:a17:90a:3488:: with SMTP id p8mr29219578pjb.114.1637566106718; Sun, 21 Nov 2021 23:28:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637566106; cv=none; d=google.com; s=arc-20160816; b=SK6fHXzVMp+17Sf/FAUn2I+OpgE1+pa4TabElqJaNoBCjN+Rord/gHJtxR5dTHZP0J dCYxLKWHIwmeA6QxxW3R7ZsurIhbzznhjk/H4ub7i9TvVbVrbIBZTOeyuz716invJff7 ETgZoaiU0CD0LPYyACPl4z2QZx70szfSlScZPl3PNYiOA/QJM2NADcGnCRoPtIBMBXuE aBjwHX1G0Pgd1FQjcJLqEVBXtvT6Q0ZRZ5whx2KwHIeNTrQgxF8J6Ybc6AiBjF6Bw5yy LtH9rMlTwwy17b20eWL2sDQhNNP5iwfykJ3gq+eaQ/FPRtUdRLrBaTXaAoMrGWL08DM5 bSSQ== 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=h0KkfqEFUtCsE4t88jytKUnXQDOeiE6FXa0Elmzcs9s0pZz3tb0E1gjJeEpHrChAVd w3QDbnjTkBKGyjsjdIdOKupHcgEwsD75/IROuMGtKhK3iFxnSQCRTblgyzuTBpASHgbS E8SlSOmVnaGqT4oTf9pK29TBvADtsWgVIHiw8ely774F+4XTsuYqGI0pHd5xKNVr9u2r CMDFYr1NLfXm9PGsqRUY/43GuTuNI3VzMMPy8FCXjwTKkA7pB/qFS7oASt/0gmrZ7fiv TRDql+ZVw1rqME8comzzk5CbgWC+13tnbRHAjsZrtkPShhqL+PuxEs+DL9+ddH9W5UKz eudQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com. [68.232.141.98]) by gmr-mx.google.com with ESMTPS id p10si389241plr.4.2021.11.21.23.28.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Nov 2021 23:28:26 -0800 (PST) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) client-ip=68.232.141.98; IronPort-SDR: iP8xhwrjpDlYUvjM1uf5OS4WG2JEaawMD6Pi0qzIFZI7MK94VH3LJvHBm4CMM1jARYlXjWf9B/ +ENFxTlawenFi81uiQ1HlHN24Jvtjbcei7nfaegBZiC9+kuNMWsJZHEV44Fy0UkZHYK5gGuNLi s57IU0d2M7rdVeWXkeExpJZig9b29abViHJB/FU6pjzT9dXA0GI3G6WF7baad7OvITtyw2gyT0 lmZatfAZ1GXmSmdMJzLvpE6T+iPHq8hXYAKEmnt8zkplbGVrRb0LYSiu/2ZX+3+c6uKddTxPTh PsZlZq6hk+7hd79MOCqPW1J6 X-IronPort-AV: E=Sophos;i="5.87,254,1631606400"; d="scan'208";a="68752155" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 21 Nov 2021 23:28:26 -0800 IronPort-SDR: eVci5I6A0fc6MgbjVZHBM5BxSFBMuZMFtT1dPq4nU3VpLH4fImTL+r3Q0Vzy0YxRG2i0Kpob4+ diX8lmJ7iiQC+IsvEFMMr/r5+3Nw2mFvCl9kDP4ye/fvKP/eESjmSTsAARAfvb0XbbOlioUrPX hahxTtRwlsATKnuXMBYP7fjY1PWosIu+XkXAIhtzWl3AAlGZyvjNg7+58wiwHxwjQXxy6/tGl0 dV0JT6GaUNH3ONnZowUg95E6mKbE3oo4t85um5V88MA3+2zmWNBiSISHdortJWvHzhPQjMdpDz /wI= From: Vijai Kumar K To: , CC: Vijai Kumar K Subject: [PATCH 1/4] u-boot: Switch to use DEB_BUILD_PROFILES Date: Mon, 22 Nov 2021 12:58:02 +0530 Message-ID: <20211122072805.2123748-2-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211122072805.2123748-1-Vijaikumar_Kanagarajan@mentor.com> References: <20211122072805.2123748-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.141.98 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.8 required=5.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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}" }