meta-facebook: simplify obmc-console config

We not longer plan to support the SSH console ports for obmc-console on
our servers and want to use OpenSSH.  A lot of the obmc-console bbappend
can therefore be simplified (and we don't even need a distinction
between multi-host and single-host).

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I86269eb1fcb45a8e43271204bd303e50a8dcbaf1
diff --git a/meta-facebook/conf/recipes/fb-consoles.inc b/meta-facebook/conf/recipes/fb-consoles.inc
index 47cfcf3..2d837ca 100644
--- a/meta-facebook/conf/recipes/fb-consoles.inc
+++ b/meta-facebook/conf/recipes/fb-consoles.inc
@@ -19,5 +19,6 @@
     return " ".join(consoles[:hosts])
 
 OBMC_CONSOLE_TTYS = "${@fb_get_consoles(d)}"
+OBMC_CONSOLE_TTYS:fb-nohost = ""
 
 
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS0-ssh-bic.socket b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS0-ssh-bic.socket
deleted file mode 100644
index 64ff545..0000000
--- a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS0-ssh-bic.socket
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Phosphor BIC Console SSH socket for Slot1
-Wants=obmc-console@ttyS0.service
-
-[Socket]
-ListenStream=2300
-Accept=yes
-
-[Install]
-WantedBy=sockets.target
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS0-ssh-host.socket b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS0-ssh-host.socket
deleted file mode 100644
index b98afec..0000000
--- a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS0-ssh-host.socket
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Phosphor Host Console SSH socket for Slot1
-Wants=obmc-console@ttyS0.service
-
-[Socket]
-ListenStream=2200
-Accept=yes
-
-[Install]
-WantedBy=sockets.target
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS1-ssh-bic.socket b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS1-ssh-bic.socket
deleted file mode 100644
index 5308c7b..0000000
--- a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS1-ssh-bic.socket
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Phosphor BIC Console SSH socket for Slot2
-Wants=obmc-console@ttyS1.service
-
-[Socket]
-ListenStream=2301
-Accept=yes
-
-[Install]
-WantedBy=sockets.target
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS1-ssh-host.socket b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS1-ssh-host.socket
deleted file mode 100644
index 1bc6290..0000000
--- a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS1-ssh-host.socket
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Phosphor Host Console SSH socket for Slot2
-Wants=obmc-console@ttyS1.service
-
-[Socket]
-ListenStream=2201
-Accept=yes
-
-[Install]
-WantedBy=sockets.target
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS2-ssh-bic.socket b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS2-ssh-bic.socket
deleted file mode 100644
index 369cb57..0000000
--- a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS2-ssh-bic.socket
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Phosphor BIC Console SSH socket for Slot3
-Wants=obmc-console@ttyS2.service
-
-[Socket]
-ListenStream=2302
-Accept=yes
-
-[Install]
-WantedBy=sockets.target
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS2-ssh-host.socket b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS2-ssh-host.socket
deleted file mode 100644
index f6bd98e..0000000
--- a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS2-ssh-host.socket
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Phosphor Host Console SSH socket for Slot3
-Wants=obmc-console@ttyS2.service
-
-[Socket]
-ListenStream=2202
-Accept=yes
-
-[Install]
-WantedBy=sockets.target
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS3-ssh-bic.socket b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS3-ssh-bic.socket
deleted file mode 100644
index c6ba36f..0000000
--- a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS3-ssh-bic.socket
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Phosphor BIC Console SSH socket for Slot4
-Wants=obmc-console@ttyS3.service
-
-[Socket]
-ListenStream=2303
-Accept=yes
-
-[Install]
-WantedBy=sockets.target
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS3-ssh-host.socket b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS3-ssh-host.socket
deleted file mode 100644
index 48ccd93..0000000
--- a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-multihost/obmc-console-ttyS3-ssh-host.socket
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Phosphor Host Console SSH socket for Slot4
-Wants=obmc-console@ttyS3.service
-
-[Socket]
-ListenStream=2203
-Accept=yes
-
-[Install]
-WantedBy=sockets.target
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console_%.bbappend b/meta-facebook/recipes-phosphor/console/obmc-console_%.bbappend
index 81c2526..9f6022c 100644
--- a/meta-facebook/recipes-phosphor/console/obmc-console_%.bbappend
+++ b/meta-facebook/recipes-phosphor/console/obmc-console_%.bbappend
@@ -4,51 +4,10 @@
 
 # Disable obmc-console ssh ports.
 PACKAGECONFIG:remove = "ssh"
+# Remove default config.
+SRC_URI:remove = "file://${BPN}.conf"
 
 OBMC_BMC_TTY = "ttyS4"
 SERVER_CONFS = "${@ ' '.join([ f'file://server.{i}.conf' for i in d.getVar('OBMC_CONSOLE_TTYS', True).split() ])}"
 
-SRC_URI:append:fb-compute-singlehost = " ${SERVER_CONFS}"
-
-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"
-
-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"
-
-SYSTEMD_SERVICE:${PN}:append:fb-compute-multihost = " \
-                        ${@compose_list(d, 'CLIENT_SERVICE_FMT', 'OBMC_CONSOLE_TTYS')} \
-                        "
-
-SRC_URI:remove = "file://${BPN}.conf"
-
-SYSTEMD_SERVICE:${PN}:remove:fb-compute-multihost = "obmc-console-ssh@.service"
-
-PACKAGECONFIG:append:fb-compute-multihost = " concurrent-servers"
-
-do_install:append() {
-        # Install the server configuration
-        install -m 0755 -d ${D}${sysconfdir}/${BPN}
-        install -m 0644 ${WORKDIR}/*.conf ${D}${sysconfdir}/${BPN}/
-        # Remove upstream-provided server configuration
-        rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf
-}
-
-do_install:append:fb-compute-multihost() {
-        # 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-host@.service ${D}${systemd_system_unitdir}
-
-        rm -rf ${D}${systemd_system_unitdir}/obmc-console-ssh@.service.d/
-        rm -f ${D}${systemd_system_unitdir}/${BPN}-ssh@.service
-}
+SRC_URI:append = " ${SERVER_CONFS}"