diff mbox series

[11/13] UBUNTU: [Packaging] generate: switch to consuming signed artifacts from linux-generate

Message ID 20220916114642.2953019-12-apw@canonical.com
State New
Headers show
Series [01/13] UBUNTU: [Packaging] generate-depends: relocate to debian/scripts | expand

Commit Message

Andy Whitcroft Sept. 16, 2022, 11:46 a.m. UTC
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 debian/rules | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/debian/rules b/debian/rules
index f55aa6b..07f37c4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,6 +9,8 @@  ver = $(shell dpkg-parsechangelog -S Version)
 abi = $(shell echo "$(ver)" | sed -ne 's/\([0-9]*\.[0-9]*\.[0-9]*\-[0-9]*\)\..*/\1/p')
 series = $(shell dpkg-parsechangelog -SDistribution | sed -e 's/-\(security\|updates\|proposed\)$$//')
 
+generate_src = $(shell echo $(src) | sed -e 's/-signed/-generate/')
+
 # Work out the source package name and version of the unsigned package
 # By convention, it is the name of this package with -signed stripped.
 # The version is identical to this package less any rebuild suffix (+signedN).
@@ -23,7 +25,7 @@  src_headers_arch = linux-headers-$(abi)-generic
 # we have no binary files and we will not run the appropriate targets.
 pre-clean:
 	rm -f debian/control
-	./debian/scripts/generate-control $(series) $(src) $(ver) $(unsigned_src) $(unsigned_ver) $(abi)
+	./debian/scripts/generate-control $(series) $(src) $(generate_src) $(ver) $(unsigned_src) $(unsigned_ver) $(abi)
 	./debian/scripts/parameterise-ancillaries $(abi) $(generate_src)
 	rm -rf ./$(unsigned_ver) UNSIGNED SIGNED
 	rm -f 	debian/linux-image-*.install				\
@@ -41,11 +43,12 @@  clean:: pre-clean
 	dh $@
 
 override_dh_auto_build:
-	./download-signed "$(src_headers_arch)" "$(unsigned_ver)" "$(unsigned_src)"
+	./download-signed "$(generate_src)" "$(ver)" "$(generate_src)"
 	#./download-unsigned "$(DEB_HOST_ARCH)" "$(unsigned_ver)"
 	mkdir SIGNED
 	(									\
-		cd "$(unsigned_ver)" || exit 1;					\
+		signed="$(CURDIR)/SIGNED";					\
+		cd "$(ver)/boot" || exit 1;					\
 		for s in *.efi.signed; do					\
 			[ ! -f "$$s" ] && continue;				\
 			base=$$(echo "$$s" | sed -e 's/.efi.signed//');		\
@@ -58,25 +61,25 @@  override_dh_auto_build:
 				fi;						\
 			);							\
 			chmod 600 "$$s";					\
-			ln "$$s" "../SIGNED/$$base";				\
+			ln "$$s" "$$signed/$$base";				\
 		done;								\
 		for s in *.opal.sig; do						\
 			[ ! -f "$$s" ] && continue;				\
 			base=$$(echo "$$s" | sed -e 's/.opal.sig//');		\
-			cat "$$base.opal" "$$s" >"../SIGNED/$$base";		\
-			chmod 600 "../SIGNED/$$base";				\
+			cat "$$base.opal" "$$s" >"$$signed/$$base";		\
+			chmod 600 "$$signed/$$base";				\
 		done;								\
 		for s in *.sipl.sig; do						\
 			[ ! -f "$$s" ] && continue;				\
 			base=$$(echo "$$s" | sed -e 's/.sipl.sig//');		\
-			cat "$$base.sipl" "$$s" >"../SIGNED/$$base";		\
-			chmod 600 "../SIGNED/$$base";				\
+			cat "$$base.sipl" "$$s" >"$$signed/$$base";		\
+			chmod 600 "$$signed/$$base";				\
 		done;								\
 		for s in *.fit.signed; do					\
 			[ ! -f "$$s" ] && continue;				\
 			chmod 600 "$$s";					\
 			base=$$(echo "$$s" | sed -e 's/.fit.signed//');		\
-			ln "$$s" "../SIGNED/$$base";				\
+			ln "$$s" "$$signed/$$base";				\
 		done;								\
 	)