File tree 2 files changed +17
-3
lines changed
2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 1
1
FROM busybox
2
2
ENV QEMU_BIN_DIR=/usr/bin
3
3
ADD ./register.sh /register
4
- CMD /register
4
+ ENTRYPOINT [ " /register" ]
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
-
4
3
QEMU_BIN_DIR=${QEMU_BIN_DIR:-/ usr/ bin}
5
4
6
5
@@ -16,6 +15,22 @@ if [ ! -f /proc/sys/fs/binfmt_misc/register ]; then
16
15
fi
17
16
18
17
18
+ if [ " ${1} " = " --reset" ]; then
19
+ (
20
+ cd /proc/sys/fs/binfmt_misc
21
+ for file in * ; do
22
+ case " ${file} " in
23
+ status|register)
24
+ ;;
25
+ * )
26
+ echo -1 > " ${file} "
27
+ ;;
28
+ esac
29
+ done
30
+ )
31
+ fi
32
+
33
+
19
34
# probe cpu type
20
35
cpu=` uname -m`
21
36
case " $cpu " in
@@ -59,7 +74,6 @@ if [ $cpu != "ppc" ] ; then
59
74
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:${QEMU_BIN_DIR}/qemu-ppc-static:' > /proc/sys/fs/binfmt_misc/register
60
75
fi
61
76
if [ $cpu != " m68k" ] ; then
62
- echo ' Please check cpu value and header information for m68k!'
63
77
echo ' :m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:${QEMU_BIN_DIR}/qemu-m68k-static:' > /proc/sys/fs/binfmt_misc/register
64
78
fi
65
79
if [ $cpu != " mips" ] ; then
You can’t perform that action at this time.
0 commit comments