summaryrefslogtreecommitdiffstats
path: root/meta-phosphor/common/recipes-phosphor/console
diff options
context:
space:
mode:
authorVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2016-10-01 11:34:42 -0500
committerPatrick Williams <patrick@stwcx.xyz>2016-10-06 02:44:33 +0000
commite4bfd68832fc670ef0db182ef48d4a56a5741b96 (patch)
tree8f3dcdd813212678b73c94c547eecf07c6d40068 /meta-phosphor/common/recipes-phosphor/console
parente6d12955a0be76ecd837c9d5809d138e737342de (diff)
downloadtalos-openbmc-e4bfd68832fc670ef0db182ef48d4a56a5741b96.tar.gz
talos-openbmc-e4bfd68832fc670ef0db182ef48d4a56a5741b96.zip
Dynamically start console server on a given TTY
obmc-console-server currently uses /dev/ttyVUART0, which is a symlink to ttyS0. This patch allows the TTY number to be populated based on some source and then passes the TTY number on which the console server needs to be started. This patch also makes sure that obmc-console-ssh@.service is instantiated only if the console server is started on the TTY device mentioned above. Fixes openbmc/openbmc#407 Change-Id: If7a6f0e5b899a32225af262e72a3292fb619920a Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/console')
-rw-r--r--meta-phosphor/common/recipes-phosphor/console/obmc-console.bb6
-rw-r--r--meta-phosphor/common/recipes-phosphor/console/obmc-console/obmc-console-ssh@.service2
-rw-r--r--meta-phosphor/common/recipes-phosphor/console/obmc-console/obmc-console.service12
-rw-r--r--meta-phosphor/common/recipes-phosphor/console/obmc-console/obmc-console@.service12
4 files changed, 17 insertions, 15 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/console/obmc-console.bb b/meta-phosphor/common/recipes-phosphor/console/obmc-console.bb
index f6c1db2d0..9d3315cf5 100644
--- a/meta-phosphor/common/recipes-phosphor/console/obmc-console.bb
+++ b/meta-phosphor/common/recipes-phosphor/console/obmc-console.bb
@@ -18,13 +18,15 @@ SRC_URI += "file://${PN}.conf"
SRCREV = "44580de4e2170c8ee06dbf401315d3acfcf52b22"
REGISTERED_SERVICES_${PN} += "obmc_console:tcp:2200"
+OBMC_CONSOLE_HOST_TTY ?= "ttyVUART0"
+SYSTEMD_SUBSTITUTIONS += "OBMC_CONSOLE_HOST_TTY:${OBMC_CONSOLE_HOST_TTY}:${PN}-ssh@.service"
SYSTEMD_SERVICE_${PN} = " \
- ${PN}.service \
+ ${PN}@.service \
+ ${PN}@${OBMC_CONSOLE_HOST_TTY}.service \
${PN}-ssh.socket \
${PN}-ssh@.service \
"
-
do_install_append() {
install -m 0755 -d ${D}${sysconfdir}
install -m 0644 ${WORKDIR}/${PN}.conf ${D}${sysconfdir}/${PN}.conf
diff --git a/meta-phosphor/common/recipes-phosphor/console/obmc-console/obmc-console-ssh@.service b/meta-phosphor/common/recipes-phosphor/console/obmc-console/obmc-console-ssh@.service
index 198383ccb..f8fa7cc7c 100644
--- a/meta-phosphor/common/recipes-phosphor/console/obmc-console/obmc-console-ssh@.service
+++ b/meta-phosphor/common/recipes-phosphor/console/obmc-console/obmc-console-ssh@.service
@@ -1,6 +1,6 @@
[Unit]
Description=Phosphor Host Console SSH Per-Connection
-Wants=obmc-console.service
+Wants=obmc-console@{OBMC_CONSOLE_HOST_TTY}.service
[Service]
Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear"
diff --git a/meta-phosphor/common/recipes-phosphor/console/obmc-console/obmc-console.service b/meta-phosphor/common/recipes-phosphor/console/obmc-console/obmc-console.service
deleted file mode 100644
index b9a6c99a4..000000000
--- a/meta-phosphor/common/recipes-phosphor/console/obmc-console/obmc-console.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=Phosphor Console Muxer
-BindsTo=dev-ttyVUART0.device
-After=dev-ttyVUART0.device
-
-[Service]
-# TODO: openbmc/obmc-console#5 - Restore this to 'obmc-console-server ttyVUART0'
-ExecStart=/bin/sh -c 'realpath /dev/ttyVUART0 | xargs basename | xargs {sbindir}/obmc-console-server'
-Restart=always
-
-[Install]
-WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/meta-phosphor/common/recipes-phosphor/console/obmc-console/obmc-console@.service b/meta-phosphor/common/recipes-phosphor/console/obmc-console/obmc-console@.service
new file mode 100644
index 000000000..d84fca90b
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/console/obmc-console/obmc-console@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Phosphor Console Muxer listening on device /dev/%I
+BindsTo=dev-%i.device
+After=dev-%i.device
+
+[Service]
+# TODO: openbmc/obmc-console#5 - Restore this to 'obmc-console-server ttyVUART0'
+ExecStart=/bin/sh -c 'realpath /dev/%i | xargs basename | xargs {sbindir}/obmc-console-server'
+Restart=always
+
+[Install]
+WantedBy={SYSTEMD_DEFAULT_TARGET}
OpenPOWER on IntegriCloud