diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-03-31 19:10:01 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-03-31 19:10:01 +0000 |
commit | 1e0e6d8be9114ac4f1b9abde5a8852949c242eb5 (patch) | |
tree | ddf501a7913d47f562af2964a57bcd85464817db | |
parent | 5813427b1ddcd74c39f49563c12f1f4a6dba5cea (diff) | |
download | hqemu-1e0e6d8be9114ac4f1b9abde5a8852949c242eb5.zip hqemu-1e0e6d8be9114ac4f1b9abde5a8852949c242eb5.tar.gz |
Update for binfmt_misc handler, by Stefan Weil.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2560 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r-- | qemu-binfmt-conf.sh | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/qemu-binfmt-conf.sh b/qemu-binfmt-conf.sh index bd278d9..cf14459 100644 --- a/qemu-binfmt-conf.sh +++ b/qemu-binfmt-conf.sh @@ -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 @@ case "$cpu" in i386|i486|i586|i686|i86pc|BePC) cpu="i386" ;; + m68k) + cpu="m68k" + ;; + mips*) + cpu="mips" + ;; "Power Macintosh"|ppc|ppc64) cpu="ppc" ;; @@ -33,7 +44,12 @@ fi 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 + # FIXME: We could use the other endianness on a MIPS host. 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 fi |