diff mbox series

[J,Unstable,1/2] UBUNTU: [Packaging] Add list of built-in firmwares to the ABI

Message ID 20220103100403.232275-2-juergh@canonical.com
State New
Headers show
Series Add builtin firmware info to the ABI | expand

Commit Message

Juerg Haefliger Jan. 3, 2022, 10:04 a.m. UTC
Built-in modules can require firmware so add a new file
<version>/fwinfo.builtin to the buildinfo package that contains that list.

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

Patch

diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index 996512f9ce0b..071878b97fd6 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -461,6 +461,13 @@  endif
 		/sbin/modinfo $$ko | grep ^firmware || true; \
 	done | sort -u >$(abidir)/$*.fwinfo
 
+	# Build the final ABI built-in firmware information.
+	if [ -f $(pkgdir)/lib/modules/$(abi_release)-$*/modules.builtin.modinfo ] ; then \
+		cat $(pkgdir)/lib/modules/$(abi_release)-$*/modules.builtin.modinfo | \
+			tr '\0' '\n' | sed -n 's/^.*firmware=/firmware: /p' | \
+			sort -u > $(abidir)/$*.fwinfo.builtin; \
+	fi
+
 	# Build the final ABI compiler information.
 	ko=$$(find $(pkgdir_bin) $(pkgdir) $(pkgdir_ex) -name \*.ko | head -1); \
 	readelf -p .comment "$$ko" | gawk ' \
@@ -499,6 +506,10 @@  endif
 		install -m644 $(abidir)/$*.modules.builtin \
 			$(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/modules.builtin; \
 	fi
+	if [ -f $(abidir)/$*.fwinfo.builtin ] ; then \
+		install -m644 $(abidir)/$*.fwinfo.builtin \
+			$(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/fwinfo.builtin; \
+	fi
 
 ifneq ($(full_build),false)
 	# Clean out this flavours build directory.