mirror of
https://gitlab.com/kernel-firmware/linux-firmware.git
synced 2025-12-10 07:44:48 +01:00
Merge branch 'copy-firmware' into 'main'
copy-firmware: various improvements See merge request kernel-firmware/linux-firmware!487
This commit is contained in:
commit
588505068c
1 changed files with 25 additions and 0 deletions
|
|
@ -11,8 +11,13 @@ compext=
|
||||||
destdir=
|
destdir=
|
||||||
num_jobs=1
|
num_jobs=1
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "Usage: $0 [-v] [-jN] [--xz|--zstd] <destination directory>"
|
||||||
|
}
|
||||||
|
|
||||||
err() {
|
err() {
|
||||||
printf "ERROR: %s\n" "$*"
|
printf "ERROR: %s\n" "$*"
|
||||||
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -22,6 +27,13 @@ warn() {
|
||||||
|
|
||||||
has_gnu_parallel() {
|
has_gnu_parallel() {
|
||||||
if command -v parallel > /dev/null; then
|
if command -v parallel > /dev/null; then
|
||||||
|
# The moreutils package comes with a simpler version of "parallel"
|
||||||
|
# that does not support the --version or -a options. Check for
|
||||||
|
# that first. In some distros, installing the "parallel" package
|
||||||
|
# will replace the moreutils version with the GNU version.
|
||||||
|
if ! parallel --version > /dev/null 2>&1; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
if parallel --version | grep -Fqi 'gnu parallel'; then
|
if parallel --version | grep -Fqi 'gnu parallel'; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
@ -39,6 +51,7 @@ while test $# -gt 0; do
|
||||||
|
|
||||||
-j*)
|
-j*)
|
||||||
num_jobs=$(echo "$1" | sed 's/-j//')
|
num_jobs=$(echo "$1" | sed 's/-j//')
|
||||||
|
num_jobs=${num_jobs:-1}
|
||||||
if [ "$num_jobs" -gt 1 ] && ! has_gnu_parallel; then
|
if [ "$num_jobs" -gt 1 ] && ! has_gnu_parallel; then
|
||||||
err "the GNU parallel command is required to use -j"
|
err "the GNU parallel command is required to use -j"
|
||||||
fi
|
fi
|
||||||
|
|
@ -66,6 +79,18 @@ while test $# -gt 0; do
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
-h|--help)
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
-*)
|
||||||
|
# Ignore anything else that begins with - because that confuses
|
||||||
|
# the "test" command below
|
||||||
|
warn "ignoring option $1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
if test -n "$destdir"; then
|
if test -n "$destdir"; then
|
||||||
err "unknown command-line options: $*"
|
err "unknown command-line options: $*"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue