From nobody Mon Mar 31 20:28:34 2025 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 1552417554482360.0334715133595; Tue, 12 Mar 2019 12:05:54 -0700 (PDT) Received: from localhost ([127.0.0.1]:58164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3mih-0004CN-CK for importer@patchew.org; Tue, 12 Mar 2019 15:05:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3mf0-0000PZ-7B for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:01:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3mZt-0001Hu-LT for qemu-devel@nongnu.org; Tue, 12 Mar 2019 14:56:42 -0400 Received: from smtp.lg.ehu.es ([158.227.0.66]:61842 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 1h3mZt-0001G5-AK for qemu-devel@nongnu.org; Tue, 12 Mar 2019 14:56:41 -0400 Received: from imsva1.lgp.ehu.es (imsva1.lgp.ehu.es [10.0.3.245]) by postfix.smtp1.imsva1 (Postfix) with ESMTPS id 986D732C79; Tue, 12 Mar 2019 19:56:39 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B5B811004A; Tue, 12 Mar 2019 19:56:39 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5DC84110045; Tue, 12 Mar 2019 19:56:39 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.73]) by imsva1.lgp.ehu.es (Postfix) with ESMTPS; Tue, 12 Mar 2019 19:56:39 +0100 (CET) Received: from 803a063d172d (unknown [139.47.78.33]) by smtp1 (Postfix) with ESMTPSA id 13D9432C79; Tue, 12 Mar 2019 19:56:39 +0100 (CET) Date: Tue, 12 Mar 2019 18:56:34 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190312185634.GA15@803a063d172d> References: <20190312185541.GA13@803a063d172d> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190312185541.GA13@803a063d172d> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 177 matched, not delayed by milter-greylist-4.4.3 (smtp1); Tue, 12 Mar 2019 19:56:39 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24486.002 X-TM-AS-Result: No-0.937-7.0-31-10 X-imss-scan-details: No-0.937-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24486.002 X-TMASE-Result: 10-0.937300-10.000000 X-TMASE-MatchedRID: hwtUKlde9zE8mRT0SYY6fkvrB8UvzFr4viRliDV2nyxLgo8+IIHbcKyJ SPZ1MHFJyQUI9mjBTGrMJYD0aRF0RSvslLrYzXFMoMfp2vHck9X54F/2i/DwjTqI/Q1zONHSo3u yF/fzkXbL7a7vhpw6CH8mA3sDDq0A5vGrSCzt19MV7NKYhc1lOfoLR4+zsDTtQh+ArmEemWXzI8 5BvSDQEnjU4PjpPPRsLP70QQn0w25js9mwfpYMG/kUxKdM2YBcxqaFumKRJvRZapFMt7EZ+/7Nb EwbVh/qW8Mo9oUVlaBTq+NyuVQu+IbhWbmaLtpNkm94VhWUY9vjdetbrmPKzVXK9tOD+u6c 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.smtp1.imsva1); Tue, 12 Mar 2019 19:56:39 +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 v6 1/9] 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.21.0 From nobody Mon Mar 31 20:28:34 2025 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 1552417839354458.5824231437657; Tue, 12 Mar 2019 12:10:39 -0700 (PDT) Received: from localhost ([127.0.0.1]:58238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3mnG-0008Oa-B9 for importer@patchew.org; Tue, 12 Mar 2019 15:10:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3mex-0000PZ-0I for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:01:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3maK-0001ja-Ad for qemu-devel@nongnu.org; Tue, 12 Mar 2019 14:57:09 -0400 Received: from smtp.lg.ehu.es ([158.227.0.66]:16489 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 1h3maJ-0001i5-Uy for qemu-devel@nongnu.org; Tue, 12 Mar 2019 14:57:08 -0400 Received: from imsva1.lgp.ehu.es (imsva1.lgp.ehu.es [10.0.3.245]) by postfix.smtp1.imsva1 (Postfix) with ESMTPS id 7E4EF348FD; Tue, 12 Mar 2019 19:57:06 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4A5AE11004A; Tue, 12 Mar 2019 19:57:06 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3E677110045; Tue, 12 Mar 2019 19:57:06 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.73]) by imsva1.lgp.ehu.es (Postfix) with ESMTPS; Tue, 12 Mar 2019 19:57:06 +0100 (CET) Received: from 803a063d172d (unknown [139.47.78.33]) by smtp1 (Postfix) with ESMTPSA id ECE11348FD; Tue, 12 Mar 2019 19:57:05 +0100 (CET) Date: Tue, 12 Mar 2019 18:57:06 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190312185706.GB15@803a063d172d> References: <20190312185541.GA13@803a063d172d> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190312185541.GA13@803a063d172d> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 177 matched, not delayed by milter-greylist-4.4.3 (smtp1); Tue, 12 Mar 2019 19:57:06 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24486.002 X-TM-AS-Result: No-0.353-7.0-31-10 X-imss-scan-details: No-0.353-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24486.002 X-TMASE-Result: 10-0.353200-10.000000 X-TMASE-MatchedRID: mafpUJSAc1A8mRT0SYY6fvYiLRVJ915DU+A7YkpDJ1g76cr3lZK7RGuk bF2FNZCX0pQhZpR72XZU4ZaPWnopPkwzknXXiTeeYl83W3jnFDD7At+An9uo83PBWZjlMys2Cf2 h9A2gFAVwudrQH6GMcmKwOsgOBYuApjLap8Pn2LsG1NkcAmdR4CseSAhqf1rRTDoylMQmcK9Tf9 uxAWVtFeLzNWBegCW2U/185JqDvmbaqT6lqWS9QsRB0bsfrpPInxMyeYT53Rl0k78Xi2V63XlBz UwUcAkvz652VKTYXo1q4rxahAyhGy3EfHwcgkVprCSGRotTrQn19oHAk+oUfQ/0eKxYdOkTReim 6QLH0Yvpn6fQaYYfBmEZXwGzbQsWLOeM/yNfYDnlrtxuq+PMxcPINhwTXBeZ 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.smtp1.imsva1); Tue, 12 Mar 2019 19:57:06 +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 v6 2/9] 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 1552417812359842.0180890560125; Tue, 12 Mar 2019 12:10:12 -0700 (PDT) Received: from localhost ([127.0.0.1]:58224 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3mmv-00085K-8e for importer@patchew.org; Tue, 12 Mar 2019 15:10:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3meu-0000F5-1e for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:01:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3mbB-0002Zr-HN for qemu-devel@nongnu.org; Tue, 12 Mar 2019 14:58:02 -0400 Received: from smtp.lg.ehu.es ([158.227.0.66]:10634 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 1h3mbB-0002Yn-5T for qemu-devel@nongnu.org; Tue, 12 Mar 2019 14:58:01 -0400 Received: from imsva1.lgp.ehu.es (imsva1.lgp.ehu.es [10.0.3.245]) by postfix.smtp1.imsva1 (Postfix) with ESMTPS id 3B5C934BDC; Tue, 12 Mar 2019 19:58:00 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 132EB11004A; Tue, 12 Mar 2019 19:58:00 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 06DA9110045; Tue, 12 Mar 2019 19:58:00 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.73]) by imsva1.lgp.ehu.es (Postfix) with ESMTPS; Tue, 12 Mar 2019 19:57:59 +0100 (CET) Received: from 803a063d172d (unknown [139.47.78.33]) by smtp1 (Postfix) with ESMTPSA id B53DC34BDC; Tue, 12 Mar 2019 19:57:59 +0100 (CET) Date: Tue, 12 Mar 2019 18:58:00 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190312185800.GC15@803a063d172d> References: <20190312185541.GA13@803a063d172d> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190312185541.GA13@803a063d172d> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 177 matched, not delayed by milter-greylist-4.4.3 (smtp1); Tue, 12 Mar 2019 19:57:59 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24486.002 X-TM-AS-Result: No-1.120-7.0-31-10 X-imss-scan-details: No-1.120-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24486.002 X-TMASE-Result: 10-1.120100-10.000000 X-TMASE-MatchedRID: P7d3tDo+wQo8mRT0SYY6fo6MisxJraxHecvjbu/xDjowEhHW5KVAzzO+ sIxDA42K0pQhZpR72XZU4ZaPWnopPibhJjVR0U351yMJs9mBCcUr2PDgwMWbIoKwF4K/wIz9AxE 7O5AxMWucHepQtiMfOBTcMjpPwLpOetI/1G0ZlijJ1E/nrJFEDxny1I2tysbymyiLZetSf8mfYw IIcLjjbeGANVBCTxXNC24oEZ6SpSlR8RAUGq/SZ2SWUv9NGeIZ4a2FNkv7/SSZMZldyp3i92NQ/ ugow9TVFE+rSqK76FhLxAWur9nHVLlY4DWRtTxP9j0acPgOcNyLORRq70g+bTfRxNq5/jk8Z6j2 OO0xbkIzq0nucUGfkI5AUTt0AWgUSac++I+/Ls3AvpLE+mvX8g== 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.smtp1.imsva1); Tue, 12 Mar 2019 19:58:00 +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 v6 3/9] 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 Reviewed-by: Laurent Vivier --- 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..ad9ae731a0 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_PERSISTENT=3D"${QEMU_PERSISTENT:-no}" +QEMU_CREDENTIAL=3D"${QEMU_CREDENTIAL:-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.21.0 From nobody Mon Mar 31 20:28:34 2025 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 1552417632109493.6478471614979; Tue, 12 Mar 2019 12:07:12 -0700 (PDT) Received: from localhost ([127.0.0.1]:58174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3mjy-0005L7-SJ for importer@patchew.org; Tue, 12 Mar 2019 15:07:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3mel-0000Db-Qq for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:01:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3mbx-0003Pn-Lz for qemu-devel@nongnu.org; Tue, 12 Mar 2019 14:58:53 -0400 Received: from smtp.lg.ehu.es ([158.227.0.66]:30932 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 1h3mbu-0003Hn-62 for qemu-devel@nongnu.org; Tue, 12 Mar 2019 14:58:47 -0400 Received: from imsva1.lgp.ehu.es (imsva1.lgp.ehu.es [10.0.3.245]) by postfix.smtp1.imsva1 (Postfix) with ESMTPS id C3FB7348FD; Tue, 12 Mar 2019 19:58:42 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8FFF511004A; Tue, 12 Mar 2019 19:58:42 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 838E2110045; Tue, 12 Mar 2019 19:58:42 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.73]) by imsva1.lgp.ehu.es (Postfix) with ESMTPS; Tue, 12 Mar 2019 19:58:42 +0100 (CET) Received: from 803a063d172d (unknown [139.47.78.33]) by smtp1 (Postfix) with ESMTPSA id 3E0E1348FD; Tue, 12 Mar 2019 19:58:42 +0100 (CET) Date: Tue, 12 Mar 2019 18:58:42 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190312185842.GD15@803a063d172d> References: <20190312185541.GA13@803a063d172d> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190312185541.GA13@803a063d172d> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 177 matched, not delayed by milter-greylist-4.4.3 (smtp1); Tue, 12 Mar 2019 19:58:42 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24486.002 X-TM-AS-Result: No--1.497-7.0-31-10 X-imss-scan-details: No--1.497-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24486.002 X-TMASE-Result: 10--1.497400-10.000000 X-TMASE-MatchedRID: mafpUJSAc1A8mRT0SYY6fgPZZctd3P4B+Gz435tISEGUdmT0Eka3cn4z 9jl2IgzvgML9UOgCBPexXMuu/NKBHrDyQVN2cGlR4bl1FkKDELfUqhJbkmLVezUsHjosUACSnFq TWUo/GE0z6xRyeDQUk9rR3zP0abjQZgDJ5bVJkeT/VoEOchXiKVObpRiWjuVrVI7KaIl9Nhfy+k xyAtKJyeLzNWBegCW2U/185JqDvmbaqT6lqWS9QsRB0bsfrpPInxMyeYT53Rnqgq1DnggCDGwFT Q39W9xdeyZIlW6gyg5kP5xKaRbCUu4+reWx1nB2PCdoNmqyCTPkdKEiuQCDM2wU/lss/Fz4EbVM wXjsOT3pn6fQaYYfBmEZXwGzbQsWLOeM/yNfYDnlrtxuq+PMxVZca9RSYo/b 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.smtp1.imsva1); Tue, 12 Mar 2019 19:58:42 +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 v6 4/9] qemu-binfmt-conf.sh: use the same presentation format as for qemu-* 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" Signed-off-by: Unai Martinez-Corral --- scripts/qemu-binfmt-conf.sh | 63 +++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index ad9ae731a0..5ac1df680b 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -167,47 +167,48 @@ qemu_get_family() { usage() { cat < Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552417419896843.3707954633063; Tue, 12 Mar 2019 12:03:39 -0700 (PDT) Received: from localhost ([127.0.0.1]:58083 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3mgY-0001pc-O2 for importer@patchew.org; Tue, 12 Mar 2019 15:03:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3mee-0000PZ-Lr for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:01:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3md6-0004r9-Lq for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:00:01 -0400 Received: from smtp.lg.ehu.es ([158.227.0.66]:3633 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 1h3md6-0004mu-7z for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:00:00 -0400 Received: from imsva1.lgp.ehu.es (imsva1.lgp.ehu.es [10.0.3.245]) by postfix.smtp1.imsva1 (Postfix) with ESMTPS id 163E8357FE; Tue, 12 Mar 2019 19:59:57 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D3E7611004A; Tue, 12 Mar 2019 19:59:56 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C71B5110045; Tue, 12 Mar 2019 19:59:56 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.73]) by imsva1.lgp.ehu.es (Postfix) with ESMTPS; Tue, 12 Mar 2019 19:59:56 +0100 (CET) Received: from 803a063d172d (unknown [139.47.78.33]) by smtp1 (Postfix) with ESMTPSA id 7E984357FE; Tue, 12 Mar 2019 19:59:56 +0100 (CET) Date: Tue, 12 Mar 2019 18:59:56 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190312185956.GE15@803a063d172d> References: <20190312185541.GA13@803a063d172d> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190312185541.GA13@803a063d172d> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 177 matched, not delayed by milter-greylist-4.4.3 (smtp1); Tue, 12 Mar 2019 19:59:56 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24486.002 X-TM-AS-Result: No--0.374-7.0-31-10 X-imss-scan-details: No--0.374-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24486.002 X-TMASE-Result: 10--0.374300-10.000000 X-TMASE-MatchedRID: a3o/0593/lo8mRT0SYY6fvYiLRVJ915D+nvSwfDbaCX0HEAj+4yaX0/O fkh/+AL4Xr7NXg/pSgQkzmvdgzo8hjhhzU44NexTYl83W3jnFDATbU1KYGoQp/gnJH5vm2+gKjl bbAp2U/fArQXEdIyvR7Fcy6780oEemko3PpH7ZG7XIwmz2YEJxX0tCKdnhB58dQgf7bli9LzT6J DACkKf2wP5zT0d393cxlblqLlYqXJL3/a71gXE/CPJyM2EYGqxDG8wvWYfqt/5z4ofzAYwfvhEW 64mIwce8JJ8RI8roI9vVTiH4pi7Ij91XZ3Rd4Yq/mARaKQ6UhfMHaTeAcZOWN3WrhGUSfC8TRiD dzyAzmNLF4fxrdZ0s9+yfB9xNB3E 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.smtp1.imsva1); Tue, 12 Mar 2019 19:59:57 +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 v6 5/9] 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 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index 5ac1df680b..c1dbdde7e6 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -167,6 +167,7 @@ qemu_get_family() { usage() { cat < Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552417398340457.54776217450865; Tue, 12 Mar 2019 12:03:18 -0700 (PDT) Received: from localhost ([127.0.0.1]:58079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3mgE-0001TO-8W for importer@patchew.org; Tue, 12 Mar 2019 15:03:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3meM-0000EM-QG for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:01:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3mdY-0005XY-O9 for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:00:30 -0400 Received: from smtp.lg.ehu.es ([158.227.0.66]:43570 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 1h3mdW-0005Nc-LZ for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:00:28 -0400 Received: from imsva1.lgp.ehu.es (imsva1.lgp.ehu.es [10.0.3.245]) by postfix.smtp1.imsva1 (Postfix) with ESMTPS id C923735EE6; Tue, 12 Mar 2019 20:00:24 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9F3FE110052; Tue, 12 Mar 2019 20:00:24 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 92DDF110050; Tue, 12 Mar 2019 20:00:24 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.73]) by imsva1.lgp.ehu.es (Postfix) with ESMTPS; Tue, 12 Mar 2019 20:00:24 +0100 (CET) Received: from 803a063d172d (unknown [139.47.78.33]) by smtp1 (Postfix) with ESMTPSA id 4C1F035EE6; Tue, 12 Mar 2019 20:00:24 +0100 (CET) Date: Tue, 12 Mar 2019 19:00:24 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190312190024.GF15@803a063d172d> References: <20190312185541.GA13@803a063d172d> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190312185541.GA13@803a063d172d> User-Agent: Mutt/1.11.2 (2019-01-07) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24486.002 X-TM-AS-Result: No--0.390-7.0-31-10 X-imss-scan-details: No--0.390-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24486.002 X-TMASE-Result: 10--0.389800-10.000000 X-TMASE-MatchedRID: alNhoJufFSQ8mRT0SYY6fo6MisxJraxH6SXuwUgGH0jTF92ikMV2gYCu qghmtWfX4vfiP6+NS81oUJgKmvCzhtH/WqWljGhSbQ9aoPSmWJEk80hXoYXya5iHbfFxQ8Qro8W MkQWv6iXpKNrfYIUgLIcyJo642SRt3QfwsVk0UbvqwGfCk7KUs1JEDVn/CN8JqveSqdueBrL1K9 swnYZMg7kZzBheKnbCyBwgnufvX5efWXTF0lNUOquYpV70j1SSLHx5mwOOhE8wOeeSvJtrFmx8S 0nxThalnBu72ovT2F/i8atvTQB42kzdPFq1gcIzftwZ3X11IV0= X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0-0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 158.227.0.66 Subject: [Qemu-devel] [PATCH v6 6/9] 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 Reviewed-by: Laurent Vivier --- scripts/qemu-binfmt-conf.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index c1dbdde7e6..b846313b4e 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -177,7 +177,7 @@ Options and associated environment variables: Argument Env-variable Description -h|--help display this usage -Q|--path PATH QEMU_PATH set path to qemu interpreter(s) --F|--suffix SUFFIX add a suffix to the default interpre= ter name +-F|--suffix SUFFIX QEMU_SUFFIX add a suffix to the default interpre= ter name -p|--persistent QEMU_PERSISTENT (yes) load the interpreter and keep = it in memory; all future uses are cloned from the open file. -c|--credential QEMU_CREDENTIAL (yes) credential and security tokens= are calculated according @@ -191,6 +191,7 @@ Argument Env-variable Description Defaults: QEMU_PATH=3D$QEMU_PATH +QEMU_SUFFIX=3D$QEMU_SUFFIX QEMU_PERSISTENT=3D$QEMU_PERSISTENT QEMU_CREDENTIAL=3D$QEMU_CREDENTIAL @@ -323,13 +324,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_PERSISTENT=3D"${QEMU_PERSISTENT:-no}" QEMU_CREDENTIAL=3D"${QEMU_CREDENTIAL:-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.21.0 From nobody Mon Mar 31 20:28:34 2025 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 1552418071436857.6189965845688; Tue, 12 Mar 2019 12:14:31 -0700 (PDT) Received: from localhost ([127.0.0.1]:58297 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3mr5-0003A6-1d for importer@patchew.org; Tue, 12 Mar 2019 15:14:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3mfD-00015G-2V for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:02:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3mf7-0007D0-En for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:02:07 -0400 Received: from smtp.lg.ehu.es ([158.227.0.66]:13769 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 1h3mf0-0006hS-LK for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:02:00 -0400 Received: from imsva1.lgp.ehu.es (imsva1.lgp.ehu.es [10.0.3.245]) by postfix.smtp1.imsva1 (Postfix) with ESMTPS id 78F6D31A34; Tue, 12 Mar 2019 20:01:35 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 39613110050; Tue, 12 Mar 2019 20:01:35 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2CCE1110045; Tue, 12 Mar 2019 20:01:35 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.73]) by imsva1.lgp.ehu.es (Postfix) with ESMTPS; Tue, 12 Mar 2019 20:01:35 +0100 (CET) Received: from 803a063d172d (unknown [139.47.78.33]) by smtp1 (Postfix) with ESMTPSA id D5FF5357FE; Tue, 12 Mar 2019 20:01:34 +0100 (CET) Date: Tue, 12 Mar 2019 19:01:35 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190312190135.GG15@803a063d172d> References: <20190312185541.GA13@803a063d172d> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190312185541.GA13@803a063d172d> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 172 matched, not delayed by milter-greylist-4.4.3 (smtp1); Tue, 12 Mar 2019 20:01:35 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24486.002 X-TM-AS-Result: No--4.542-7.0-31-10 X-imss-scan-details: No--4.542-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24486.002 X-TMASE-Result: 10--4.542100-10.000000 X-TMASE-MatchedRID: RsPxVIkBekw8mRT0SYY6fggKAWhuC2ojb6bRSg4rpzvrKAwxOgrz3ZG4 TFKxKJcilB6IdnaWhV1343G9TapOGGJnITZQ7LgcvnSVh24OCE6+JGWINXafLNchlMhSt6Fev4d GcGTuw1dfll+ZbVibhYAvT09hxhi7zO35OKTxh+U2zdLf3NqhdtGuPHzXu+/6c8FZmOUzKzZWFs MQfbcNE+L34j+vjUvNoxDjGqq9g0nPlrFA9QLlUlz+axQLnAVBK9jw4MDFmyJFDR0AKGX+XH/sD LdkieHySFvD9DvvV0KpWL1QDKxiuJH0YXYnbGoz/sToY2qzpx5eu6llOoM7BnnDQRq5CiZHjocz muoPCq11d+LCQ1ipK/jmsIDehmIPFxtgF86j3voKvD4LgYLRQ33FlGH7TkjNiQiwxaFD04oyFvD aCwL54w7a++vLTEP4zooiBOZd/tKd3SaL0pUZ0TIs/pHfy5KvymBsSxwng4cev0UmjjsZI564GT p+lG2X 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.smtp1.imsva1); Tue, 12 Mar 2019 20:01:35 +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 v6 7/9] qemu-binfmt-conf.sh: generalize to positional 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" 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. If no positional arguments are provided, 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. Support QEMU_TARGETS environment variable, consistently with 'path', 'suffix', 'persistent' and 'credential', 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 qemu_target_list. Signed-off-by: Unai Martinez-Corral --- scripts/qemu-binfmt-conf.sh | 80 +++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 34 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index b846313b4e..51c4c67799 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -6,6 +6,28 @@ 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 TARGETS is/are in the supported target list +qemu_check_target_list() { + if [ $# -eq 0 ] ; then + checked_target_list=3D"$qemu_target_list" + return + fi + unset checked_target_list + for target ; do + for cpu in $qemu_target_list ; do + if [ "x$cpu" =3D "x$target" ] ; then + checked_target_list=3D"$checked_target_list $target" + break + fi + done + if [ "x$cpu" !=3D "x$target" ] ; then + echo "ERROR: unknown CPU \"$target\"" 1>&2 + usage + exit 1 + fi + done +} + 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,14 +189,16 @@ qemu_get_family() { usage() { cat <&2 - usage - exit 1 - fi - fi ;; -Q|--path) shift @@ -390,5 +400,7 @@ while true ; do shift done +shift + $CHECK -qemu_set_binfmts +qemu_set_binfmts "$@" -- 2.21.0 From nobody Mon Mar 31 20:28:34 2025 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 1552418842538619.6535837892585; Tue, 12 Mar 2019 12:27:22 -0700 (PDT) Received: from localhost ([127.0.0.1]:58551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3n3S-00054G-CB for importer@patchew.org; Tue, 12 Mar 2019 15:27:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3mhN-0003HE-JT for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:04:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3mhG-0001I2-RG for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:04:21 -0400 Received: from smtp.lg.ehu.es ([158.227.0.66]:58244 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 1h3mhA-0008Js-2d for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:04:14 -0400 Received: from imsva1.lgp.ehu.es (imsva1.lgp.ehu.es [10.0.3.245]) by postfix.smtp1.imsva1 (Postfix) with ESMTPS id 22B5D357FE; Tue, 12 Mar 2019 20:03:10 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CEE6411004A; Tue, 12 Mar 2019 20:03:09 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C2407110045; Tue, 12 Mar 2019 20:03:09 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.73]) by imsva1.lgp.ehu.es (Postfix) with ESMTPS; Tue, 12 Mar 2019 20:03:09 +0100 (CET) Received: from 803a063d172d (unknown [139.47.78.33]) by smtp1 (Postfix) with ESMTPSA id 612B933388; Tue, 12 Mar 2019 20:03:09 +0100 (CET) Date: Tue, 12 Mar 2019 19:03:09 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190312190309.GH15@803a063d172d> References: <20190312185541.GA13@803a063d172d> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190312185541.GA13@803a063d172d> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 172 matched, not delayed by milter-greylist-4.4.3 (smtp1); Tue, 12 Mar 2019 20:03:09 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24486.002 X-TM-AS-Result: No--1.679-7.0-31-10 X-imss-scan-details: No--1.679-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24486.002 X-TMASE-Result: 10--1.679100-10.000000 X-TMASE-MatchedRID: x/EPlNU2vY08mRT0SYY6fguB7zdAMUjAbYZQU1whlX9UjspoiX02F0R7 kF2MEpMASIkcopeTUu6Of30LOspw9AjZsijeXMGW2MZGQuKc8UhaNaxZBRbNWiAWlErg1VlPShc oFt7Iuk8Zw5ucm3NLWkZb9TVWKMA5HKicLVBy7TlbF+jvJlkOpkyQ5fRSh265DgB6l2o8FRhCcg 190NG0LjElClGessEfhZoMPmZo0JT7zsWX+owtEwbU2RwCZ1Hgu56wFPSkMVGtj24Xqh0yXDvd4 jBDU8JFxxTXIIUjOO8U3DI6T8C6TnrSP9RtGZYoydRP56yRRA9LxPtqS8Bm55soi2XrUn/Jn2MC CHC4423hgDVQQk8VzQtuKBGekqUpnH7sbImOEBTqMDo1F1ew7hbqrwfYsYsIm532R4UdvEXyikZ y3J6YNQ0dr2uZpBCUlLpOM4sxFqu99Y+sLkEOOsLiRoTQvtttq9n/o875HoM30cTauf45PGeo9j jtMW5CM6tJ7nFBn5COQFE7dAFoFLAUyUg9ogFt 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.smtp1.imsva1); Tue, 12 Mar 2019 20:03:10 +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 v6 8/9] qemu-binfmt-conf.sh: add option --clear 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: alex.bennee@linaro.org, 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. Valid values are those in qemu_target_list. If TARGETS is empty, all the existing 'qemu-*' interpreters are removed. This is partial because 'debian' and 'systemd' configurations are not supported. The script will exit with error 'option clear 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 | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index 51c4c67799..c672ec4886 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -197,7 +197,7 @@ Options and associated environment variables: Argument Env-variable Description TARGETS QEMU_TARGETS A single arch name or a list of them= (see all names below); - if empty, configure all known target= s; + if empty, configure/clear all known = targets; if 'NONE', no interpreter is configu= red. -h|--help display this usage -Q|--path PATH QEMU_PATH set path to qemu interpreter(s) @@ -206,6 +206,8 @@ TARGETS QEMU_TARGETS A single arch nam= e or a list of them (see uses are cloned from the open file. -c|--credential QEMU_CREDENTIAL (yes) credential and security tokens= are calculated according to the binary to interpret +-r|--clear QEMU_CLEAR (yes) remove registered interpreters= for target TARGETS; + then exit. -e|--exportdir PATH define where to write configuration = files (default: $SYSTEMDDIR or $DEBIANDIR) -s|--systemd don't write into /proc, generate fil= e(s) for @@ -218,6 +220,7 @@ QEMU_PATH=3D$QEMU_PATH QEMU_SUFFIX=3D$QEMU_SUFFIX QEMU_PERSISTENT=3D$QEMU_PERSISTENT QEMU_CREDENTIAL=3D$QEMU_CREDENTIAL +QEMU_CLEAR=3D$QEMU_CLEAR To import templates with update-binfmts, use : @@ -344,8 +347,19 @@ qemu_set_binfmts() { done } +qemu_clear_notimplemented() { + echo "ERROR: option clear not implemented for this mode yet" 1>&2 + usage + exit 1 +} + +qemu_clear_interpreter() { + printf %s -1 > "/proc/sys/fs/binfmt_misc/$1" +} + CHECK=3Dqemu_check_bintfmt_misc BINFMT_SET=3Dqemu_register_interpreter +BINFMT_CLEAR=3Dqemu_clear_interpreter SYSTEMDDIR=3D"/etc/binfmt.d" DEBIANDIR=3D"/usr/share/binfmts" @@ -355,20 +369,26 @@ QEMU_PATH=3D"${QEMU_PATH:-/usr/local/bin}" QEMU_SUFFIX=3D"${QEMU_SUFFIX:-}" QEMU_PERSISTENT=3D"${QEMU_PERSISTENT:-no}" QEMU_CREDENTIAL=3D"${QEMU_CREDENTIAL:-no}" +QEMU_CLEAR=3D"${QEMU_CLEAR:-no}" -options=3D$(getopt -o dsQ:S:e:hcp -l debian,systemd,path:,suffix:,exportdi= r:,help,credential,persistent -- "$@") +options=3D$(getopt -o rdsQ:S:e:hcp -l clear,debian,systemd,path:,suffix:,e= xportdir:,help,credential,persistent -- "$@") eval set -- "$options" while true ; do case "$1" in + -r|--clear) + QEMU_CLEAR=3D"yes" + ;; -d|--debian) CHECK=3Dqemu_check_debian BINFMT_SET=3Dqemu_generate_debian + BINFMT_CLEAR=3Dqemu_clear_notimplemented EXPORTDIR=3D${EXPORTDIR:-$DEBIANDIR} ;; -s|--systemd) CHECK=3Dqemu_check_systemd BINFMT_SET=3Dqemu_generate_systemd + BINFMT_CLEAR=3Dqemu_clear_notimplemented EXPORTDIR=3D${EXPORTDIR:-$SYSTEMDDIR} ;; -Q|--path) @@ -403,4 +423,13 @@ done shift $CHECK + +if [ "x$QEMU_CLEAR" =3D "xyes" ] ; then + qemu_check_target_list "$@" + for t in $checked_target_list ; do + $BINFMT_CLEAR "qemu-$t" + done + exit +fi + qemu_set_binfmts "$@" -- 2.21.0 From nobody Mon Mar 31 20:28:34 2025 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 1552418620260392.4394231052031; Tue, 12 Mar 2019 12:23:40 -0700 (PDT) Received: from localhost ([127.0.0.1]:58487 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3mzs-0002H5-2z for importer@patchew.org; Tue, 12 Mar 2019 15:23:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3mhA-0002wc-5M for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:04:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3mh2-00010I-KU for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:04:07 -0400 Received: from smtp.lg.ehu.es ([158.227.0.66]:52634 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 1h3mgw-0000pN-V8 for qemu-devel@nongnu.org; Tue, 12 Mar 2019 15:04:00 -0400 Received: from imsva1.lgp.ehu.es (imsva1.lgp.ehu.es [10.0.3.245]) by postfix.smtp1.imsva1 (Postfix) with ESMTPS id D77B935EE6; Tue, 12 Mar 2019 20:03:54 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AC2F911004A; Tue, 12 Mar 2019 20:03:54 +0100 (CET) Received: from imsva1.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A03AA110045; Tue, 12 Mar 2019 20:03:54 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.73]) by imsva1.lgp.ehu.es (Postfix) with ESMTPS; Tue, 12 Mar 2019 20:03:54 +0100 (CET) Received: from 803a063d172d (unknown [139.47.78.33]) by smtp1 (Postfix) with ESMTPSA id 5A09735EE6; Tue, 12 Mar 2019 20:03:54 +0100 (CET) Date: Tue, 12 Mar 2019 19:03:54 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190312190354.GI15@803a063d172d> References: <20190312185541.GA13@803a063d172d> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190312185541.GA13@803a063d172d> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 172 matched, not delayed by milter-greylist-4.4.3 (smtp1); Tue, 12 Mar 2019 20:03:54 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24486.002 X-TM-AS-Result: No--2.766-7.0-31-10 X-imss-scan-details: No--2.766-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24486.002 X-TMASE-Result: 10--2.765700-10.000000 X-TMASE-MatchedRID: ehvrJQ9m4PA8mRT0SYY6fguB7zdAMUjATJDl9FKHbrkOAHqXajwVGEJy DX3Q0bQuRZ3bsJ5dhK9sy3DPX9Umyv2E4cGVTliSEe5D10MltLYxmbT6wQT2a/HFoBcOsKez02b 9SFcwxUmVdYejSz2J/mFP3OsrR0xZlYSFi/RRLjcXKqR+w9a7UCtovaaHxlUrnQqircTOm4dZhL w6sxHoN/uBAQFQ9xUB363fb6EBgcmPaFHMfVTC4P7E6GNqs6ceXrupZTqDOwZ5w0EauQomR46HM 5rqDwqtAXY01CK5yMt3bHwIkevHfkO03zqdxJSeHHT35V2UcjNZQ2L2Tksawp19yViR0MmyPNNm q03e8HjWrUrFIv1PxK+2Wj7PuZdfnd0mi9KVGdEyLP6R38uSr8pgbEscJ4OHHr9FJo47GSOeuBk 6fpRtlw== 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.smtp1.imsva1); Tue, 12 Mar 2019 20:03:54 +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 v6 9/9] qemu-binfmt-conf.sh: add --test 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" Signed-off-by: Unai Martinez-Corral --- scripts/qemu-binfmt-conf.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index c672ec4886..7e7f6e31a6 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -197,8 +197,7 @@ Options and associated environment variables: Argument Env-variable Description TARGETS QEMU_TARGETS A single arch name or a list of them= (see all names below); - if empty, configure/clear all known = targets; - if 'NONE', no interpreter is configu= red. + if empty, configure/clear all known = targets. -h|--help display this usage -Q|--path PATH QEMU_PATH set path to qemu interpreter(s) -F|--suffix SUFFIX QEMU_SUFFIX add a suffix to the default interpre= ter name @@ -208,6 +207,8 @@ TARGETS QEMU_TARGETS A single arch nam= e or a list of them (see to the binary to interpret -r|--clear QEMU_CLEAR (yes) remove registered interpreters= for target TARGETS; then exit. +-t|--test QEMU_TEST (yes) test the setup with the provid= ed arguments, but do not + configure any of the interpreters. -e|--exportdir PATH define where to write configuration = files (default: $SYSTEMDDIR or $DEBIANDIR) -s|--systemd don't write into /proc, generate fil= e(s) for @@ -221,6 +222,7 @@ QEMU_SUFFIX=3D$QEMU_SUFFIX QEMU_PERSISTENT=3D$QEMU_PERSISTENT QEMU_CREDENTIAL=3D$QEMU_CREDENTIAL QEMU_CLEAR=3D$QEMU_CLEAR +QEMU_TEST=3D$QEMU_TEST To import templates with update-binfmts, use : @@ -319,9 +321,6 @@ qemu_set_binfmts() { # reduce the list of target interpreters to those given in the CLI targets=3D${@:-$QEMU_TARGET} - if [ "x$targets" =3D "xNONE" ] ; then - return - fi qemu_check_target_list $targets # register the interpreter for each target except for the native one @@ -370,12 +369,16 @@ QEMU_SUFFIX=3D"${QEMU_SUFFIX:-}" QEMU_PERSISTENT=3D"${QEMU_PERSISTENT:-no}" QEMU_CREDENTIAL=3D"${QEMU_CREDENTIAL:-no}" QEMU_CLEAR=3D"${QEMU_CLEAR:-no}" +QEMU_TEST=3D"${QEMU_TEST:-no}" -options=3D$(getopt -o rdsQ:S:e:hcp -l clear,debian,systemd,path:,suffix:,e= xportdir:,help,credential,persistent -- "$@") +options=3D$(getopt -o trdsQ:S:e:hcp -l test,clear,debian,systemd,path:,suf= fix:,exportdir:,help,credential,persistent -- "$@") eval set -- "$options" while true ; do case "$1" in + -t|--test) + QEMU_TEST=3D"yes" + ;; -r|--clear) QEMU_CLEAR=3D"yes" ;; @@ -424,6 +427,11 @@ shift $CHECK +if [ "x$QEMU_TEST" =3D "xyes" ] ; then + BINFMT_SET=3D: + BINFMT_CLEAR=3D: +fi + if [ "x$QEMU_CLEAR" =3D "xyes" ] ; then qemu_check_target_list "$@" for t in $checked_target_list ; do -- 2.21.0