From patchwork Fri Nov 19 20:39:19 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: 1093 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3) with LMTPA; Sat, 20 Nov 2021 07:39:50 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-qv1-f64.google.com (mail-qv1-f64.google.com [209.85.219.64]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPS id 1AK6dnBw026052 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 20 Nov 2021 07:39:49 +0100 Received: by mail-qv1-f64.google.com with SMTP id 1-20020ad45ba1000000b003bdfcecfe10sf10952953qvq.23 for ; Fri, 19 Nov 2021 22:39:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1637390383; cv=pass; d=google.com; s=arc-20160816; b=F54Fh8ayYvAUlxiLRN2ogXMM6pwqYQK4VYnP9jjDkFMq1jxiEch9j/wjjqx9hC6c13 Xi80yfEUhxbMMsguMoDZ94NegLcTChsyFagjG63vtTgq09FzMzs8Z8QJG67tUsK3LKlg 7kwt2ig1K3cpAyDENfUSUy2eCq9p9j6J2guyIToEWjD7pcSlLjOU0pvGtmHke9mr5QvH wHzbgjmYAEsLTiReVb51ZVwMWFpXERmv3kPA1TxO8ksbcj5MDVRZxS6hIeVc+cJ2jG+q Ka2jKqtMaG/53Q1cklb6E2Zry9o4+FpPhE8TISXXzFwTZngCID3wXgUcAWuvArh3hY+p OrWg== 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=6cqXU0SwDVDhUpTBXGrMZCwoibLhOFHw3ujbQ2zdv/k=; b=uI098TFM2kkpPuL6htCfX5bZuHRcZe6aNyHq/UQDFpggz0eZjpvwtBvmVugcGj9lmQ a+STT7huXbm+oHqt02T6JWrpzP5iYf277FkSQqZDRJV4G+FgdWZ5iAt5IBnnps75aobn 3Atur4CgQTO8kJPtg9PXBED3tgN02MhFlZd6DNRTMr7vM5XO5B6ImBYXlyzD60cheuU4 y2ZnKfCEOSQ/wFrdP6xW2Bo8cX/HnErTFhbFzy4S7J2Vs/u6ynsjs0lowo62ajPwdq86 Vu3K5HOywPOytF8q0KR3RToy2mKyzZ2lKQizuPQRV0rd4WghJXGVrQnlkBIVVD3A/WWV 9THw== 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=6cqXU0SwDVDhUpTBXGrMZCwoibLhOFHw3ujbQ2zdv/k=; b=QMLYRKOS/gNvX1gFur+VovEwhPqTAsOkoj/xdQHXC9BFT5w850fISMWO+G6ZDJWtL5 R12MuvvIPJ7zWIVjW1NHHcz6PJWHhdqFwpP4m1JOZDmy6BBagnY2CsBuJnXJ3rf5yF9j 69uaOqCyK/+IEqFmvPE64nAn0wLiK+IzNhL/kGpAzfx6L+aMghMGxJeZ9vLkO4b+FMDs D7QVNK53Jfx31VZ5+/s+Zps1OPOhDwJjvuLlF40wE8/DZ1gDs8jXOQeMRtf8h8igVR6v lv67c0o1Ye1ezSyp9ebEudMKxtus4SA/gJEFrrEqF8x70uAtRNlVbI8L9LJQWc2bAGXL O1Fw== 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=6cqXU0SwDVDhUpTBXGrMZCwoibLhOFHw3ujbQ2zdv/k=; b=4fF0oxG+F4eSoP/Wq11O8xu79IQTtJvqmY+WtVhCa2BIgKZ2DAHOFZSHlw/TYb18xR GwgAjKlgdTO2qVidQQoUc7hggIBUOrh07k+rPvk6/ax3xJldFGG1oNSCxp+5tIwlHP/r NW+lHFA9KkQ0yYtIBWPnOEu1qNEiiwC2q5JPn47SU5nw93ptHzXouSJ3I8+tFDL4ync9 I4K75VMkJTcRdPIWxPjR34Dzcri6X645vZbwCv5rJRsNlEQ+SnkLf6M7z8tI5Z1u6B+s ez1hcyf39DvhO9YJqAISQxeOPfTSyqurZNs4ihAtrj1nkJkxhgu4Kt+4WC+LmaUNOBEq 8hMQ== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM532gm2G8KhCBgYGH4hZM4ntmrDpJmg8HeMqPRN0I+mxaa4rZU0zy 6E5rj6yqYGG07FJAYimvyo0= X-Google-Smtp-Source: ABdhPJwBG/T7HNuWfJV5LD2unoZPS5YKV7zplSdykN0bkGPFD9+2gloDwjJmFMT0LdBUf6zmZDnfcA== X-Received: by 2002:a05:620a:430b:: with SMTP id u11mr34753101qko.473.1637390383682; Fri, 19 Nov 2021 22:39:43 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:620a:4613:: with SMTP id br19ls1219978qkb.6.gmail; Fri, 19 Nov 2021 22:39:43 -0800 (PST) X-Received: by 2002:a37:3d6:: with SMTP id 205mr34851473qkd.250.1637390383257; Fri, 19 Nov 2021 22:39:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637390383; cv=none; d=google.com; s=arc-20160816; b=D8qCUElhDHQocOnluoR4VvLpnwyOGbj6wnL+8Pcc7MMg82k3972vErFObqq+JNKIzS RhKvokJ+QMI0Paf014neD323N/vTSWR7AvReJYkY+5dy3GQdhEYe8sibbq+z4eP089oe gT6MWoL5YU65IQVxLv+EgwjgNtESBm7Rntqx5Pbe6U4/lQ5oMHNdN6PCqFhwGFS6z99Z s79qOg427EwRGkN6VMWkldK4P4JBkfwxk7gjYsXqfX4XubkaRjVj5/37f+oS26ptc1xh P/bnzWILTUlgF0wiFV0dsw8ZszevZJenC6gNoX9m1S4kT1f7hZ/xZI9hHpau1LQj42LV mMNA== 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=uuCJhWaHtP5XJJxMOOCAEGlRW+NZckUebCzHOvE1lu0=; b=untrUkSbOn2RMrW6CuSb3BNTPoPqtkL9aTFPxMz0kenFWZ+quZNNkW4gUffuMAWpO4 3CRUTtlnjL5xnSU/b40POnUC1/4Q1A8c/NDZJONxBNIt/YDHUN5ScDVobXzzBJLO5b/E 01O+OTemTlWKysozHcGNm/eii5ChwEbkoTUr9rlCGGLvVm1B3kvEwW+2XaH8xVpFw7F4 RXNQiU8hXtdGTD6/OpqpaEX+sf+emx5sF1phVfLHE3PTgMsHKy/p392z+2ouvB0p5/Rl nNkB0h1ai5Q/QCiqPTWe6SXHovVX2q4+7tQY1dTGuf4pKXLDZadnaxznK5a8Q1Rw5TcM +7Pw== 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 u7si318333qki.5.2021.11.19.22.39.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Nov 2021 22:39:43 -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: cSea4P/6gyuis9CcxW1tyxIfZ1IrX76jr3ZVQ2RW29nYNJw674njwLoALPRofJgHKavhC0/gB4 GidN+xMk87lAJNu5p/LBy1xYY2sjgqo9Jz2Gh1WQjN/HRiK4OL4gooRIhWpIB5K5cGWKfdnYK6 aj+ZWpGypgCrL8i8/PyKa2SVMirHWZAPaHJlR5vFOzmCbbCAyX2ch3m+70b+grhi6RwQFK46XL CBXN7vgYJjA0P4e09BLX9XUPichfVvcWG3GXCL4be8EIhIfZP2FsOrm9i9mmlWDqj5gpSITziA yehxlscKMs1DRSQhEYR1yKoC X-IronPort-AV: E=Sophos;i="5.87,250,1631606400"; d="scan'208";a="68712290" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 19 Nov 2021 22:39:42 -0800 IronPort-SDR: WDMYx8PDnGIe/8cwrwfWtY88+ztlDpV04xi1x8n52lLf4BehaYogwmITd5A6y1xh9gIpqQlPF/ C2bEAUW0XPgtIDUIW6SiGhEpAGGqcWe8cgpSeef/PrLgSnyc16oZ7fZeoKJcrkY8iigKeQF/mk JCEcH49T7p1CeI+hun0ySrBPUek99aVGAKdCiclYkTvvZ0jn+Tp4Ljv1lkczu2CWYFc+boIvNK K9xYKyzmVrOgbc4Db2CEhSZQw1nqxYm/baVvuenipb4gR0eQ75dda4pxJXN/7VQPlTUdz1tqQM MaM= From: Vijai Kumar K To: CC: Vijai Kumar K Subject: [PATCH v4 1/3] u-boot: Switch to use DEB_BUILD_PROFILES Date: Sat, 20 Nov 2021 12:09:19 +0530 Message-ID: <20211120063921.1588706-2-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211120063921.1588706-1-Vijaikumar_Kanagarajan@mentor.com> References: <20211120063921.1588706-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-06.mgc.mentorg.com (147.34.90.206) 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.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 3680f01..5e8a15b 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, libssl-dev:native" @@ -30,8 +47,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}/ @@ -41,31 +58,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 @@ -76,4 +77,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}" }