qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH 0/0] binfmt script patches
@ 2014-01-08 14:25 alex.bennee
  2014-01-08 14:25 ` [Qemu-devel] [PATCH 1/2] scripts/qemu-binfmt-conf.sh: re-factor and clean-up alex.bennee
  2014-01-08 14:25 ` [Qemu-devel] [PATCH 2/2] scripts/qemu-binfmt-check.py: a binfmt checker alex.bennee
  0 siblings, 2 replies; 5+ messages in thread
From: alex.bennee @ 2014-01-08 14:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Hi,

While working on my aarch64 work I found setting up binfmt was more of
a pain than it could have been. Specifically:

* hard-coded for /usr/local installs
* no help
* no error checking

Tellingly the script doesn't seem to be used by the distros who have
rolled their own binfmt_misc stuff around qemu. I also found it hard
to figure out why things were not working so I wrote a noddy checker
script for interrogating the state of binfmt.

I'm currently using the -d mode of this script and am running qemu
directly from my source tree (with $HOME bind mounted into my chroot)
and it seems to be working well.

Any comments? Worth pushing some love to the scripts upstream?


Cheers,

--
Alex Bennée
QEMU/KVM Hacker for Linaro

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 1/2] scripts/qemu-binfmt-conf.sh: re-factor and clean-up
  2014-01-08 14:25 [Qemu-devel] [RFC PATCH 0/0] binfmt script patches alex.bennee
@ 2014-01-08 14:25 ` alex.bennee
  2014-01-08 14:50   ` Andreas Färber
  2014-01-08 14:25 ` [Qemu-devel] [PATCH 2/2] scripts/qemu-binfmt-check.py: a binfmt checker alex.bennee
  1 sibling, 1 reply; 5+ messages in thread
From: alex.bennee @ 2014-01-08 14:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

From: Alex Bennée <alex.bennee@linaro.org>

I was looking to set-up for development but found the script made some
hard-coded assumptions. It doesn't seem the script is used by the
distros but if it had a little more love maybe it would be ;-)

* Add usage() instructions
* Move all registering to a single function
* Check for existence of executable qemu before registering
* Add -d (devel) mode for subscribing in-src tree binaries
* error handling when setting binfmt fails
* add support for aarch64
---
 scripts/qemu-binfmt-conf.sh | 124 +++++++++++++++++++++++++++++++++++++-------
 1 file changed, 105 insertions(+), 19 deletions(-)
 mode change 100644 => 100755 scripts/qemu-binfmt-conf.sh

diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
old mode 100644
new mode 100755
index 0da2618..8cfb387
--- a/scripts/qemu-binfmt-conf.sh
+++ b/scripts/qemu-binfmt-conf.sh
@@ -1,5 +1,89 @@
 #!/bin/sh
-# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/s390 program execution by the kernel
+# Enable automatic i386/ARM/aarch64/M68K/MIPS/SPARC/PPC/s390
+# program execution by the kernel using the binfmt_misc feature
+#
+
+# Base path for finding QEMU binary
+BINFMT_DEVEL_MODE=""
+BINFMT_VERBOSE=""
+BINFMT_BASE_PATH=/usr/local/bin
+
+# Print out some simple usage instructions
+usage() {
+    echo "Usage: `basename $0` options (-hdp)"
+    echo "
+This script is used to configure binfmt_misc on a system
+to automatically call QEMU when a binary that it can
+deal with is detected by the kernel.
+
+Parameters:
+    -p PATH     - base path to find QEMU binaries
+                  (default: $BINFMT_BASE_PATH)
+    -d          - developer mode, search source tree for
+                  the QEMU binaries.
+    -v          - more verbose output
+"
+    exit 1
+}
+
+# Register an individual binfmt
+#
+# Before registering the format we check for the
+# existence of the binary and if VERBOSE is set we
+# specify what exactly has been registered.
+
+register_binfmt () {
+    name=$1
+    qbin=$2
+    binfmt_string=$3
+    warning=$4
+
+    if [ -n "${BINFMT_DEVEL_MODE}" ]; then
+        qemu_check_path=${BINFMT_BASE_PATH}/${qbin}-linux-user/qemu-${qbin}
+    else
+        qemu_check_path=${BINFMT_BASE_PATH}/qemu-${qbin}
+    fi
+
+    if [ -x "$qemu_check_path" ]; then
+        bfmt=":$name:M::$binfmt_string:$qemu_check_path:"
+        echo $bfmt > /proc/sys/fs/binfmt_misc/register
+        res=$?
+        if [ "$res" != "0" ]; then
+            echo "Error ($res): $bfmt > /proc/sys/fs/binfmt_misc/register"
+        else
+            if [ -n "${BINFMT_VERBOSE}" ] ; then
+                echo "registered $qemu_check_path for $name binaries"
+            fi
+            if [ -n "$warning" ]; then
+                echo "$warning"
+            fi
+        fi
+    fi
+}
+
+while getopts "vhdp:" opt
+do
+    case $opt in
+        h)
+            usage
+            ;;
+        p)
+            BINFMT_BASE_PATH=$OPTARG
+            ;;
+        d)
+            BINFMT_DEVEL_MODE=1
+            script_dir=`dirname $0`
+            BINFMT_BASE_PATH=`realpath $script_dir/..`
+            ;;
+        v)
+            BINFMT_VERBOSE=1
+            ;;
+        *)
+            echo "Unknown option."
+            usage
+            ;;
+  esac
+done
 
 # load the binfmt_misc module
 if [ ! -d /proc/sys/fs/binfmt_misc ]; then
@@ -31,39 +115,41 @@ esac
 
 # register the interpreter for each cpu except for the native one
 if [ $cpu != "i386" ] ; then
-    echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register
-    echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register
+    register_binfmt i386 i386 "\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"
+    register_binfmt i486 i386 "\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"
 fi
 if [ $cpu != "alpha" ] ; then
-    echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-alpha:' > /proc/sys/fs/binfmt_misc/register
+    register_binfmt alpha alpha "\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"
 fi
 if [ $cpu != "arm" ] ; then
-    echo   ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register
-    echo   ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-armeb:' > /proc/sys/fs/binfmt_misc/register
+    register_binfmt arm arm "\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"
+    register_binfmt armeb armeb "\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"
+fi
+if [ $cpu != "aarch64" ] ; then
+    register_binfmt aarch64 aarch64 "\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"
 fi
 if [ $cpu != "sparc" ] ; then
-    echo   ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-sparc:' > /proc/sys/fs/binfmt_misc/register
+    register_binfmt sparc sparc "\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"
 fi
 if [ $cpu != "ppc" ] ; then
-    echo   ':ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-ppc:' > /proc/sys/fs/binfmt_misc/register
+    register_binfmt ppc ppc "\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"
 fi
 if [ $cpu != "m68k" ] ; then
-    echo   'Please check cpu value and header information for m68k!'
-    echo   ':m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-m68k:' > /proc/sys/fs/binfmt_misc/register
+    register_binfmt m68k m68k "\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff" 'Please check cpu value and header information for m68k!'
 fi
 if [ $cpu != "mips" ] ; then
     # FIXME: We could use the other endianness on a MIPS host.
-    echo   ':mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-mips:' > /proc/sys/fs/binfmt_misc/register
-    echo   ':mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-mipsel:' > /proc/sys/fs/binfmt_misc/register
-    echo   ':mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-mipsn32:' > /proc/sys/fs/binfmt_misc/register
-    echo   ':mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-mipsn32el:' > /proc/sys/fs/binfmt_misc/register
-    echo   ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-mips64:' > /proc/sys/fs/binfmt_misc/register
-    echo   ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-mips64el:' > /proc/sys/fs/binfmt_misc/register
+    register_binfmt mips mips "\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"
+    register_binfmt mipsel mipsel "\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"
+    register_binfmt mipsn32 mipsn32 "\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"
+    register_binfmt mipsn32el mipsn32el "\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"
+    register_binfmt mips64 mips64 "\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"
+    register_binfmt mips64el mips64el "\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"
 fi
 if [ $cpu != "sh" ] ; then
-    echo    ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-sh4:' > /proc/sys/fs/binfmt_misc/register
-    echo    ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-sh4eb:' > /proc/sys/fs/binfmt_misc/register
+    register_binfmt sh4 sh4 "\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"
+    register_binfmt sh4eb sh4eb "\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"
 fi
 if [ $cpu != "s390x" ] ; then
-    echo   ':s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-s390x:' > /proc/sys/fs/binfmt_misc/register
+    register_binfmt s390x s390x "\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"
 fi
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 2/2] scripts/qemu-binfmt-check.py: a binfmt checker
  2014-01-08 14:25 [Qemu-devel] [RFC PATCH 0/0] binfmt script patches alex.bennee
  2014-01-08 14:25 ` [Qemu-devel] [PATCH 1/2] scripts/qemu-binfmt-conf.sh: re-factor and clean-up alex.bennee
@ 2014-01-08 14:25 ` alex.bennee
  1 sibling, 0 replies; 5+ messages in thread
From: alex.bennee @ 2014-01-08 14:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

From: Alex Bennée <alex.bennee@linaro.org>

This script allows you to check if a given binary will match against any
of the currently registered binfmts on the system.

---

v2 (ajb):
   - cleaned up whitespace and checkpatch fixes
---
 scripts/qemu-binfmt-check.py | 109 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 109 insertions(+)
 create mode 100755 scripts/qemu-binfmt-check.py

diff --git a/scripts/qemu-binfmt-check.py b/scripts/qemu-binfmt-check.py
new file mode 100755
index 0000000..c4309a5
--- /dev/null
+++ b/scripts/qemu-binfmt-check.py
@@ -0,0 +1,109 @@
+#!/usr/bin/python
+#
+# binfmt check script
+#
+# Copyright 2014 Linaro
+#
+# Authors:
+#  Alex Bennee <alex.bennee@linaro.org>
+#
+# This work is licensed under the terms of the GNU GPL, version 2.  See
+# the COPYING file in the top-level directory.
+
+import os
+import re
+import binascii
+
+re_int = re.compile(r"interpreter (.+)$")
+re_off = re.compile(r"offset (\d+)$")
+re_magic = re.compile(r"magic ([\dabcdef]+)")
+re_mask = re.compile(r"mask ([\dabcdef]+)")
+
+# argparse is only available in Python >= 2.7
+from optparse import OptionParser
+parser = OptionParser()
+
+# list of binfmts
+binfmts = []
+
+
+def read_binfmt_spec(f):
+    bfmt = {}
+    with open(f) as fd:
+        content = fd.readlines()
+    for l in content:
+        m = re_int.match(l)
+        if m:
+            bfmt["interpreter"] = m.group(1)
+        m = re_off.match(l)
+        if m:
+            bfmt["offset"] = int(m.group(1))
+        m = re_magic.match(l)
+        if m:
+            bfmt["magic"] = binascii.unhexlify(m.group(1))
+        m = re_mask.match(l)
+        if m:
+            bfmt["mask"] = binascii.unhexlify(m.group(1))
+    print "loaded: %s" % bfmt
+    binfmts.append(bfmt)
+
+
+def load_binfmt_masks():
+    binfmt_dir = "/proc/sys/fs/binfmt_misc"
+    files = os.listdir(binfmt_dir)
+    for f in files:
+        if not f.startswith("status"):
+            fp = "%s/%s" % (binfmt_dir, f)
+            if os.access(fp, os.R_OK):
+                read_binfmt_spec(fp)
+
+
+def check_file_against_binfmt(fmt, f):
+    """
+    Check if a file will match a given binfmt mask
+    """
+    print "checking %s" % (f)
+    nbytes = len(fmt["magic"])
+
+    fd = open(f, "rb")
+    fd.seek(fmt["offset"])
+    header = fd.read(nbytes)
+    magic = fmt["magic"]
+    try:
+        mask = fmt["mask"]
+    except:
+        # TODO, make full mask
+        return
+
+    values = zip(mask, magic, header)
+    failed = False
+    pos = 0
+    for m, g, h in values:
+        mask = ord(m)
+        bits_to_check = ord(h) & mask
+        magic = ord(g)
+        if not bits_to_check == magic:
+            print "failed at %d (%x, %x, %x)" % (pos, mask, magic, bits_to_check)
+            failed = True
+            break
+        pos += 1
+    return not failed
+
+
+def check_file_against_all_binfmts(f):
+    """
+    Check a file against the binfmt masks
+    """
+    path = os.path.abspath(f)
+    print "file is %s" % (path)
+    for b in binfmts:
+        if check_file_against_binfmt(b, path):
+            print "%s will use %s" % (path, b["interpreter"])
+            break
+
+
+if __name__ == "__main__":
+    (opts, args) = parser.parse_args()
+    load_binfmt_masks()
+    for f in args:
+        check_file_against_all_binfmts(f)
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] scripts/qemu-binfmt-conf.sh: re-factor and clean-up
  2014-01-08 14:25 ` [Qemu-devel] [PATCH 1/2] scripts/qemu-binfmt-conf.sh: re-factor and clean-up alex.bennee
@ 2014-01-08 14:50   ` Andreas Färber
  2014-01-08 15:02     ` Alex Bennée
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Färber @ 2014-01-08 14:50 UTC (permalink / raw)
  To: alex.bennee, qemu-devel; +Cc: patches

Hi,

Am 08.01.2014 15:25, schrieb alex.bennee@linaro.org:
> From: Alex Bennée <alex.bennee@linaro.org>
> 
> I was looking to set-up for development but found the script made some
> hard-coded assumptions. It doesn't seem the script is used by the
> distros but if it had a little more love maybe it would be ;-)
> 
> * Add usage() instructions
> * Move all registering to a single function
> * Check for existence of executable qemu before registering
> * Add -d (devel) mode for subscribing in-src tree binaries
> * error handling when setting binfmt fails
> * add support for aarch64
> ---
>  scripts/qemu-binfmt-conf.sh | 124 +++++++++++++++++++++++++++++++++++++-------
>  1 file changed, 105 insertions(+), 19 deletions(-)
>  mode change 100644 => 100755 scripts/qemu-binfmt-conf.sh

Apart from both patches missing a Sob, did you take a look at the
refactoring we discussed with Laurent Vivier (?) a while back?

Essentially, there's multiple ways to register this, and based on our
feedback he refactored it so that the magic strings can be retrieved
individually. Don't remember where that got stuck...

Regards
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] scripts/qemu-binfmt-conf.sh: re-factor and clean-up
  2014-01-08 14:50   ` Andreas Färber
@ 2014-01-08 15:02     ` Alex Bennée
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Bennée @ 2014-01-08 15:02 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-devel, patches


afaerber@suse.de writes:

> Hi,
>
> Am 08.01.2014 15:25, schrieb alex.bennee@linaro.org:
>> From: Alex Bennée <alex.bennee@linaro.org>
>> 
>> I was looking to set-up for development but found the script made some
>> hard-coded assumptions. It doesn't seem the script is used by the
>> distros but if it had a little more love maybe it would be ;-)
<snip>
>
> Apart from both patches missing a Sob, did you take a look at the

I didn't think SoB was needed for RFC patches?

> refactoring we discussed with Laurent Vivier (?) a while back?
>
> Essentially, there's multiple ways to register this, and based on our
> feedback he refactored it so that the magic strings can be retrieved
> individually. Don't remember where that got stuck...

I wasn't aware of this. I'll go and have a look through the archives. Thanks.

>
> Regards
> Andreas

-- 
Alex Bennée

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-01-08 15:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-08 14:25 [Qemu-devel] [RFC PATCH 0/0] binfmt script patches alex.bennee
2014-01-08 14:25 ` [Qemu-devel] [PATCH 1/2] scripts/qemu-binfmt-conf.sh: re-factor and clean-up alex.bennee
2014-01-08 14:50   ` Andreas Färber
2014-01-08 15:02     ` Alex Bennée
2014-01-08 14:25 ` [Qemu-devel] [PATCH 2/2] scripts/qemu-binfmt-check.py: a binfmt checker alex.bennee

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).