obmc-console: Support 8 slots for Yosemite 4
Support ttyS5~ttyS8 if multi-host is needed.
Support server/client conf 2204~2207 for console redirection.
Support ttyS5~ttyS8 host-logger.
Tested:
- Do obmc-console to link from uart1 to uart9
- List log of lost-logger
Change-Id: I558f71992f2cdab6c2a6338f728cdf5d476bcff2
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS5-ssh-bic@.service b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS5-ssh-bic@.service
new file mode 100644
index 0000000..b7ab262
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS5-ssh-bic@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Phosphor BIC Console SSH socket for Slot5
+Wants=obmc-console@ttyS5.service
+
+[Service]
+ExecStartPre=/usr/bin/select-uart-mux slot5 bic
+ExecStart=/usr/sbin/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key -c "/usr/bin/obmc-console-client -i host4" $DROPBEAR_EXTRA_ARGS
+SyslogIdentifier=console-client-ttyS5
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
+KillMode=process
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS5-ssh-host@.service b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS5-ssh-host@.service
new file mode 100644
index 0000000..0e0bf5f
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS5-ssh-host@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Phosphor Host Console SSH socket for Slot5
+Wants=obmc-console@ttyS5.service
+
+[Service]
+ExecStartPre=/usr/bin/select-uart-mux slot5 host
+ExecStart=/usr/sbin/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key -c "/usr/bin/obmc-console-client -i host4" $DROPBEAR_EXTRA_ARGS
+SyslogIdentifier=console-client-ttyS5
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
+KillMode=process
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS6-ssh-bic@.service b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS6-ssh-bic@.service
new file mode 100644
index 0000000..af1f653
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS6-ssh-bic@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Phosphor BIC Console SSH socket for Slot6
+Wants=obmc-console@ttyS6.service
+
+[Service]
+ExecStartPre=/usr/bin/select-uart-mux slot6 bic
+ExecStart=/usr/sbin/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key -c "/usr/bin/obmc-console-client -i host5" $DROPBEAR_EXTRA_ARGS
+SyslogIdentifier=console-client-ttyS6
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
+KillMode=process
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS6-ssh-host@.service b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS6-ssh-host@.service
new file mode 100644
index 0000000..36b1f3c
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS6-ssh-host@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Phosphor Host Console SSH socket for Slot6
+Wants=obmc-console@ttyS6.service
+
+[Service]
+ExecStartPre=/usr/bin/select-uart-mux slot6 host
+ExecStart=/usr/sbin/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key -c "/usr/bin/obmc-console-client -i host5" $DROPBEAR_EXTRA_ARGS
+SyslogIdentifier=console-client-ttyS6
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
+KillMode=process
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS7-ssh-bic@.service b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS7-ssh-bic@.service
new file mode 100644
index 0000000..f36c653
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS7-ssh-bic@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Phosphor BIC Console SSH socket for Slot7
+Wants=obmc-console@ttyS7.service
+
+[Service]
+ExecStartPre=/usr/bin/select-uart-mux slot7 bic
+ExecStart=/usr/sbin/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key -c "/usr/bin/obmc-console-client -i host6" $DROPBEAR_EXTRA_ARGS
+SyslogIdentifier=console-client-ttyS7
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
+KillMode=process
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS7-ssh-host@.service b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS7-ssh-host@.service
new file mode 100644
index 0000000..b8ed1d5
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS7-ssh-host@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Phosphor Host Console SSH socket for Slot7
+Wants=obmc-console@ttyS7.service
+
+[Service]
+ExecStartPre=/usr/bin/select-uart-mux slot7 host
+ExecStart=/usr/sbin/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key -c "/usr/bin/obmc-console-client -i host6" $DROPBEAR_EXTRA_ARGS
+SyslogIdentifier=console-client-ttyS7
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
+KillMode=process
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS8-ssh-bic@.service b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS8-ssh-bic@.service
new file mode 100644
index 0000000..20afea3
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS8-ssh-bic@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Phosphor BIC Console SSH socket for Slot8
+Wants=obmc-console@ttyS8.service
+
+[Service]
+ExecStartPre=/usr/bin/select-uart-mux slot8 bic
+ExecStart=/usr/sbin/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key -c "/usr/bin/obmc-console-client -i host7" $DROPBEAR_EXTRA_ARGS
+SyslogIdentifier=console-client-ttyS8
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
+KillMode=process
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS8-ssh-host@.service b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS8-ssh-host@.service
new file mode 100644
index 0000000..3a40ba3
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS8-ssh-host@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Phosphor Host Console SSH socket for Slot8
+Wants=obmc-console@ttyS8.service
+
+[Service]
+ExecStartPre=/usr/bin/select-uart-mux slot8 host
+ExecStart=/usr/sbin/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key -c "/usr/bin/obmc-console-client -i host7" $DROPBEAR_EXTRA_ARGS
+SyslogIdentifier=console-client-ttyS8
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
+KillMode=process
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/server.ttyS5.conf b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/server.ttyS5.conf
new file mode 100644
index 0000000..f614234
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/server.ttyS5.conf
@@ -0,0 +1,4 @@
+local-tty = ttyS5
+baud = 57600
+console-id = host4
+logfile = /var/log/obmc-console4.log
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/server.ttyS6.conf b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/server.ttyS6.conf
new file mode 100644
index 0000000..d8215fa
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/server.ttyS6.conf
@@ -0,0 +1,4 @@
+local-tty = ttyS6
+baud = 57600
+console-id = host5
+logfile = /var/log/obmc-console5.log
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/server.ttyS7.conf b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/server.ttyS7.conf
new file mode 100644
index 0000000..d36ffa8
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/server.ttyS7.conf
@@ -0,0 +1,4 @@
+local-tty = ttyS7
+baud = 57600
+console-id = host6
+logfile = /var/log/obmc-console6.log
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/server.ttyS8.conf b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/server.ttyS8.conf
new file mode 100644
index 0000000..4972435
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/server.ttyS8.conf
@@ -0,0 +1,4 @@
+local-tty = ttyS8
+baud = 57600
+console-id = host7
+logfile = /var/log/obmc-console7.log
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console_%.bbappend b/meta-facebook/recipes-phosphor/console/obmc-console_%.bbappend
index 6a6a628..197eb81 100644
--- a/meta-facebook/recipes-phosphor/console/obmc-console_%.bbappend
+++ b/meta-facebook/recipes-phosphor/console/obmc-console_%.bbappend
@@ -4,31 +4,29 @@
PACKAGECONFIG:remove = "ssh"
OBMC_CONSOLE_HOST_TTY = "ttyS2"
-OBMC_CONSOLE_TTYS:fb-compute-multihost = "ttyS0 ttyS1 ttyS2 ttyS3"
+OBMC_CONSOLE_TTYS = "${@' '.join(['ttyS{}'.format(i) for i in range(int(d.getVar('OBMC_CONSOLE_INST_CNT', True)) + 1) if 'ttyS{}'.format(i) != d.getVar('OBMC_BMC_TTY', True)])}"
+OBMC_BMC_TTY = "ttyS4"
+
+OBMC_CONSOLE_INST = "${@d.getVar('OBMC_HOST_INSTANCES', True)}"
+OBMC_CONSOLE_INST_CNT = "${@sum([1 for item in d.getVar('OBMC_CONSOLE_INST', True).split() if item.isdigit()])}"
+SERVER_CONFS = "${@' '.join(['file://server.ttyS{}.conf'.format(i) for i in range(int(d.getVar('OBMC_CONSOLE_INST_CNT', True)) + 1) if 'ttyS{}'.format(i) != d.getVar('OBMC_BMC_TTY', True)])}"
SRC_URI:append:fb-compute-singlehost = " file://server.ttyS2.conf"
-SRC_URI:append:fb-compute-multihost = " file://server.ttyS0.conf \
- file://server.ttyS1.conf \
- file://server.ttyS2.conf \
- file://server.ttyS3.conf \
+SRC_URI:append:fb-compute-multihost = " ${SERVER_CONFS} \
file://client.2200.conf \
file://client.2201.conf \
file://client.2202.conf \
file://client.2203.conf"
CLIENT_SERVICE_FILES_FMT = "file://${BPN}-{0}-ssh-host@.service \
- file://${BPN}-{0}-ssh-bic@.service \
- file://${BPN}-{0}-ssh-host.socket \
- file://${BPN}-{0}-ssh-bic.socket"
+ file://${BPN}-{0}-ssh-bic@.service"
SRC_URI:append:fb-compute-multihost = " \
${@compose_list(d, 'CLIENT_SERVICE_FILES_FMT', 'OBMC_CONSOLE_TTYS')}"
CLIENT_SERVICE_FMT = "${PN}-{0}-ssh-host@.service \
- ${PN}-{0}-ssh-bic@.service \
- ${PN}-{0}-ssh-host.socket \
- ${PN}-{0}-ssh-bic.socket"
+ ${PN}-{0}-ssh-bic@.service"
SYSTEMD_SERVICE:${PN}:append:fb-compute-multihost = " \
${@compose_list(d, 'CLIENT_SERVICE_FMT', 'OBMC_CONSOLE_TTYS')} \
@@ -36,7 +34,6 @@
SRC_URI:remove = "file://${BPN}.conf"
-SYSTEMD_SERVICE:${PN}:remove:fb-compute-multihost = "obmc-console-ssh.socket"
SYSTEMD_SERVICE:${PN}:remove:fb-compute-multihost = "obmc-console-ssh@.service"
PACKAGECONFIG:append:fb-compute-multihost = " concurrent-servers"
@@ -53,11 +50,8 @@
# Implement a script called "select-uart-mux" in project layer and follow the interface below:
# Usage: select-uart-mux <slot1|slot2|slot3|slot4> <host|bic>
install -m 0644 ${WORKDIR}/${BPN}-*-ssh-bic@.service ${D}${systemd_system_unitdir}
- install -m 0644 ${WORKDIR}/${BPN}-*-ssh-bic.socket ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/${BPN}-*-ssh-host@.service ${D}${systemd_system_unitdir}
- install -m 0644 ${WORKDIR}/${BPN}-*-ssh-host.socket ${D}${systemd_system_unitdir}
rm -rf ${D}${systemd_system_unitdir}/obmc-console-ssh@.service.d/
rm -f ${D}${systemd_system_unitdir}/${BPN}-ssh@.service
- rm -f ${D}${systemd_system_unitdir}/${BPN}-ssh.socket
}
diff --git a/meta-facebook/recipes-phosphor/hostlogger/phosphor-hostlogger/fb-compute-multihost/ttyS5.conf b/meta-facebook/recipes-phosphor/hostlogger/phosphor-hostlogger/fb-compute-multihost/ttyS5.conf
new file mode 100644
index 0000000..2af30d5
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/hostlogger/phosphor-hostlogger/fb-compute-multihost/ttyS5.conf
@@ -0,0 +1,7 @@
+SOCKET_ID=host4
+BUF_MAXSIZE=3000
+BUF_MAXTIME=0
+FLUSH_FULL=false
+HOST_STATE=/xyz/openbmc_project/state/host5
+OUT_DIR=/var/lib/obmc/hostlogs/host5
+MAX_FILES=10
diff --git a/meta-facebook/recipes-phosphor/hostlogger/phosphor-hostlogger/fb-compute-multihost/ttyS6.conf b/meta-facebook/recipes-phosphor/hostlogger/phosphor-hostlogger/fb-compute-multihost/ttyS6.conf
new file mode 100644
index 0000000..7b5d435
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/hostlogger/phosphor-hostlogger/fb-compute-multihost/ttyS6.conf
@@ -0,0 +1,7 @@
+SOCKET_ID=host5
+BUF_MAXSIZE=3000
+BUF_MAXTIME=0
+FLUSH_FULL=false
+HOST_STATE=/xyz/openbmc_project/state/host6
+OUT_DIR=/var/lib/obmc/hostlogs/host6
+MAX_FILES=10
diff --git a/meta-facebook/recipes-phosphor/hostlogger/phosphor-hostlogger/fb-compute-multihost/ttyS7.conf b/meta-facebook/recipes-phosphor/hostlogger/phosphor-hostlogger/fb-compute-multihost/ttyS7.conf
new file mode 100644
index 0000000..dbcdcd9
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/hostlogger/phosphor-hostlogger/fb-compute-multihost/ttyS7.conf
@@ -0,0 +1,7 @@
+SOCKET_ID=host6
+BUF_MAXSIZE=3000
+BUF_MAXTIME=0
+FLUSH_FULL=false
+HOST_STATE=/xyz/openbmc_project/state/host7
+OUT_DIR=/var/lib/obmc/hostlogs/host7
+MAX_FILES=10
diff --git a/meta-facebook/recipes-phosphor/hostlogger/phosphor-hostlogger/fb-compute-multihost/ttyS8.conf b/meta-facebook/recipes-phosphor/hostlogger/phosphor-hostlogger/fb-compute-multihost/ttyS8.conf
new file mode 100644
index 0000000..006f6be
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/hostlogger/phosphor-hostlogger/fb-compute-multihost/ttyS8.conf
@@ -0,0 +1,7 @@
+SOCKET_ID=host7
+BUF_MAXSIZE=3000
+BUF_MAXTIME=0
+FLUSH_FULL=false
+HOST_STATE=/xyz/openbmc_project/state/host8
+OUT_DIR=/var/lib/obmc/hostlogs/host8
+MAX_FILES=10
diff --git a/meta-facebook/recipes-phosphor/hostlogger/phosphor-hostlogger_%.bbappend b/meta-facebook/recipes-phosphor/hostlogger/phosphor-hostlogger_%.bbappend
index 5887a3d..c38571c 100644
--- a/meta-facebook/recipes-phosphor/hostlogger/phosphor-hostlogger_%.bbappend
+++ b/meta-facebook/recipes-phosphor/hostlogger/phosphor-hostlogger_%.bbappend
@@ -1,12 +1,13 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append:fb-compute-singlehost = " file://ttyS2.conf"
+OBMC_BMC_TTY = "ttyS4"
-SRC_URI:append:fb-compute-multihost = " file://ttyS0.conf \
- file://ttyS1.conf \
- file://ttyS2.conf \
- file://ttyS3.conf "
+HOST_LOGGER_INST = "${@d.getVar('OBMC_HOST_INSTANCES', True)}"
+HOST_LOGGER_INST_CNT = "${@sum([1 for item in d.getVar('HOST_LOGGER_INST', True).split() if item.isdigit()])}"
+HOST_LOGGER_CONFS = "${@' '.join(['file://ttyS{}.conf'.format(i) for i in range(int(d.getVar('HOST_LOGGER_INST_CNT', True)) + 1) if 'ttyS{}'.format(i) != d.getVar('OBMC_BMC_TTY', True)])}"
+SRC_URI:append:fb-compute-multihost = " ${HOST_LOGGER_CONFS}"
do_install:append() {