-
Notifications
You must be signed in to change notification settings - Fork 0
/
uml-test-init
executable file
·44 lines (33 loc) · 1.08 KB
/
uml-test-init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
set -ex
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
mount -t proc none /proc
mount -t sysfs none /sys
mount -t tmpfs none /tmp
mount --bind /usr/lib/uml/modules /lib/modules
ip addr add 127.0.0.1 dev lo
ip link set lo up
ip addr add 10.0.2.15/24 dev eth0
ip link set eth0 up
ip route add default via 10.0.2.2
modprobe loop
if grep -q 127.0.0.1 /etc/resolv.conf; then
echo "nameserver 10.0.2.2" > /tmp/resolv.conf
mount --bind /tmp/resolv.conf /etc/resolv.conf
fi
cd $(dirname $0)
mkdir -p /tmp/boot/grub
mount --bind /tmp/boot /boot
grub-editenv test/grubenv.test create
touch /tmp/boot/grub/grubenv
mount --bind test/grubenv.test /tmp/boot/grub/grubenv
cp -a /etc/dbus-1/system.d /tmp
cp -a data/de.pengutronix.rauc.conf /tmp/system.d
chown root:root /tmp/system.d/de.pengutronix.rauc.conf
chmod 644 /tmp/system.d/de.pengutronix.rauc.conf
mount --bind /tmp/system.d /etc/dbus-1/system.d
mkdir /tmp/var_run_dbus
mount --bind /tmp/var_run_dbus /var/run/dbus
dbus-daemon --system --fork --nopidfile
make check && touch uml-test-ok || true
poweroff -f