[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v9 2/9] qemu-binfmt-conf.sh: make opts -p and -c boolean
From: |
Unai Martinez-Corral |
Subject: |
[PATCH v9 2/9] qemu-binfmt-conf.sh: make opts -p and -c boolean |
Date: |
Mon, 9 Mar 2020 18:37:39 +0000 |
This patch breaks backward compatibility.
Both '--persistent' and '--credential' default to 'no'. Hence, '-p no'
or '-c no' are redundant. Overall, accepting an argument might be
misleading because options are, indeed, boolean. This patch makes both
options boolean in getopt, so if any of them is provided the corresponding
variable is set to true.
Signed-off-by: umarcor <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
---
scripts/qemu-binfmt-conf.sh | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
index 98401f4e7c..285ce528d1 100755
--- a/scripts/qemu-binfmt-conf.sh
+++ b/scripts/qemu-binfmt-conf.sh
@@ -172,8 +172,8 @@ qemu_get_family() {
usage() {
cat <<EOF
Usage: qemu-binfmt-conf.sh [--qemu-path PATH][--debian][--systemd CPU]
- [--help][--credential yes|no][--exportdir PATH]
- [--persistent yes|no][--qemu-suffix SUFFIX]
+ [--help][--credential][--exportdir PATH]
+ [--persistent][--qemu-suffix SUFFIX]
Configure binfmt_misc to use qemu interpreter
@@ -188,9 +188,9 @@ Usage: qemu-binfmt-conf.sh [--qemu-path
PATH][--debian][--systemd CPU]
file for all known cpus
--exportdir: define where to write configuration files
(default: $SYSTEMDDIR or $DEBIANDIR)
- --credential: if yes, credential and security tokens are
+ --credential: if present, credential and security tokens are
calculated according to the binary to interpret
- --persistent: if yes, the interpreter is loaded when binfmt is
+ --persistent: if present, the interpreter is loaded when binfmt is
configured and remains in memory. All future uses
are cloned from the open file.
@@ -328,7 +328,7 @@ CREDENTIAL=no
PERSISTENT=no
QEMU_SUFFIX=""
-options=$(getopt -o ds:Q:S:e:hc:p: -l
debian,systemd:,qemu-path:,qemu-suffix:,exportdir:,help,credential:,persistent:
-- "$@")
+options=$(getopt -o ds:Q:S:e:hcp -l
debian,systemd:,qemu-path:,qemu-suffix:,exportdir:,help,credential,persistent
-- "$@")
eval set -- "$options"
while true; do
@@ -377,12 +377,10 @@ while true; do
exit 1
;;
-c|--credential)
- shift
- CREDENTIAL="$1"
+ CREDENTIAL="yes"
;;
-p|--persistent)
- shift
- PERSISTENT="$1"
+ PERSISTENT="yes"
;;
*)
break
--
2.25.1
- [PATCH v9 0/9] qemu-binfmt-conf.sh, Unai Martinez-Corral, 2020/03/09
- [PATCH v9 1/9] qemu-binfmt-conf.sh: enforce safe style consistency, Unai Martinez-Corral, 2020/03/09
- [PATCH v9 2/9] qemu-binfmt-conf.sh: make opts -p and -c boolean,
Unai Martinez-Corral <=
- [PATCH v9 3/9] qemu-binfmt-conf.sh: add QEMU_CREDENTIAL and QEMU_PERSISTENT, Unai Martinez-Corral, 2020/03/09
- [PATCH v9 4/9] qemu-binfmt-conf.sh: use the same presentation format as for qemu-*, Unai Martinez-Corral, 2020/03/09
- [PATCH v9 5/9] qemu-binfmt-conf.sh: remove 'qemu' prefix from cli options, Unai Martinez-Corral, 2020/03/09
- [PATCH v9 6/9] qemu-binfmt-conf.sh: honour QEMU_PATH and/or QEMU_SUFFIX, Unai Martinez-Corral, 2020/03/09
- [PATCH v9 7/9] qemu-binfmt-conf.sh: generalize <CPU> to positional [TARGETS], Unai Martinez-Corral, 2020/03/09
- [PATCH v9 8/9] qemu-binfmt-conf.sh: add option --clear, Unai Martinez-Corral, 2020/03/09
- [PATCH v9 9/9] qemu-binfmt-conf.sh: add --test, Unai Martinez-Corral, 2020/03/09
- Re: [PATCH v9 0/9] qemu-binfmt-conf.sh, no-reply, 2020/03/09
- Re: [PATCH v9 0/9] qemu-binfmt-conf.sh, no-reply, 2020/03/09