Control: clone 977803 -1
Control: retitle -1 arm-trusted-firmware: Make each command run by Make visible 
in the build log

On 2020-12-20, Nicolas Boulenguez wrote:
> Please consider the attached suggestions for the packaging part.

Thanks for the patches, I've merged some with minor changes.

In the future, please file separate issues as separate bugs and please
do not bundle patches in a tarball; it makes it a harder to review and
comment on the changes individually.


0001-Update-debian-watch.patch

Merged, thanks!


0002-Delegate-changelog-renaming-to-debhelper.patch

Merged (with extraneous whitespace removed), Thanks.


0003-Let-dh_auto_build-call-sub-Makes-with-j-from-DEB_BUI.patch

Merged (adjusted for whitespace change)


0004-Make-each-command-run-by-Make-visible-in-the-build-l.patch

I like parts of this, but need to look it over more. Reassigning this to
a new bug, and attaching the patch.


0005-Simplify-the-lintian-overrides.patch

Merged the glob part, thanks! Leaving the "extra" stuff in the lintian
overrides for now.


live well,
  vagrant
From f895f034796bbc91de3f1dde0389ac1dc2aae219 Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <nicolas.bouleng...@free.fr>
Date: Sun, 20 Dec 2020 14:55:26 +0100
Subject: [PATCH 4/5] Make each command run by Make visible in the build log

The information flow is easyer to understand in named Make variables
than in shell pipes.

Also, errors are handled properly.  For example, chmod is currently
emitting an error message in the amd64 logs (of course, *this* error
can be ignored).
---
 debian/arm-trusted-firmware.install |  8 --------
 debian/rules                        | 20 ++++++++++++++++++--
 debian/targets                      |  5 -----
 3 files changed, 18 insertions(+), 15 deletions(-)
 delete mode 100755 debian/arm-trusted-firmware.install
 delete mode 100644 debian/targets

diff --git a/debian/arm-trusted-firmware.install b/debian/arm-trusted-firmware.install
deleted file mode 100755
index e8c531430..000000000
--- a/debian/arm-trusted-firmware.install
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-grep -v '^#' debian/targets | while read plat targets ; do
-	for target in $targets ; do
-		chmod a-x build/$plat/debug/$target
-		echo build/$plat/debug/$target usr/lib/arm-trusted-firmware/$plat/
-	done
-done
diff --git a/debian/rules b/debian/rules
index ce1005bda..686921af3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,6 +9,13 @@ else
 VERBOSE=1
 endif
 
+platforms := g12a gxbb sun50i_a64 rk3328 rk3399
+g12a_targets        := bl31.bin
+gxbb_targets        := bl31.bin
+sun50i_a64_targets  := bl31.bin
+rk3328_targets      := bl31/bl31.elf
+rk3399_targets      := bl31/bl31.elf
+
 %:
 	dh $@
 
@@ -21,12 +28,21 @@ endif
 # Only build firmware on arm64.
 ifeq ($(DEB_HOST_ARCH),arm64)
 	# Always set CROSS_COMPILE, which also works for native builds.
-	grep -v '^#' debian/targets | while read plat targets ; do \
+	for plat in $(platforms); do \
 		CROSS_COMPILE=aarch64-linux-gnu- CFLAGS= LDFLAGS= dh_auto_build -- V=$(VERBOSE) DEBUG=1 PLAT=$$plat bl31 ; \
 	done
-
 endif
 
+execute_after_dh_install: $(addprefix install-,$(platforms))
+install-%:
+	dh_install -parm-trusted-firmware $(addprefix build/$*/debug/,$($*_targets)) usr/lib/arm-trusted-firmware/$*
+
+execute_after_dh_fixperms:
+  # The test prevents a failure when the glob pattern matches nothing.
+  ifeq ($(DEB_HOST_ARCH),arm64)
+	chmod a-x debian/arm-trusted-firmware/usr/lib/arm-trusted-firmware/*/*
+  endif
+
 override_dh_installchangelogs:
 	dh_installchangelogs -parm-trusted-firmware docs/change-log.rst
 	dh_installchangelogs -parm-trusted-firmware-tools
diff --git a/debian/targets b/debian/targets
deleted file mode 100644
index 122e49943..000000000
--- a/debian/targets
+++ /dev/null
@@ -1,5 +0,0 @@
-g12a bl31.bin
-gxbb bl31.bin
-sun50i_a64 bl31.bin
-rk3328 bl31/bl31.elf
-rk3399 bl31/bl31.elf
-- 
2.20.1

Attachment: signature.asc
Description: PGP signature

Reply via email to