-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrootfs.setup
More file actions
72 lines (56 loc) · 1.47 KB
/
rootfs.setup
File metadata and controls
72 lines (56 loc) · 1.47 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env bash
set -e
if [ "$#" -ne 2 ]; then
echo "Usage: $0 DIST DIST_URL"
exit 1
fi
DIST=$1
DIST_URL=$2
echo "Running postinstall script..."
# Sets the hostname
echo "pmsbox" > /etc/hostname
# Set the locale
locale-gen en_US.UTF-8
# Set timezone
dpkg-reconfigure -f noninteractive tzdata
# Set the keyboard
cat << EOF > /etc/default/keyboard
XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""
EOF
# Set root password
echo "root:odroid" | chpasswd
# Initialize /etc/apt/sources.list
cat << EOF > /etc/apt/sources.list
deb $DIST_URL $DIST main universe restricted
deb-src $DIST_URL $DIST main universe restricted
deb $DIST_URL $DIST-updates main universe restricted
deb-src $DIST_URL $DIST-updates main universe restricted
deb $DIST_URL $DIST-backports main restricted
deb-src $DIST_URL $DIST-backports main restricted
deb $DIST_URL $DIST-security main restricted
deb-src $DIST_URL $DIST-security main restricted
deb $DIST_URL $DIST-security universe
deb-src $DIST_URL $DIST-security universe
deb $DIST_URL $DIST-security multiverse
deb-src $DIST_URL $DIST-security multiverse
EOF
# Setup the loopback interface
cat << EOF > /etc/network/interfaces.d/lo
auto lo
iface lo inet loopback
EOF
# Setup ethernet as DHCP
cat << EOF > /etc/network/interfaces.d/eth0
auto eth0
iface eth0 inet dhcp
EOF
# Enable the Serial console
cat << EOF > /etc/init/ttyS0.conf
start on stopped rc or RUNLEVEL=[12345]
stop on runlevel [!12345]
respawn
exec /sbin/getty -L 115200 ttyS0 vt102
EOF