blob: 946c92bc3c3785f37cf77a94ffe3e872032dedff [file] [log] [blame]
Hieu Huynh325a8112022-10-24 11:15:17 +00001#!/bin/sh -e
2
Chau Ly23148bd2023-01-13 04:18:51 +00003# shellcheck disable=SC3010
Hieu Huynh325a8112022-10-24 11:15:17 +00004
5tty="$1"
6uart=0
7
8case "${tty}" in
9 "ttyS0") uart=1
10 ;;
11 "ttyS1") uart=2
12 ;;
13 "ttyS2") uart=3
14 ;;
15 "ttyS3") uart=4
16 ;;
Chau Ly23148bd2023-01-13 04:18:51 +000017 "ttyS7") uart=0
18 ;;
19 "ttyS8") uart=0
20 ;;
Hieu Huynh325a8112022-10-24 11:15:17 +000021 *) echo "Invalid tty passed to $0. Exiting!"
22 exit 1;
23 ;;
24esac
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 Ly23148bd2023-01-13 04:18:51 +000030if [[ ${uart} -ne 0 ]]
31then
32 /usr/sbin/ampere_uartmux_ctrl.sh ${uart} 2
33fi
Hieu Huynh325a8112022-10-24 11:15:17 +000034
35/usr/sbin/obmc-console-server --config /etc/obmc-console/server."${tty}".conf "${tty}"