meta-ampere: console: refactor configuration

Refactor console configuration for Mt.Jade and Mt.Mitchell to avoid
duplication and make the configuration files simpler.

Tested:
1. IPMI sol on Mt.Jade and Mt.Mitchell works
2. SOL SSH on Mt.Jade and Mt.Mitchell work for all console ports

Change-Id: I68d1a3c6be530ca93f8adc1dd61906ba8b206dc5
Signed-off-by: Chau Ly <chaul@amperecomputing.com>
diff --git a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/ampere_uartmux_ctrl.sh b/meta-ampere/meta-common/recipes-phosphor/console/obmc-console/ampere_uartmux_ctrl.sh
similarity index 75%
rename from meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/ampere_uartmux_ctrl.sh
rename to meta-ampere/meta-common/recipes-phosphor/console/obmc-console/ampere_uartmux_ctrl.sh
index 3148b61..6976263 100644
--- a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/ampere_uartmux_ctrl.sh
+++ b/meta-ampere/meta-common/recipes-phosphor/console/obmc-console/ampere_uartmux_ctrl.sh
@@ -1,8 +1,14 @@
 #!/bin/bash
 #
-# shellcheck disable=SC2046
+# Ampere Computing LLC: UART MUX/DEMUX for CPU0 UART0,1,4 and CPU1 UART1
+# Usage: ampere_uartmux_ctrl.sh <CPU UART port number> <UARTx_MODE>
+#        <UARTx_MODE> of 1 sets CPU To HDR_CONN
+#        <UARTx_MODE> of 2 sets BMC to CPU (eg dropbear ssh server on port 2200)
+#
 # This can be called to set uart mux manually
 
+# shellcheck disable=SC2046
+
 if [ $# -lt 2 ]; then
 	exit 1
 fi
diff --git a/meta-ampere/meta-common/recipes-phosphor/console/obmc-console/obmc-console@.service b/meta-ampere/meta-common/recipes-phosphor/console/obmc-console/obmc-console@.service
new file mode 100644
index 0000000..64d443f
--- /dev/null
+++ b/meta-ampere/meta-common/recipes-phosphor/console/obmc-console/obmc-console@.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=%i Console Server
+ConditionPathExists=/etc/obmc-console/server.%i.conf
+
+[Service]
+# Instance ID is the VUART basename
+ExecStartPre=/usr/sbin/ampere_uart_console_setup.sh %i
+ExecStart=/usr/sbin/obmc-console-server --config /etc/obmc-console/server.%i.conf %i
+SyslogIdentifier=%i-console-server
+Restart=always
diff --git a/meta-ampere/meta-common/recipes-phosphor/console/obmc-console_%.bbappend b/meta-ampere/meta-common/recipes-phosphor/console/obmc-console_%.bbappend
new file mode 100644
index 0000000..dd857f2
--- /dev/null
+++ b/meta-ampere/meta-common/recipes-phosphor/console/obmc-console_%.bbappend
@@ -0,0 +1,27 @@
+FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"
+RDEPENDS:${PN} += "bash"
+
+CONSOLE_CLIENT_SERVICE_FMT = "obmc-console-ssh@{0}.service"
+CONSOLE_SERVER_CONF_FMT = "file://server.{0}.conf"
+CONSOLE_CLIENT_CONF_FMT = "file://client.{0}.conf"
+
+SRC_URI += " \
+             file://ampere_uartmux_ctrl.sh \
+             file://obmc-console@.service \
+           "
+
+SYSTEMD_SERVICE:${PN}:remove = "obmc-console-ssh.socket"
+
+FILES:${PN}:remove = "${systemd_system_unitdir}/obmc-console-ssh@.service.d/use-socket.conf"
+
+PACKAGECONFIG:append = " concurrent-servers"
+
+do_install:append() {
+    # Script to switch host's uart muxes by GPIOs
+    install -d ${D}${sbindir}
+    install -m 0755 ${WORKDIR}/ampere_uartmux_ctrl.sh ${D}/${sbindir}
+
+    # Overriding service to call ampere_uart_console_setup.sh at ExecStartPre
+    install -d ${D}${systemd_system_unitdir}
+    install -m 0644 ${WORKDIR}/obmc-console@.service ${D}${systemd_system_unitdir}
+}
diff --git a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init.bb b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init.bb
index ad6dd1f..ca1065a 100644
--- a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init.bb
+++ b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init.bb
@@ -14,9 +14,7 @@
 
 SRC_URI = " \
     file://ampere_platform_init.sh \
-    file://ampere_uart_console_setup.sh \
     file://mtjade_platform_gpios_init.sh \
-    file://ampere_uartmux_ctrl.sh \
     file://ampere-platform-init.service \
     "
 
@@ -26,8 +24,6 @@
 do_install () {
     install -d ${D}${sbindir}
     install -m 0755 ${WORKDIR}/ampere_platform_init.sh ${D}${sbindir}/
-    install -m 0755 ${WORKDIR}/ampere_uart_console_setup.sh ${D}${sbindir}/
-    install -m 0755 ${WORKDIR}/ampere_uartmux_ctrl.sh ${D}/${sbindir}/
     install -d ${D}${systemd_unitdir}/system/
     install -m 0644 ${WORKDIR}/ampere-platform-init.service ${D}${systemd_unitdir}/system
     install -m 0755 ${WORKDIR}/mtjade_platform_gpios_init.sh ${D}${sbindir}/platform_gpios_init.sh
diff --git a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_platform_init.sh b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_platform_init.sh
index 7e33776..98f4ffc 100644
--- a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_platform_init.sh
+++ b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_platform_init.sh
@@ -3,7 +3,6 @@
 # shellcheck disable=SC2046
 # shellcheck source=meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/mtjade_platform_gpios_init.sh
 source /usr/sbin/platform_gpios_init.sh
-source /usr/sbin/ampere_uart_console_setup.sh
 
 #pre platform init function. implemented in platform_gpios_init.sh
 pre-platform-init
@@ -41,10 +40,6 @@
     gpioget $(gpiofind "$gpioName")
 done
 
-# =======================================================
-# Setting uart muxes to BMC as default
-uart_console_setup
-
 #post platform init function. implemented in platform_gpios_init.sh
 post-platform-init
 
diff --git a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_uart_console_setup.sh b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_uart_console_setup.sh
deleted file mode 100644
index fe8d203..0000000
--- a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_uart_console_setup.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/sh -e
-#
-# Copyright (c) 2020 Ampere Computing LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#	http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# shellcheck disable=SC2039
-# shellcheck disable=SC2112
-# shellcheck disable=SC3010
-# shellcheck disable=SC3030
-# shellcheck disable=SC3054
-
-export obmc_console_tty=("ttyS0" "ttyS1" "ttyS2" "ttyS3")
-
-function get_uart_port()
-{
-   tty=$1
-   case "${tty}" in
-   "ttyS0") uart=1
-   ;;
-   "ttyS1") uart=2
-   ;;
-   "ttyS2") uart=3
-   ;;
-   "ttyS3") uart=4
-   ;;
-   *) echo "Invalid tty passed to $0. Exiting!"
-      exit 1;
-   ;;
-   esac
-   echo $uart
-}
-
-function uart_console_setup()
-{
-   # Default the host routing through the mux to use the BMC (2)
-   # 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
-   for tty in "${obmc_console_tty[@]}"; do
-      uart=$(get_uart_port "$tty")
-      if [ "${uart}" -ne 0 ]
-      then
-         /usr/sbin/ampere_uartmux_ctrl.sh "${uart}" 2
-      fi
-   done
-}
diff --git a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_uartmux_ctrl.sh b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_uartmux_ctrl.sh
deleted file mode 100755
index c659e56..0000000
--- a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_uartmux_ctrl.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2021 Ampere Computing LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#	http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Ampere Computing LLC: UART MUX/DEMUX for CPU0 UART0,1,4 and CPU1 UART1
-# Usage: ampere_uartmux_ctrl.sh <CPU UART port number> <UARTx_MODE>
-#        <UARTx_MODE> of 1 sets CPU To HDR_CONN
-#        <UARTx_MODE> of 2 sets BMC to CPU (eg dropbear ssh server on port 2200)
-# shellcheck disable=SC2046
-
-if [ $# -lt 2 ]; then
-	exit 1
-fi
-
-case "$1" in
-	1) GPIO_UARTx_MODE0="uart1-mode0"
-		GPIO_UARTx_MODE1="uart1-mode1"
-	;;
-	2) GPIO_UARTx_MODE0="uart2-mode0"
-		GPIO_UARTx_MODE1="uart2-mode1"
-	;;
-	3) GPIO_UARTx_MODE0="uart3-mode0"
-		GPIO_UARTx_MODE1="uart3-mode1"
-	;;
-	4) GPIO_UARTx_MODE0="uart4-mode0"
-		GPIO_UARTx_MODE1="uart4-mode1"
-	;;
-	*) echo "Invalid UART port selection"
-		exit 1
-	;;
-esac
-
-echo "Ampere UART MUX CTRL UART port $1 to mode $2"
-
-case "$2" in
-	1)
-		if gpiofind "$GPIO_UARTx_MODE0"; then
-			gpioset $(gpiofind "$GPIO_UARTx_MODE0")=1
-		fi
-		if gpiofind "$GPIO_UARTx_MODE1"; then
-			gpioset $(gpiofind "$GPIO_UARTx_MODE1")=0
-		fi
-		exit 0
-		;;
-	2)
-		if gpiofind "$GPIO_UARTx_MODE0"; then
-			gpioset $(gpiofind "$GPIO_UARTx_MODE0")=0
-		fi
-		if gpiofind "$GPIO_UARTx_MODE1"; then
-			gpioset $(gpiofind "$GPIO_UARTx_MODE1")=1
-		fi
-		exit 0
-		;;
-	*) echo "Invalid UART mode selection"
-	   exit 1
-	;;
-esac
diff --git a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/mtjade_platform_gpios_init.sh b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/mtjade_platform_gpios_init.sh
index d7bb3d3..76e4600 100644
--- a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/mtjade_platform_gpios_init.sh
+++ b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/mtjade_platform_gpios_init.sh
@@ -1,8 +1,5 @@
 #!/bin/bash
 
-# shellcheck source=meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_uart_console_setup.sh
-source /usr/sbin/ampere_uart_console_setup.sh
-
 function pre-platform-init() {
     echo "Do pre platform init"
 }
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/ampere_uart_console_setup.sh b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/ampere_uart_console_setup.sh
new file mode 100644
index 0000000..5a48d49
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/ampere_uart_console_setup.sh
@@ -0,0 +1,30 @@
+#!/bin/sh -e
+#
+# Platform can add tty ports for console server to OBMC_CONSOLE_TTYS in their
+# bbappend. The target tty devices exposed by kernel will then start their
+# corresponding obmc-console-server instance and the
+# obmc-console@<tty-port>.service will execute this script to direct the uart
+# port of the <tty-port> to BMC
+
+tty="$1"
+uart=0
+
+case "${tty}" in
+ "ttyS0") uart=1
+ ;;
+ "ttyS1") uart=2
+ ;;
+ "ttyS2") uart=3
+ ;;
+ "ttyS3") uart=4
+ ;;
+ *) echo "Invalid tty passed to $0. Exiting!"
+    exit 0;
+ ;;
+esac
+
+# Default the host routing through the mux to use the BMC (2)
+# 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
diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console_%.bbappend b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console_%.bbappend
index 26a356d..bd75de6 100644
--- a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console_%.bbappend
+++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console_%.bbappend
@@ -5,25 +5,20 @@
 OBMC_CONSOLE_TTYS = "ttyS0 ttyS1 ttyS2 ttyS3"
 CONSOLE_CLIENT = "2200 2201 2202 2203"
 
-CONSOLE_SERVER_CONF_FMT = "file://server.{0}.conf"
-CONSOLE_CLIENT_CONF_FMT = "file://client.{0}.conf"
-CONSOLE_CLIENT_SERVICE_FMT = "obmc-console-ssh@{0}.service"
-
 SRC_URI += " \
              ${@compose_list(d, 'CONSOLE_SERVER_CONF_FMT', 'OBMC_CONSOLE_TTYS')} \
              ${@compose_list(d, 'CONSOLE_CLIENT_CONF_FMT', 'CONSOLE_CLIENT')} \
+             file://ampere_uart_console_setup.sh \
            "
 
 SYSTEMD_SERVICE:${PN}:append = " \
                                   ${@compose_list(d, 'CONSOLE_CLIENT_SERVICE_FMT', 'CONSOLE_CLIENT')} \
                                 "
-SYSTEMD_SERVICE:${PN}:remove = "obmc-console-ssh.socket"
-
-FILES:${PN}:remove = "${systemd_system_unitdir}/obmc-console-ssh@.service.d/use-socket.conf"
-
-PACKAGECONFIG:append = " concurrent-servers"
 
 do_install:append() {
+    # Script to set host's uart muxes to BMC
+    install -m 0755 ${WORKDIR}/ampere_uart_console_setup.sh ${D}${sbindir}
+
     # Install the console client configurations
-    install -m 0644 ${WORKDIR}/client.*.conf ${D}${sysconfdir}/${BPN}/
+    install -m 0644 ${WORKDIR}/client.*.conf ${D}${sysconfdir}/${BPN}
 }
diff --git a/meta-ampere/meta-jade/recipes-phosphor/hostlogger/phosphor-hostlogger/ttyS0.conf b/meta-ampere/meta-jade/recipes-phosphor/hostlogger/phosphor-hostlogger/ttyS0.conf
index d3a1eb60..e2d5396 100644
--- a/meta-ampere/meta-jade/recipes-phosphor/hostlogger/phosphor-hostlogger/ttyS0.conf
+++ b/meta-ampere/meta-jade/recipes-phosphor/hostlogger/phosphor-hostlogger/ttyS0.conf
@@ -1,3 +1,3 @@
-SOCKET_ID=default
+#SOCKET_ID defaults to "default"
 MODE=stream
 STREAM_DST=/run/rsyslog/console/cpu
diff --git a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init.bb b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init.bb
index 362b4c8..3a1eb2c 100644
--- a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init.bb
+++ b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init.bb
@@ -19,8 +19,6 @@
            file://ampere_bmc_heartbeat.sh \
            file://mtmitchell_platform_gpios_init.sh \
            file://gpio-lib.sh \
-           file://ampere_uart_console_setup.sh \
-           file://ampere_uartmux_ctrl.sh \
           "
 SYSTEMD_PACKAGES = "${PN}"
 SYSTEMD_SERVICE:${PN} = "ampere-platform-init.service ampere-bmc-heartbeat.service"
@@ -31,8 +29,6 @@
     install -m 0755 ${WORKDIR}/ampere_platform_init.sh ${D}${sbindir}/
     install -m 0755 ${WORKDIR}/ampere_bmc_heartbeat.sh ${D}${sbindir}/
     install -m 0755 ${WORKDIR}/mtmitchell_platform_gpios_init.sh ${D}${sbindir}/platform_gpios_init.sh
-    install -m 0755 ${WORKDIR}/ampere_uart_console_setup.sh ${D}${sbindir}/
-    install -m 0755 ${WORKDIR}/ampere_uartmux_ctrl.sh ${D}/${sbindir}/
     install -d ${D}${systemd_unitdir}/system/
     install -m 0644 ${WORKDIR}/ampere-platform-init.service ${D}${systemd_unitdir}/system
 }
diff --git a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/ampere_platform_init.sh b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/ampere_platform_init.sh
index 4d737a7..a5ec8e7 100644
--- a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/ampere_platform_init.sh
+++ b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/ampere_platform_init.sh
@@ -3,7 +3,6 @@
 # shellcheck disable=SC2046
 # shellcheck source=meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/mtmitchell_platform_gpios_init.sh
 source /usr/sbin/platform_gpios_init.sh
-source /usr/sbin/ampere_uart_console_setup.sh
 
 #pre platform init function. implemented in platform_gpios_init.sh
 pre-platform-init
@@ -41,10 +40,6 @@
     gpioget $(gpiofind "$gpioName")
 done
 
-# =======================================================
-# Setting uart muxes to BMC as default
-uart_console_setup
-
 #post platform init function. implemented in platform_gpios_init.sh
 post-platform-init
 
diff --git a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/ampere_uart_console_setup.sh b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/ampere_uart_console_setup.sh
deleted file mode 100644
index 10a1981..0000000
--- a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/ampere_uart_console_setup.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh -e
-
-# shellcheck disable=SC2039
-# shellcheck disable=SC2112
-# shellcheck disable=SC3010
-# shellcheck disable=SC3030
-# shellcheck disable=SC3054
-
-export obmc_console_tty=("ttyS0" "ttyS1" "ttyS2" "ttyS3" "ttyS7" "ttyS8")
-
-function get_uart_port()
-{
-   tty=$1
-   case "${tty}" in
-   "ttyS0") uart=1
-   ;;
-   "ttyS1") uart=2
-   ;;
-   "ttyS2") uart=3
-   ;;
-   "ttyS3") uart=4
-   ;;
-   "ttyS7") uart=0
-   ;;
-   "ttyS8") uart=0
-   ;;
-   *) echo "Invalid tty passed to $0. Exiting!"
-      exit 1;
-   ;;
-   esac
-   echo $uart
-}
-
-function uart_console_setup()
-{
-   # Default the host routing through the mux to use the BMC (2)
-   # 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
-   for tty in "${obmc_console_tty[@]}"; do
-      uart=$(get_uart_port "$tty")
-      if [ "${uart}" -ne 0 ]
-      then
-         /usr/sbin/ampere_uartmux_ctrl.sh "${uart}" 2
-      fi
-   done
-}
diff --git a/meta-ampere/meta-mitchell/recipes-phosphor/console/obmc-console/ampere_uart_console_setup.sh b/meta-ampere/meta-mitchell/recipes-phosphor/console/obmc-console/ampere_uart_console_setup.sh
new file mode 100644
index 0000000..fa8d5e9
--- /dev/null
+++ b/meta-ampere/meta-mitchell/recipes-phosphor/console/obmc-console/ampere_uart_console_setup.sh
@@ -0,0 +1,40 @@
+#!/bin/sh -e
+#
+# Platform can add tty ports for console server to OBMC_CONSOLE_TTYS in their
+# bbappend. The target tty devices exposed by kernel will then start their
+# corresponding obmc-console-server instance and the
+# obmc-console@<tty-port>.service will execute this script to direct the uart
+# port of the <tty-port> to BMC
+
+tty="$1"
+uart=0
+
+case "${tty}" in
+ "ttyS0") uart=1
+ ;;
+ "ttyS1") uart=2
+ ;;
+ "ttyS2") uart=3
+ ;;
+ "ttyS3") uart=4
+ ;;
+ "ttyS7")
+   # Socket 1 UART 1 connects directly to BMC UART 8
+   echo "Ampere UART MUX CTRL UART port 8 to mode 2"
+   exit 0
+ ;;
+ "ttyS8")
+   # Socket 1 UART 4 connects directly to BMC UART 9
+   echo "Ampere UART MUX CTRL UART port 9 to mode 2"
+   exit 0
+ ;;
+ *) echo "Invalid tty passed to $0. Exiting!"
+    exit 1;
+ ;;
+esac
+
+# Default the host routing through the mux to use the BMC (2)
+# 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
diff --git a/meta-ampere/meta-mitchell/recipes-phosphor/console/obmc-console_%.bbappend b/meta-ampere/meta-mitchell/recipes-phosphor/console/obmc-console_%.bbappend
index 605c9e1..c45db95 100644
--- a/meta-ampere/meta-mitchell/recipes-phosphor/console/obmc-console_%.bbappend
+++ b/meta-ampere/meta-mitchell/recipes-phosphor/console/obmc-console_%.bbappend
@@ -5,25 +5,20 @@
 OBMC_CONSOLE_TTYS = "ttyS0 ttyS1 ttyS2 ttyS3 ttyS7 ttyS8"
 CONSOLE_CLIENT = "2200 2201 2202 2203 2204 2205"
 
-CONSOLE_SERVER_CONF_FMT = "file://server.{0}.conf"
-CONSOLE_CLIENT_CONF_FMT = "file://client.{0}.conf"
-CONSOLE_CLIENT_SERVICE_FMT = "obmc-console-ssh@{0}.service"
-
 SRC_URI += " \
              ${@compose_list(d, 'CONSOLE_SERVER_CONF_FMT', 'OBMC_CONSOLE_TTYS')} \
              ${@compose_list(d, 'CONSOLE_CLIENT_CONF_FMT', 'CONSOLE_CLIENT')} \
+             file://ampere_uart_console_setup.sh \
            "
 
 SYSTEMD_SERVICE:${PN}:append = " \
                                   ${@compose_list(d, 'CONSOLE_CLIENT_SERVICE_FMT', 'CONSOLE_CLIENT')} \
                                 "
-SYSTEMD_SERVICE:${PN}:remove = "obmc-console-ssh.socket"
-
-FILES:${PN}:remove = "${systemd_system_unitdir}/obmc-console-ssh@.service.d/use-socket.conf"
-
-PACKAGECONFIG:append = " concurrent-servers"
 
 do_install:append() {
+    # Script to set host's uart muxes to BMC
+    install -m 0755 ${WORKDIR}/ampere_uart_console_setup.sh ${D}${sbindir}
+
     # Install the console client configurations
-    install -m 0644 ${WORKDIR}/client.*.conf ${D}${sysconfdir}/${BPN}/
+    install -m 0644 ${WORKDIR}/client.*.conf ${D}${sysconfdir}/${BPN}
 }
diff --git a/meta-ampere/meta-mitchell/recipes-phosphor/hostlogger/phosphor-hostlogger/ttyS0.conf b/meta-ampere/meta-mitchell/recipes-phosphor/hostlogger/phosphor-hostlogger/ttyS0.conf
index d3a1eb60..e2d5396 100644
--- a/meta-ampere/meta-mitchell/recipes-phosphor/hostlogger/phosphor-hostlogger/ttyS0.conf
+++ b/meta-ampere/meta-mitchell/recipes-phosphor/hostlogger/phosphor-hostlogger/ttyS0.conf
@@ -1,3 +1,3 @@
-SOCKET_ID=default
+#SOCKET_ID defaults to "default"
 MODE=stream
 STREAM_DST=/run/rsyslog/console/cpu