]>
Commit | Line | Data |
---|---|---|
08785f48 | 1 | #!/bin/sh |
ecbed728 | 2 | # Enable automatic program execution by the kernel. |
08785f48 | 3 | |
7c81570d RH |
4 | qemu_target_list="i386 i486 alpha arm armeb sparc sparc32plus sparc64 \ |
5 | ppc ppc64 ppc64le m68k mips mipsel mipsn32 mipsn32el mips64 mips64el \ | |
ecbed728 | 6 | sh4 sh4eb s390x aarch64 aarch64_be hppa riscv32 riscv64 xtensa xtensaeb \ |
3e7a84ee | 7 | microblaze microblazeel or1k x86_64 hexagon" |
3bef0451 LV |
8 | |
9 | i386_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00' | |
daf238dc | 10 | i386_mask='\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' |
3bef0451 LV |
11 | i386_family=i386 |
12 | ||
13 | i486_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00' | |
daf238dc | 14 | i486_mask='\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' |
3bef0451 LV |
15 | i486_family=i386 |
16 | ||
b8dbfc9c LV |
17 | x86_64_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00' |
18 | x86_64_mask='\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' | |
19 | x86_64_family=i386 | |
20 | ||
3bef0451 | 21 | alpha_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90' |
daf238dc | 22 | alpha_mask='\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' |
3bef0451 LV |
23 | alpha_family=alpha |
24 | ||
25 | arm_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00' | |
26 | arm_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' | |
27 | arm_family=arm | |
28 | ||
29 | armeb_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28' | |
30 | armeb_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' | |
2ced93ee | 31 | armeb_family=armeb |
3bef0451 LV |
32 | |
33 | sparc_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02' | |
daf238dc | 34 | sparc_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' |
3bef0451 LV |
35 | sparc_family=sparc |
36 | ||
37 | sparc32plus_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x12' | |
daf238dc | 38 | sparc32plus_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' |
3bef0451 LV |
39 | sparc32plus_family=sparc |
40 | ||
7c81570d RH |
41 | sparc64_magic='\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2b' |
42 | sparc64_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' | |
43 | sparc64_family=sparc | |
44 | ||
3bef0451 LV |
45 | ppc_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14' |
46 | ppc_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' | |
47 | ppc_family=ppc | |
48 | ||
49 | ppc64_magic='\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15' | |
50 | ppc64_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' | |
51 | ppc64_family=ppc | |
52 | ||
53 | ppc64le_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00' | |
54 | ppc64le_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00' | |
55 | ppc64le_family=ppcle | |
56 | ||
57 | m68k_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04' | |
daf238dc | 58 | m68k_mask='\xff\xff\xff\xff\xff\xff\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' |
3bef0451 LV |
59 | m68k_family=m68k |
60 | ||
61 | # FIXME: We could use the other endianness on a MIPS host. | |
62 | ||
63 | mips_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08' | |
64 | mips_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' | |
65 | mips_family=mips | |
66 | ||
67 | mipsel_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00' | |
68 | mipsel_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' | |
69 | mipsel_family=mips | |
70 | ||
71 | mipsn32_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08' | |
72 | mipsn32_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' | |
73 | mipsn32_family=mips | |
74 | ||
75 | mipsn32el_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00' | |
76 | mipsn32el_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' | |
77 | mipsn32el_family=mips | |
78 | ||
79 | mips64_magic='\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08' | |
80 | mips64_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' | |
81 | mips64_family=mips | |
82 | ||
83 | mips64el_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00' | |
84 | mips64el_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' | |
85 | mips64el_family=mips | |
86 | ||
87 | sh4_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00' | |
daf238dc | 88 | sh4_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' |
3bef0451 LV |
89 | sh4_family=sh4 |
90 | ||
91 | sh4eb_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a' | |
daf238dc | 92 | sh4eb_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' |
3bef0451 LV |
93 | sh4eb_family=sh4 |
94 | ||
95 | s390x_magic='\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16' | |
daf238dc | 96 | s390x_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' |
3bef0451 LV |
97 | s390x_family=s390x |
98 | ||
99 | aarch64_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00' | |
100 | aarch64_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' | |
101 | aarch64_family=arm | |
102 | ||
f772f212 MW |
103 | aarch64_be_magic='\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7' |
104 | aarch64_be_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' | |
2ced93ee | 105 | aarch64_be_family=armeb |
f772f212 | 106 | |
e4d966cc LV |
107 | hppa_magic='\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x0f' |
108 | hppa_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' | |
109 | hppa_family=hppa | |
110 | ||
25fa194b MC |
111 | riscv32_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf3\x00' |
112 | riscv32_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' | |
113 | riscv32_family=riscv | |
114 | ||
115 | riscv64_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf3\x00' | |
116 | riscv64_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' | |
117 | riscv64_family=riscv | |
118 | ||
d4090306 MF |
119 | xtensa_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x5e\x00' |
120 | xtensa_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' | |
121 | xtensa_family=xtensa | |
122 | ||
123 | xtensaeb_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x5e' | |
124 | xtensaeb_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' | |
125 | xtensaeb_family=xtensaeb | |
126 | ||
947aeab3 LV |
127 | microblaze_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xba\xab' |
128 | microblaze_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' | |
129 | microblaze_family=microblaze | |
130 | ||
131 | microblazeel_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xab\xba' | |
132 | microblazeel_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' | |
133 | microblazeel_family=microblazeel | |
134 | ||
ecbed728 RH |
135 | or1k_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x5c' |
136 | or1k_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' | |
137 | or1k_family=or1k | |
138 | ||
3e7a84ee TS |
139 | hexagon_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xa4\x00' |
140 | hexagon_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' | |
141 | hexagon_family=hexagon | |
142 | ||
3bef0451 LV |
143 | qemu_get_family() { |
144 | cpu=${HOST_ARCH:-$(uname -m)} | |
145 | case "$cpu" in | |
146 | amd64|i386|i486|i586|i686|i86pc|BePC|x86_64) | |
147 | echo "i386" | |
148 | ;; | |
149 | mips*) | |
150 | echo "mips" | |
151 | ;; | |
152 | "Power Macintosh"|ppc64|powerpc|ppc) | |
153 | echo "ppc" | |
154 | ;; | |
155 | ppc64el|ppc64le) | |
156 | echo "ppcle" | |
157 | ;; | |
2ced93ee | 158 | arm|armel|armhf|arm64|armv[4-9]*l|aarch64) |
3bef0451 LV |
159 | echo "arm" |
160 | ;; | |
2ced93ee MW |
161 | armeb|armv[4-9]*b|aarch64_be) |
162 | echo "armeb" | |
163 | ;; | |
3bef0451 LV |
164 | sparc*) |
165 | echo "sparc" | |
166 | ;; | |
25fa194b MC |
167 | riscv*) |
168 | echo "riscv" | |
169 | ;; | |
3bef0451 LV |
170 | *) |
171 | echo "$cpu" | |
172 | ;; | |
173 | esac | |
174 | } | |
175 | ||
176 | usage() { | |
177 | cat <<EOF | |
178 | Usage: qemu-binfmt-conf.sh [--qemu-path PATH][--debian][--systemd CPU] | |
179 | [--help][--credential yes|no][--exportdir PATH] | |
7155be7c | 180 | [--persistent yes|no][--qemu-suffix SUFFIX] |
3bef0451 LV |
181 | |
182 | Configure binfmt_misc to use qemu interpreter | |
183 | ||
7155be7c LV |
184 | --help: display this usage |
185 | --qemu-path: set path to qemu interpreter ($QEMU_PATH) | |
186 | --qemu-suffix: add a suffix to the default interpreter name | |
187 | --debian: don't write into /proc, | |
188 | instead generate update-binfmts templates | |
189 | --systemd: don't write into /proc, | |
190 | instead generate file for systemd-binfmt.service | |
191 | for the given CPU. If CPU is "ALL", generate a | |
192 | file for all known cpus | |
193 | --exportdir: define where to write configuration files | |
194 | (default: $SYSTEMDDIR or $DEBIANDIR) | |
195 | --credential: if yes, credential and security tokens are | |
196 | calculated according to the binary to interpret | |
197 | --persistent: if yes, the interpreter is loaded when binfmt is | |
198 | configured and remains in memory. All future uses | |
199 | are cloned from the open file. | |
3bef0451 LV |
200 | |
201 | To import templates with update-binfmts, use : | |
202 | ||
203 | sudo update-binfmts --importdir ${EXPORTDIR:-$DEBIANDIR} --import qemu-CPU | |
204 | ||
205 | To remove interpreter, use : | |
206 | ||
207 | sudo update-binfmts --package qemu-CPU --remove qemu-CPU $QEMU_PATH | |
208 | ||
209 | With systemd, binfmt files are loaded by systemd-binfmt.service | |
210 | ||
211 | The environment variable HOST_ARCH allows to override 'uname' to generate | |
212 | configuration files for a different architecture than the current one. | |
213 | ||
214 | where CPU is one of: | |
215 | ||
216 | $qemu_target_list | |
217 | ||
218 | EOF | |
219 | } | |
220 | ||
221 | qemu_check_access() { | |
222 | if [ ! -w "$1" ] ; then | |
223 | echo "ERROR: cannot write to $1" 1>&2 | |
224 | exit 1 | |
225 | fi | |
226 | } | |
227 | ||
228 | qemu_check_bintfmt_misc() { | |
229 | # load the binfmt_misc module | |
230 | if [ ! -d /proc/sys/fs/binfmt_misc ]; then | |
231 | if ! /sbin/modprobe binfmt_misc ; then | |
232 | exit 1 | |
233 | fi | |
234 | fi | |
235 | if [ ! -f /proc/sys/fs/binfmt_misc/register ]; then | |
236 | if ! mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc ; then | |
237 | exit 1 | |
238 | fi | |
239 | fi | |
240 | ||
241 | qemu_check_access /proc/sys/fs/binfmt_misc/register | |
242 | } | |
243 | ||
244 | installed_dpkg() { | |
245 | dpkg --status "$1" > /dev/null 2>&1 | |
246 | } | |
247 | ||
248 | qemu_check_debian() { | |
249 | if [ ! -e /etc/debian_version ] ; then | |
250 | echo "WARNING: your system is not a Debian based distro" 1>&2 | |
251 | elif ! installed_dpkg binfmt-support ; then | |
252 | echo "WARNING: package binfmt-support is needed" 1>&2 | |
253 | fi | |
254 | qemu_check_access "$EXPORTDIR" | |
255 | } | |
256 | ||
257 | qemu_check_systemd() { | |
258 | if ! systemctl -q is-enabled systemd-binfmt.service ; then | |
259 | echo "WARNING: systemd-binfmt.service is missing or disabled" 1>&2 | |
260 | fi | |
261 | qemu_check_access "$EXPORTDIR" | |
262 | } | |
263 | ||
264 | qemu_generate_register() { | |
70a77984 LV |
265 | flags="" |
266 | if [ "$CREDENTIAL" = "yes" ] ; then | |
267 | flags="OC" | |
268 | fi | |
01ecd22a LV |
269 | if [ "$PERSISTENT" = "yes" ] ; then |
270 | flags="${flags}F" | |
271 | fi | |
70a77984 LV |
272 | |
273 | echo ":qemu-$cpu:M::$magic:$mask:$qemu:$flags" | |
3bef0451 LV |
274 | } |
275 | ||
276 | qemu_register_interpreter() { | |
277 | echo "Setting $qemu as binfmt interpreter for $cpu" | |
278 | qemu_generate_register > /proc/sys/fs/binfmt_misc/register | |
279 | } | |
280 | ||
281 | qemu_generate_systemd() { | |
282 | echo "Setting $qemu as binfmt interpreter for $cpu for systemd-binfmt.service" | |
283 | qemu_generate_register > "$EXPORTDIR/qemu-$cpu.conf" | |
284 | } | |
285 | ||
286 | qemu_generate_debian() { | |
287 | cat > "$EXPORTDIR/qemu-$cpu" <<EOF | |
288 | package qemu-$cpu | |
289 | interpreter $qemu | |
290 | magic $magic | |
291 | mask $mask | |
70a77984 | 292 | credential $CREDENTIAL |
3bef0451 | 293 | EOF |
3bef0451 LV |
294 | } |
295 | ||
296 | qemu_set_binfmts() { | |
297 | # probe cpu type | |
298 | host_family=$(qemu_get_family) | |
299 | ||
300 | # register the interpreter for each cpu except for the native one | |
301 | ||
302 | for cpu in ${qemu_target_list} ; do | |
303 | magic=$(eval echo \$${cpu}_magic) | |
304 | mask=$(eval echo \$${cpu}_mask) | |
305 | family=$(eval echo \$${cpu}_family) | |
306 | ||
307 | if [ "$magic" = "" ] || [ "$mask" = "" ] || [ "$family" = "" ] ; then | |
308 | echo "INTERNAL ERROR: unknown cpu $cpu" 1>&2 | |
309 | continue | |
310 | fi | |
311 | ||
312 | qemu="$QEMU_PATH/qemu-$cpu" | |
313 | if [ "$cpu" = "i486" ] ; then | |
314 | qemu="$QEMU_PATH/qemu-i386" | |
315 | fi | |
316 | ||
7155be7c | 317 | qemu="$qemu$QEMU_SUFFIX" |
3bef0451 LV |
318 | if [ "$host_family" != "$family" ] ; then |
319 | $BINFMT_SET | |
320 | fi | |
321 | done | |
322 | } | |
323 | ||
324 | CHECK=qemu_check_bintfmt_misc | |
325 | BINFMT_SET=qemu_register_interpreter | |
326 | ||
327 | SYSTEMDDIR="/etc/binfmt.d" | |
328 | DEBIANDIR="/usr/share/binfmts" | |
329 | ||
330 | QEMU_PATH=/usr/local/bin | |
70a77984 | 331 | CREDENTIAL=no |
01ecd22a | 332 | PERSISTENT=no |
7155be7c | 333 | QEMU_SUFFIX="" |
3bef0451 | 334 | |
7155be7c | 335 | options=$(getopt -o ds:Q:S:e:hc:p: -l debian,systemd:,qemu-path:,qemu-suffix:,exportdir:,help,credential:,persistent: -- "$@") |
3bef0451 LV |
336 | eval set -- "$options" |
337 | ||
338 | while true ; do | |
339 | case "$1" in | |
340 | -d|--debian) | |
341 | CHECK=qemu_check_debian | |
342 | BINFMT_SET=qemu_generate_debian | |
343 | EXPORTDIR=${EXPORTDIR:-$DEBIANDIR} | |
344 | ;; | |
345 | -s|--systemd) | |
346 | CHECK=qemu_check_systemd | |
347 | BINFMT_SET=qemu_generate_systemd | |
348 | EXPORTDIR=${EXPORTDIR:-$SYSTEMDDIR} | |
349 | shift | |
350 | # check given cpu is in the supported CPU list | |
3ff48453 LV |
351 | if [ "$1" != "ALL" ] ; then |
352 | for cpu in ${qemu_target_list} ; do | |
353 | if [ "$cpu" = "$1" ] ; then | |
354 | break | |
355 | fi | |
356 | done | |
357 | ||
6f75023a | 358 | if [ "$cpu" = "$1" ] ; then |
3ff48453 LV |
359 | qemu_target_list="$1" |
360 | else | |
361 | echo "ERROR: unknown CPU \"$1\"" 1>&2 | |
362 | usage | |
363 | exit 1 | |
3bef0451 | 364 | fi |
3bef0451 LV |
365 | fi |
366 | ;; | |
367 | -Q|--qemu-path) | |
368 | shift | |
369 | QEMU_PATH="$1" | |
370 | ;; | |
7155be7c LV |
371 | -F|--qemu-suffix) |
372 | shift | |
373 | QEMU_SUFFIX="$1" | |
374 | ;; | |
3bef0451 LV |
375 | -e|--exportdir) |
376 | shift | |
377 | EXPORTDIR="$1" | |
378 | ;; | |
379 | -h|--help) | |
380 | usage | |
381 | exit 1 | |
382 | ;; | |
383 | -c|--credential) | |
384 | shift | |
70a77984 | 385 | CREDENTIAL="$1" |
3bef0451 | 386 | ;; |
01ecd22a LV |
387 | -p|--persistent) |
388 | shift | |
389 | PERSISTENT="$1" | |
3bef0451 LV |
390 | ;; |
391 | *) | |
392 | break | |
393 | ;; | |
394 | esac | |
395 | shift | |
396 | done | |
397 | ||
398 | $CHECK | |
399 | qemu_set_binfmts |