From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HXLvL-00077K-QV for qemu-devel@nongnu.org; Fri, 30 Mar 2007 14:34:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HXLvK-00076R-1k for qemu-devel@nongnu.org; Fri, 30 Mar 2007 14:34:07 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HXLvJ-00076N-Vb for qemu-devel@nongnu.org; Fri, 30 Mar 2007 13:34:05 -0500 Received: from moutng.kundenserver.de ([212.227.126.174]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HXLsZ-0004zL-W5 for qemu-devel@nongnu.org; Fri, 30 Mar 2007 14:31:16 -0400 Message-ID: <460D576D.5050200@mail.berlios.de> Date: Fri, 30 Mar 2007 20:31:09 +0200 From: Stefan Weil MIME-Version: 1.0 Subject: [Qemu-devel] [PATCH] Update qemu-binfmt-conf.sh Content-Type: multipart/mixed; boundary="------------020004080700080903040401" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers This is a multi-part message in MIME format. --------------020004080700080903040401 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit 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 --------------020004080700080903040401 Content-Type: text/x-diff; name="qemu-binfmt-conf.sh.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-binfmt-conf.sh.patch" 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 --------------020004080700080903040401--