APPLIED[N]/Cmnt: [Mantic/Noble/Unstable][SRU][PATCH] UBUNTU: [Packaging] Fix kernel module compression failures

Stefan Bader stefan.bader at canonical.com
Fri Jan 12 10:18:07 UTC 2024


On 24.11.23 11:51, Juerg Haefliger wrote:
> 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 <juerg.haefliger 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 79e3e857e2c8..f1950bbdcb92 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -542,7 +542,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 -P $(CONCURRENCY_LEVEL) -r zstd -19 --quiet --rm
>   	dh_fixperms -p$(1) -X/boot/
>   	dh_shlibdeps -p$(1) $(shlibdeps_opts)
>   	dh_installdeb -p$(1)

This was already applied to noble:linux/master-next by Juerg back in 
November last year. Thanks.

-Stefan


-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xE8675DEECBEECEA3.asc
Type: application/pgp-keys
Size: 48643 bytes
Desc: OpenPGP public key
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20240112/6f79b4e6/attachment-0001.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20240112/6f79b4e6/attachment-0001.sig>


More information about the kernel-team mailing list