Hieu Huynh | 325a811 | 2022-10-24 11:15:17 +0000 | [diff] [blame] | 1 | #!/bin/sh -e |
| 2 | |
Chau Ly | 23148bd | 2023-01-13 04:18:51 +0000 | [diff] [blame^] | 3 | # shellcheck disable=SC3010 |
Hieu Huynh | 325a811 | 2022-10-24 11:15:17 +0000 | [diff] [blame] | 4 | |
| 5 | tty="$1" |
| 6 | uart=0 |
| 7 | |
| 8 | case "${tty}" in |
| 9 | "ttyS0") uart=1 |
| 10 | ;; |
| 11 | "ttyS1") uart=2 |
| 12 | ;; |
| 13 | "ttyS2") uart=3 |
| 14 | ;; |
| 15 | "ttyS3") uart=4 |
| 16 | ;; |
Chau Ly | 23148bd | 2023-01-13 04:18:51 +0000 | [diff] [blame^] | 17 | "ttyS7") uart=0 |
| 18 | ;; |
| 19 | "ttyS8") uart=0 |
| 20 | ;; |
Hieu Huynh | 325a811 | 2022-10-24 11:15:17 +0000 | [diff] [blame] | 21 | *) echo "Invalid tty passed to $0. Exiting!" |
| 22 | exit 1; |
| 23 | ;; |
| 24 | esac |
| 25 | |
| 26 | # Default the host routing through the mux to use the BMC (2) |
| 27 | # This allows the SoL console in webui, and the ssh port 2200, to work |
| 28 | # upon startup. If UART transcievers are installed on the header and required, |
| 29 | # this value should be set to 1 |
Chau Ly | 23148bd | 2023-01-13 04:18:51 +0000 | [diff] [blame^] | 30 | if [[ ${uart} -ne 0 ]] |
| 31 | then |
| 32 | /usr/sbin/ampere_uartmux_ctrl.sh ${uart} 2 |
| 33 | fi |
Hieu Huynh | 325a811 | 2022-10-24 11:15:17 +0000 | [diff] [blame] | 34 | |
| 35 | /usr/sbin/obmc-console-server --config /etc/obmc-console/server."${tty}".conf "${tty}" |