File: copy-fimrware-don-t-create-links-to-excluded-files.patch

package info (click to toggle)
firmware-nonfree 20250410-2
  • links: PTS, VCS
  • area: non-free-firmware
  • in suites: trixie
  • size: 1,131,100 kB
  • sloc: xml: 8,601; asm: 3,983; python: 3,895; sh: 488; ansic: 230; makefile: 155; perl: 17
file content (27 lines) | stat: -rw-r--r-- 850 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: Ben Hutchings <benh@debian.org>
Date: Mon, 25 Nov 2024 22:51:12 +0100
Subject: copy-firmware: Don't create links to excluded files
Forwarded: not-needed

Currently copy-firmware.sh skips missing files, but it may still
create symlinks to them.  Specifically, it currently creates the
follwoing broken symlinks:

- i915/skl_dmc_ver1.bin
- i915/skl_guc_ver6.bin
- i915/kbl_dmc_ver1.bin

Add a check that the symlink target exists.

---
--- a/copy-firmware.sh
+++ b/copy-firmware.sh
@@ -90,7 +90,7 @@ grep -E '^Link:' WHENCE | sed -e 's/^Lin
         else
             ln -s "$t" "$destdir/$l"
         fi
-    else
+    elif test -f "$target$compext"; then
         $verbose "creating link $l$compext -> $t$compext"
         if [ "$num_jobs" -gt 1 ]; then
             echo "ln -s \"$t$compext\" \"$destdir/$l$compext\"" >> "$parallel_args_file"