From 77087f6c67ed20097116ef134c56b3a803d54cc8 Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Mon, 20 Nov 2023 22:32:17 +0000 Subject: [PATCH] UBUNTU: [Packaging] make ZSTD module compression conditional BugLink: https://bugs.launchpad.net/bugs/2045593 Make ZSTD module compression conditional. Only enable it when building on recent series, such that backports of v6.5 kernels to jammy keep uncompressed modules, with zstd compressed .deb. Fixes: b2638e9702 ("UBUNTU: [Packaging] ZSTD compress modules") Signed-off-by: Dimitri John Ledkov Acked-by: Andrea Righi Acked-by: Roxana Nicolescu Signed-off-by: Dimitri John Ledkov --- debian/rules.d/0-common-vars.mk | 6 ++++++ debian/rules.d/2-binary-arch.mk | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk index 6f2400d9a3e6..6e4323f2c4e1 100644 --- a/debian/rules.d/0-common-vars.mk +++ b/debian/rules.d/0-common-vars.mk @@ -199,6 +199,12 @@ do_dtbs=false # FIPS check do_fips_checks=false +# ZSTD compressed kernel modules +do_zstd_ko=true +ifeq ($(series),jammy) +do_zstd_ko= +endif + # Support parallel= in DEB_BUILD_OPTIONS (see #209008) # # These 2 environment variables set the -j value of the kernel build. For example, diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index 53fbb55c198a..444564faea3c 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -567,8 +567,8 @@ define dh_all dh_installchangelogs -p$(1) 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 + # 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) dh_fixperms -p$(1) -X/boot/ dh_shlibdeps -p$(1) $(shlibdeps_opts) dh_installdeb -p$(1) @@ -621,7 +621,7 @@ binary-%: checks-% dh_testroot $(call dh_all,$(pkgimg)) -- -Znone - $(call dh_all,$(pkgimg_mods)) -- -Znone + $(call dh_all,$(pkgimg_mods))$(if $(do_zstd_ko), -- -Znone) ifeq ($(do_extras_package),true) ifeq ($(ship_extras_package),false) @@ -633,13 +633,13 @@ ifeq ($(do_extras_package),true) | tee -a $(target_flavour).not-shipped.log; else if [ -f $(DEBIAN)/control.d/$(target_flavour).inclusion-list ] ; then \ - $(call dh_all_inline,$(pkgimg_ex)) -- -Znone; \ + $(call dh_all_inline,$(pkgimg_ex))$(if $(do_zstd_ko), -- -Znone); \ fi endif endif $(foreach _m,$(all_standalone_dkms_modules), \ - $(if $(enable_$(_m)),$(call dh_all,$(dkms_$(_m)_pkg_name)-$*) -- -Znone;)\ + $(if $(enable_$(_m)),$(call dh_all,$(dkms_$(_m)_pkg_name)-$*)$(if $(do_zstd_ko), -- -Znone);)\ ) $(call dh_all,$(pkgbldinfo))