brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 3 | if [[ "$(hostname)" == "roboRIO"* ]]; then |
Austin Schuh | ac1b775 | 2021-10-12 22:05:09 -0700 | [diff] [blame] | 4 | /usr/local/natinst/etc/init.d/systemWebServer stop |
| 5 | |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 6 | ROBOT_CODE="/home/admin/robot_code" |
| 7 | |
Austin Schuh | de605f1 | 2022-02-23 23:08:19 -0800 | [diff] [blame^] | 8 | # Get the CTRE libraries in the shared library search path |
| 9 | for f in $(ls *.so); |
| 10 | do |
| 11 | ln -f -s /home/admin/robot_code/$f /usr/local/frc/third-party/lib/$f |
| 12 | done |
| 13 | |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 14 | ln -s /var/local/natinst/log/FRC_UserProgram.log /tmp/FRC_UserProgram.log |
| 15 | ln -s /var/local/natinst/log/FRC_UserProgram.log "${ROBOT_CODE}/FRC_UserProgram.log" |
James Kuszmaul | 2d8fa2a | 2020-03-01 13:51:50 -0800 | [diff] [blame] | 16 | elif [[ "$(hostname)" == "pi-"* ]]; then |
Austin Schuh | f7970ca | 2022-02-11 22:19:29 -0800 | [diff] [blame] | 17 | function chrtirq() { |
| 18 | ps -ef | grep "\\[$1\\]" | awk '{print $2}' | xargs chrt $2 -p $3 |
| 19 | } |
| 20 | |
| 21 | chrtirq "irq/20-fe00b880" -f 50 |
| 22 | chrtirq "irq/66-xhci_hcd" -f 1 |
| 23 | chrtirq "irq/50-VCHIQ do" -o 0 |
| 24 | chrtirq "irq/27-DMA IRQ" -f 50 |
| 25 | chrtirq "irq/51-mmc1" -o 0 |
| 26 | chrtirq "irq/51-mmc0" -o 0 |
| 27 | chrtirq "irq/51-s-mmc0" -o 0 |
| 28 | chrtirq "irq/64-v3d" -o 0 |
| 29 | chrtirq "irq/24-vc4 hvs" -o 0 |
| 30 | chrtirq "irq/42-vc4 hdmi" -o 0 |
| 31 | chrtirq "irq/43-vc4 hdmi" -o 0 |
| 32 | chrtirq "irq/39-vc4 hdmi" -o 0 |
| 33 | chrtirq "irq/39-s-vc4 hd" -o 0 |
| 34 | chrtirq "irq/38-vc4 hdmi" -o 0 |
| 35 | chrtirq "irq/38-s-vc4 hd" -o 0 |
| 36 | chrtirq "irq/29-DMA IRQ" -f 50 |
| 37 | chrtirq "irq/48-vc4 hdmi" -o 0 |
| 38 | chrtirq "irq/49-vc4 hdmi" -o 0 |
| 39 | chrtirq "irq/45-vc4 hdmi" -o 0 |
| 40 | chrtirq "irq/45-s-vc4 hd" -o 0 |
| 41 | chrtirq "irq/44-vc4 hdmi" -o 0 |
| 42 | chrtirq "irq/44-s-vc4 hd" -o 0 |
| 43 | chrtirq "irq/30-DMA IRQ" -f 50 |
| 44 | chrtirq "irq/19-fe004000" -f 50 |
| 45 | chrtirq "irq/34-vc4 crtc" -o 0 |
| 46 | chrtirq "irq/35-vc4 crtc" -o 0 |
| 47 | chrtirq "irq/36-vc4 crtc" -o 0 |
| 48 | chrtirq "irq/35-vc4 crtc" -o 0 |
| 49 | chrtirq "irq/37-vc4 crtc" -o 0 |
| 50 | chrtirq "irq/23-uart-pl0" -o 0 |
| 51 | chrtirq "irq/57-eth0" -f 10 |
| 52 | chrtirq "irq/58-eth0" -f 10 |
| 53 | |
Austin Schuh | 66e0005 | 2021-10-23 22:00:52 -0700 | [diff] [blame] | 54 | # We have systemd configured to handle restarting, so just exec. |
| 55 | export PATH="${PATH}:/home/pi/robot_code" |
Austin Schuh | 5c96bf8 | 2021-11-02 21:08:17 -0700 | [diff] [blame] | 56 | rm -rf /dev/shm/aos |
Austin Schuh | 66e0005 | 2021-10-23 22:00:52 -0700 | [diff] [blame] | 57 | exec starterd |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 58 | else |
| 59 | ROBOT_CODE="${HOME}/robot_code" |
| 60 | fi |
| 61 | |
Austin Schuh | 540089c | 2019-12-29 20:36:16 -0800 | [diff] [blame] | 62 | cd "${ROBOT_CODE}" |
| 63 | export PATH="${PATH}:${ROBOT_CODE}" |
Brian Silverman | 17bb36d | 2015-03-29 16:50:06 -0400 | [diff] [blame] | 64 | while true; do |
Austin Schuh | 5c96bf8 | 2021-11-02 21:08:17 -0700 | [diff] [blame] | 65 | rm -rf /dev/shm/aos |
| 66 | starterd 2>&1 |
Brian Silverman | 17bb36d | 2015-03-29 16:50:06 -0400 | [diff] [blame] | 67 | done |