blob: 06f481b297ba273a09b9516528ea9c1d3f1b229a [file] [log] [blame]
Austin Schuhab8c0c52020-02-22 13:42:37 -08001#!/bin/bash
2
3set -ex
4
5mkdir -p /root/bin
Jim Ostrowskib82a22f2022-02-27 16:10:17 -08006mkdir -p /home/pi/bin
Austin Schuhab8c0c52020-02-22 13:42:37 -08007
8# Give it a static IP
9cp /tmp/dhcpcd.conf /etc/
10
11# And provide a script to change it.
12cp /tmp/change_hostname.sh /root/bin/
Austin Schuhc0ec2a82022-02-24 17:26:29 -080013cp /tmp/enable_imu.sh /root/bin/
Austin Schuhab8c0c52020-02-22 13:42:37 -080014chmod a+x /root/bin/change_hostname.sh
Austin Schuhc0ec2a82022-02-24 17:26:29 -080015chmod a+x /root/bin/enable_imu.sh
Austin Schuhab8c0c52020-02-22 13:42:37 -080016
17chown -R pi.pi /home/pi/.ssh
Austin Schuhc0ec2a82022-02-24 17:26:29 -080018chown -R pi.pi /home/pi/bin
Austin Schuhab8c0c52020-02-22 13:42:37 -080019
Austin Schuh90c82782020-02-26 19:54:51 -080020apt-get update
21
Austin Schuhab8c0c52020-02-22 13:42:37 -080022apt-get install -y vim-nox \
23 git \
Austin Schuh90c82782020-02-26 19:54:51 -080024 cpufrequtils \
Jim Ostrowskic58989a2022-01-29 16:12:08 -080025 libopencv-calib3d4.5 \
26 libopencv-contrib4.5 \
27 libopencv-core4.5 \
28 libopencv-features2d4.5 \
29 libopencv-flann4.5 \
30 libopencv-highgui4.5 \
31 libopencv-imgcodecs4.5 \
32 libopencv-imgproc4.5 \
33 libopencv-ml4.5 \
34 libopencv-objdetect4.5 \
35 libopencv-photo4.5 \
36 libopencv-shape4.5 \
37 libopencv-stitching4.5 \
38 libopencv-superres4.5 \
39 libopencv-video4.5 \
40 libopencv-videoio4.5 \
41 libopencv-videostab4.5 \
42 libopencv-viz4.5 \
Austin Schuh1252ed12020-03-01 19:27:29 -080043 libnice10 \
Austin Schuh867bd922021-11-07 16:59:52 -080044 pmount \
Jim Ostrowskic58989a2022-01-29 16:12:08 -080045 libnice-dev \
46 feh
Austin Schuhab8c0c52020-02-22 13:42:37 -080047
Austin Schuhc0ec2a82022-02-24 17:26:29 -080048dpkg -i /tmp/wiringpi-2.70-1.deb
Jim Ostrowski2a483b32022-02-15 18:19:14 -080049
Austin Schuhab8c0c52020-02-22 13:42:37 -080050echo 'GOVERNOR="performance"' > /etc/default/cpufrequtils
51
52# Add a .bashrc and friends for root.
53if [[ ! -e "/root/.dotfiles" ]]; then
54 cd /root/
55 git clone --separate-git-dir=/root/.dotfiles https://github.com/AustinSchuh/.dotfiles.git tmpdotfiles
56 rsync --recursive --verbose --exclude '.git' tmpdotfiles/ /root/
57 rm -r tmpdotfiles
58 git --git-dir=/root/.dotfiles/ --work-tree=/root/ config --local status.showUntrackedFiles no
59 # Run the vundle installer which installs plugins on the first run of vim.
60 vim -c ":qa!"
61fi
62
63# Add a .bashrc and friends for pi.
64if [[ ! -e "/home/pi/.dotfiles" ]]; then
65 cd /home/pi/
66 su -c "git clone --separate-git-dir=/home/pi/.dotfiles https://github.com/AustinSchuh/.dotfiles.git tmpdotfiles" pi
67 su -c "rsync --recursive --verbose --exclude '.git' tmpdotfiles/ /home/pi/" pi
68 su -c "rm -r tmpdotfiles" pi
69 su -c "git --git-dir=/home/pi/.dotfiles/ --work-tree=/home/pi/ config --local status.showUntrackedFiles no" pi
70 # Run the vundle installer which installs plugins on the first run of vim.
71 su -c "vim -c ':qa!'" pi
72fi
73
74# Make SSH work and not complain about pi being the username and pw still.
75rm -f /etc/profile.d/sshpwd.sh
76rm -f /etc/profile.d/wifi-check.sh
77
78systemctl enable ssh.service
James Kuszmaul2d8fa2a2020-03-01 13:51:50 -080079systemctl enable frc971.service
Austin Schuhf7970ca2022-02-11 22:19:29 -080080systemctl enable frc971chrt.service
Austin Schuhab8c0c52020-02-22 13:42:37 -080081
Austin Schuhd4df9552020-09-13 18:59:50 -070082# Default us to pi-971-1
83/root/bin/change_hostname.sh pi-971-1