From b448cf64c98261fa15a3aa1e217559c4cfb383c5 Mon Sep 17 00:00:00 2001 From: Juerg Haefliger Date: Fri, 24 Nov 2023 11:51:38 +0100 Subject: [PATCH] UBUNTU: [Packaging] Fix kernel module compression failures BugLink: https://bugs.launchpad.net/bugs/2044512 The kernel module compression step is run for every binary package, not just the modules packages. This results in a build failure when run in a console for packages that don't contain any .ko files: \# Compress kernel modules find debian/linux-unstable-tools-6.6.0-12 -name '*.ko' -print0 | xargs -0 -n1 -P 8 zstd -19 --quiet --rm stdout is a console, aborting make: *** [debian/rules.d/2-binary-arch.mk:769: binary-perarch] Error 123 Basically, if find returns nothing, zstd tries to read from stdin: $ echo | xargs zstd stdout is a console, aborting $ echo $? 123 To fix that, tell xargs not to run the command if stdin is empty: $ echo | xargs -r zstd $ echo $? 0 Signed-off-by: Juerg Haefliger Acked-by: Manuel Diewald Acked-by: Thibault Ferrante Acked-by: Dimitri John Ledkov Signed-off-by: Dimitri John Ledkov --- debian/rules.d/2-binary-arch.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index 444564faea3c..c372e2f9ea09 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -568,7 +568,7 @@ define dh_all dh_installdocs -p$(1) dh_compress -p$(1) # Compress kernel modules, on mantic+ - $(if $(do_zstd_ko),find debian/$(1) -name '*.ko' -print0 | xargs -0 -n1 -P $(CONCURRENCY_LEVEL) zstd -19 --quiet --rm, true) + $(if $(do_zstd_ko),find debian/$(1) -name '*.ko' -print0 | xargs -0 -n1 -P $(CONCURRENCY_LEVEL) -r zstd -19 --quiet --rm, true) dh_fixperms -p$(1) -X/boot/ dh_shlibdeps -p$(1) $(shlibdeps_opts) dh_installdeb -p$(1)