aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/preboot/files/etc/miniboot.sh
blob: 1997ff86460369e4744f61468cdc13de56b5d5e0 (plain)
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
#!/bin/sh                                

# Mount proc
mount -t proc proc /proc -o rw,noexec,nosuid,nodev
# Mount sys
mount -t sysfs sys /sys -o rw,noexec,nosuid,nodev

# Mount root rw
mount / -o remount,rw

# Prep modules
depmod -A

# Populate /dev
/etc/init.d/udev start

# Mount everything
# mount -a

# Setup a proper /tmp using tmpfs
cat /proc/mounts | grep -q "\s/tmp\s"
[ "x$?" != "x0" ] && mount -t tmpfs tmpfs /tmp

cat /proc/mounts | grep -q "\s/dev/pts\s"
[ "x$?" != "x0" ] && mount -t devpts devpts /dev/pts

# Set the hostname
hostname -F /etc/hostname

# USB gadget configuration
if [ -e /sys/class/usb_gadget/config_num ]; then
	echo 5 > /sys/class/usb_gadget/config_num
fi

# USB network configuration
ifup -f usb0
ifconfig usb0 192.168.0.202

# Dropbear ssh service
/etc/init.d/dropbear start

# Spin relaunching login
while true; do getty 115200 console; done