Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -ex |
| 4 | |
| 5 | mkdir -p /root/bin |
Jim Ostrowski | b82a22f | 2022-02-27 16:10:17 -0800 | [diff] [blame] | 6 | mkdir -p /home/pi/bin |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 7 | |
| 8 | # Give it a static IP |
| 9 | cp /tmp/dhcpcd.conf /etc/ |
| 10 | |
| 11 | # And provide a script to change it. |
| 12 | cp /tmp/change_hostname.sh /root/bin/ |
Austin Schuh | c0ec2a8 | 2022-02-24 17:26:29 -0800 | [diff] [blame] | 13 | cp /tmp/enable_imu.sh /root/bin/ |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 14 | chmod a+x /root/bin/change_hostname.sh |
Austin Schuh | c0ec2a8 | 2022-02-24 17:26:29 -0800 | [diff] [blame] | 15 | chmod a+x /root/bin/enable_imu.sh |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 16 | |
| 17 | chown -R pi.pi /home/pi/.ssh |
Austin Schuh | c0ec2a8 | 2022-02-24 17:26:29 -0800 | [diff] [blame] | 18 | chown -R pi.pi /home/pi/bin |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 19 | |
Tyler Chatow | 6309a47 | 2022-03-27 23:09:48 -0700 | [diff] [blame] | 20 | echo 'deb [trusted=yes] https://software.frc971.org/Build-Dependencies/gstreamer_bullseye_arm64_deps ./' >> /etc/apt/sources.list |
| 21 | |
Austin Schuh | 90c8278 | 2020-02-26 19:54:51 -0800 | [diff] [blame] | 22 | apt-get update |
| 23 | |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 24 | apt-get install -y vim-nox \ |
| 25 | git \ |
Austin Schuh | 90c8278 | 2020-02-26 19:54:51 -0800 | [diff] [blame] | 26 | cpufrequtils \ |
Jim Ostrowski | c58989a | 2022-01-29 16:12:08 -0800 | [diff] [blame] | 27 | libopencv-calib3d4.5 \ |
| 28 | libopencv-contrib4.5 \ |
| 29 | libopencv-core4.5 \ |
| 30 | libopencv-features2d4.5 \ |
| 31 | libopencv-flann4.5 \ |
| 32 | libopencv-highgui4.5 \ |
| 33 | libopencv-imgcodecs4.5 \ |
| 34 | libopencv-imgproc4.5 \ |
| 35 | libopencv-ml4.5 \ |
| 36 | libopencv-objdetect4.5 \ |
| 37 | libopencv-photo4.5 \ |
| 38 | libopencv-shape4.5 \ |
| 39 | libopencv-stitching4.5 \ |
| 40 | libopencv-superres4.5 \ |
| 41 | libopencv-video4.5 \ |
| 42 | libopencv-videoio4.5 \ |
| 43 | libopencv-videostab4.5 \ |
| 44 | libopencv-viz4.5 \ |
Austin Schuh | 1252ed1 | 2020-03-01 19:27:29 -0800 | [diff] [blame] | 45 | libnice10 \ |
Austin Schuh | 867bd92 | 2021-11-07 16:59:52 -0800 | [diff] [blame] | 46 | pmount \ |
Jim Ostrowski | c58989a | 2022-01-29 16:12:08 -0800 | [diff] [blame] | 47 | libnice-dev \ |
Tyler Chatow | 6309a47 | 2022-03-27 23:09:48 -0700 | [diff] [blame] | 48 | feh \ |
| 49 | libgstreamer1.0-0 \ |
| 50 | libgstreamer-plugins-base1.0-0 \ |
| 51 | libgstreamer-plugins-bad1.0-0 \ |
| 52 | gstreamer1.0-plugins-base \ |
| 53 | gstreamer1.0-plugins-good \ |
| 54 | gstreamer1.0-plugins-bad \ |
| 55 | gstreamer1.0-plugins-ugly \ |
| 56 | gstreamer1.0-nice |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 57 | |
Tyler Chatow | 6309a47 | 2022-03-27 23:09:48 -0700 | [diff] [blame] | 58 | PATH=$PATH:/sbin dpkg -i /tmp/wiringpi-2.70-1.deb |
Jim Ostrowski | 2a483b3 | 2022-02-15 18:19:14 -0800 | [diff] [blame] | 59 | |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 60 | echo 'GOVERNOR="performance"' > /etc/default/cpufrequtils |
| 61 | |
| 62 | # Add a .bashrc and friends for root. |
| 63 | if [[ ! -e "/root/.dotfiles" ]]; then |
| 64 | cd /root/ |
| 65 | git clone --separate-git-dir=/root/.dotfiles https://github.com/AustinSchuh/.dotfiles.git tmpdotfiles |
| 66 | rsync --recursive --verbose --exclude '.git' tmpdotfiles/ /root/ |
| 67 | rm -r tmpdotfiles |
| 68 | git --git-dir=/root/.dotfiles/ --work-tree=/root/ config --local status.showUntrackedFiles no |
| 69 | # Run the vundle installer which installs plugins on the first run of vim. |
| 70 | vim -c ":qa!" |
| 71 | fi |
| 72 | |
| 73 | # Add a .bashrc and friends for pi. |
| 74 | if [[ ! -e "/home/pi/.dotfiles" ]]; then |
| 75 | cd /home/pi/ |
| 76 | su -c "git clone --separate-git-dir=/home/pi/.dotfiles https://github.com/AustinSchuh/.dotfiles.git tmpdotfiles" pi |
| 77 | su -c "rsync --recursive --verbose --exclude '.git' tmpdotfiles/ /home/pi/" pi |
| 78 | su -c "rm -r tmpdotfiles" pi |
| 79 | su -c "git --git-dir=/home/pi/.dotfiles/ --work-tree=/home/pi/ config --local status.showUntrackedFiles no" pi |
| 80 | # Run the vundle installer which installs plugins on the first run of vim. |
| 81 | su -c "vim -c ':qa!'" pi |
| 82 | fi |
| 83 | |
| 84 | # Make SSH work and not complain about pi being the username and pw still. |
| 85 | rm -f /etc/profile.d/sshpwd.sh |
| 86 | rm -f /etc/profile.d/wifi-check.sh |
| 87 | |
| 88 | systemctl enable ssh.service |
James Kuszmaul | 2d8fa2a | 2020-03-01 13:51:50 -0800 | [diff] [blame] | 89 | systemctl enable frc971.service |
Austin Schuh | f7970ca | 2022-02-11 22:19:29 -0800 | [diff] [blame] | 90 | systemctl enable frc971chrt.service |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 91 | |
Austin Schuh | d4df955 | 2020-09-13 18:59:50 -0700 | [diff] [blame] | 92 | # Default us to pi-971-1 |
| 93 | /root/bin/change_hostname.sh pi-971-1 |