forked from teawater/libhermit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·26 lines (19 loc) · 760 Bytes
/
init.sh
File metadata and controls
executable file
·26 lines (19 loc) · 760 Bytes
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
#!/bin/sh
PROXY=/hermit/bin/proxy
ELF_OSABI_OFFSET=7
ELF_OSABI="\\x42"
# Network
/sbin/ifconfig lo 127.0.0.1 netmask 255.0.0.0 up
/sbin/ifconfig eth0 up 10.0.2.15 netmask 255.255.255.0 up
/sbin/ifconfig mmnif up 192.168.28.1 netmask 255.255.255.0 up
/sbin/route add default gw 10.0.2.2
/bin/hostname -F /etc/hostname
echo "Network setup completed"
# Load binfmt_misc kernel module and mount pseudo FS
test -d /lib/modules && modprobe binfmt_misc
grep binfmt_misc /proc/mounts || mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
# Register new format
echo ":hermit:M:$ELF_OSABI_OFFSET:$ELF_OSABI::$PROXY:" > /proc/sys/fs/binfmt_misc/register
# Startup completed
sleep 1 && echo -e '\nWelcome to HermitCore (http://www.hermitcore.org/)!'
/bin/sh