aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Baranov <reagentoo@gmail.com>2024-03-05 21:53:05 +0300
committerBen Kohler <bkohler@gentoo.org>2024-05-20 07:58:59 -0500
commitcc7d5e1e32a88dc2a4f144ce6ac9a92a2d679b05 (patch)
treec5bc58ec1c269c99b907a466fa54e0b2c879ffed
parentgen_moddeps.sh: use KEXT along with default '.ko' extension to prevent modinf... (diff)
downloadgenkernel-cc7d5e1e32a88dc2a4f144ce6ac9a92a2d679b05.tar.gz
genkernel-cc7d5e1e32a88dc2a4f144ce6ac9a92a2d679b05.tar.bz2
genkernel-cc7d5e1e32a88dc2a4f144ce6ac9a92a2d679b05.zip
gen_initramfs.sh: copy compressed firmwares
Signed-off-by: Dmitriy Baranov <reagentoo@gmail.com> Signed-off-by: Ben Kohler <bkohler@gentoo.org>
-rwxr-xr-xgen_initramfs.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 2cfa0fd..486f0e6 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -1773,6 +1773,7 @@ append_firmware() {
fwlist=( "${FIRMWARE_FILES[@]}" )
else
local myfw=
+ local -a myfw_f=()
while IFS= read -r -u 3 myfw
do
if [ -z "${myfw}" ]
@@ -1780,13 +1781,20 @@ append_firmware() {
gen_die "modinfo error!"
fi
- if [ ! -f "${FIRMWARE_DIR}/${myfw}" ]
+ myfw_f=( $(compgen -G "${FIRMWARE_DIR}/${myfw}*") )
+
+ if [ ${#myfw_f[@]} -gt 1 ]
+ then
+ gen_die "excessive number of firmwares!"
+ fi
+
+ if [ ${#myfw_f[@]} -lt 1 ]
then
print_warning 3 "$(get_indent 3) - ${myfw} is missing; Ignoring ..."
continue
fi
- fwlist+=( "${myfw}" )
+ fwlist+=( "${myfw_f#${FIRMWARE_DIR}/}" )
done 3< <( (
modinfo -b "${KERNEL_MODULES_PREFIX%/}" -k "${KV}" -F firmware $(mod_dep_list) 2>/dev/null || echo
) | sort | uniq )