home: hub: mkinitfs

Download patch

ref: a5f05c98f690d95374b69ae5405052b250305fdf
parent: 41bddaed815be0d7faa09728a9de534c88c980fa
author: Dermot Bradley <dermot_bradley@yahoo.com>
date: Sun Nov 14 11:18:40 CST 2021

mkinitfs: handle compressed kernel modules

When determining which firmware needs to be includes in the initramfs
mkinitfs searches for kernel modules using the filename *.ko and so
does not cater for compressed modules (and therefore does not include
their required firmware in the initramfs).

Change the search pattern to deal with both uncompressed and
compressed modules.

--- a/mkinitfs.in
+++ b/mkinitfs.in
@@ -138,9 +138,9 @@
 	rm -rf "$tmpdir"/lib/firmware
 	mkdir -p "$tmpdir"/lib/firmware
 	# Verify if there are initfs modules
-	_modules=`find "$tmpdir"/lib/modules -type f -name "*.ko" -print -quit`
+	_modules=`find "$tmpdir"/lib/modules -type f -name "*.ko*" -print -quit`
 	[ -n "$_modules" ] || return 0
-	find "$tmpdir"/lib/modules -type f -name "*.ko" | xargs modinfo -F firmware | sort -u | while read FW; do
+	find "$tmpdir"/lib/modules -type f -name "*.ko*" | xargs modinfo -F firmware | sort -u | while read FW; do
 		[ -e "${basedir}/lib/firmware/${FW}" ] && install -pD "${basedir}/lib/firmware/${FW}" "$tmpdir"/lib/firmware/$FW
 	done
 	return 0