This repository was archived by the owner on Aug 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpi-main.sh
More file actions
executable file
·80 lines (59 loc) · 1.68 KB
/
pi-main.sh
File metadata and controls
executable file
·80 lines (59 loc) · 1.68 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
73
74
75
76
77
78
79
80
#!/bin/bash
set -e
export DEBIAN_FRONTEND=noninteractive
export LC_ALL="en_GB.UTF-8"
export LANG="en_GB.UTF-8"
echo "Putting hostname into /etc/hosts"
echo "127.0.0.1 $(hostname)" >> /etc/hosts
echo "Disable dhcpcd"
systemctl disable dhcpcd.service
mkdir sb-debs
echo "Adding local repository to sources"
echo "deb [trusted=yes] file:/sb-debs ./" >> /etc/apt/sources.list.d/sourcebots.list
echo "deb-src [trusted=yes] file:/sb-debs ./" >> /etc/apt/sources.list.d/sourcebots.list
function rebuild_repo {
pushd /sb-debs
echo "Rebuilding local apt repository"
dpkg-scanpackages . /dev/null > Packages
xz -f -3 Packages
dpkg-scansources . /dev/null > Sources
xz -f -3 Sources
popd
}
rebuild_repo
cd /building
function buildme {
pushd $1
echo "Installing build dependencies for $1"
yes | sudo mk-build-deps -i debian/control
echo "Building $1"
DEB_BUILD_OPTIONS=nocheck debuild -uc -us
popd
mv *.deb /sb-debs/
mv *.tar.* /sb-debs/
rebuild_repo
echo "Re-updating apt"
apt-get --quiet update -y
echo "Installing $1"
apt-get --quiet -o "Dpkg::Options::=--force-confnew" install -y $1 || true
}
buildme usbmount
buildme sb-vision
buildme robotd
buildme robot-api
buildme runusb
echo "Setting passwords"
echo 'root:beeeeees' | chpasswd
echo 'pi:beeeeees' | chpasswd
echo "Updating fstab"
tee /etc/fstab <<EOF
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
EOF
echo "Installing additional libraries"
apt-get --quiet install -y \
python3-scipy \
python3-numpy
# turn on persistent journalctl logging
echo "Storage=persistent" >> /etc/systemd/journald.conf