[34] | 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\xfe\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\xfe\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\xfe\xff\xff\xff:/usr/local/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register |
---|
| 28 | 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 |
---|
| 29 | fi |
---|
| 30 | if [ $cpu != "sparc" ] ; then |
---|
| 31 | 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 |
---|
| 32 | fi |
---|
| 33 | if [ $cpu != "ppc" ] ; then |
---|
| 34 | 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 |
---|
| 35 | fi |
---|
| 36 | if [ $cpu != "mips" ] ; then |
---|
| 37 | 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 |
---|
| 38 | 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 |
---|
| 39 | fi |
---|