]> git.proxmox.com Git - qemu.git/blame - qemu-binfmt-conf.sh
Fix dumping of arm registers (Paul Brook)
[qemu.git] / qemu-binfmt-conf.sh
CommitLineData
08785f48
FB
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
8cpu=`uname -m`
9case "$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 ;;
19esac
20
21# register the interpreter for each cpu except for the native one
22if [ $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
25fi
26if [ $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
808c4954 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\xfb\xff\xff:/usr/local/bin/qemu-armeb:' > /proc/sys/fs/binfmt_misc/register
08785f48
FB
29fi
30if [ $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\xfb\xff\xff\xff:/usr/local/bin/qemu-sparc:' > /proc/sys/fs/binfmt_misc/register
32fi
33if [ $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\xfb\xff\xff\xff:/usr/local/bin/qemu-ppc:' > /proc/sys/fs/binfmt_misc/register
35fi