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