Gentoo Archives: gentoo-commits

From: Michael Palimaka <kensington@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/qemu/files/
Date: Wed, 06 Dec 2017 12:42:06
Message-Id: 1512564112.b4f56dd13d25045c4e6fdb245c41e0858e770a3c.kensington@gentoo
1 commit: b4f56dd13d25045c4e6fdb245c41e0858e770a3c
2 Author: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com>
3 AuthorDate: Sun Dec 3 12:35:00 2017 +0000
4 Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 6 12:41:52 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4f56dd1
7
8 app-emulation/qemu: remove unused file
9
10 Closes: https://github.com/gentoo/gentoo/pull/6419
11
12 app-emulation/qemu/files/qemu-binfmt.initd-r1 | 138 --------------------------
13 1 file changed, 138 deletions(-)
14
15 diff --git a/app-emulation/qemu/files/qemu-binfmt.initd-r1 b/app-emulation/qemu/files/qemu-binfmt.initd-r1
16 deleted file mode 100644
17 index fe62a2a211e..00000000000
18 --- a/app-emulation/qemu/files/qemu-binfmt.initd-r1
19 +++ /dev/null
20 @@ -1,138 +0,0 @@
21 -#!/sbin/openrc-run
22 -# Copyright 1999-2016 Gentoo Foundation
23 -# Distributed under the terms of the GNU General Public License v2
24 -
25 -# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/s390 program execution by the kernel
26 -
27 -# Defaulting to OC should be safe because it comes down to:
28 -# - do we trust the interp itself to not be malicious? yes; we built it.
29 -# - do we trust the programs we're running? ish; same permission as native
30 -# binaries apply. so if user can do bad stuff natively, cross isn't worse.
31 -: ${QEMU_BINFMT_FLAGS:=OC}
32 -
33 -depend() {
34 - after procfs
35 -}
36 -
37 -start() {
38 - ebegin "Registering qemu-user binaries (flags: ${QEMU_BINFMT_FLAGS})"
39 -
40 - if [ ! -d /proc/sys/fs/binfmt_misc ] ; then
41 - modprobe -q binfmt_misc
42 - fi
43 -
44 - if [ ! -d /proc/sys/fs/binfmt_misc ] ; then
45 - eend $? "You need support for 'misc binaries' in your kernel!" || return
46 - fi
47 -
48 - if [ ! -f /proc/sys/fs/binfmt_misc/register ] ; then
49 - mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc >/dev/null 2>&1
50 - eend $? || return
51 - fi
52 -
53 - # probe cpu type
54 - cpu=`uname -m`
55 - case "$cpu" in
56 - i386|i486|i586|i686|i86pc|BePC|x86_64)
57 - cpu="i386"
58 - ;;
59 - m68k)
60 - cpu="m68k"
61 - ;;
62 - mips*)
63 - cpu="mips"
64 - ;;
65 - "Power Macintosh"|ppc|ppc64)
66 - cpu="ppc"
67 - ;;
68 - armv[4-9]*)
69 - cpu="arm"
70 - ;;
71 - sparc*)
72 - cpu="sparc"
73 - ;;
74 - esac
75 -
76 - # register the interpreter for each cpu except for the native one
77 - if [ $cpu != "i386" -a -x "/usr/bin/qemu-i386" ] ; then
78 - 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:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
79 - 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:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
80 - fi
81 - if [ $cpu != "alpha" -a -x "/usr/bin/qemu-alpha" ] ; then
82 - 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:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
83 - fi
84 - if [ $cpu != "arm" -a -x "/usr/bin/qemu-arm" ] ; then
85 - 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:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
86 - fi
87 - if [ $cpu != "arm" -a -x "/usr/bin/qemu-armeb" ] ; then
88 - 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:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
89 - fi
90 - if [ $cpu != "aarch64" -a -x "/usr/bin/qemu-aarch64" ] ; then
91 - echo ':aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-aarch64:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
92 - fi
93 - if [ $cpu != "sparc" -a -x "/usr/bin/qemu-sparc" ] ; then
94 - 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:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
95 - fi
96 - if [ $cpu != "ppc" -a -x "/usr/bin/qemu-ppc" ] ; then
97 - 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\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
98 - fi
99 - if [ $cpu != "m68k" -a -x "/usr/bin/qemu-m68k" ] ; then
100 - #echo 'Please check cpu value and header information for m68k!'
101 - 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:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
102 - fi
103 - if [ $cpu != "mips" -a -x "/usr/bin/qemu-mips" ] ; then
104 - # FIXME: We could use the other endianness on a MIPS host.
105 - 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:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
106 - fi
107 - if [ $cpu != "mips" -a -x "/usr/bin/qemu-mipsel" ] ; then
108 - 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:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
109 - fi
110 - if [ $cpu != "mips" -a -x "/usr/bin/qemu-mipsn32" ] ; then
111 - 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:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
112 - fi
113 - if [ $cpu != "mips" -a -x "/usr/bin/qemu-mipsn32el" ] ; then
114 - 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:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
115 - fi
116 - if [ $cpu != "mips" -a -x "/usr/bin/qemu-mips64" ] ; then
117 - 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:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
118 - fi
119 - if [ $cpu != "mips" -a -x "/usr/bin/qemu-mips64el" ] ; then
120 - 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:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
121 - fi
122 - if [ $cpu != "sh" -a -x "/usr/bin/qemu-sh4" ] ; then
123 - 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:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
124 - fi
125 - if [ $cpu != "sh" -a -x "/usr/bin/qemu-sh4eb" ] ; then
126 - 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:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
127 - fi
128 - if [ $cpu != "s390x" -a -x "/usr/bin/qemu-s390x" ] ; then
129 - 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/bin/qemu-s390x:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
130 - fi
131 - eend $?
132 -}
133 -
134 -stop() {
135 - ebegin "Unregistering qemu-user binaries"
136 - local arches
137 -
138 - arches="${arches} i386 i486"
139 - arches="${arches} alpha"
140 - arches="${arches} arm armeb"
141 - arches="${arches} aarch64"
142 - arches="${arches} sparc"
143 - arches="${arches} ppc"
144 - arches="${arches} m68k"
145 - arches="${arches} mips mipsel mipsn32 mipsn32el mips64 mips64el"
146 - arches="${arches} sh4 sh4eb"
147 - arches="${arches} s390x"
148 -
149 - for a in ${arches}; do
150 - if [ -f /proc/sys/fs/binfmt_misc/$a ] ; then
151 - echo '-1' > /proc/sys/fs/binfmt_misc/$a
152 - fi
153 - done
154 -
155 - eend $?
156 -}
157 -
158 -# vim: ts=4 :