From: Timur Tabi <ttabi@nvidia.com>
To: <jwboyer@kernel.org>, <superm1@gmail.com>,
<maxim.cournoyer@gmail.com>, <linux-firmware@kernel.org>
Subject: [PATCH 2/2] copy-firmware: fail gracefully if moreutils parallel is installed
Date: Mon, 17 Mar 2025 14:16:06 -0500 [thread overview]
Message-ID: <20250317191606.64181-2-ttabi@nvidia.com> (raw)
In-Reply-To: <20250317191606.64181-1-ttabi@nvidia.com>
The copy-firmware.sh script can use the "parallel" command to
parallelize some operations, but it needs the GNU version of
parallel. There is another, simpler version of parallel that is part
of the moreutils package, but that version confuses the
has_gnu_parallel() function. So first test to make sure that
the --version parameter is even recognized before trying to use it.
If in the future, moreutils parallel adds support for --version, this
script should still work because that version should never report
"GNU parallel".
Signed-off-by: Timur Tabi <ttabi@nvidia.com>
---
copy-firmware.sh | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/copy-firmware.sh b/copy-firmware.sh
index cd5a6893..d8bfa2a3 100755
--- a/copy-firmware.sh
+++ b/copy-firmware.sh
@@ -27,6 +27,14 @@ warn() {
has_gnu_parallel() {
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.
+ parallel --version >/dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ return 1
+ fi
if parallel --version | grep -Fqi 'gnu parallel'; then
return 0
fi
--
2.43.0
next prev parent reply other threads:[~2025-03-17 19:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 19:16 [PATCH 1/2] copy-firmware: make script smarter about parameters Timur Tabi
2025-03-17 19:16 ` Timur Tabi [this message]
2025-03-18 6:20 ` [PATCH 2/2] copy-firmware: fail gracefully if moreutils parallel is installed Maxim Cournoyer
2025-03-18 7:06 ` Timur Tabi
2025-03-18 6:42 ` Maxim Cournoyer
2025-03-18 7:08 ` Timur Tabi
2025-03-18 14:58 ` Maxim Cournoyer
2025-03-18 15:14 ` Timur Tabi
2025-03-17 20:27 ` [PATCH 1/2] copy-firmware: make script smarter about parameters Mario Limonciello
2025-03-17 21:14 ` Timur Tabi
2025-03-17 21:16 ` Mario Limonciello
2025-03-17 21:45 ` Timur Tabi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250317191606.64181-2-ttabi@nvidia.com \
--to=ttabi@nvidia.com \
--cc=jwboyer@kernel.org \
--cc=linux-firmware@kernel.org \
--cc=maxim.cournoyer@gmail.com \
--cc=superm1@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.