diff mbox series

[Unstable,v2,1/5] UBUNTU: [Packaging] buildinfo: Use modinfo data for the ABI

Message ID 20210610080807.25518-2-juergh@canonical.com
State New
Headers show
Series Use modinfo data for the ABI | expand

Commit Message

Juerg Haefliger June 10, 2021, 8:08 a.m. UTC
Instead of just listing the provided modules, collect the modinfo data
from all modules and put it in a modules subdirectory provided by the
buildinfo package. This also includes the firmware information so drop
the fwinfo file.

For Hirsute this adds roughly 25MB to the amd64 generic buildinfo package:
  $ du -h /usr/lib/linux/5.11.0-14-generic/modules/
  25M	/usr/lib/linux/5.11.0-14-generic/modules/

Signed-off-by: Juerg Haefliger <juergh@canonical.com>
---
 debian/rules.d/2-binary-arch.mk | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index 5ae9a989207c..fbc7ce928587 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -460,14 +460,13 @@  endif
 		$(builddir)/build-$*/Module.symvers | sort > $(abidir)/$*
 
 	# Build the final ABI modules information.
-	find $(pkgdir_bin) $(pkgdir) $(pkgdir_ex) -name \*.ko | \
-		sed -e 's/.*\/\([^\/]*\)\.ko/\1/' | sort > $(abidir)/$*.modules
-
-	# Build the final ABI firmware information.
+	install -d $(abidir)/$*.modules
 	find $(pkgdir_bin) $(pkgdir) $(pkgdir_ex) -name \*.ko | \
 	while read ko; do \
-		/sbin/modinfo $$ko | grep ^firmware || true; \
-	done | sort -u >$(abidir)/$*.fwinfo
+		modname=$${ko##*/}; \
+		modname=$${modname%.ko}; \
+		/sbin/modinfo "$${ko}" > $(abidir)/$*.modules/"$${modname}"; \
+	done
 
 	# Build the final ABI compiler information.
 	ko=$$(find $(pkgdir_bin) $(pkgdir) $(pkgdir_ex) -name \*.ko | head -1); \
@@ -495,10 +494,9 @@  endif
 		$(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/config
 	install -m644 $(abidir)/$* \
 		$(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/abi
-	install -m644 $(abidir)/$*.modules \
-		$(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/modules
-	install -m644 $(abidir)/$*.fwinfo \
-		$(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/fwinfo
+	install -d $(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/modules
+	install -m644 $(abidir)/$*.modules/* \
+		$(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/modules/
 	install -m644 $(abidir)/$*.retpoline \
 		$(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/retpoline
 	install -m644 $(abidir)/$*.compiler \