From eefb1dde08064d8400a9107500dde5d26ebad63b Mon Sep 17 00:00:00 2001 From: Oskar Senft Date: Wed, 24 Nov 2021 15:19:25 -0500 Subject: obmc-console: Re-introduce OBMC_CONSOLE_HOST_TTY variable This change re-adds the OBMC_CONSOLE_HOST_TTY configuration variable to define the host TTY that the obmc-consoler-server should attach to. This allows individual machines to use a TTY different from the default ttyVUART0. Follow-up changes can then remove duplicate code in machine meta layers that work around the missing support for OBMC_CONSOLE_HOST_TTY. Tested: Ran a build for both cases with obmc-console.conf and a server.ttyS2.conf. Checked that the files got installed in the correct place with the expected names in both cases. Signed-off-by: Oskar Senft Change-Id: I4fc408577827a827ee10de4f5757726a1eec4a66 --- meta-phosphor/recipes-phosphor/console/obmc-console_git.bb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'meta-phosphor/recipes-phosphor/console') diff --git a/meta-phosphor/recipes-phosphor/console/obmc-console_git.bb b/meta-phosphor/recipes-phosphor/console/obmc-console_git.bb index dccc05cc3..97b197c93 100644 --- a/meta-phosphor/recipes-phosphor/console/obmc-console_git.bb +++ b/meta-phosphor/recipes-phosphor/console/obmc-console_git.bb @@ -38,6 +38,8 @@ SYSTEMD_SERVICE:${PN} += "obmc-console-ssh@.service \ FILES:${PN} += "${systemd_system_unitdir}/obmc-console-ssh@.service.d/use-socket.conf" +OBMC_CONSOLE_HOST_TTY ?= "ttyVUART0" + do_install:append() { # Install the server configuration install -m 0755 -d ${D}${sysconfdir}/${BPN} @@ -47,15 +49,15 @@ do_install:append() { # Install the old-style server configuration install -m 0644 ${WORKDIR}/${BPN}.conf ${D}${sysconfdir}/ # Link the custom configuration to the required location - ln -sr ${D}${sysconfdir}/${BPN}.conf ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf - elif test -f "${WORKDIR}/server.ttyVUART0.conf" ; then + ln -sr ${D}${sysconfdir}/${BPN}.conf ${D}${sysconfdir}/${BPN}/server.${OBMC_CONSOLE_HOST_TTY}.conf + elif test -f "${WORKDIR}/server.${OBMC_CONSOLE_HOST_TTY}.conf" ; then # Remove the upstream-provided server configuration rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf # Install the package-provided new-style configuration - install -m 0644 ${WORKDIR}/server.ttyVUART0.conf ${D}${sysconfdir}/${BPN}/ + install -m 0644 ${WORKDIR}/server.${OBMC_CONSOLE_HOST_TTY}.conf ${D}${sysconfdir}/${BPN}/ else # Otherwise, remove socket-id from the shipped configuration to # align with the lack of a client configuration file - sed -ri '/^socket-id =/d' ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf + sed -ri '/^socket-id =/d' ${D}${sysconfdir}/${BPN}/server.${OBMC_CONSOLE_HOST_TTY}.conf fi } -- cgit v1.2.3 From e29824360d02936fc1431f612bf89bb49d19b335 Mon Sep 17 00:00:00 2001 From: Vivekanand Veeracholan Date: Fri, 3 Dec 2021 17:09:52 -0800 Subject: meta-phosphor: obmc-console: Add support for multiple ports 1. Add support to install multiple console port configuration files. OBMC_CONSOLE_TTYS is space separated list to set multiple ports. Defaults to OBMC_CONSOLE_HOST_TTY. 2. Prioritize picking up port specific configuration over generic one. Tested: Built for single and multi port configuration and verified the presence of correct config file in sysconf directory. Signed-off-by: Vivekanand Veeracholan Change-Id: Ic918b5830f972adbcfa14e2befa4e3420698825f --- .../recipes-phosphor/console/obmc-console_git.bb | 54 ++++++++++++++++------ 1 file changed, 40 insertions(+), 14 deletions(-) (limited to 'meta-phosphor/recipes-phosphor/console') diff --git a/meta-phosphor/recipes-phosphor/console/obmc-console_git.bb b/meta-phosphor/recipes-phosphor/console/obmc-console_git.bb index 97b197c93..bda58aab7 100644 --- a/meta-phosphor/recipes-phosphor/console/obmc-console_git.bb +++ b/meta-phosphor/recipes-phosphor/console/obmc-console_git.bb @@ -40,24 +40,50 @@ FILES:${PN} += "${systemd_system_unitdir}/obmc-console-ssh@.service.d/use-socket OBMC_CONSOLE_HOST_TTY ?= "ttyVUART0" +# Support multiple TTY ports using space separated list. +# Ex. OBMC_CONSOLE_TTYS = "ttyS1 ttyS2" +OBMC_CONSOLE_TTYS ?= "${OBMC_CONSOLE_HOST_TTY}" + do_install:append() { # Install the server configuration install -m 0755 -d ${D}${sysconfdir}/${BPN} - if test -f "${WORKDIR}/${BPN}.conf"; then - # Remove the upstream-provided server configuration - rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf - # Install the old-style server configuration - install -m 0644 ${WORKDIR}/${BPN}.conf ${D}${sysconfdir}/ - # Link the custom configuration to the required location - ln -sr ${D}${sysconfdir}/${BPN}.conf ${D}${sysconfdir}/${BPN}/server.${OBMC_CONSOLE_HOST_TTY}.conf - elif test -f "${WORKDIR}/server.${OBMC_CONSOLE_HOST_TTY}.conf" ; then - # Remove the upstream-provided server configuration + + # If the OBMC_CONSOLE_TTYS variable is used without the default OBMC_CONSOLE_HOST_TTY + # the port specific config file should be provided. If it is just OBMC_CONSOLE_HOST_TTY, + # use the old style which supports both port specific or obmc-console.conf method. + if [[ "${OBMC_CONSOLE_TTYS}" != "${OBMC_CONSOLE_HOST_TTY}" ]]; then rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf - # Install the package-provided new-style configuration - install -m 0644 ${WORKDIR}/server.${OBMC_CONSOLE_HOST_TTY}.conf ${D}${sysconfdir}/${BPN}/ + + for CONSOLE in ${OBMC_CONSOLE_TTYS} + do + if test -f "${WORKDIR}/server.${CONSOLE}.conf" ; then + install -m 0644 ${WORKDIR}/server.${CONSOLE}.conf ${D}${sysconfdir}/${BPN}/ + else + bberror "Must provide port specific config files when using OBMC_CONSOLE_TTYS" \ + "Missing server.${CONSOLE}.conf" + fi + done else - # Otherwise, remove socket-id from the shipped configuration to - # align with the lack of a client configuration file - sed -ri '/^socket-id =/d' ${D}${sysconfdir}/${BPN}/server.${OBMC_CONSOLE_HOST_TTY}.conf + # Port specific config file is prioritized over generic conf file. + # If port specific config file is not present and generic "obmc-console.conf" + # exists, it will be used. + if test -f "${WORKDIR}/server.${OBMC_CONSOLE_TTYS}.conf" ; then + # Remove the upstream-provided server configuration + rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf + # Install the package-provided new-style configuration + install -m 0644 ${WORKDIR}/server.${OBMC_CONSOLE_TTYS}.conf ${D}${sysconfdir}/${BPN}/ + elif test -f "${WORKDIR}/${BPN}.conf"; then + # Remove the upstream-provided server configuration + rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf + # Install the old-style server configuration + install -m 0644 ${WORKDIR}/${BPN}.conf ${D}${sysconfdir}/ + # Link the custom configuration to the required location + ln -sr ${D}${sysconfdir}/${BPN}.conf ${D}${sysconfdir}/${BPN}/server.${OBMC_CONSOLE_TTYS}.conf + else + # Otherwise, remove socket-id from the shipped configuration to + # align with the lack of a client configuration file + sed -ri '/^socket-id =/d' ${D}${sysconfdir}/${BPN}/server.${OBMC_CONSOLE_TTYS}.conf + fi fi + } -- cgit v1.2.3