From: Laurent Vivier <laurent@vivier.eu>
To: Max Filippov <jcmvbkbc@gmail.com>, qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3] scripts/qemu-binfmt-conf.sh: add bFLT handler registration
Date: Wed, 24 Oct 2018 12:52:17 +0100 [thread overview]
Message-ID: <9edbf1fc-9401-f6c9-e487-bc3c0d4afd02@vivier.eu> (raw)
In-Reply-To: <20181021165542.8692-1-jcmvbkbc@gmail.com>
On 21/10/2018 17:55, Max Filippov wrote:
> bFLT format header doesn't have enough information to register a handler
> for a specific architecture. Add switch -f / --flat that registers one
> of the qemu binaries as a handler for bFLT executable images.
>
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> ---
> Changes v2->v3:
> - fix bFLT in the patch subject
>
> Changes v1->v2:
> - drop unintended changes to dtc;
>
> scripts/qemu-binfmt-conf.sh | 32 ++++++++++++++++++++++++++++++--
> 1 file changed, 30 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
> index b5a16742a149..39f61065c698 100755
> --- a/scripts/qemu-binfmt-conf.sh
> +++ b/scripts/qemu-binfmt-conf.sh
> @@ -132,6 +132,9 @@ or1k_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\
> or1k_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
> or1k_family=or1k
>
> +flat_magic='bFLT\x00\x00\x00\x04'
> +flat_mask='\xff\xff\xff\xff\xff\xff\xff\xff'
> +
> qemu_get_family() {
> cpu=${HOST_ARCH:-$(uname -m)}
> case "$cpu" in
> @@ -170,6 +173,7 @@ usage() {
> Usage: qemu-binfmt-conf.sh [--qemu-path PATH][--debian][--systemd CPU]
> [--help][--credential yes|no][--exportdir PATH]
> [--persistent yes|no][--qemu-suffix SUFFIX]
> + [--flat CPU]
>
> Configure binfmt_misc to use qemu interpreter
>
> @@ -188,7 +192,9 @@ Usage: qemu-binfmt-conf.sh [--qemu-path PATH][--debian][--systemd CPU]
> 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.
> + are cloned from the open file
> + --flat: register QEMU for this CPU architecture as a handler
> + for the bFLT executable format.
>
> To import templates with update-binfmts, use :
>
> @@ -311,6 +317,13 @@ qemu_set_binfmts() {
> $BINFMT_SET
> fi
> done
> + if [ -n "$QEMU_FLAT" ] ; then
> + cpu="${QEMU_FLAT}_bflt"
I think you don't need this, you can let the user to use "--qemu-suffix"
for that.
Thanks,
Laurent
next prev parent reply other threads:[~2018-10-24 11:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-21 16:55 [Qemu-devel] [PATCH v3] scripts/qemu-binfmt-conf.sh: add bFLT handler registration Max Filippov
2018-10-24 11:52 ` Laurent Vivier [this message]
2018-10-24 16:34 ` Laurent Vivier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9edbf1fc-9401-f6c9-e487-bc3c0d4afd02@vivier.eu \
--to=laurent@vivier.eu \
--cc=jcmvbkbc@gmail.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).