summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Kostecki <conikost@gentoo.org>2025-01-10 23:18:03 +0100
committerConrad Kostecki <conikost@gentoo.org>2025-01-10 23:18:03 +0100
commitea301ba0b6143bd96d21f5d4be15fc6c64b539af (patch)
treeab13717867726c8073a120a5e4519a91f2ee39e1 /sys-kernel
parentnet-news/newsboat: remove unused patch(es) (diff)
downloadgentoo-ea301ba0b6143bd96d21f5d4be15fc6c64b539af.tar.gz
gentoo-ea301ba0b6143bd96d21f5d4be15fc6c64b539af.tar.bz2
gentoo-ea301ba0b6143bd96d21f5d4be15fc6c64b539af.zip
sys-kernel/linux-firmware: fix USE=savedconfig
Closes: https://bugs.gentoo.org/947829 Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
Diffstat (limited to 'sys-kernel')
-rw-r--r--sys-kernel/linux-firmware/files/linux-firmware-copy-firmware-r8.patch57
-rw-r--r--sys-kernel/linux-firmware/linux-firmware-20250109-r1.ebuild (renamed from sys-kernel/linux-firmware/linux-firmware-20250109.ebuild)3
2 files changed, 60 insertions, 0 deletions
diff --git a/sys-kernel/linux-firmware/files/linux-firmware-copy-firmware-r8.patch b/sys-kernel/linux-firmware/files/linux-firmware-copy-firmware-r8.patch
new file mode 100644
index 000000000000..e8eba66cc07c
--- /dev/null
+++ b/sys-kernel/linux-firmware/files/linux-firmware-copy-firmware-r8.patch
@@ -0,0 +1,57 @@
+--- a/copy-firmware.sh
++++ b/copy-firmware.sh
+@@ -66,6 +66,16 @@
+ shift
+ ;;
+
++ --firmware-list)
++ if [ -n "$2" ]; then
++ FIRMWARE_LIST=$2
++ shift 2
++ else
++ echo "ERROR: '--firmware-list' requires a non-empty option argument of firmware files to install"
++ exit 1
++ fi
++ ;;
++
+ *)
+ if test -n "$destdir"; then
+ err "unknown command-line options: $*"
+@@ -90,8 +100,18 @@
+ ./check_whence.py || err "check_whence.py has detected errors."
+ fi
+
++if test -n "${FIRMWARE_LIST}"; then
++ grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read l t; do
++ if ! cat "${FIRMWARE_LIST}" | grep -q "${l}"; then continue; fi
++ target="$(realpath --relative-to="$(pwd)" -m -s "$(dirname "$l")/$t")"
++ echo "${target}" >> "${FIRMWARE_LIST}"
++ done
++ FIRMWARE_LIST=$(cat "${FIRMWARE_LIST}")
++fi
++
+ # shellcheck disable=SC2162 # file/folder name can include escaped symbols
+ grep -E '^(RawFile|File):' WHENCE | sed -E -e 's/^(RawFile|File): */\1 /;s/"//g' | while read k f; do
++ [ -n "${FIRMWARE_LIST}" ] && if ! echo "${FIRMWARE_LIST}" | grep -q "${f}"; then continue; fi
+ install -d "$destdir/$(dirname "$f")"
+ $verbose "copying/compressing file $f$compext"
+ if test "$compress" != "cat" && test "$k" = "RawFile"; then
+@@ -116,6 +136,7 @@
+ echo > "$parallel_args_file"
+ # shellcheck disable=SC2162 # file/folder name can include escaped symbols
+ grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read l t; do
++ [ -n "${FIRMWARE_LIST}" ] && if ! echo "${FIRMWARE_LIST}" | grep -q "${l}"; then continue; fi
+ directory="$destdir/$(dirname "$l")"
+ install -d "$directory"
+ target="$(cd "$directory" && realpath -m -s "$t")"
+@@ -141,7 +162,9 @@
+
+ # Verify no broken symlinks
+ if test "$(find "$destdir" -xtype l | wc -l)" -ne 0 ; then
+- err "Broken symlinks found:\n$(find "$destdir" -xtype l)"
++ if [ -z "${FIRMWARE_LIST}" ]; then
++ err "Broken symlinks found:\n$(find "$destdir" -xtype l)"
++ fi
+ fi
+
+ exit 0
diff --git a/sys-kernel/linux-firmware/linux-firmware-20250109.ebuild b/sys-kernel/linux-firmware/linux-firmware-20250109-r1.ebuild
index 16d0264424c8..e014cbac6dfb 100644
--- a/sys-kernel/linux-firmware/linux-firmware-20250109.ebuild
+++ b/sys-kernel/linux-firmware/linux-firmware-20250109-r1.ebuild
@@ -73,6 +73,9 @@ IDEPEND="
"
QA_PREBUILT="*"
+PATCHES=(
+ "${FILESDIR}"/${PN}-copy-firmware-r8.patch
+)
pkg_pretend() {
if use initramfs; then