]> git.ipfire.org Git - thirdparty/linux-firmware.git/commitdiff
copy-firmware: Fix 'No such file or directory' error.
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>
Tue, 4 Feb 2025 00:43:24 +0000 (09:43 +0900)
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>
Tue, 4 Feb 2025 01:28:32 +0000 (10:28 +0900)
Attempting to clear the PARALLEL_ARGS_FILE variable when it was not
set would cause the above error message.  Clear it only when we know
we are using it.  This bug was only triggered when using the 'deb'
target, as it invokes the copy-firmware.sh script without any '-j'
argument, while the other install targets end up passing '-j1' when
not using parallel compression.

* copy-firmware.sh [NUM_JOBS > 1]: Only clear the content of
PARALLEL_ARGS_FILE when this condition is met.

Reported-by: Christophe Guillain <jean-christophe@guillain.net>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
copy-firmware.sh

index e64b5677ab737dc4040627b9923d0a7e25c0885a..dd4b9b6f9d6aa446a67b3baf36274c1dde9a4586 100755 (executable)
@@ -111,9 +111,9 @@ grep -E '^(RawFile|File):' WHENCE | sed -E -e 's/^(RawFile|File): */\1 /;s/"//g'
 done
 if [ "$num_jobs" -gt 1 ]; then
     parallel -j"$num_jobs" -a "$parallel_args_file"
+    echo > "$parallel_args_file" # prepare for next run
 fi
 
-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
     directory="$destdir/$(dirname "$l")"