From cc7d5e1e32a88dc2a4f144ce6ac9a92a2d679b05 Mon Sep 17 00:00:00 2001 From: Dmitriy Baranov Date: Tue, 5 Mar 2024 21:53:05 +0300 Subject: gen_initramfs.sh: copy compressed firmwares Signed-off-by: Dmitriy Baranov Signed-off-by: Ben Kohler --- gen_initramfs.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 2cfa0fdb..486f0e6c 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 ) -- cgit v1.2.3-65-gdbad