Statistics
| Branch: | Revision:

root / qemu-binfmt-conf.sh @ 9a64fbe4

History | View | Annotate | Download (1.7 kB)

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