summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2025-01-21 14:06:32 +0900
committerHilton Chain <hako@ultrarare.space>2025-01-21 18:59:02 +0800
commitf3a110cbd75e61233323ca3cea525bbaac9db219 (patch)
treecd523bcd3d1c52f9869be3780ff25de7d3da35e2
parente290eaf25f1c57a33c6a155c76193dc54de1aa45 (diff)
nongnu: linux-firmware: Update to 20250109.
* nongnu/packages/linux.scm (linux-firmware): Update to 20250109. [source]: Delete patches field. * nongnu/packages/patches/linux-firmware-parallel.patch: Delete file.
-rw-r--r--nongnu/packages/linux.scm5
-rw-r--r--nongnu/packages/patches/linux-firmware-parallel.patch155
2 files changed, 2 insertions, 158 deletions
diff --git a/nongnu/packages/linux.scm b/nongnu/packages/linux.scm
index 2defece..2c23f42 100644
--- a/nongnu/packages/linux.scm
+++ b/nongnu/packages/linux.scm
@@ -315,15 +315,14 @@ stable, responsive and smooth desktop experience.")))
315(define-public linux-firmware 315(define-public linux-firmware
316 (package 316 (package
317 (name "linux-firmware") 317 (name "linux-firmware")
318 (version "20241210") 318 (version "20250109")
319 (source (origin 319 (source (origin
320 (method url-fetch) 320 (method url-fetch)
321 (uri (string-append "mirror://kernel.org/linux/kernel/firmware/" 321 (uri (string-append "mirror://kernel.org/linux/kernel/firmware/"
322 "linux-firmware-" version ".tar.xz")) 322 "linux-firmware-" version ".tar.xz"))
323 (sha256 323 (sha256
324 (base32 324 (base32
325 "1xcsx51z5x0bim10a391n3xk6k8a5v1a35j1gpwpdl3nhmq3bc1b")) 325 "0w0mclq20jcam6xl6jbil3n9vw74nqlvw0k7dkslnfck8y7v6b51"))))
326 (patches (nongnu-patches "linux-firmware-parallel.patch"))))
327 (build-system gnu-build-system) 326 (build-system gnu-build-system)
328 (arguments 327 (arguments
329 (list #:tests? #f 328 (list #:tests? #f
diff --git a/nongnu/packages/patches/linux-firmware-parallel.patch b/nongnu/packages/patches/linux-firmware-parallel.patch
deleted file mode 100644
index 0e61cc1..0000000
--- a/nongnu/packages/patches/linux-firmware-parallel.patch
+++ /dev/null
@@ -1,155 +0,0 @@
1Upstream status: https://gitlab.com/kernel-firmware/linux-firmware/-/merge_requests/396
2
3From 5d8341be46374c5b4c3e34af0c9fd4837f25ad67 Mon Sep 17 00:00:00 2001
4From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
5Date: Thu, 2 Jan 2025 00:31:43 +0900
6Subject: [PATCH 3/4] Add support to install files/symlinks in parallel.
7
8This reduces the install-zst target time from 100 s to 25 s on my test
9system, a 400% speed improvement.
10
11* Makefile (NUM_JOBS): New variable.
12(install, install-xz, install-zst): Use it.
13* copy-firmware.sh (num_jobs): New variable.
14(has_gnu_parallel): New procedure.
15<-j>: Parse new option, and use it along GNU parallel to parallelize
16firmware copying and compression/symlink creation.
17
18Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
19---
20 Makefile | 8 +++++---
21 copy-firmware.sh | 51 ++++++++++++++++++++++++++++++++++++++++++++----
22 2 files changed, 52 insertions(+), 7 deletions(-)
23
24diff --git a/Makefile b/Makefile
25index 1f507bfd..0719f874 100644
26--- a/Makefile
27+++ b/Makefile
28@@ -1,4 +1,6 @@
29 FIRMWAREDIR = /lib/firmware
30+NUM_JOBS := $(or $(patsubst -j%,%,$(filter -j%,$(MAKEFLAGS))),\
31+ 1)
32
33 all:
34
35@@ -33,17 +35,17 @@ install:
36 false; \
37 fi
38 install -d $(DESTDIR)$(FIRMWAREDIR)
39- ./copy-firmware.sh $(DESTDIR)$(FIRMWAREDIR)
40+ ./copy-firmware.sh -j$(NUM_JOBS) $(DESTDIR)$(FIRMWAREDIR)
41 @echo "Now run \"make dedup\" to de-duplicate any firmware files"
42
43 install-xz:
44 install -d $(DESTDIR)$(FIRMWAREDIR)
45- ./copy-firmware.sh --xz $(DESTDIR)$(FIRMWAREDIR)
46+ ./copy-firmware.sh -j$(NUM_JOBS) --xz $(DESTDIR)$(FIRMWAREDIR)
47 @echo "Now run \"make dedup\" to de-duplicate any firmware files"
48
49 install-zst:
50 install -d $(DESTDIR)$(FIRMWAREDIR)
51- ./copy-firmware.sh --zstd $(DESTDIR)$(FIRMWAREDIR)
52+ ./copy-firmware.sh -j$(NUM_JOBS) --zstd $(DESTDIR)$(FIRMWAREDIR)
53 @echo "Now run \"make dedup\" to de-duplicate any firmware files"
54
55 clean:
56diff --git a/copy-firmware.sh b/copy-firmware.sh
57index 1a1094ae..f703443e 100755
58--- a/copy-firmware.sh
59+++ b/copy-firmware.sh
60@@ -9,6 +9,7 @@ verbose=:
61 compress=cat
62 compext=
63 destdir=
64+num_jobs=1
65
66 err() {
67 printf "ERROR: %s\n" "$*"
68@@ -19,6 +20,15 @@ warn() {
69 printf "WARNING: %s\n" "$*"
70 }
71
72+has_gnu_parallel() {
73+ if command -v parallel > /dev/null; then
74+ if parallel --version | grep -Fq 'GNU Parallel'; then
75+ return 0
76+ fi
77+ fi
78+ return 1
79+}
80+
81 while test $# -gt 0; do
82 case $1 in
83 -v | --verbose)
84@@ -27,6 +37,16 @@ while test $# -gt 0; do
85 shift
86 ;;
87
88+ -j*)
89+ num_jobs=$(echo "$1" | sed 's/-j//')
90+ if [ "$num_jobs" -gt 1 ] && ! has_gnu_parallel; then
91+ err "the GNU parallel command is required to use -j"
92+ fi
93+ parallel_args_file=$(mktemp)
94+ trap 'rm -f $parallel_args_file' EXIT INT QUIT TERM
95+ shift
96+ ;;
97+
98 --xz)
99 if test "$compext" = ".zst"; then
100 err "cannot mix XZ and ZSTD compression"
101@@ -76,12 +96,24 @@ grep -E '^(RawFile|File):' WHENCE | sed -E -e 's/^(RawFile|File): */\1 /;s/"//g'
102 $verbose "copying/compressing file $f$compext"
103 if test "$compress" != "cat" && test "$k" = "RawFile"; then
104 $verbose "compression will be skipped for file $f"
105- cat "$f" > "$destdir/$f"
106+ if [ "$num_jobs" -gt 1 ]; then
107+ echo "cat \"$f\" > \"$destdir/$f\"" >> "$parallel_args_file"
108+ else
109+ cat "$f" > "$destdir/$f"
110+ fi
111 else
112- $compress "$f" > "$destdir/$f$compext"
113+ if [ "$num_jobs" -gt 1 ]; then
114+ echo "$compress \"$f\" > \"$destdir/$f$compext\"" >> "$parallel_args_file"
115+ else
116+ $compress "$f" > "$destdir/$f$compext"
117+ fi
118 fi
119 done
120+if [ "$num_jobs" -gt 1 ]; then
121+ parallel -j"$num_jobs" -a "$parallel_args_file"
122+fi
123
124+echo > "$parallel_args_file"
125 # shellcheck disable=SC2162 # file/folder name can include escaped symbols
126 grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read l t; do
127 directory="$destdir/$(dirname "$l")"
128@@ -89,12 +121,23 @@ grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read l t; do
129 target="$(cd "$directory" && realpath -m -s "$t")"
130 if test -e "$target"; then
131 $verbose "creating link $l -> $t"
132- ln -s "$t" "$destdir/$l"
133+ if [ "$num_jobs" -gt 1 ]; then
134+ echo "ln -s \"$t\" \"$destdir/$l\"" >> "$parallel_args_file"
135+ else
136+ ln -s "$t" "$destdir/$l"
137+ fi
138 else
139 $verbose "creating link $l$compext -> $t$compext"
140- ln -s "$t$compext" "$destdir/$l$compext"
141+ if [ "$num_jobs" -gt 1 ]; then
142+ echo "ln -s \"$t$compext\" \"$destdir/$l$compext\"" >> "$parallel_args_file"
143+ else
144+ ln -s "$t$compext" "$destdir/$l$compext"
145+ fi
146 fi
147 done
148+if [ "$num_jobs" -gt 1 ]; then
149+ parallel -j"$num_jobs" -a "$parallel_args_file"
150+fi
151
152 # Verify no broken symlinks
153 if test "$(find "$destdir" -xtype l | wc -l)" -ne 0 ; then
154--
155GitLab