From 95e04fc5385668b90f5957ec52ec14dcc6db10f0 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Tue, 18 Jul 2023 12:16:32 +0200 Subject: [PATCH] UBUNTU: Compress kernel modules with zst -19 LP: #2028568 Signed-off-by: Benjamin Drung --- debian.master/control.stub.in | 2 +- debian/rules.d/2-binary-arch.mk | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/debian.master/control.stub.in b/debian.master/control.stub.in index b2fd9c4a6329..fa43443746ad 100644 --- a/debian.master/control.stub.in +++ b/debian.master/control.stub.in @@ -37,7 +37,7 @@ Build-Depends: libnuma-dev [amd64 arm64 ppc64el s390x] , dkms , curl , - zstd [amd64 s390x] , + zstd , pahole [amd64 arm64 armhf ppc64el s390x riscv64] | dwarves (>= 1.21) [amd64 arm64 armhf ppc64el s390x riscv64] , rustc-1.62 [amd64], rust-1.62-src [amd64], diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index b796e67dadb1..2137df2bef66 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -487,6 +487,10 @@ endif sed -e 's/^\(.\+\)[[:space:]]\+\(.\+\)[[:space:]]\(.\+\)$$/\3 \2 \1/' \ $(builddir)/build-$*/Module.symvers | sort > $(abidir)/$* + # Compress kernel modules + find $(pkgdir_bin) $(pkgdir) $(pkgdir_ex) \( -name '*.ko' -o -name '*.ko.*' \) | \ + while read -r ko; do zstd -19 -z --rm "$$ko"; done + # Build the final ABI modules information. find $(pkgdir_bin) $(pkgdir) $(pkgdir_ex) \( -name '*.ko' -o -name '*.ko.*' \) | \ sed -e 's/.*\/\([^\/]*\)\.ko.*/\1/' | sort > $(abidir)/$*.modules @@ -498,7 +502,7 @@ endif fi # Build the final ABI firmware information. - find $(pkgdir_bin) $(pkgdir) $(pkgdir_ex) -name \*.ko | \ + find $(pkgdir_bin) $(pkgdir) $(pkgdir_ex) \( -name '*.ko' -o -name '*.ko.*' \) | \ while read ko; do \ /sbin/modinfo $$ko | grep ^firmware || true; \ done | sort -u >$(abidir)/$*.fwinfo @@ -511,7 +515,7 @@ endif fi # Build the final ABI compiler information. - ko=$$(find $(pkgdir_bin) $(pkgdir) $(pkgdir_ex) -name \*.ko | head -1); \ + ko=$$(find $(pkgdir_bin) $(pkgdir) $(pkgdir_ex) \( -name '*.ko' -o -name '*.ko.*' \) | head -1); \ readelf -p .comment "$$ko" | gawk ' \ ($$1 == "[") { \ printf("%s", $$3); \ -- 2.39.2