On 06/03/2019 05:55, Unai Martinez-Corral wrote: > Rename CPUS to TARGETS, and support QEMU_TARGETS environment variable. > This does not break backward compatibility, because it is just a placeholder. > > Consistently with 'path', 'suffix', 'persistent' and 'credential', > provide an environment variable to set the list of target architectures. > The supported formats are the same as for positional arguments, which have > priority. If both the variable and the list of positional arguments are empty, > defaults to 'ALL'. > > Signed-off-by: Unai Martinez-Corral <unai.martinezcor...@ehu.eus> > --- > scripts/qemu-binfmt-conf.sh | 26 ++++++++++++++------------ > 1 file changed, 14 insertions(+), 12 deletions(-) > > diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh > index 8ca2647ed0..0676f86512 100755 > --- a/scripts/qemu-binfmt-conf.sh > +++ b/scripts/qemu-binfmt-conf.sh > @@ -6,7 +6,7 @@ mips mipsel mipsn32 mipsn32el mips64 mips64el \ > sh4 sh4eb s390x aarch64 aarch64_be hppa riscv32 riscv64 xtensa xtensaeb \ > microblaze microblazeel or1k x86_64" > > -# check if given target CPUS is/are in the supported target list > +# check if given TARGETS is/are in the supported target list > qemu_check_target_list() { > all="$qemu_target_list" > if [ "x$1" = "xALL" ] ; then > @@ -199,12 +199,12 @@ usage() { > cat <<EOF > Usage: qemu-binfmt-conf.sh [--help][--path PATH][--suffix SUFFIX] > [--persistent][--credential][--exportdir PATH] > - [--reset ARCHS][--systemd][--debian][CPUS] > + [--reset ARCHS][--systemd][--debian][TARGETS] > > - Configure binfmt_misc to use qemu interpreter for the given CPUS. > - Supported formats for CPUS are: single arch or comma/space separated > list. > - See QEMU target list below. If CPUS is 'ALL' or empty, configure all > known > - cpus. If CPUS is 'NONE', no interpreter is configured. > + Configure binfmt_misc to use qemu interpreter for the given TARGETS. > + Supported formats for TARGETS are: single arch or comma/space separated > list. > + See QEMU target list below. If TARGETS is 'ALL' or empty, configure all > known > + TARGETS. If TARGETS is 'NONE', no interpreter is configured. > > --help: display this usage. > --path: set path to qemu interpreter. > @@ -244,6 +244,7 @@ Usage: qemu-binfmt-conf.sh [--help][--path PATH][--suffix > SUFFIX] > QEMU_SUFFIX= > QEMU_PERSISTENT=no > QEMU_CREDENTIAL=no > + QEMU_TARGETS=
QEMU_TARGETS=$QEMU_TARGETS > > EOF > } > @@ -324,17 +325,17 @@ EOF > } > > qemu_set_binfmts() { > - if [ "x$1" = "xNONE" ] ; then > - return > - fi > - > # probe cpu type > host_family=$(qemu_get_family) > > # reduce the list of target interpreters to those given in the CLI > - targets="$@" > if [ $# -eq 0 ] ; then > - targets="ALL" > + targets="${QEMU_TARGETS:-ALL}" > + else > + if [ "x$1" = "xNONE" ] ; then In fact, I think it would be cleaner to have a "--dry-run" option instead (something setting BINFMT_SET to ':' I think) Thanks, Laurent