From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B7E25158004 for ; Mon, 20 May 2024 12:59:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 70EE5E2A40; Mon, 20 May 2024 12:59:15 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 43BA8E2A3D for ; Mon, 20 May 2024 12:59:15 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7170333BEF1 for ; Mon, 20 May 2024 12:59:14 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 055971AE3 for ; Mon, 20 May 2024 12:59:13 +0000 (UTC) From: "Ben Kohler" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ben Kohler" Message-ID: <1716209939.cc7d5e1e32a88dc2a4f144ce6ac9a92a2d679b05.bkohler@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_initramfs.sh X-VCS-Directories: / X-VCS-Committer: bkohler X-VCS-Committer-Name: Ben Kohler X-VCS-Revision: cc7d5e1e32a88dc2a4f144ce6ac9a92a2d679b05 X-VCS-Branch: master Date: Mon, 20 May 2024 12:59:13 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: bb4bca1e-f9ec-4a87-9d85-f91b700169b3 X-Archives-Hash: eda26cb09174d319966b269c397be2f6 commit: cc7d5e1e32a88dc2a4f144ce6ac9a92a2d679b05 Author: Dmitriy Baranov gmail com> AuthorDate: Tue Mar 5 18:53:05 2024 +0000 Commit: Ben Kohler gentoo org> CommitDate: Mon May 20 12:58:59 2024 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=cc7d5e1e gen_initramfs.sh: copy compressed firmwares Signed-off-by: Dmitriy Baranov gmail.com> Signed-off-by: Ben Kohler gentoo.org> gen_initramfs.sh | 12 ++++++++++-- 1 file 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 )