meta-ampere: mtmitchell: Support host consoles logger
This commit supports phosphor-hostlogger in STREAM mode, to forward
the byte stream from obmc-console to rsyslog via the imuxsock module.
The logs can be obtained in /var/log/. The logs are rotated by
logrotate. The size threshold of cpu console is 256KB and the others are
64KB. Each log is polled every 1 minute to check if its file size
exceeds the threshold to rotate it to the new file. Each console can be
saved in up to 2 log files.
Tested (CPU console):
1. Change the mux of CPU console to BMC
$ ampere_uartmux_ctrl.sh 1 2
2. Connect to CPU SOL console
$ ssh root@<BMC_IP> -p 2200
3. Execute commands in the CPU SOL console
=> The console output on CPU SOL console will all be logged to
/var/log/obmc-console-cpu.log
=> The log will be rotated to /var/log/obmc-console-cpu.log.1 if the
original log file size exceeds 256KB every 1min poll
Signed-off-by: Chau Ly <chaul@amperecomputing.com>
Change-Id: I336bde09c4ef61ea68e05bef2c0b4e4298ea7959
diff --git a/meta-ampere/meta-mitchell/recipes-phosphor/console/obmc-console/obmc-console-server-setup.sh b/meta-ampere/meta-mitchell/recipes-phosphor/console/obmc-console/obmc-console-server-setup.sh
index 763161a..946c92b 100644
--- a/meta-ampere/meta-mitchell/recipes-phosphor/console/obmc-console/obmc-console-server-setup.sh
+++ b/meta-ampere/meta-mitchell/recipes-phosphor/console/obmc-console/obmc-console-server-setup.sh
@@ -1,5 +1,6 @@
#!/bin/sh -e
+# shellcheck disable=SC3010
tty="$1"
uart=0
@@ -13,6 +14,10 @@
;;
"ttyS3") uart=4
;;
+ "ttyS7") uart=0
+ ;;
+ "ttyS8") uart=0
+ ;;
*) echo "Invalid tty passed to $0. Exiting!"
exit 1;
;;
@@ -22,6 +27,9 @@
# This allows the SoL console in webui, and the ssh port 2200, to work
# upon startup. If UART transcievers are installed on the header and required,
# this value should be set to 1
-/usr/sbin/ampere_uartmux_ctrl.sh ${uart} 2
+if [[ ${uart} -ne 0 ]]
+then
+ /usr/sbin/ampere_uartmux_ctrl.sh ${uart} 2
+fi
/usr/sbin/obmc-console-server --config /etc/obmc-console/server."${tty}".conf "${tty}"