All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: QEMU Developers <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] Update qemu-binfmt-conf.sh
Date: Fri, 30 Mar 2007 20:31:09 +0200	[thread overview]
Message-ID: <460D576D.5050200@mail.berlios.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 304 bytes --]

The patch updates the comments, makes modprobe conditional,
adds a mount needed at least for Debian, and tries to add m68k.

I have no m68k executable available, perhaps somebody can
check the header bytes and the cpu type for this platform?

Maybe the cpu list for mips must be completed, too.

Stefan


[-- Attachment #2: qemu-binfmt-conf.sh.patch --]
[-- Type: text/x-diff, Size: 2119 bytes --]

Index: qemu-binfmt-conf.sh
===================================================================
RCS file: /sources/qemu/qemu/qemu-binfmt-conf.sh,v
retrieving revision 1.4
diff -u -b -B -r1.4 qemu-binfmt-conf.sh
--- qemu-binfmt-conf.sh	6 Dec 2005 21:43:35 -0000	1.4
+++ qemu-binfmt-conf.sh	30 Mar 2007 18:22:59 -0000
@@ -1,8 +1,13 @@
 #!/bin/sh
-# enable automatic i386/ARM/SPARC/PPC program execution by the kernel
+# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC program execution by the kernel
 
 # load the binfmt_misc module
-/sbin/modprobe binfmt_misc
+if [ ! -d /proc/sys/fs/binfmt_misc ]; then
+  /sbin/modprobe binfmt_misc
+fi
+if [ ! -f /proc/sys/fs/binfmt_misc/register ]; then
+  mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
+fi
 
 # probe cpu type
 cpu=`uname -m`
@@ -10,6 +15,12 @@
   i386|i486|i586|i686|i86pc|BePC)
     cpu="i386"
   ;;
+  m68k)
+    cpu="m68k"
+  ;;
+  mips)
+    cpu="mips"
+  ;;
   "Power Macintosh"|ppc|ppc64)
     cpu="ppc"
   ;;
@@ -33,6 +44,10 @@
 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
 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\x04\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-m68k:' > /proc/sys/fs/binfmt_misc/register
+fi
 if [ $cpu != "mips" ] ; then
     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

                 reply	other threads:[~2007-03-30 18:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=460D576D.5050200@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.