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 | |
| 8 | ln -s /var/local/natinst/log/FRC_UserProgram.log /tmp/FRC_UserProgram.log |
| 9 | 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] | 10 | elif [[ "$(hostname)" == "pi-"* ]]; then |
Austin Schuh | f7970ca | 2022-02-11 22:19:29 -0800 | [diff] [blame^] | 11 | function chrtirq() { |
| 12 | ps -ef | grep "\\[$1\\]" | awk '{print $2}' | xargs chrt $2 -p $3 |
| 13 | } |
| 14 | |
| 15 | chrtirq "irq/20-fe00b880" -f 50 |
| 16 | chrtirq "irq/66-xhci_hcd" -f 1 |
| 17 | chrtirq "irq/50-VCHIQ do" -o 0 |
| 18 | chrtirq "irq/27-DMA IRQ" -f 50 |
| 19 | chrtirq "irq/51-mmc1" -o 0 |
| 20 | chrtirq "irq/51-mmc0" -o 0 |
| 21 | chrtirq "irq/51-s-mmc0" -o 0 |
| 22 | chrtirq "irq/64-v3d" -o 0 |
| 23 | chrtirq "irq/24-vc4 hvs" -o 0 |
| 24 | chrtirq "irq/42-vc4 hdmi" -o 0 |
| 25 | chrtirq "irq/43-vc4 hdmi" -o 0 |
| 26 | chrtirq "irq/39-vc4 hdmi" -o 0 |
| 27 | chrtirq "irq/39-s-vc4 hd" -o 0 |
| 28 | chrtirq "irq/38-vc4 hdmi" -o 0 |
| 29 | chrtirq "irq/38-s-vc4 hd" -o 0 |
| 30 | chrtirq "irq/29-DMA IRQ" -f 50 |
| 31 | chrtirq "irq/48-vc4 hdmi" -o 0 |
| 32 | chrtirq "irq/49-vc4 hdmi" -o 0 |
| 33 | chrtirq "irq/45-vc4 hdmi" -o 0 |
| 34 | chrtirq "irq/45-s-vc4 hd" -o 0 |
| 35 | chrtirq "irq/44-vc4 hdmi" -o 0 |
| 36 | chrtirq "irq/44-s-vc4 hd" -o 0 |
| 37 | chrtirq "irq/30-DMA IRQ" -f 50 |
| 38 | chrtirq "irq/19-fe004000" -f 50 |
| 39 | chrtirq "irq/34-vc4 crtc" -o 0 |
| 40 | chrtirq "irq/35-vc4 crtc" -o 0 |
| 41 | chrtirq "irq/36-vc4 crtc" -o 0 |
| 42 | chrtirq "irq/35-vc4 crtc" -o 0 |
| 43 | chrtirq "irq/37-vc4 crtc" -o 0 |
| 44 | chrtirq "irq/23-uart-pl0" -o 0 |
| 45 | chrtirq "irq/57-eth0" -f 10 |
| 46 | chrtirq "irq/58-eth0" -f 10 |
| 47 | |
Austin Schuh | 66e0005 | 2021-10-23 22:00:52 -0700 | [diff] [blame] | 48 | # We have systemd configured to handle restarting, so just exec. |
| 49 | export PATH="${PATH}:/home/pi/robot_code" |
Austin Schuh | 5c96bf8 | 2021-11-02 21:08:17 -0700 | [diff] [blame] | 50 | rm -rf /dev/shm/aos |
Austin Schuh | 66e0005 | 2021-10-23 22:00:52 -0700 | [diff] [blame] | 51 | exec starterd |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 52 | else |
| 53 | ROBOT_CODE="${HOME}/robot_code" |
| 54 | fi |
| 55 | |
Austin Schuh | 540089c | 2019-12-29 20:36:16 -0800 | [diff] [blame] | 56 | cd "${ROBOT_CODE}" |
| 57 | export PATH="${PATH}:${ROBOT_CODE}" |
Brian Silverman | 17bb36d | 2015-03-29 16:50:06 -0400 | [diff] [blame] | 58 | while true; do |
Austin Schuh | 5c96bf8 | 2021-11-02 21:08:17 -0700 | [diff] [blame] | 59 | rm -rf /dev/shm/aos |
| 60 | starterd 2>&1 |
Brian Silverman | 17bb36d | 2015-03-29 16:50:06 -0400 | [diff] [blame] | 61 | done |