From nobody Mon May 20 11:04:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551847092970281.99521756259526; Tue, 5 Mar 2019 20:38:12 -0800 (PST) Received: from localhost ([127.0.0.1]:54160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OJl-0004Z1-Nj for importer@patchew.org; Tue, 05 Mar 2019 23:38:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OIn-0004Ft-T3 for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:37:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1OIm-0003cj-Db for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:37:09 -0500 Received: from smtp.lg.ehu.es ([158.227.0.66]:16173 helo=smtp.ehu.eus) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1OIm-0003Yx-0D for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:37:08 -0500 Received: from imsva2.lgp.ehu.es (imsva2.lgp.ehu.es [10.0.3.246]) by postfix.smtp2.imsva2 (Postfix) with ESMTPS id C517C2C22; Wed, 6 Mar 2019 05:37:03 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 829D65A04F; Wed, 6 Mar 2019 05:37:03 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 775285A045; Wed, 6 Mar 2019 05:37:03 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.76]) by imsva2.lgp.ehu.es (Postfix) with ESMTPS; Wed, 6 Mar 2019 05:37:03 +0100 (CET) Received: from 03612eec87fc (unknown [139.47.78.33]) by smtp2 (Postfix) with ESMTPSA id 00B1D2C22; Wed, 6 Mar 2019 05:37:02 +0100 (CET) Date: Wed, 6 Mar 2019 04:36:58 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190306043658.GA75@03612eec87fc> References: <20190306031221.GA53@03612eec87fc> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190306031221.GA53@03612eec87fc> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 174 matched, not delayed by milter-greylist-4.4.3 (smtp2); Wed, 06 Mar 2019 05:37:03 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24472.004 X-TM-AS-Result: No--0.243-7.0-31-10 X-imss-scan-details: No--0.243-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24472.004 X-TMASE-Result: 10--0.242600-10.000000 X-TMASE-MatchedRID: hwtUKlde9zE8mRT0SYY6fkvrB8UvzFr4viRliDV2nyzwQK0wGZW4tHch tJI6MELjokpikGcAFFsIlsaZLrUbOKF2E6v/FJwhNs3S39zaoXbXLq4lttlH/0oCplsay+SBo8W MkQWv6iVj9cVL65Yctebxq0gs7dfTFezSmIXNZTn6C0ePs7A07ba607moR85RN5GbtXMz3chhZB 5F+gtDHAfvC1/H7kAaWoO14E53yBTbP4Ukg5Z1NcpkOT2+SI/VyzU5gSE+geSN0Y3cVvY9CgMus 59lw9sBN9HE2rn+OTxnqPY47TFuQjOrSe5xQZ+QjkBRO3QBaBSwFMlIPaIBbQ== X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0-0 X-Greylist: Sender IP whitelisted, Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (postfix.smtp2.imsva2); Wed, 06 Mar 2019 05:37:03 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 158.227.0.66 Subject: [Qemu-devel] [PATCH v3 1/10] qemu-binfmt-conf.sh: enforce safe style consistency X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: riku.voipio@iki.fi, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Spaces are added before '; then', for consistency. All the tests are prefixed with 'x', in order to avoid risky comparisons (i.e. a user deliberately trying to provoke a syntax error). Signed-off-by: Unai Martinez-Corral Reviewed-by: Laurent Vivier --- scripts/qemu-binfmt-conf.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index b5a16742a1..0009385be2 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -219,12 +219,12 @@ qemu_check_access() { qemu_check_bintfmt_misc() { # load the binfmt_misc module - if [ ! -d /proc/sys/fs/binfmt_misc ]; then + if [ ! -d /proc/sys/fs/binfmt_misc ] ; then if ! /sbin/modprobe binfmt_misc ; then exit 1 fi fi - if [ ! -f /proc/sys/fs/binfmt_misc/register ]; then + if [ ! -f /proc/sys/fs/binfmt_misc/register ] ; then if ! mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc ; then exit 1 fi @@ -255,10 +255,10 @@ qemu_check_systemd() { qemu_generate_register() { flags=3D"" - if [ "$CREDENTIAL" =3D "yes" ] ; then + if [ "x$CREDENTIAL" =3D "xyes" ] ; then flags=3D"OC" fi - if [ "$PERSISTENT" =3D "yes" ] ; then + if [ "x$PERSISTENT" =3D "xyes" ] ; then flags=3D"${flags}F" fi @@ -296,18 +296,18 @@ qemu_set_binfmts() { mask=3D$(eval echo \$${cpu}_mask) family=3D$(eval echo \$${cpu}_family) - if [ "$magic" =3D "" ] || [ "$mask" =3D "" ] || [ "$family" =3D ""= ] ; then + if [ "x$magic" =3D "x" ] || [ "x$mask" =3D "x" ] || [ "x$family" = =3D "x" ] ; then echo "INTERNAL ERROR: unknown cpu $cpu" 1>&2 continue fi qemu=3D"$QEMU_PATH/qemu-$cpu" - if [ "$cpu" =3D "i486" ] ; then + if [ "x$cpu" =3D "xi486" ] ; then qemu=3D"$QEMU_PATH/qemu-i386" fi qemu=3D"$qemu$QEMU_SUFFIX" - if [ "$host_family" !=3D "$family" ] ; then + if [ "x$host_family" !=3D "x$family" ] ; then $BINFMT_SET fi done -- 2.20.1 From nobody Mon May 20 11:04:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551847437644445.3423993537441; Tue, 5 Mar 2019 20:43:57 -0800 (PST) Received: from localhost ([127.0.0.1]:54218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OP9-0006uu-SS for importer@patchew.org; Tue, 05 Mar 2019 23:43:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OOH-0006bq-He for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:42:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1OOG-0007Ta-Rd for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:42:49 -0500 Received: from smtp.lg.ehu.es ([158.227.0.66]:3465 helo=smtp.ehu.eus) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1OOF-0007Qx-5X for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:42:47 -0500 Received: from imsva2.lgp.ehu.es (imsva2.lgp.ehu.es [10.0.3.246]) by postfix.smtp2.imsva2 (Postfix) with ESMTPS id EE5882B23; Wed, 6 Mar 2019 05:42:43 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BDF5C5A04F; Wed, 6 Mar 2019 05:42:43 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B2D1F5A045; Wed, 6 Mar 2019 05:42:43 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.76]) by imsva2.lgp.ehu.es (Postfix) with ESMTPS; Wed, 6 Mar 2019 05:42:43 +0100 (CET) Received: from 03612eec87fc (unknown [139.47.78.33]) by smtp2 (Postfix) with ESMTPSA id 730932B23; Wed, 6 Mar 2019 05:42:43 +0100 (CET) Date: Wed, 6 Mar 2019 04:42:44 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190306044244.GB75@03612eec87fc> References: <20190306031221.GA53@03612eec87fc> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190306031221.GA53@03612eec87fc> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 174 matched, not delayed by milter-greylist-4.4.3 (smtp2); Wed, 06 Mar 2019 05:42:43 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24472.004 X-TM-AS-Result: No--0.827-7.0-31-10 X-imss-scan-details: No--0.827-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24472.004 X-TMASE-Result: 10--0.826700-10.000000 X-TMASE-MatchedRID: AvuQOGDihJo8mRT0SYY6fvYiLRVJ915DU+A7YkpDJ1g76cr3lZK7RPlz JXP9DPsdKnoLoDc7CX2tUROjXJZnm6VQ2UDgU7NDTd1FGyH+HrJQCOsAlaxN70UNHQAoZf5cf+w Mt2SJ4fIZBJ5lR/aMbtA0BAkvqUqCb4ixR8bvk/YR7kPXQyW0tsUO3Y+aw/kbmyiLZetSf8mfYw IIcLjjbeGANVBCTxXNC24oEZ6SpSk6XEE7Yhw4FoQmnoHSkQEYrwzynTi9MdaukcO4nH4VAsLRR WJX1jNqQ9eNwtfZ35M9n4Q/vxtASTTqqSaHcYmV8APDVYYXOIFE+0D5xLl/9p3dJovSlRnRMiz+ kd/Lkq/KYGxLHCeDhx6/RSaOOxkjnrgZOn6UbZc= X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0-0 X-Greylist: Sender IP whitelisted, Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (postfix.smtp2.imsva2); Wed, 06 Mar 2019 05:42:43 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 158.227.0.66 Subject: [Qemu-devel] [PATCH v3 2/10] qemu-binfmt-conf.sh: make opts -p and -c boolean X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: riku.voipio@iki.fi, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This patch breaks backward compatibility. Both '--persistent' and '--credential' default to 'no'. Hence, '-p no' or '-c no' are reduntant. 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: Unai Martinez-Corral Reviewed-by: Laurent Vivier --- 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 0009385be2..ca15ff8092 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -168,8 +168,8 @@ qemu_get_family() { usage() { cat < Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551847668072495.2394052835649; Tue, 5 Mar 2019 20:47:48 -0800 (PST) Received: from localhost ([127.0.0.1]:54266 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OSx-0007xa-07 for importer@patchew.org; Tue, 05 Mar 2019 23:47:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1ORv-0007eG-Sz for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:46:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1ORs-0001rs-96 for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:46:33 -0500 Received: from smtp.lg.ehu.es ([158.227.0.66]:31997 helo=smtp.ehu.eus) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1ORj-0001gh-Bu for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:46:26 -0500 Received: from imsva2.lgp.ehu.es (imsva2.lgp.ehu.es [10.0.3.246]) by postfix.smtp2.imsva2 (Postfix) with ESMTPS id 2E8EC2D3D; Wed, 6 Mar 2019 05:46:20 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EEEE95A04F; Wed, 6 Mar 2019 05:46:19 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E3A465A045; Wed, 6 Mar 2019 05:46:19 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.76]) by imsva2.lgp.ehu.es (Postfix) with ESMTPS; Wed, 6 Mar 2019 05:46:19 +0100 (CET) Received: from 03612eec87fc (unknown [139.47.78.33]) by smtp2 (Postfix) with ESMTPSA id A1D382D3D; Wed, 6 Mar 2019 05:46:19 +0100 (CET) Date: Wed, 6 Mar 2019 04:46:20 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190306044620.GC75@03612eec87fc> References: <20190306031221.GA53@03612eec87fc> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190306031221.GA53@03612eec87fc> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 174 matched, not delayed by milter-greylist-4.4.3 (smtp2); Wed, 06 Mar 2019 05:46:19 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24472.004 X-TM-AS-Result: No--0.060-7.0-31-10 X-imss-scan-details: No--0.060-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24472.004 X-TMASE-Result: 10--0.059800-10.000000 X-TMASE-MatchedRID: a3o/0593/lo8mRT0SYY6fo6MisxJraxHecvjbu/xDjowEhHW5KVAzw/x 9pUv0o6LF8NKa4AxCmABe2S13w4YFs2Ew69EJjc0QpxiLlDD9FUIjen4m7yaqsWkDW4kV3WaZZZ 3VUEj3odNWTyNFwAkqdK1oiVNECWQK0GqbXFQeoWeAiCmPx4NwMidYBYDjITpGbCHby04y9gAGD UCklbGIsK21zBg2KlfKJvqFwff1POXSVPTnmE3XdRhGISf/raJdfcDcnHUvcewkqAiZH8vCHNKN DsixybQhlFBmMPmsnae6da7iZdmVs50GmUgU4JPqx8PzN6Mrq1Tq+NyuVQu+IbhWbmaLtpNkm94 VhWUY9vjdetbrmPKzcC+ksT6a9fy X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0-0 X-Greylist: Sender IP whitelisted, Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (postfix.smtp2.imsva2); Wed, 06 Mar 2019 05:46:20 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 158.227.0.66 Subject: [Qemu-devel] [PATCH v3 3/10] qemu-binfmt-conf.sh: add QEMU_CREDENTIAL and QEMU_PERSISTENT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: riku.voipio@iki.fi, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Allow to set options '--persistent' and/or '--credential' through environment variables. If not defined, defaults are used ('no'). Anyway, command-line arguments have priority over environment variables. Signed-off-by: Unai Martinez-Corral --- scripts/qemu-binfmt-conf.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index ca15ff8092..e7a714e22c 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -186,9 +186,11 @@ Usage: qemu-binfmt-conf.sh [--qemu-path PATH][--debian= ][--systemd CPU] (default: $SYSTEMDDIR or $DEBIANDIR) --credential: if present, credential and security tokens are calculated according to the binary to interpret + ($QEMU_CREDENTIAL=3Dyes) --persistent: if present, the interpreter is loaded when binfmt is configured and remains in memory. All future uses are cloned from the open file. + ($QEMU_PERSISTENT=3Dyes) To import templates with update-binfmts, use : @@ -255,10 +257,10 @@ qemu_check_systemd() { qemu_generate_register() { flags=3D"" - if [ "x$CREDENTIAL" =3D "xyes" ] ; then + if [ "x$QEMU_CREDENTIAL" =3D "xyes" ] ; then flags=3D"OC" fi - if [ "x$PERSISTENT" =3D "xyes" ] ; then + if [ "x$QEMU_PERSISTENT" =3D "xyes" ] ; then flags=3D"${flags}F" fi @@ -281,7 +283,7 @@ package qemu-$cpu interpreter $qemu magic $magic mask $mask -credential $CREDENTIAL +credential $QEMU_CREDENTIAL EOF } @@ -320,8 +322,10 @@ SYSTEMDDIR=3D"/etc/binfmt.d" DEBIANDIR=3D"/usr/share/binfmts" QEMU_PATH=3D/usr/local/bin -CREDENTIAL=3Dno -PERSISTENT=3Dno + +QEMU_CREDENTIAL=3D"${QEMU_CREDENTIAL:-no}" +QEMU_PERSISTENT=3D"${QEMU_PERSISTENT:-no}" + QEMU_SUFFIX=3D"" options=3D$(getopt -o ds:Q:S:e:hcp -l debian,systemd:,qemu-path:,qemu-suff= ix:,exportdir:,help,credential,persistent -- "$@") @@ -373,10 +377,10 @@ while true ; do exit 1 ;; -c|--credential) - CREDENTIAL=3D"yes" + QEMU_CREDENTIAL=3D"yes" ;; -p|--persistent) - PERSISTENT=3D"yes" + QEMU_PERSISTENT=3D"yes" ;; *) break -- 2.20.1 From nobody Mon May 20 11:04:25 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551847835153566.5221460649772; Tue, 5 Mar 2019 20:50:35 -0800 (PST) Received: from localhost ([127.0.0.1]:54272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OVX-0000Ob-PY for importer@patchew.org; Tue, 05 Mar 2019 23:50:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OUZ-0008U5-0T for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:49:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1OUY-0003UG-23 for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:49:18 -0500 Received: from smtp.lg.ehu.es ([158.227.0.66]:31891 helo=smtp.ehu.eus) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1OUX-0003TB-NR for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:49:18 -0500 Received: from imsva2.lgp.ehu.es (imsva2.lgp.ehu.es [10.0.3.246]) by postfix.smtp2.imsva2 (Postfix) with ESMTPS id 014675C49; Wed, 6 Mar 2019 05:49:14 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B5A895A04F; Wed, 6 Mar 2019 05:49:13 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AA4525A045; Wed, 6 Mar 2019 05:49:13 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.76]) by imsva2.lgp.ehu.es (Postfix) with ESMTPS; Wed, 6 Mar 2019 05:49:13 +0100 (CET) Received: from 03612eec87fc (unknown [139.47.78.33]) by smtp2 (Postfix) with ESMTPSA id 69D61565B; Wed, 6 Mar 2019 05:49:13 +0100 (CET) Date: Wed, 6 Mar 2019 04:49:14 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190306044914.GD75@03612eec87fc> References: <20190306031221.GA53@03612eec87fc> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190306031221.GA53@03612eec87fc> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 174 matched, not delayed by milter-greylist-4.4.3 (smtp2); Wed, 06 Mar 2019 05:49:13 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24472.004 X-TM-AS-Result: No--0.449-7.0-31-10 X-imss-scan-details: No--0.449-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24472.004 X-TMASE-Result: 10--0.448900-10.000000 X-TMASE-MatchedRID: J/NqXV0mzJc8mRT0SYY6fvYiLRVJ915D+nvSwfDbaCX0HEAj+4yaX0/O fkh/+AL4erb3e1hTuhGtUROjXJZnm5Aw3zxNeSJtsyNb+yeIRAoxmbT6wQT2a/HFoBcOsKezXVC mjmk3Kwyuv3vwUNtBWH8mA3sDDq0A5vGrSCzt19MV7NKYhc1lOfoLR4+zsDTttrrTuahHzlGp0I D83QRUsnOzq0tPr7rvOCuSDDmvK5uxlily1DgOXRH1BSDvEkJQQyoCCft53W74nf+JdYiIkIH8R h4/UIoqNe57UNZ5SGo30cTauf45PGeo9jjtMW5CM6tJ7nFBn5COQFE7dAFoFLAUyUg9ogFt X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0-0 X-Greylist: Sender IP whitelisted, Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (postfix.smtp2.imsva2); Wed, 06 Mar 2019 05:49:14 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 158.227.0.66 Subject: [Qemu-devel] [PATCH v3 4/10] qemu-binfmt-conf.sh: remove 'qemu' prefix from cli options X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: riku.voipio@iki.fi, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This breaks backward compatibility. Options 'qemu-path' and 'qemu-suffix' have the 'qemu-' prefix, which is not present in other option names ('debian', 'systemd', 'persistent', 'credential'...). In order to keep consistency, the prefix is removed. Signed-off-by: Unai Martinez-Corral Reviewed-by: Laurent Vivier --- scripts/qemu-binfmt-conf.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index e7a714e22c..68aa4c3f78 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -167,15 +167,15 @@ qemu_get_family() { usage() { cat < Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551847938356413.3021989686746; Tue, 5 Mar 2019 20:52:18 -0800 (PST) Received: from localhost ([127.0.0.1]:54313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OXP-0001W7-Dt for importer@patchew.org; Tue, 05 Mar 2019 23:52:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OV3-0000Fc-6x for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:49:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1OV2-0003ya-IY for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:49:49 -0500 Received: from smtp.lg.ehu.es ([158.227.0.66]:58426 helo=smtp.ehu.eus) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1OV2-0003y7-63 for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:49:48 -0500 Received: from imsva2.lgp.ehu.es (imsva2.lgp.ehu.es [10.0.3.246]) by postfix.smtp2.imsva2 (Postfix) with ESMTPS id 41F642D3D; Wed, 6 Mar 2019 05:49:47 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 17E865A054; Wed, 6 Mar 2019 05:49:47 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0B1285A053; Wed, 6 Mar 2019 05:49:47 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.76]) by imsva2.lgp.ehu.es (Postfix) with ESMTPS; Wed, 6 Mar 2019 05:49:47 +0100 (CET) Received: from 03612eec87fc (unknown [139.47.78.33]) by smtp2 (Postfix) with ESMTPSA id B7E0F2D3D; Wed, 6 Mar 2019 05:49:46 +0100 (CET) Date: Wed, 6 Mar 2019 04:49:47 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190306044947.GE75@03612eec87fc> References: <20190306031221.GA53@03612eec87fc> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190306031221.GA53@03612eec87fc> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 174 matched, not delayed by milter-greylist-4.4.3 (smtp2); Wed, 06 Mar 2019 05:49:46 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24472.004 X-TM-AS-Result: No--0.464-7.0-31-10 X-imss-scan-details: No--0.464-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24472.004 X-TMASE-Result: 10--0.464400-10.000000 X-TMASE-MatchedRID: ntF4Soh351A8mRT0SYY6fo6MisxJraxHTJDl9FKHbrlcKZwALwMGs9ro EGQiudNyFULLkuLAIHN1F2UJ40Hu5gzyMxeMEX6w/sToY2qzpx5eu6llOoM7BnnDQRq5CiZH9xS 3mVzWUuAojN1lLei7RTkZpB/sBFJfYq9UOOBbeeSzJaUU4faXupxfENmSZIT/QGUGnItpMgkCH0 qBR+l0bOMIUT9TMJXJLEsMkTy4azpc8aHbI53jA+mfp9Bphh8GYRlfAbNtCxYs54z/I19gOVNoe JYJ3Pr6 X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0-0 X-Greylist: Sender IP whitelisted, Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (postfix.smtp2.imsva2); Wed, 06 Mar 2019 05:49:47 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 158.227.0.66 Subject: [Qemu-devel] [PATCH v3 5/10] qemu-binfmt-conf.sh: honour QEMU_PATH and/or QEMU_SUFFIX X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: riku.voipio@iki.fi, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Allow to set 'path' or 'suffix' through environment variables, consistently with 'persistent' and 'credential'. Signed-off-by: Unai Martinez-Corral --- scripts/qemu-binfmt-conf.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index 68aa4c3f78..c113ff131e 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -176,6 +176,7 @@ Usage: qemu-binfmt-conf.sh [--path PATH][--debian][--sy= stemd CPU] --help: display this usage --path: set path to qemu interpreter ($QEMU_PATH) --suffix: add a suffix to the default interpreter name + ($QEMU_SUFFIX) --debian: don't write into /proc, instead generate update-binfmts templates --systemd: don't write into /proc, @@ -321,13 +322,11 @@ BINFMT_SET=3Dqemu_register_interpreter SYSTEMDDIR=3D"/etc/binfmt.d" DEBIANDIR=3D"/usr/share/binfmts" -QEMU_PATH=3D/usr/local/bin - +QEMU_PATH=3D"${QEMU_PATH:-/usr/local/bin}" +QEMU_SUFFIX=3D"${QEMU_SUFFIX:-}" QEMU_CREDENTIAL=3D"${QEMU_CREDENTIAL:-no}" QEMU_PERSISTENT=3D"${QEMU_PERSISTENT:-no}" -QEMU_SUFFIX=3D"" - options=3D$(getopt -o ds:Q:S:e:hcp -l debian,systemd:,path:,suffix:,export= dir:,help,credential,persistent -- "$@") eval set -- "$options" -- 2.20.1 From nobody Mon May 20 11:04:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551847910373292.35925658380825; Tue, 5 Mar 2019 20:51:50 -0800 (PST) Received: from localhost ([127.0.0.1]:54311 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OWx-0001Eb-6p for importer@patchew.org; Tue, 05 Mar 2019 23:51:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OVb-0000b2-HU for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:50:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1OVa-0004Cj-4G for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:50:23 -0500 Received: from smtp.lg.ehu.es ([158.227.0.66]:23885 helo=smtp.ehu.eus) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1OVZ-0004Bt-00 for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:50:22 -0500 Received: from imsva2.lgp.ehu.es (imsva2.lgp.ehu.es [10.0.3.246]) by postfix.smtp2.imsva2 (Postfix) with ESMTPS id 55579565B; Wed, 6 Mar 2019 05:50:19 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 226EB5A04F; Wed, 6 Mar 2019 05:50:19 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 177295A045; Wed, 6 Mar 2019 05:50:19 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.76]) by imsva2.lgp.ehu.es (Postfix) with ESMTPS; Wed, 6 Mar 2019 05:50:19 +0100 (CET) Received: from 03612eec87fc (unknown [139.47.78.33]) by smtp2 (Postfix) with ESMTPSA id C7B8A565B; Wed, 6 Mar 2019 05:50:18 +0100 (CET) Date: Wed, 6 Mar 2019 04:50:19 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190306045019.GF75@03612eec87fc> References: <20190306031221.GA53@03612eec87fc> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190306031221.GA53@03612eec87fc> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 174 matched, not delayed by milter-greylist-4.4.3 (smtp2); Wed, 06 Mar 2019 05:50:19 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24472.004 X-TM-AS-Result: No--4.903-7.0-31-10 X-imss-scan-details: No--4.903-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24472.004 X-TMASE-Result: 10--4.902900-10.000000 X-TMASE-MatchedRID: Y0uQemhUR+E8mRT0SYY6fggKAWhuC2ojb6bRSg4rpzvrKAwxOgrz3ZG4 TFKxKJcilB6IdnaWhV1343G9TapOGAJGd3LsKHhDQpxiLlDD9FWyNcEJTKJGJiIUGQYL+Y0iT8s RnQxSSqdfll+ZbVibhZg6ydcjYFP/ydSy/G+xHpJWeFNzK1vl0vhs+N+bSEhBlHZk9BJGt3J+M/ Y5diIM76s56LhEMRaftF3RbBlJV01bm8EGC/b6ghHuQ9dDJbS2u56wFPSkMVGdCqKtxM6bh3/sD LdkieHyGQSeZUf2jG597G91giQ9lJH0YXYnbGoz/sToY2qzpx5eu6llOoM7BnnDQRq5CiZH9xS3 mVzWUuAojN1lLei7RbQ3tXYURaJSBxbfwvkgfSz07tLA9j4DQq2Q1Q3A+dAk8NporE/4Lx1APwl 4QwYTjB7vri3F/UFCkWacFowkMqcgTttRrEZmoemfp9Bphh8GYRlfAbNtCxYs54z/I19gOVNoeJ YJ3Pr6 X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0-0 X-Greylist: Sender IP whitelisted, Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (postfix.smtp2.imsva2); Wed, 06 Mar 2019 05:50:19 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 158.227.0.66 Subject: [Qemu-devel] [PATCH v3 6/10] qemu-binfmt-conf.sh: generalize to positional X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: riku.voipio@iki.fi, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This breaks brackward compatibility. Option '--systemd CPU' allows to register binfmt interpreters for a single target architecture or for 'ALL' (of them). This patch generalizes the approach to support it in any mode (default, '--debian' or '--systemd'). To do so, option 'systemd' is changed to be boolean (no args). Then, all the positional arguments are considered to be a list of target architectures. The list can be separated by spaces, tabs, newlines or commas. If no positional argument is provided, or when it is 'ALL', all of the architectures in qemu_target_list are registered. Conversely, argument value 'NONE' allows to make a 'dry run' of the script. I.e., checks are executed according to the mode, but no interpreter is registered. Signed-off-by: Unai Martinez-Corral --- scripts/qemu-binfmt-conf.sh | 92 +++++++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 35 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index c113ff131e..2751363089 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -6,6 +6,36 @@ 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 +qemu_check_target_list() { + all=3D"$qemu_target_list" + if [ "x$1" =3D "xALL" ] ; then + checked_target_list=3D"$all" + return + fi + list=3D"" + bIFS=3D"$IFS" + IFS=3D$"$IFS", + for target ; do + unknown_target=3D"true" + for cpu in $all ; do + if [ "x$cpu" =3D "x$target" ] ; then + list=3D"$list $target" + unknown_target=3D"false" + break + fi + done + if [ "$unknown_target" =3D "true" ] ; then + IFS=3D"$bIFS" + echo "ERROR: unknown CPU \"$target\"" 1>&2 + usage + exit 1 + fi + done + IFS=3D"$bIFS" + checked_target_list=3D"$list" +} + i386_magic=3D'\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\= x00\x03\x00' i386_mask=3D'\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\= xff\xfe\xff\xff\xff' i386_family=3Di386 @@ -167,11 +197,14 @@ qemu_get_family() { usage() { cat <&2 - usage - exit 1 - fi - fi ;; -Q|--path) shift @@ -388,5 +408,7 @@ while true ; do shift done +shift + $CHECK -qemu_set_binfmts +qemu_set_binfmts "$@" -- 2.20.1 From nobody Mon May 20 11:04:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551848040950902.1169933816955; Tue, 5 Mar 2019 20:54:00 -0800 (PST) Received: from localhost ([127.0.0.1]:54321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OZ2-0002Lk-Su for importer@patchew.org; Tue, 05 Mar 2019 23:53:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OY8-000235-Kg for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:53:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1OY7-0005Xy-Hr for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:53:00 -0500 Received: from smtp.lg.ehu.es ([158.227.0.66]:27791 helo=smtp.ehu.eus) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1OY4-0005U7-Gk for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:52:59 -0500 Received: from imsva2.lgp.ehu.es (imsva2.lgp.ehu.es [10.0.3.246]) by postfix.smtp2.imsva2 (Postfix) with ESMTPS id 14C012D3D; Wed, 6 Mar 2019 05:52:52 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C52EB5A04F; Wed, 6 Mar 2019 05:52:51 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B99115A045; Wed, 6 Mar 2019 05:52:51 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.76]) by imsva2.lgp.ehu.es (Postfix) with ESMTPS; Wed, 6 Mar 2019 05:52:51 +0100 (CET) Received: from 03612eec87fc (unknown [139.47.78.33]) by smtp2 (Postfix) with ESMTPSA id 751102D3D; Wed, 6 Mar 2019 05:52:51 +0100 (CET) Date: Wed, 6 Mar 2019 04:52:52 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190306045252.GG75@03612eec87fc> References: <20190306031221.GA53@03612eec87fc> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190306031221.GA53@03612eec87fc> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 174 matched, not delayed by milter-greylist-4.4.3 (smtp2); Wed, 06 Mar 2019 05:52:51 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24472.004 X-TM-AS-Result: No--4.158-7.0-31-10 X-imss-scan-details: No--4.158-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24472.004 X-TMASE-Result: 10--4.158200-10.000000 X-TMASE-MatchedRID: x/EPlNU2vY08mRT0SYY6ftTXZe7/fokgbYZQU1whlX9UjspoiX02F8Pn D/CT46hF7ZfN05L+GUJ0xH360N5TM9YqWwyVXB9DdOc7KAdVCk7UqhJbkmLVexae5J4l8aLz5gc Q9o9yjpuVu5TRVGSDEQuinfgZ2xrHw06jXpUJ/XIZXJLztZviXBbjReJSRusbfJkt0kSNAe1m+j 6YVbX2YOhURetUfQ4BJBR9boLgnggtJMbDWD8p3t35+5/2RxqmK2i9pofGVSvxxaAXDrCns5xak 1lKPxhNfAf9+hJ7151+XHMTeEdcYW7vEKjEI8LyHcQQBuf4ZFt9LQinZ4QefHUIH+25YvS80+iQ wApCn9sD+c09Hd/d3MprJP8FBOIaTxc4wpH5GFJL+C5hJBQNPH6BUtwo5foINveFbXFnOBgdPJ8 4MM1Q5hxNdDH4vp0s8obWMnIbCc2Y1bpt/JGTUaGUVnbtWe9B85PmlIIazKLGdrQxGzmqhmbMTv hNxfbfmRe1anfHjAYFTcazvERT8w== X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0-0 X-Greylist: Sender IP whitelisted, Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (postfix.smtp2.imsva2); Wed, 06 Mar 2019 05:52:52 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 158.227.0.66 Subject: [Qemu-devel] [PATCH v3 7/10] qemu-binfmt-conf.sh: add option --reset X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: riku.voipio@iki.fi, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is a partial implementation. Allows to remove a single or a list of already registered binfmt interpreters. If is a list, it must be comma-separated. Valid values are those in qemu_target_list. If is 'ALL', all the existing 'qemu-*' interpreters are removed. This is partial because 'debian' and 'systemd' configurations are not removed. If option 'reset' is provided before any of those, reset is executed first and the configuration proceeds. However, if 'reset' is provided after any of them, the script will exit with error 'option reset not implemented for this mode yet'. Removal is done by printing '-1' as explained at: https://www.kernel.org/doc/Documentation/admin-guide/binfmt-misc.rst Signed-off-by: Unai Martinez-Corral --- scripts/qemu-binfmt-conf.sh | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index 2751363089..824e3c4c34 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -197,8 +197,8 @@ qemu_get_family() { usage() { cat <&2 + usage + exit 1 +} + +qemu_remove_interpreter() { + names=3D'qemu-*' + if [ "x$1" !=3D "xALL" ] ; then + qemu_check_target_list $1 + unset names pre + for t in $checked_target_list ; do + names=3D"${names}${pre}qemu-$t" + pre=3D' -o -name ' + done + fi + find /proc/sys/fs/binfmt_misc/ -type f -name $names -exec sh -c 'print= f %s -1 > {}' \; +} + CHECK=3Dqemu_check_bintfmt_misc BINFMT_SET=3Dqemu_register_interpreter +BINFMT_REMOVE=3Dqemu_remove_interpreter SYSTEMDDIR=3D"/etc/binfmt.d" DEBIANDIR=3D"/usr/share/binfmts" @@ -364,19 +387,26 @@ QEMU_SUFFIX=3D"${QEMU_SUFFIX:-}" QEMU_CREDENTIAL=3D"${QEMU_CREDENTIAL:-no}" QEMU_PERSISTENT=3D"${QEMU_PERSISTENT:-no}" -options=3D$(getopt -o :dsQ:S:e:hcp -l debian,systemd,path:,suffix:,exportd= ir:,help,credential,persistent -- "$@") +options=3D$(getopt -o r:dsQ:S:e:hcp -l reset:,debian,systemd,path:,suffix:= ,exportdir:,help,credential,persistent -- "$@") eval set -- "$options" while true ; do case "$1" in + -r|--reset) + shift + $CHECK + qemu_remove_interpreter $1 + ;; -d|--debian) CHECK=3Dqemu_check_debian BINFMT_SET=3Dqemu_generate_debian + BINFMT_REMOVE=3Dqemu_remove_notimplemented EXPORTDIR=3D${EXPORTDIR:-$DEBIANDIR} ;; -s|--systemd) CHECK=3Dqemu_check_systemd BINFMT_SET=3Dqemu_generate_systemd + BINFMT_REMOVE=3Dqemu_remove_notimplemented EXPORTDIR=3D${EXPORTDIR:-$SYSTEMDDIR} ;; -Q|--path) -- 2.20.1 From nobody Mon May 20 11:04:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551848093785880.95369849051; Tue, 5 Mar 2019 20:54:53 -0800 (PST) Received: from localhost ([127.0.0.1]:54328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OZu-00032K-R7 for importer@patchew.org; Tue, 05 Mar 2019 23:54:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OYl-0002M6-7o for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:53:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1OYj-0005tU-Eu for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:53:38 -0500 Received: from smtp.lg.ehu.es ([158.227.0.66]:38039 helo=smtp.ehu.eus) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1OYi-0005sA-6J for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:53:37 -0500 Received: from imsva2.lgp.ehu.es (imsva2.lgp.ehu.es [10.0.3.246]) by postfix.smtp2.imsva2 (Postfix) with ESMTPS id AA76C6400; Wed, 6 Mar 2019 05:53:34 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 821F05A04F; Wed, 6 Mar 2019 05:53:34 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 772A65A045; Wed, 6 Mar 2019 05:53:34 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.76]) by imsva2.lgp.ehu.es (Postfix) with ESMTPS; Wed, 6 Mar 2019 05:53:34 +0100 (CET) Received: from 03612eec87fc (unknown [139.47.78.33]) by smtp2 (Postfix) with ESMTPSA id 3193A6400; Wed, 6 Mar 2019 05:53:34 +0100 (CET) Date: Wed, 6 Mar 2019 04:53:35 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190306045335.GH75@03612eec87fc> References: <20190306031221.GA53@03612eec87fc> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190306031221.GA53@03612eec87fc> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 174 matched, not delayed by milter-greylist-4.4.3 (smtp2); Wed, 06 Mar 2019 05:53:34 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24472.004 X-TM-AS-Result: No-0.033-7.0-31-10 X-imss-scan-details: No-0.033-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24472.004 X-TMASE-Result: 10-0.032600-10.000000 X-TMASE-MatchedRID: qeYWT+AUEkE8mRT0SYY6fvGSfx66m+aMYu7s3QSSN+QAIXlMppp3X3oz jAUD8f5DKnoLoDc7CX2tUROjXJZnm6ezlDj0PvT9Td1FGyH+HrJQCOsAlaxN79chlMhSt6FeKRB 0Pe9L+kKZNLEQMGVPB7Fcy6780oEesPJBU3ZwaVHhuXUWQoMQt9SqEluSYtV7NSweOixQAJLAkt gDJtZ0ApEzfp4vCq8nU31wj3oC6r3NhMOvRCY3NBIRh9wkXSlFUAaLtAB/PbSbKItl61J/yZ9jA ghwuONt4YA1UEJPFc0LbigRnpKlKTpcQTtiHDgWCBIdjBhKnp8bg7m9mN7D817IL4US/FZt/fwf rib8Sw9TiLXszl74kFSmSUdrEmMwpvjnE47SZk4n3G4M8IJk8Zh2Nv6Wdz8snd0mi9KVGdEyLP6 R38uSr8pgbEscJ4OHHr9FJo47GSOjSBtp8JgI7ZRMZUCEHkRt X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0-0 X-Greylist: Sender IP whitelisted, Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (postfix.smtp2.imsva2); Wed, 06 Mar 2019 05:53:34 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 158.227.0.66 Subject: [Qemu-devel] [PATCH v3 8/10] qemu-binfmt-conf.sh: refactor usage() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: riku.voipio@iki.fi, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Reorder how the options are presented to the user. Move 'systemd' and 'debian' to the end, so that the latter is close to the additional comments and example commands about it. Make the order in the prototype consistent with the list where each option is explained. Signed-off-by: Unai Martinez-Corral --- scripts/qemu-binfmt-conf.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index 824e3c4c34..4a45636b53 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -197,9 +197,9 @@ qemu_get_family() { usage() { cat < Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551848157576896.4208491797604; Tue, 5 Mar 2019 20:55:57 -0800 (PST) Received: from localhost ([127.0.0.1]:54366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1Oas-0003kf-EX for importer@patchew.org; Tue, 05 Mar 2019 23:55:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OZg-00034Y-0q for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:54:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1OZf-0006Ml-2h for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:54:35 -0500 Received: from smtp.lg.ehu.es ([158.227.0.66]:56736 helo=smtp.ehu.eus) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1OZe-0006Lf-OK for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:54:35 -0500 Received: from imsva2.lgp.ehu.es (imsva2.lgp.ehu.es [10.0.3.246]) by postfix.smtp2.imsva2 (Postfix) with ESMTPS id EF11D6400; Wed, 6 Mar 2019 05:54:31 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B041E5A04F; Wed, 6 Mar 2019 05:54:31 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A56035A045; Wed, 6 Mar 2019 05:54:31 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.76]) by imsva2.lgp.ehu.es (Postfix) with ESMTPS; Wed, 6 Mar 2019 05:54:31 +0100 (CET) Received: from 03612eec87fc (unknown [139.47.78.33]) by smtp2 (Postfix) with ESMTPSA id 62B716400; Wed, 6 Mar 2019 05:54:31 +0100 (CET) Date: Wed, 6 Mar 2019 04:54:32 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190306045432.GI75@03612eec87fc> References: <20190306031221.GA53@03612eec87fc> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190306031221.GA53@03612eec87fc> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 174 matched, not delayed by milter-greylist-4.4.3 (smtp2); Wed, 06 Mar 2019 05:54:31 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24472.004 X-TM-AS-Result: No--2.280-7.0-31-10 X-imss-scan-details: No--2.280-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24472.004 X-TMASE-Result: 10--2.280100-10.000000 X-TMASE-MatchedRID: mZljRXDwq+48mRT0SYY6frMjW/sniEQKUXlp1FHYSPVcKZwALwMGs0hh ikD15t6mUnDDud66KYyvXn8ZlTtgDFhq/B0ZZyJ49Jn/ZrGuc8F/aDoolm3GXY3EVvTKniav4nm g1woDU7Yr+Flpb471nyjqKQQTMLsBnpTuOg/W2Y4G1NkcAmdR4LuesBT0pDFRrY9uF6odMlznKb VxJ/Gd2JV1h6NLPYn+AlsypQZbPISXBXaJoB9JZ/7E6GNqs6ceXrupZTqDOwZ5w0EauQomR/cUt 5lc1lLgKIzdZS3ou0UdRyYZEqEQsMnH90d6JHlmvkvCS6PUZlZjop3s8OJ51VWlC8pp6OTJpDdh bOxooC3kc6f3X49/NvFwo0qzRNLoEttof7Ek2gLpn6fQaYYfBmEZXwGzbQsWLOeM/yNfYDlTaHi WCdz6+g== X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0-0 X-Greylist: Sender IP whitelisted, Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (postfix.smtp2.imsva2); Wed, 06 Mar 2019 05:54:31 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 158.227.0.66 Subject: [Qemu-devel] [PATCH v3 9/10] qemu-binfmt-conf.sh: update usage() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: riku.voipio@iki.fi, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Reduce indentation to better use available space. Add list of supported environment variables and their default values. Signed-off-by: Unai Martinez-Corral --- scripts/qemu-binfmt-conf.sh | 61 ++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index 4a45636b53..8ca2647ed0 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -201,34 +201,31 @@ Usage: qemu-binfmt-conf.sh [--help][--path PATH][--su= ffix SUFFIX] [--persistent][--credential][--exportdir PATH] [--reset ARCHS][--systemd][--debian][CPUS] - Configure binfmt_misc to use qemu interpreter for the given CPUS. - Supported formats for CPUS are: single arch or comma/space separate= d list. - See QEMU target list below. If CPUS is 'ALL' or empty, configure al= l known - cpus. If CPUS is 'NONE', no interpreter is configured. + Configure binfmt_misc to use qemu interpreter for the given CPUS. + Supported formats for CPUS are: single arch or comma/space separated l= ist. + See QEMU target list below. If CPUS is 'ALL' or empty, configure all k= nown + cpus. If CPUS is 'NONE', no interpreter is configured. - --help: display this usage - --path: set path to qemu interpreter ($QEMU_PATH) - --suffix: add a suffix to the default interpreter name - ($QEMU_SUFFIX) - --persistent: if present, the interpreter is loaded when binfmt is - configured and remains in memory. All future uses - are cloned from the open file. - ($QEMU_PERSISTENT=3Dyes) - --credential: if present, credential and security tokens are - calculated according to the binary to interpret - ($QEMU_CREDENTIAL=3Dyes) - --exportdir: define where to write configuration files - (default: $SYSTEMDDIR or $DEBIANDIR) - --reset: remove registered interpreter for target ARCHS (comma - separated list). If ARCHS is 'ALL', remove all regis= tered - 'qemu-*' interpreters. - --systemd: don't write into /proc, - instead generate file for systemd-binfmt.service; - environment variable HOST_ARCH allows to override 'u= name' - to generate configuration files for a different - architecture than the current one. - --debian: don't write into /proc, - instead generate update-binfmts templates + --help: display this usage. + --path: set path to qemu interpreter. + --suffix: add a suffix to the default interpreter name. + --persistent: if present, the interpreter is loaded when binfmt is + configured and remains in memory. All future uses + are cloned from the open file. + --credential: if present, credential and security tokens are + calculated according to the binary to interpret. + --exportdir: define where to write configuration files. + (default: $SYSTEMDDIR or $DEBIANDIR) + --reset: remove registered interpreter for target ARCHS (comma + separated list). If ARCHS is 'ALL', remove all register= ed + 'qemu-*' interpreters. + --systemd: don't write into /proc, + instead generate file(s) for systemd-binfmt.service; + environment variable HOST_ARCH allows to override 'unam= e' + to generate configuration files for a different + architecture than the current one. + --debian: don't write into /proc, + instead generate update-binfmts templates. To import templates with update-binfmts, use : @@ -240,6 +237,14 @@ Usage: qemu-binfmt-conf.sh [--help][--path PATH][--suf= fix SUFFIX] QEMU target list: $qemu_target_list + Options 'path, 'suffix', 'persistent' and 'credential' are also suppor= ted + through environment variables. Defaults are: + + QEMU_PATH=3D/usr/local/bin + QEMU_SUFFIX=3D + QEMU_PERSISTENT=3Dno + QEMU_CREDENTIAL=3Dno + EOF } @@ -384,8 +389,8 @@ DEBIANDIR=3D"/usr/share/binfmts" QEMU_PATH=3D"${QEMU_PATH:-/usr/local/bin}" QEMU_SUFFIX=3D"${QEMU_SUFFIX:-}" -QEMU_CREDENTIAL=3D"${QEMU_CREDENTIAL:-no}" QEMU_PERSISTENT=3D"${QEMU_PERSISTENT:-no}" +QEMU_CREDENTIAL=3D"${QEMU_CREDENTIAL:-no}" options=3D$(getopt -o r:dsQ:S:e:hcp -l reset:,debian,systemd,path:,suffix:= ,exportdir:,help,credential,persistent -- "$@") eval set -- "$options" -- 2.20.1 From nobody Mon May 20 11:04:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551848193559771.9045573008574; Tue, 5 Mar 2019 20:56:33 -0800 (PST) Received: from localhost ([127.0.0.1]:54368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1ObW-0004Hl-Ka for importer@patchew.org; Tue, 05 Mar 2019 23:56:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OaG-0003Vl-Nj for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:55:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1OaF-0007Ys-Lo for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:55:12 -0500 Received: from smtp.lg.ehu.es ([158.227.0.66]:39156 helo=smtp.ehu.eus) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1OaF-0007NC-9Q for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:55:11 -0500 Received: from imsva2.lgp.ehu.es (imsva2.lgp.ehu.es [10.0.3.246]) by postfix.smtp2.imsva2 (Postfix) with ESMTPS id 92464644A; Wed, 6 Mar 2019 05:55:07 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6807A5A04F; Wed, 6 Mar 2019 05:55:07 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5CDBB5A045; Wed, 6 Mar 2019 05:55:07 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.76]) by imsva2.lgp.ehu.es (Postfix) with ESMTPS; Wed, 6 Mar 2019 05:55:07 +0100 (CET) Received: from 03612eec87fc (unknown [139.47.78.33]) by smtp2 (Postfix) with ESMTPSA id 1C463644A; Wed, 6 Mar 2019 05:55:07 +0100 (CET) Date: Wed, 6 Mar 2019 04:55:08 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190306045508.GJ75@03612eec87fc> References: <20190306031221.GA53@03612eec87fc> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190306031221.GA53@03612eec87fc> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 174 matched, not delayed by milter-greylist-4.4.3 (smtp2); Wed, 06 Mar 2019 05:55:07 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24472.004 X-TM-AS-Result: No--0.500-7.0-31-10 X-imss-scan-details: No--0.500-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24472.004 X-TMASE-Result: 10--0.499800-10.000000 X-TMASE-MatchedRID: GnNqJBi8oAc8mRT0SYY6fj9B1SHosSXQ/RmmEswf7Ic5yqWxi+AoVUOi +VacedxgjxP2jab36MTMJYD0aRF0RS2j+9qk89IedOc7KAdVCk4TbU1KYGoQp/gnJH5vm2+gKRB 0Pe9L+kIlprBSlvY4eUL9KmsV+Go/Nyl1nd9CIt3+xOhjarOnHl67qWU6gzsGecNBGrkKJkf3FL eZXNZS4CiM3WUt6LtFMwRZhGgC7GaRh7ssvlqEyoJvw8s0YOoMdn8eTh0zyajoea26P5qNLJp+l FnWHTzQHnCC5h+KVyozt8qc20oeU0qSJSmnRMty6Z+n0GmGHwZhGV8Bs20LFiznjP8jX2A5U2h4 lgnc+vo= X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0-0 X-Greylist: Sender IP whitelisted, Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (postfix.smtp2.imsva2); Wed, 06 Mar 2019 05:55:07 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 158.227.0.66 Subject: [Qemu-devel] [PATCH v3 10/10] qemu-binfmt-conf.sh: support QEMU_TARGETS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: riku.voipio@iki.fi, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Rename CPUS to TARGETS, and support QEMU_TARGETS environment variable. This does not break backward compatibility, because it is just a placeholde= r. 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 emp= ty, defaults to 'ALL'. Signed-off-by: Unai Martinez-Corral --- 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=3D"$qemu_target_list" if [ "x$1" =3D "xALL" ] ; then @@ -199,12 +199,12 @@ usage() { cat <