blob: 11b8cc86400f36863c228525ff071bdd0c42e5db [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 python3-pip \
21 cpufrequtils \
22 libopencv-calib3d3.2 \
23 libopencv-contrib3.2 \
24 libopencv-core3.2 \
25 libopencv-features2d3.2 \
26 libopencv-flann3.2 \
27 libopencv-highgui3.2 \
28 libopencv-imgcodecs3.2 \
29 libopencv-imgproc3.2 \
30 libopencv-ml3.2 \
31 libopencv-objdetect3.2 \
32 libopencv-photo3.2 \
33 libopencv-shape3.2 \
34 libopencv-stitching3.2 \
35 libopencv-superres3.2 \
36 libopencv-video3.2 \
37 libopencv-videoio3.2 \
38 libopencv-videostab3.2 \
39 libopencv-viz3.2 \
Austin Schuh1252ed12020-03-01 19:27:29 -080040 python3-opencv \
Jim Ostrowskid59ebe62021-03-07 00:11:51 -080041 python3-matplotlib \
Austin Schuh1252ed12020-03-01 19:27:29 -080042 gstreamer1.0-plugins-bad \
43 gstreamer1.0-plugins-base \
44 gstreamer1.0-plugins-good \
45 gstreamer1.0-plugins-ugly \
46 gstreamer1.0-x \
47 gstreamer1.0-nice \
48 gstreamer1.0-gl \
49 libgstreamer-plugins-bad1.0-0 \
50 libgstreamer-plugins-base1.0-0 \
51 libgstreamer1.0-0 \
52 libgstreamer-gl1.0-0 \
53 libnice10 \
54 libnice-dev
Austin Schuhab8c0c52020-02-22 13:42:37 -080055
Jim Ostrowski33ea41e2021-03-11 12:17:38 -080056python3 -m pip install glog
57
Austin Schuhab8c0c52020-02-22 13:42:37 -080058echo 'GOVERNOR="performance"' > /etc/default/cpufrequtils
59
60# Add a .bashrc and friends for root.
61if [[ ! -e "/root/.dotfiles" ]]; then
62 cd /root/
63 git clone --separate-git-dir=/root/.dotfiles https://github.com/AustinSchuh/.dotfiles.git tmpdotfiles
64 rsync --recursive --verbose --exclude '.git' tmpdotfiles/ /root/
65 rm -r tmpdotfiles
66 git --git-dir=/root/.dotfiles/ --work-tree=/root/ config --local status.showUntrackedFiles no
67 # Run the vundle installer which installs plugins on the first run of vim.
68 vim -c ":qa!"
69fi
70
71# Add a .bashrc and friends for pi.
72if [[ ! -e "/home/pi/.dotfiles" ]]; then
73 cd /home/pi/
74 su -c "git clone --separate-git-dir=/home/pi/.dotfiles https://github.com/AustinSchuh/.dotfiles.git tmpdotfiles" pi
75 su -c "rsync --recursive --verbose --exclude '.git' tmpdotfiles/ /home/pi/" pi
76 su -c "rm -r tmpdotfiles" pi
77 su -c "git --git-dir=/home/pi/.dotfiles/ --work-tree=/home/pi/ config --local status.showUntrackedFiles no" pi
78 # Run the vundle installer which installs plugins on the first run of vim.
79 su -c "vim -c ':qa!'" pi
80fi
81
82# Make SSH work and not complain about pi being the username and pw still.
83rm -f /etc/profile.d/sshpwd.sh
84rm -f /etc/profile.d/wifi-check.sh
85
86systemctl enable ssh.service
James Kuszmaul2d8fa2a2020-03-01 13:51:50 -080087systemctl enable frc971.service
Austin Schuhab8c0c52020-02-22 13:42:37 -080088
Austin Schuhd4df9552020-09-13 18:59:50 -070089# Default us to pi-971-1
90/root/bin/change_hostname.sh pi-971-1