aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-03-14 17:47:49 +0000
committerPeter Maydell <peter.maydell@linaro.org>2021-03-14 17:47:49 +0000
commit6157b0e19721aadb4c7fdcfe57b2924af6144b14 (patch)
tree21359ab73b14667700a990773e90345ad7acdf11 /scripts
parent757acb9a8295e8be4a37b2cfc1cd947e357fd29c (diff)
parent0266e8e3b3981b492e82be20bb97e8ed9792ed00 (diff)
downloadqemu-6157b0e19721aadb4c7fdcfe57b2924af6144b14.zip
qemu-6157b0e19721aadb4c7fdcfe57b2924af6144b14.tar.gz
qemu-6157b0e19721aadb4c7fdcfe57b2924af6144b14.tar.bz2
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-request' into staging
linux-user pull request 20210313 - fix elfload - fix executable page of /proc/self/maps - add preserve-arg[0] support for binfmt_misc # gpg: Signature made Sat 13 Mar 2021 09:47:23 GMT # gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C # gpg: issuer "laurent@vivier.eu" # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full] # gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full] # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full] # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * remotes/vivier2/tags/linux-user-for-6.0-pull-request: linux-user/elfload: fix address calculation in fallback scenario linux-user/elfload: do not assume MAP_FIXED_NOREPLACE kernel support linux-user/elfload: munmap proper address in pgd_find_hole_fallback linux-user: manage binfmt-misc preserve-arg[0] flag linux-user: Fix executable page of /proc/self/maps Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/qemu-binfmt-conf.sh44
1 files changed, 27 insertions, 17 deletions
diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
index 7b5d54b..573b5dc 100755
--- a/scripts/qemu-binfmt-conf.sh
+++ b/scripts/qemu-binfmt-conf.sh
@@ -178,25 +178,27 @@ usage() {
Usage: qemu-binfmt-conf.sh [--qemu-path PATH][--debian][--systemd CPU]
[--help][--credential yes|no][--exportdir PATH]
[--persistent yes|no][--qemu-suffix SUFFIX]
+ [--preserve-argv0 yes|no]
Configure binfmt_misc to use qemu interpreter
- --help: display this usage
- --qemu-path: set path to qemu interpreter ($QEMU_PATH)
- --qemu-suffix: add a suffix to the default interpreter name
- --debian: don't write into /proc,
- instead generate update-binfmts templates
- --systemd: don't write into /proc,
- instead generate file for systemd-binfmt.service
- for the given CPU. If CPU is "ALL", generate a
- file for all known cpus
- --exportdir: define where to write configuration files
- (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.
+ --help: display this usage
+ --qemu-path: set path to qemu interpreter ($QEMU_PATH)
+ --qemu-suffix: add a suffix to the default interpreter name
+ --debian: don't write into /proc,
+ instead generate update-binfmts templates
+ --systemd: don't write into /proc,
+ instead generate file for systemd-binfmt.service
+ for the given CPU. If CPU is "ALL", generate a
+ file for all known cpus
+ --exportdir: define where to write configuration files
+ (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.
+ --preserve-argv0 preserve argv[0]
To import templates with update-binfmts, use :
@@ -269,6 +271,9 @@ qemu_generate_register() {
if [ "$PERSISTENT" = "yes" ] ; then
flags="${flags}F"
fi
+ if [ "$PRESERVE_ARG0" = "yes" ] ; then
+ flags="${flags}P"
+ fi
echo ":qemu-$cpu:M::$magic:$mask:$qemu:$flags"
}
@@ -330,9 +335,10 @@ DEBIANDIR="/usr/share/binfmts"
QEMU_PATH=/usr/local/bin
CREDENTIAL=no
PERSISTENT=no
+PRESERVE_ARG0=no
QEMU_SUFFIX=""
-options=$(getopt -o ds:Q:S:e:hc:p: -l debian,systemd:,qemu-path:,qemu-suffix:,exportdir:,help,credential:,persistent: -- "$@")
+options=$(getopt -o ds:Q:S:e:hc:p:g: -l debian,systemd:,qemu-path:,qemu-suffix:,exportdir:,help,credential:,persistent:,preserve-argv0: -- "$@")
eval set -- "$options"
while true ; do
@@ -388,6 +394,10 @@ while true ; do
shift
PERSISTENT="$1"
;;
+ -g|--preserve-argv0)
+ shift
+ PRESERVE_ARG0="$1"
+ ;;
*)
break
;;