diff options
author | Mike Pagano <mpagano@gentoo.org> | 2023-11-26 10:12:29 -0500 |
---|---|---|
committer | Mike Pagano <mpagano@gentoo.org> | 2023-11-26 10:12:29 -0500 |
commit | c7898633e0c2811881fc0fdde6b93e26f2277e8d (patch) | |
tree | 8ed30064e211d0806e471e8a8f818c97e6d85d1d /sys-kernel/linux-firmware/files | |
parent | profiles/desc/amdgpu_targets.desc: fill in more GPU models. (diff) | |
download | gentoo-c7898633e0c2811881fc0fdde6b93e26f2277e8d.tar.gz gentoo-c7898633e0c2811881fc0fdde6b93e26f2277e8d.tar.bz2 gentoo-c7898633e0c2811881fc0fdde6b93e26f2277e8d.zip |
sys-kernel/linux-firmware: upd EAPI 7 -> 8, add dedup optional logic
Move upstream's deduplication part of their script,
which requires rdfind, behind a new use flag: deduplicate
Patch will remove the deduplication part of the script based on
use flag.
Add info on deduplicate use flag
Thanks to Sam for the review
Bug: https://bugs.gentoo.org/917324
Closes: https://github.com/gentoo/gentoo/pull/33988
Signed-off-by: Mike Pagano <mpagano@gentoo.org>
Diffstat (limited to 'sys-kernel/linux-firmware/files')
-rw-r--r-- | sys-kernel/linux-firmware/files/linux-firmware-remove-rdfind-dep-and-use.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sys-kernel/linux-firmware/files/linux-firmware-remove-rdfind-dep-and-use.patch b/sys-kernel/linux-firmware/files/linux-firmware-remove-rdfind-dep-and-use.patch new file mode 100644 index 000000000000..83646a073224 --- /dev/null +++ b/sys-kernel/linux-firmware/files/linux-firmware-remove-rdfind-dep-and-use.patch @@ -0,0 +1,34 @@ +--- a/copy-firmware.sh 2023-11-25 18:07:49.362441380 -0500 ++++ b/copy-firmware.sh 2023-11-25 18:19:03.612907595 -0500 +@@ -69,7 +69,7 @@ if [ -z "$destdir" ]; then + exit 1 + fi + +-if ! which rdfind 2>/dev/null >/dev/null; then ++if [ -n "$LINUX_FIRMWARE_DO_DEDUPE" ] && ! which rdfind 2>/dev/null >/dev/null; then + echo "ERROR: rdfind is not installed" + exit 1 + fi +@@ -87,13 +87,15 @@ grep -E '^(RawFile|File):' WHENCE | sed + fi + done + +-$verbose "Finding duplicate files" +-rdfind -makesymlinks true -makeresultsfile false "$destdir" >/dev/null +-find "$destdir" -type l | while read -r l; do +- target="$(realpath "$l")" +- $verbose "Correcting path for $l" +- ln -fs "$(realpath --relative-to="$(dirname "$(realpath -s "$l")")" "$target")" "$l" +-done ++if [ -n "$LINUX_FIRMWARE_DO_DEDUPE" ]; then ++ $verbose "Finding duplicate files" ++ rdfind -makesymlinks true -makeresultsfile false "$destdir" >/dev/null ++ find "$destdir" -type l | while read -r l; do ++ target="$(realpath "$l")" ++ $verbose "Correcting path for $l" ++ ln -fs "$(realpath --relative-to="$(dirname "$(realpath -s "$l")")" "$target")" "$l" ++ done ++fi + + # shellcheck disable=SC2162 # file/folder name can include escaped symbols + grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read f d; do |