[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 2/7] qemu-binfmt-conf.sh: add persistent (F) flags
From: |
Laurent Vivier |
Subject: |
[Qemu-devel] [PULL 2/7] qemu-binfmt-conf.sh: add persistent (F) flags |
Date: |
Tue, 3 Jul 2018 18:34:46 +0200 |
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 <address@hidden>
Message-Id: <address@hidden>
---
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 <<EOF
Usage: qemu-binfmt-conf.sh [--qemu-path PATH][--debian][--systemd CPU]
[--help][--credential yes|no][--exportdir PATH]
+ [--persistent yes|no]
Configure binfmt_misc to use qemu interpreter
@@ -176,6 +177,9 @@ Usage: qemu-binfmt-conf.sh [--qemu-path
PATH][--debian][--systemd CPU]
(default: $SYSTEMDDIR or $DEBIANDIR)
--credential: if yes, credential and security tokens are
calculated according to the binary to interpret
+ --persistent: if yes, the interpreter is loaded when binfmt is
+ configured and remains in memory. All future uses
+ are cloned from the open file.
To import templates with update-binfmts, use :
@@ -245,6 +249,9 @@ qemu_generate_register() {
if [ "$CREDENTIAL" = "yes" ] ; then
flags="OC"
fi
+ if [ "$PERSISTENT" = "yes" ] ; then
+ flags="${flags}F"
+ fi
echo ":qemu-$cpu:M::$magic:$mask:$qemu:$flags"
}
@@ -304,8 +311,9 @@ DEBIANDIR="/usr/share/binfmts"
QEMU_PATH=/usr/local/bin
CREDENTIAL=no
+PERSISTENT=no
-options=$(getopt -o ds:Q:e:hc: -l
debian,systemd:,qemu-path:,exportdir:,help,credential: -- "$@")
+options=$(getopt -o ds:Q:e:hc:p: -l
debian,systemd:,qemu-path:,exportdir:,help,credential:,persistent: -- "$@")
eval set -- "$options"
while true ; do
@@ -353,6 +361,10 @@ while true ; do
shift
CREDENTIAL="$1"
;;
+ -p|--persistent)
+ shift
+ PERSISTENT="$1"
+ ;;
*)
break
;;
--
2.17.1
- [Qemu-devel] [PULL 0/7] Linux user for 3.0 patches, Laurent Vivier, 2018/07/03
- [Qemu-devel] [PULL 4/7] linux-user: add netlink CARRIER_UP_COUNT/CARRIER_DOWN_COUNT, Laurent Vivier, 2018/07/03
- [Qemu-devel] [PULL 5/7] linux-user: update do_setsockopt(), Laurent Vivier, 2018/07/03
- [Qemu-devel] [PULL 2/7] qemu-binfmt-conf.sh: add persistent (F) flags,
Laurent Vivier <=
- [Qemu-devel] [PULL 6/7] linux-user/strace: Improve capget()/capset() output, Laurent Vivier, 2018/07/03
- [Qemu-devel] [PULL 7/7] linux-user/strace: Improve recvmsg() output, Laurent Vivier, 2018/07/03
- [Qemu-devel] [PULL 1/7] qemu-binfmt-conf.sh: cleanup --credential, Laurent Vivier, 2018/07/03
- [Qemu-devel] [PULL 3/7] qemu-binfmt-conf.sh: allow to provide a suffix to the interpreter name, Laurent Vivier, 2018/07/03
- Re: [Qemu-devel] [PULL 0/7] Linux user for 3.0 patches, no-reply, 2018/07/03
- Re: [Qemu-devel] [PULL 0/7] Linux user for 3.0 patches, Peter Maydell, 2018/07/05