[noble PATCH] UBUNTU: SAUCE: do not attempt to compress modules where no module exists

Masahiro Yamada masahiro.yamada at canonical.com
Mon Dec 4 01:37:22 UTC 2023


When building the Ubuntu kernel from the terminal, you will encounter
a build error like follows:

  find debian/linux-tools-6.6.0-14 -name '*.ko' -print0 | xargs -0 -n1 -P 24 zstd -19 --quiet --rm
  stdout is a console, aborting
  make: *** [debian/rules.d/2-binary-arch.mk:802: binary-perarch] Error 123

This code is implemented in dh_all, so it is executed for all packages,
even though not all of them contain modules.

Without the -r option, xargs runs the given command at least once.
'zstd -19 --quiet --rm' reads from stdin, and writes to stdout, which
is a terminal. The zstd command gracefully errors out instead of messing
up the terminal.

This issue may go unnoticed when you build the kernel in cbd or
launchpad, where the stdout is redirected to a logger. You can
observe garbled characters in a log file, at least.

Signed-off-by: Masahiro Yamada <masahiro.yamada at canonical.com>
---

 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 53fbb55c198a..f89efd270e1c 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
-	find debian/$(1) -name '*.ko' -print0 | xargs -0 -n1 -P $(CONCURRENCY_LEVEL) zstd -19 --quiet --rm
+	find debian/$(1) -name '*.ko' -print0 | xargs -0 -n1 -r -P $(CONCURRENCY_LEVEL) zstd -19 --quiet --rm
 	dh_fixperms -p$(1) -X/boot/
 	dh_shlibdeps -p$(1) $(shlibdeps_opts)
 	dh_installdeb -p$(1)
-- 
2.40.1




More information about the kernel-team mailing list