From patchwork Wed Jun 27 20:53:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 935724 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41GFp71w6Vz9s19 for ; Thu, 28 Jun 2018 07:06:39 +1000 (AEST) Received: from localhost ([::1]:33243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYHe9-0004Tg-0a for incoming@patchwork.ozlabs.org; Wed, 27 Jun 2018 17:06:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYHRl-0004GD-Ca for qemu-devel@nongnu.org; Wed, 27 Jun 2018 16:53:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYHRi-0003Zf-8j for qemu-devel@nongnu.org; Wed, 27 Jun 2018 16:53:49 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:42760) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYHRh-0003XC-U0 for qemu-devel@nongnu.org; Wed, 27 Jun 2018 16:53:46 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.167]) with ESMTPSA (Nemesis) id 0Loeg3-1g4I8p20qJ-00gp7a; Wed, 27 Jun 2018 22:53:36 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 27 Jun 2018 22:53:15 +0200 Message-Id: <20180627205317.10343-2-laurent@vivier.eu> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180627205317.10343-1-laurent@vivier.eu> References: <20180627205317.10343-1-laurent@vivier.eu> X-Provags-ID: V03:K1:sCFZ6nJYl+w6oTJ/hPyLuySISH9UBmMkbgFDbw676Fb6R3xvWMC RXzvqJ/JdaJg3bul0mY56Sv7W+Yybt2YPPg44idLnNiQxmF7neHrmRlApeJkPz4tMgHnr+D or+GA5UbwJfzLBYv9XHam2zc3tINe3+RHrn41TO4XUZ0YNPFwraD6YSOFb8twM0Wyz/VujN wthtXpr3kNqzFhry7nsTw== X-UI-Out-Filterresults: notjunk:1; V01:K0:TPeeklcJ+Mw=:3UgThmunDWSrzIs9oZAK27 tC5r6C//uxzF61SD5wlmrsGlbeaYf4QWGovadiubywKl26fZBaDomBRHfrzgX3rNMmdgV68ZX 2TQu+8znnA7O9XwTdgMviiF81MXLo/hrw6BNSiwfi6zxbW+bzIYTQp7KZ8bRxOu81XPiUxQsc wpi6NprRGHR0NK1+sLOYcFXOolDNe5hOKZy/UAcgqwarzQHoxLkCQPVin8QTr9diBV3IYF0/+ 8doT2kw2GOxUGnhptWmaLJCSi2FR5fvKb1r0PstKQQ2Z7sDJBeVfDQqNqMLBl2CKiCY52RxVM D597MQT7V/c12ucsspHkaym4d6zAE6KpeWQABgTw6/t1mah7oY7r4TGqhNvGjjTdK9P63tJkm N0uie/V9h0gr3iKTgSmiTQUbo86jLBSnU1MV4kG3aamu4R2B2o9Dmru9iC29vrqKR3kdgyRwM qBlFr0M3MlyFioZ7+fAiKzdOiQp/H6pPIUelMPZlGLiHeRdqKL7rUK5vGgqR7gKIfngbZaw79 EXKwix72HW59vwdi4uvlbqhifw1ci+3vguvMrbfURC4patlOFByzFYJpRBT+v6Icn9D8UEo+B UTCpbr2Mm+7yDFurGCeDVKwwak5Ux7rBeW/+u5OLzAiu1MUJOKj6D2G1776Vcit8xANAdmum+ 5IAUPmv4UZm+mS6oujNCpRHAlQ9xJbgBQ0YaKdj3asIqG5mkpKT5WV1RoOjLzN2DHDxw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.130 Subject: [Qemu-devel] [PATCH 1/3] qemu-binfmt-conf.sh: cleanup --credential 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 , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" move credential value to its own variable to be able to manage more flags Signed-off-by: Laurent Vivier --- scripts/qemu-binfmt-conf.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index d7eefda0b8..9900554608 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -241,7 +241,12 @@ qemu_check_systemd() { } qemu_generate_register() { - echo ":qemu-$cpu:M::$magic:$mask:$qemu:$FLAGS" + flags="" + if [ "$CREDENTIAL" = "yes" ] ; then + flags="OC" + fi + + echo ":qemu-$cpu:M::$magic:$mask:$qemu:$flags" } qemu_register_interpreter() { @@ -260,10 +265,8 @@ package qemu-$cpu interpreter $qemu magic $magic mask $mask +credential $CREDENTIAL EOF - if [ "$FLAGS" = "OC" ] ; then - echo "credentials yes" >> "$EXPORTDIR/qemu-$cpu" - fi } qemu_set_binfmts() { @@ -300,7 +303,7 @@ SYSTEMDDIR="/etc/binfmt.d" DEBIANDIR="/usr/share/binfmts" QEMU_PATH=/usr/local/bin -FLAGS="" +CREDENTIAL=no options=$(getopt -o ds:Q:e:hc: -l debian,systemd:,qemu-path:,exportdir:,help,credential: -- "$@") eval set -- "$options" @@ -348,11 +351,7 @@ while true ; do ;; -c|--credential) shift - if [ "$1" = "yes" ] ; then - FLAGS="OC" - else - FLAGS="" - fi + CREDENTIAL="$1" ;; *) break From patchwork Wed Jun 27 20:53:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 935715 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41GFXm2pMGz9s19 for ; Thu, 28 Jun 2018 06:55:04 +1000 (AEST) Received: from localhost ([::1]:33161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYHSv-0004dl-Ql for incoming@patchwork.ozlabs.org; Wed, 27 Jun 2018 16:55:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYHSC-0004bt-4m for qemu-devel@nongnu.org; Wed, 27 Jun 2018 16:54:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYHS9-0004B6-3Z for qemu-devel@nongnu.org; Wed, 27 Jun 2018 16:54:16 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:46744) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYHS8-00049j-QF for qemu-devel@nongnu.org; Wed, 27 Jun 2018 16:54:13 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.167]) with ESMTPSA (Nemesis) id 0ME84Z-1fNV9C0Sml-00HLk6; Wed, 27 Jun 2018 22:53:37 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 27 Jun 2018 22:53:16 +0200 Message-Id: <20180627205317.10343-3-laurent@vivier.eu> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180627205317.10343-1-laurent@vivier.eu> References: <20180627205317.10343-1-laurent@vivier.eu> X-Provags-ID: V03:K1:sHGL4UtcTIej4qTI+87ngOGA4FX6Cm1CR8M47MylXr6dJQtHHRX mJ7yHS5Ckh/GNhyr+pa9IfEBTwBOV+qanqXMBOQFYI4wdK46Y3Cg7djYv8lFhNIxHrBlpFg V3qrDup6iJoBjvw6WP8vmrYuD4RY5EicP1fiD/wcc6fW7xct+cEKR0WR5bythfHMC7rd9+V Y8oIYuqlWuW2G1kfI57Og== X-UI-Out-Filterresults: notjunk:1; V01:K0:jN1X7PxMVDY=:RqQunpNS9AWOn+IRKE3rJL q4nuH4BnaVOJDiJPjF3yN7lBKDITGCwqwOZfxVG7KyqSAj4lrW0axg0GC8LrbvyMFhG9u84dE W2k9RDhTfwd9/0c1OL61O8zIAad6bTYysso7d3DFvkTRC882jtvqx5qapwCgJFfOFeTKYWlJK /ASsK1nTsXfojEOpo8TdNrkR+ghpT1bNkAsewbpOCFCl8vLY5KnH1tNed9BHpdTrXinhZ27qc FmaZshGFdM8aYVgYz96occFZCBCNhWaRLi20TZOHnpR76GGz3fqiPGcl3+JYMURQCdOxQhpI3 8vq0inadDIi8uaGIX2FUpHzWQ7CidytYHege1fcwEFNZU++IcxqKoUXxP5puf8wqfXokjwtYB GcP63D62tmSpZ0FUknyxCcpnPMtZVlqfnLt39A6pDWiWWJSuy4yZPxAXu6peFbSc/eoV5L6aO UbeDX2oVrMAVopBNL2nKZiRBS/U3D0m2T0JZUKVESndfRkRZO7qptWLehXjQInLL6+GtbeIbm 80eOI+5qvILTUHviIEnEpWNMywVlyrK3RDMQ0KADBrs5ckDCc/fjMRCpxAsWU2JQVbyTFoxxh KjOs+pbHSiG7GyudYu+BNYCVTuHL389tIdj6VkmP83ft4LZQg8bxPZvGYIJlBrnEw73OOm6/+ wKom/GE8sKLCbRoX+XyPBMDOINcG6E2tJUCJUBbZ+v9PVIrhcLUZ+tiG8GIocYF+RvTk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.187 Subject: [Qemu-devel] [PATCH 2/3] qemu-binfmt-conf.sh: add persistent (F) flags 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 , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Since kernel commit 948b701a607f (binfmt_misc: add persistent opened binary handler for containers) kernel allows to load the interpreter at the configuration time. In case of chroot, it allows to have the interpreter in the host root filesystem and not to copy it to the chroot filesystem. Signed-off-by: Laurent Vivier --- scripts/qemu-binfmt-conf.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index 9900554608..00c9c3aa16 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -161,6 +161,7 @@ usage() { cat < X-Patchwork-Id: 935720 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41GFfg2XLbz9s19 for ; Thu, 28 Jun 2018 07:00:11 +1000 (AEST) Received: from localhost ([::1]:33192 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYHXt-0000Cu-22 for incoming@patchwork.ozlabs.org; Wed, 27 Jun 2018 17:00:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYHSC-0004bo-2e for qemu-devel@nongnu.org; Wed, 27 Jun 2018 16:54:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYHS9-0004Aq-0I for qemu-devel@nongnu.org; Wed, 27 Jun 2018 16:54:16 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:42028) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYHS8-00049Y-Kd for qemu-devel@nongnu.org; Wed, 27 Jun 2018 16:54:12 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LjPsy-1g9X4b3EpE-00baK1; Wed, 27 Jun 2018 22:53:38 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 27 Jun 2018 22:53:17 +0200 Message-Id: <20180627205317.10343-4-laurent@vivier.eu> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180627205317.10343-1-laurent@vivier.eu> References: <20180627205317.10343-1-laurent@vivier.eu> X-Provags-ID: V03:K1:h/N+liOJteyC+ggRh8QvTGglGRQPFlJMO9nN1XPpQlcNCkcLN2+ NnDPwQd+iSzd+FxITsaeGtSt3BOmfz1ItEZmAT9l09W5HtQKv5S88fWLMnWXsb7xRydx/F4 eROc5vlt7kfYguX5lrrHWUgBHeDfkGXu3Fs/XVskv8BZne0MDyWttR85lBkz9oXD16L6xvd 9iZY1P3ixr/ypqH4zwMIg== X-UI-Out-Filterresults: notjunk:1; V01:K0:zRKVY0phjuA=:TpJ4CEum5GGi5QsTPeWwo1 +Z1q8Do8zxp+qlqGQFPyg0vY9iJcbiJI/1KhV/op4iIqUZQ4qUomwlie6mmpKuKmDPmh3FYKV HJEW7BmGkLQtj2pjad2YJqf4MlUcxGayIHWvLQrLedEXjpYTbSeeGJZaCh5n1bwew8TVD1uFs 5h8qCsp1wWx3cDCAuojWQk/QEPou6l5UEtlSdM8DpsppCv95Uv02+tZH/u1wjxJEBqU2goeth CD2Mlr+l53cSCfAoBG/v7dmiRwpmCeFkbmNiZ07nN9t8Lj5XXgOxbQw6K29sO6iDYXcr4X5gd VYqyoKy6FuMoy3CMznB2tSwLh3yXYYoQIrha9eudcMZ2YNSN2DRhjN0sDvvueYbyJKI9RxmhC HJu+aXWih/sdrWcru9Fnacn0mNuLub8bbLY7Idmq7pwOib8QKtkOQWB8VK45RhwB1lR1Chkgu yTcN6xPVDuzNFTiqQjyvW3/PFNX6glF16PVQZzU8rug5MQHf0X8eNH/tums2bBPXyFK3cOO0c lMMjzHmK6Ttc6dnuVRkBA6CtJ/dEiJqnaxx5ubPZ3IS+i8elrLHzOsnB4rkdH7X8AKmK3VH3+ /Xj49Og2DJ+bMoaQhE6dQnpPxxBG89EkvrqB/+GkaRkk275xa+Ethk9VxKuz4Ap/zsYk89Oh6 wndabp/Ys+HMQahkWPFu+DNfF6BmyVJtNumwwgwXO2EEyA52JMtQTYcLvIOIbKVGZro4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.131 Subject: [Qemu-devel] [PATCH 3/3] qemu-binfmt-conf.sh: allow to provide a suffix to the interpreter name 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 , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" some distros provide a qemu-CPU-static binary beside the qemu-CPU one. This change allows to use it by providing "--qemu-suffix -static" to the script. Signed-off-by: Laurent Vivier --- scripts/qemu-binfmt-conf.sh | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index 00c9c3aa16..23df00ae30 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -161,25 +161,26 @@ usage() { cat <