public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] u-boot-custom: Add control for u-boot-tools package build
@ 2019-09-03  5:41 Jan Kiszka
  2019-09-12 14:12 ` Baurzhan Ismagulov
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2019-09-03  5:41 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

Each custom u-boot currently generates also the u-boot-tools packages.
That can cause redundant builds in the best case when building multiple
targets with custom u-boots. In the worst case, an undeterministic
version is installed, depending one which u-boot with which version is
finished first.

Allow the user to define which recipe generates also the u-boot-tools
package so that only one is generated in a multi-target scenario. We
default to "no build" as a tools package different to the distro one is
rarely needed on the target.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta-isar/recipes-bsp/u-boot/u-boot_2018.09.bb    |  3 +++
 meta/recipes-bsp/u-boot/files/debian/control.tmpl |  5 -----
 meta/recipes-bsp/u-boot/u-boot-custom.inc         | 15 ++++++++++++++-
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/meta-isar/recipes-bsp/u-boot/u-boot_2018.09.bb b/meta-isar/recipes-bsp/u-boot/u-boot_2018.09.bb
index fe00b73..9a3fd90 100644
--- a/meta-isar/recipes-bsp/u-boot/u-boot_2018.09.bb
+++ b/meta-isar/recipes-bsp/u-boot/u-boot_2018.09.bb
@@ -9,3 +9,6 @@ SRC_URI += " \
     ftp://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
     "
 SRC_URI[sha256sum] = "839bf23cfe8ce613a77e583a60375179d0ad324e92c82fbdd07bebf0fd142268"
+
+# Just for testing purposes, distro package would be recent enough
+U_BOOT_TOOLS_PACKAGE = "1"
diff --git a/meta/recipes-bsp/u-boot/files/debian/control.tmpl b/meta/recipes-bsp/u-boot/files/debian/control.tmpl
index 5c1cc92..0ab3a29 100644
--- a/meta/recipes-bsp/u-boot/files/debian/control.tmpl
+++ b/meta/recipes-bsp/u-boot/files/debian/control.tmpl
@@ -12,8 +12,3 @@ Description: ${DESCRIPTION}, bootloader binaries
 Package: u-boot-${MACHINE}-dev
 Architecture: ${DISTRO_ARCH}
 Description: ${DESCRIPTION}, bootloader libraries
-
-Package: u-boot-tools
-Architecture: linux-any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: ${DESCRIPTION}, companion tools
diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc
index 400aba2..8843789 100644
--- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc
@@ -9,7 +9,8 @@ FILESPATH =. "${LAYERDIR_core}/recipes-bsp/u-boot/files:"
 
 DESCRIPTION ?= "Custom U-Boot"
 
-PROVIDES += "u-boot-${MACHINE} u-boot-${MACHINE}-dev u-boot-tools"
+PROVIDES += "u-boot-${MACHINE} u-boot-${MACHINE}-dev"
+PROVIDES += "${@'u-boot-tools' if d.getVar('U_BOOT_TOOLS_PACKAGE') == '1' else ''}"
 
 inherit dpkg
 
@@ -20,6 +21,8 @@ BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git"
 TEMPLATE_FILES = "debian/control.tmpl"
 TEMPLATE_VARS += "MACHINE BUILD_DEPENDS"
 
+U_BOOT_TOOLS_PACKAGE ?= "0"
+
 do_prepare_build() {
     cp -r ${WORKDIR}/debian ${S}/
 
@@ -30,6 +33,16 @@ do_prepare_build() {
 
     echo "tools/env/libubootenv.a usr/lib" > \
         ${S}/debian/u-boot-${MACHINE}-dev.install
+
+    if [ "${U_BOOT_TOOLS_PACKAGE}" = "1" ]; then
+        cat <<EOF >>${S}/debian/control
+
+Package: u-boot-tools
+Architecture: linux-any
+Depends: \${shlibs:Depends}, \${misc:Depends}
+Description: ${DESCRIPTION}, companion tools
+EOF
+    fi
 }
 
 dpkg_runbuild_prepend() {
-- 

2.16.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-13  6:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-03  5:41 [PATCH] u-boot-custom: Add control for u-boot-tools package build Jan Kiszka
2019-09-12 14:12 ` Baurzhan Ismagulov
2019-09-13  6:21   ` Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox