Commit 08785f48b73cfe79f316c49b60dded9afb220161
1 parent
75c6215f
updated so that PPC/ARM/SPARC executables are automatically launched when invoked
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@522 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
34 additions
and
3 deletions
qemu-binfmt-conf.sh
| 1 | -# enable automatic i386 program execution by the kernel (must enable binfmt_misc) | |
| 2 | -echo ':i386:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff:/usr/local/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register | |
| 3 | -echo ':i486:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff:/usr/local/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register | |
| 1 | +#!/bin/sh | |
| 2 | +# enable automatic i386/ARM/SPARC/PPC program execution by the kernel | |
| 3 | + | |
| 4 | +# load the binfmt_misc module | |
| 5 | +/sbin/modprobe binfmt_misc | |
| 6 | + | |
| 7 | +# probe cpu type | |
| 8 | +cpu=`uname -m` | |
| 9 | +case "$cpu" in | |
| 10 | + i386|i486|i586|i686|i86pc|BePC) | |
| 11 | + cpu="i386" | |
| 12 | + ;; | |
| 13 | + "Power Macintosh"|ppc|ppc64) | |
| 14 | + cpu="ppc" | |
| 15 | + ;; | |
| 16 | + armv4l) | |
| 17 | + cpu="arm" | |
| 18 | + ;; | |
| 19 | +esac | |
| 20 | + | |
| 21 | +# register the interpreter for each cpu except for the native one | |
| 22 | +if [ $cpu != "i386" ] ; then | |
| 23 | + 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\xfb\xff\xff\xff:/usr/local/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register | |
| 24 | + 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\xfb\xff\xff\xff:/usr/local/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register | |
| 25 | +fi | |
| 26 | +if [ $cpu != "arm" ] ; then | |
| 27 | + 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\xfb\xff\xff\xff:/usr/local/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register | |
| 28 | +fi | |
| 29 | +if [ $cpu != "sparc" ] ; then | |
| 30 | + 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\xfb\xff\xff\xff:/usr/local/bin/qemu-sparc:' > /proc/sys/fs/binfmt_misc/register | |
| 31 | +fi | |
| 32 | +if [ $cpu != "ppc" ] ; then | |
| 33 | + 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\xfb\xff\xff\xff:/usr/local/bin/qemu-ppc:' > /proc/sys/fs/binfmt_misc/register | |
| 34 | +fi | ... | ... |