Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 380252 Details for
Bug 516454
app-emulation/qemu - add binfmt wrapper for argv[0] handling
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
binfmt-wrapper initd
qemu-binfmt-wrapper.initd-r1 (text/plain), 7.35 KB, created by
Andrew Aladjev
on 2014-07-05 15:32:59 UTC
(
hide
)
Description:
binfmt-wrapper initd
Filename:
MIME Type:
Creator:
Andrew Aladjev
Created:
2014-07-05 15:32:59 UTC
Size:
7.35 KB
patch
obsolete
>#!/sbin/runscript ># Copyright 1999-2013 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 ># $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/files/qemu-binfmt-wrapper.initd-r1,v 1.3 2013/02/17 22:05:22 vapier Exp $ > ># enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/s390 program execution by the kernel > >depend() { > after procfs >} > >start() { > ebegin "Registering qemu-user binaries" > > if [ ! -d /proc/sys/fs/binfmt_misc ] ; then > modprobe -q binfmt_misc > fi > > if [ ! -d /proc/sys/fs/binfmt_misc ] ; then > eend $? "You need support for 'misc binaries' in your kernel!" || return > fi > > if [ ! -f /proc/sys/fs/binfmt_misc/register ] ; then > mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc >/dev/null 2>&1 > eend $? || return > fi > > # probe cpu type > cpu=`uname -m` > case "$cpu" in > i386|i486|i586|i686|i86pc|BePC|x86_64) > cpu="i386" > ;; > m68k) > cpu="m68k" > ;; > mips*) > cpu="mips" > ;; > "Power Macintosh"|ppc|ppc64) > cpu="ppc" > ;; > armv[4-9]*) > cpu="arm" > ;; > sparc*) > cpu="sparc" > ;; > esac > > # register the interpreter for each cpu except for the native one > if [ $cpu != "i386" -a -x "/usr/bin/qemu-i386-binfmt-wrapper" ] ; then > 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/bin/qemu-i386-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > 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/bin/qemu-i386-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > fi > if [ $cpu != "alpha" -a -x "/usr/bin/qemu-alpha-binfmt-wrapper" ] ; then > echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > fi > if [ $cpu != "arm" -a -x "/usr/bin/qemu-arm-binfmt-wrapper" ] ; then > 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\x00\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > fi > if [ $cpu != "arm" -a -x "/usr/bin/qemu-armeb-binfmt-wrapper" ] ; then > 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/bin/qemu-armeb-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > fi > if [ $cpu != "sparc" -a -x "/usr/bin/qemu-sparc-binfmt-wrapper" ] ; then > 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/bin/qemu-sparc-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > fi > if [ $cpu != "ppc" -a -x "/usr/bin/qemu-ppc-binfmt-wrapper" ] ; 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/bin/qemu-ppc-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > fi > if [ $cpu != "m68k" -a -x "/usr/bin/qemu-m68k-binfmt-wrapper" ] ; 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/bin/qemu-m68k-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > fi > if [ $cpu != "mips" -a -x "/usr/bin/qemu-mips-binfmt-wrapper" ] ; 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/bin/qemu-mips-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > fi > if [ $cpu != "mips" -a -x "/usr/bin/qemu-mipsel-binfmt-wrapper" ] ; then > 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/bin/qemu-mipsel-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > fi > if [ $cpu != "mips" -a -x "/usr/bin/qemu-mipsn32-binfmt-wrapper" ] ; then > echo ':mipsn32: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/bin/qemu-mipsn32-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > fi > if [ $cpu != "mips" -a -x "/usr/bin/qemu-mipsn32el-binfmt-wrapper" ] ; then > echo ':mipsn32el: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/bin/qemu-mipsn32el-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > fi > if [ $cpu != "mips" -a -x "/usr/bin/qemu-mips64-binfmt-wrapper" ] ; then > echo ':mips64:M::\x7fELF\x02\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/bin/qemu-mips64-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > fi > if [ $cpu != "mips" -a -x "/usr/bin/qemu-mips64el-binfmt-wrapper" ] ; then > echo ':mips64el:M::\x7fELF\x02\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/bin/qemu-mips64el-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > fi > if [ $cpu != "sh" -a -x "/usr/bin/qemu-sh4-binfmt-wrapper" ] ; then > echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > fi > if [ $cpu != "sh" -a -x "/usr/bin/qemu-sh4eb-binfmt-wrapper" ] ; then > echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > fi > if [ $cpu != "s390x" -a -x "/usr/local/bin/qemu-s390x-binfmt-wrapper" ] ; then > echo ':s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-s390x-binfmt-wrapper:P' > /proc/sys/fs/binfmt_misc/register > fi > eend $? >} > >stop() { > ebegin "Unregistering qemu-user binaries" > local arches > > arches="${arches} i386 i486" > arches="${arches} alpha" > arches="${arches} arm armeb" > arches="${arches} sparc" > arches="${arches} ppc" > arches="${arches} m68k" > arches="${arches} mips mipsel mipsn32 mipsn32el mips64 mips64el" > arches="${arches} sh4 sh4eb" > arches="${arches} s390x" > > for a in ${arches}; do > if [ -f /proc/sys/fs/binfmt_misc/$a ] ; then > echo '-1' > /proc/sys/fs/binfmt_misc/$a > fi > done > > eend $? >} > ># vim: ts=4 :
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 516454
:
380248
|
380250
|
380252
|
380746