blob: 388d29138b68798ab55c54ad4d2db25d609ca145 [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/
Austin Schuhc0ec2a82022-02-24 17:26:29 -080012cp /tmp/enable_imu.sh /root/bin/
Austin Schuhab8c0c52020-02-22 13:42:37 -080013chmod a+x /root/bin/change_hostname.sh
Austin Schuhc0ec2a82022-02-24 17:26:29 -080014chmod a+x /root/bin/enable_imu.sh
Austin Schuhab8c0c52020-02-22 13:42:37 -080015
16chown -R pi.pi /home/pi/.ssh
Austin Schuhc0ec2a82022-02-24 17:26:29 -080017chown -R pi.pi /home/pi/bin
Austin Schuhab8c0c52020-02-22 13:42:37 -080018
Austin Schuh90c82782020-02-26 19:54:51 -080019apt-get update
20
Austin Schuhab8c0c52020-02-22 13:42:37 -080021apt-get install -y vim-nox \
22 git \
Austin Schuh90c82782020-02-26 19:54:51 -080023 cpufrequtils \
Jim Ostrowskic58989a2022-01-29 16:12:08 -080024 libopencv-calib3d4.5 \
25 libopencv-contrib4.5 \
26 libopencv-core4.5 \
27 libopencv-features2d4.5 \
28 libopencv-flann4.5 \
29 libopencv-highgui4.5 \
30 libopencv-imgcodecs4.5 \
31 libopencv-imgproc4.5 \
32 libopencv-ml4.5 \
33 libopencv-objdetect4.5 \
34 libopencv-photo4.5 \
35 libopencv-shape4.5 \
36 libopencv-stitching4.5 \
37 libopencv-superres4.5 \
38 libopencv-video4.5 \
39 libopencv-videoio4.5 \
40 libopencv-videostab4.5 \
41 libopencv-viz4.5 \
Austin Schuh1252ed12020-03-01 19:27:29 -080042 libnice10 \
Austin Schuh867bd922021-11-07 16:59:52 -080043 pmount \
Jim Ostrowskic58989a2022-01-29 16:12:08 -080044 libnice-dev \
45 feh
Austin Schuhab8c0c52020-02-22 13:42:37 -080046
Austin Schuhc0ec2a82022-02-24 17:26:29 -080047dpkg -i /tmp/wiringpi-2.70-1.deb
Jim Ostrowski2a483b32022-02-15 18:19:14 -080048
Austin Schuhab8c0c52020-02-22 13:42:37 -080049echo 'GOVERNOR="performance"' > /etc/default/cpufrequtils
50
51# Add a .bashrc and friends for root.
52if [[ ! -e "/root/.dotfiles" ]]; then
53 cd /root/
54 git clone --separate-git-dir=/root/.dotfiles https://github.com/AustinSchuh/.dotfiles.git tmpdotfiles
55 rsync --recursive --verbose --exclude '.git' tmpdotfiles/ /root/
56 rm -r tmpdotfiles
57 git --git-dir=/root/.dotfiles/ --work-tree=/root/ config --local status.showUntrackedFiles no
58 # Run the vundle installer which installs plugins on the first run of vim.
59 vim -c ":qa!"
60fi
61
62# Add a .bashrc and friends for pi.
63if [[ ! -e "/home/pi/.dotfiles" ]]; then
64 cd /home/pi/
65 su -c "git clone --separate-git-dir=/home/pi/.dotfiles https://github.com/AustinSchuh/.dotfiles.git tmpdotfiles" pi
66 su -c "rsync --recursive --verbose --exclude '.git' tmpdotfiles/ /home/pi/" pi
67 su -c "rm -r tmpdotfiles" pi
68 su -c "git --git-dir=/home/pi/.dotfiles/ --work-tree=/home/pi/ config --local status.showUntrackedFiles no" pi
69 # Run the vundle installer which installs plugins on the first run of vim.
70 su -c "vim -c ':qa!'" pi
71fi
72
73# Make SSH work and not complain about pi being the username and pw still.
74rm -f /etc/profile.d/sshpwd.sh
75rm -f /etc/profile.d/wifi-check.sh
76
77systemctl enable ssh.service
James Kuszmaul2d8fa2a2020-03-01 13:51:50 -080078systemctl enable frc971.service
Austin Schuhf7970ca2022-02-11 22:19:29 -080079systemctl enable frc971chrt.service
Austin Schuhab8c0c52020-02-22 13:42:37 -080080
Austin Schuhd4df9552020-09-13 18:59:50 -070081# Default us to pi-971-1
82/root/bin/change_hostname.sh pi-971-1