Skip to content

Commit 4460f91

Browse files
authored
Configure RubikPi cloud-init files (#105)
1 parent 36a3f3c commit 4460f91

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

install_rubikpi3.sh

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ chmod 0440 /etc/sudoers.d/010_pi-nopasswd
2323

2424
echo "pi:raspberry" | chpasswd
2525

26-
# Delete ubuntu user
27-
28-
if id "ubuntu" >/dev/null 2>&1; then
29-
echo 'removing ubuntu user'
30-
deluser --remove-home ubuntu
31-
fi
26+
# silence log spam from dpkg
27+
cat > /etc/apt/apt.conf.d/99dpkg.conf << EOF
28+
Dpkg::Progress-Fancy "0";
29+
APT::Color "0";
30+
Dpkg::Use-Pty "0";
31+
EOF
3232

3333
# This needs to run before install.sh to fix some weird dependency issues
3434
apt-get -y --allow-downgrades install libsqlite3-0=3.45.1-1ubuntu2
@@ -61,3 +61,29 @@ apt-get clean
6161

6262
rm -rf /usr/share/doc
6363
rm -rf /usr/share/locale/
64+
65+
# modify photonvision.service to run on A78 cores
66+
sed -i 's/# AllowedCPUs=4-7/AllowedCPUs=4-7/g' /lib/systemd/system/photonvision.service
67+
cp -f /lib/systemd/system/photonvision.service /etc/systemd/system/photonvision.service
68+
chmod 644 /etc/systemd/system/photonvision.service
69+
cat /etc/systemd/system/photonvision.service
70+
71+
# networkd isn't being used, this causes an unnecessary delay
72+
systemctl disable systemd-networkd-wait-online.service
73+
74+
# PhotonVision server is managing the network, so it doesn't need to wait for online
75+
# systemctl disable NetworkManager-wait-online.service
76+
77+
# Disable Bluetooth
78+
sed -i 's/^AutoEnable=.*/AutoEnable=false/g' /etc/bluetooth/main.conf
79+
systemctl disable bluetooth.service
80+
81+
# set the hostname during cloud-init and disable cloud-init after first boot
82+
cat >> /var/lib/cloud/seed/nocloud/user-data << EOFUSERDATA
83+
84+
hostname: photonvision
85+
86+
runcmd:
87+
- nmcli radio all off
88+
- touch /etc/cloud/cloud-init.disabled
89+
EOFUSERDATA

0 commit comments

Comments
 (0)