Jeremy Kerr | 882199e | 2016-03-17 17:35:27 +0800 | [diff] [blame] | 1 | SUMMARY = "OpenBMC console daemon" |
| 2 | DESCRIPTION = "Daemon to handle UART console connections" |
| 3 | HOMEPAGE = "http://github.com/openbmc/obmc-console" |
Brad Bishop | 75f0387 | 2018-11-03 09:41:57 -0700 | [diff] [blame] | 4 | LICENSE = "Apache-2.0" |
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" |
Ed Tanous | 9936f86 | 2022-09-19 09:13:20 -0700 | [diff] [blame] | 6 | DEPENDS += "autoconf-archive-native \ |
| 7 | systemd \ |
| 8 | " |
Andrew Geissler | 2a843a8 | 2023-02-10 06:00:35 -0600 | [diff] [blame^] | 9 | SRCREV = "397fd035e3adda2f3d36bfc5f2268372847778e7" |
Andrew Jeffery | abf95ef | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 10 | PACKAGECONFIG ??= "udev ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" |
| 11 | PACKAGECONFIG[udev] = "--with-udevdir=`pkg-config --variable=udevdir udev`,\ |
| 12 | --without-udevdir,udev" |
| 13 | PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir}, \ |
| 14 | --without-systemdsystemunitdir" |
Ed Tanous | 9936f86 | 2022-09-19 09:13:20 -0700 | [diff] [blame] | 15 | PV = "1.0+git${SRCPV}" |
| 16 | PR = "r1" |
Matthew Barth | 3e20a72 | 2016-09-26 16:26:27 -0500 | [diff] [blame] | 17 | |
Patrick Williams | bb99d22 | 2022-01-24 15:55:09 -0600 | [diff] [blame] | 18 | SRC_URI += "git://github.com/openbmc/obmc-console;branch=master;protocol=https" |
Brad Bishop | 58b6bd1 | 2019-06-19 16:42:18 -0400 | [diff] [blame] | 19 | SRC_URI += "file://${BPN}.conf" |
Jeremy Kerr | 2a9a9d7 | 2016-04-12 13:10:12 +0800 | [diff] [blame] | 20 | |
Ed Tanous | 9936f86 | 2022-09-19 09:13:20 -0700 | [diff] [blame] | 21 | S = "${WORKDIR}/git" |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 22 | SYSTEMD_SERVICE:${PN} += "obmc-console-ssh@.service \ |
Andrew Jeffery | abf95ef | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 23 | obmc-console-ssh.socket \ |
| 24 | obmc-console@.service \ |
| 25 | " |
| 26 | |
Ed Tanous | 9936f86 | 2022-09-19 09:13:20 -0700 | [diff] [blame] | 27 | inherit autotools pkgconfig |
| 28 | inherit obmc-phosphor-discovery-service |
| 29 | inherit systemd |
Vivekanand Veeracholan | e298243 | 2021-12-03 17:09:52 -0800 | [diff] [blame] | 30 | |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 31 | do_install:append() { |
Andrew Jeffery | abf95ef | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 32 | # Install the server configuration |
| 33 | install -m 0755 -d ${D}${sysconfdir}/${BPN} |
Vivekanand Veeracholan | e298243 | 2021-12-03 17:09:52 -0800 | [diff] [blame] | 34 | # If the OBMC_CONSOLE_TTYS variable is used without the default OBMC_CONSOLE_HOST_TTY |
| 35 | # the port specific config file should be provided. If it is just OBMC_CONSOLE_HOST_TTY, |
| 36 | # use the old style which supports both port specific or obmc-console.conf method. |
Vivekanand Veeracholan | e791412 | 2022-02-02 10:53:33 -0800 | [diff] [blame] | 37 | if [ "${OBMC_CONSOLE_TTYS}" != "${OBMC_CONSOLE_HOST_TTY}" ]; then |
Andrew Jeffery | abf95ef | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 38 | rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf |
Vivekanand Veeracholan | e298243 | 2021-12-03 17:09:52 -0800 | [diff] [blame] | 39 | for CONSOLE in ${OBMC_CONSOLE_TTYS} |
| 40 | do |
| 41 | if test -f "${WORKDIR}/server.${CONSOLE}.conf" ; then |
| 42 | install -m 0644 ${WORKDIR}/server.${CONSOLE}.conf ${D}${sysconfdir}/${BPN}/ |
| 43 | else |
| 44 | bberror "Must provide port specific config files when using OBMC_CONSOLE_TTYS" \ |
| 45 | "Missing server.${CONSOLE}.conf" |
| 46 | fi |
| 47 | done |
Andrew Jeffery | abf95ef | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 48 | else |
Vivekanand Veeracholan | e298243 | 2021-12-03 17:09:52 -0800 | [diff] [blame] | 49 | # Port specific config file is prioritized over generic conf file. |
| 50 | # If port specific config file is not present and generic "obmc-console.conf" |
| 51 | # exists, it will be used. |
| 52 | if test -f "${WORKDIR}/server.${OBMC_CONSOLE_TTYS}.conf" ; then |
| 53 | # Remove the upstream-provided server configuration |
| 54 | rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf |
| 55 | # Install the package-provided new-style configuration |
| 56 | install -m 0644 ${WORKDIR}/server.${OBMC_CONSOLE_TTYS}.conf ${D}${sysconfdir}/${BPN}/ |
| 57 | elif test -f "${WORKDIR}/${BPN}.conf"; then |
| 58 | # Remove the upstream-provided server configuration |
| 59 | rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf |
| 60 | # Install the old-style server configuration |
| 61 | install -m 0644 ${WORKDIR}/${BPN}.conf ${D}${sysconfdir}/ |
| 62 | # Link the custom configuration to the required location |
| 63 | ln -sr ${D}${sysconfdir}/${BPN}.conf ${D}${sysconfdir}/${BPN}/server.${OBMC_CONSOLE_TTYS}.conf |
| 64 | else |
| 65 | # Otherwise, remove socket-id from the shipped configuration to |
| 66 | # align with the lack of a client configuration file |
| 67 | sed -ri '/^socket-id =/d' ${D}${sysconfdir}/${BPN}/server.${OBMC_CONSOLE_TTYS}.conf |
| 68 | fi |
Andrew Jeffery | abf95ef | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 69 | fi |
Jeremy Kerr | 882199e | 2016-03-17 17:35:27 +0800 | [diff] [blame] | 70 | } |
Ed Tanous | 9936f86 | 2022-09-19 09:13:20 -0700 | [diff] [blame] | 71 | |
| 72 | FILES:${PN} += "${systemd_system_unitdir}/obmc-console-ssh@.service.d/use-socket.conf" |
| 73 | |
| 74 | TARGET_CFLAGS += "-fpic -O2" |
| 75 | |
| 76 | REGISTERED_SERVICES:${PN} += "obmc_console:tcp:2200:" |
| 77 | OBMC_CONSOLE_HOST_TTY ?= "ttyVUART0" |
| 78 | # Support multiple TTY ports using space separated list. |
| 79 | # Ex. OBMC_CONSOLE_TTYS = "ttyS1 ttyS2" |
| 80 | OBMC_CONSOLE_TTYS ?= "${OBMC_CONSOLE_HOST_TTY}" |