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 | 872125b | 2023-05-04 19:00:15 -0500 | [diff] [blame] | 9 | SRCREV = "4ee702a86592edcd1a1dd2c2ab94a50e0a49ee0d" |
Andrew Jeffery | 08413f2 | 2023-04-21 11:45:51 +0930 | [diff] [blame] | 10 | PACKAGECONFIG ??= "udev" |
| 11 | PACKAGECONFIG[udev] = "-Dudev=enabled,-Dudev=disabled,udev" |
| 12 | PACKAGECONFIG[concurrent-servers] = "-Dconcurrent-servers=true,-Dconcurrent-servers=false," |
Ed Tanous | 9936f86 | 2022-09-19 09:13:20 -0700 | [diff] [blame] | 13 | PV = "1.0+git${SRCPV}" |
| 14 | PR = "r1" |
Matthew Barth | 3e20a72 | 2016-09-26 16:26:27 -0500 | [diff] [blame] | 15 | |
Patrick Williams | bccaff3 | 2023-04-14 11:24:47 -0500 | [diff] [blame] | 16 | SRC_URI = "git://github.com/openbmc/obmc-console;branch=master;protocol=https" |
Brad Bishop | 58b6bd1 | 2019-06-19 16:42:18 -0400 | [diff] [blame] | 17 | SRC_URI += "file://${BPN}.conf" |
Ninad Palsule | 34d2144 | 2023-03-09 10:20:38 -0600 | [diff] [blame] | 18 | SRC_URI += "file://dropbear.env" |
Jeremy Kerr | 2a9a9d7 | 2016-04-12 13:10:12 +0800 | [diff] [blame] | 19 | |
Ed Tanous | 9936f86 | 2022-09-19 09:13:20 -0700 | [diff] [blame] | 20 | S = "${WORKDIR}/git" |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 21 | SYSTEMD_SERVICE:${PN} += "obmc-console-ssh@.service \ |
Andrew Jeffery | abf95ef | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 22 | obmc-console-ssh.socket \ |
| 23 | obmc-console@.service \ |
| 24 | " |
| 25 | |
Andrew Jeffery | 08413f2 | 2023-04-21 11:45:51 +0930 | [diff] [blame] | 26 | inherit meson pkgconfig |
Ed Tanous | 9936f86 | 2022-09-19 09:13:20 -0700 | [diff] [blame] | 27 | inherit obmc-phosphor-discovery-service |
| 28 | inherit systemd |
Vivekanand Veeracholan | e298243 | 2021-12-03 17:09:52 -0800 | [diff] [blame] | 29 | |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 30 | do_install:append() { |
Andrew Jeffery | abf95ef | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 31 | # Install the server configuration |
| 32 | install -m 0755 -d ${D}${sysconfdir}/${BPN} |
Ninad Palsule | 34d2144 | 2023-03-09 10:20:38 -0600 | [diff] [blame] | 33 | |
| 34 | install -m 0644 ${WORKDIR}/dropbear.env ${D}${sysconfdir}/${BPN}/ |
| 35 | |
Vivekanand Veeracholan | e298243 | 2021-12-03 17:09:52 -0800 | [diff] [blame] | 36 | # If the OBMC_CONSOLE_TTYS variable is used without the default OBMC_CONSOLE_HOST_TTY |
| 37 | # the port specific config file should be provided. If it is just OBMC_CONSOLE_HOST_TTY, |
| 38 | # 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] | 39 | if [ "${OBMC_CONSOLE_TTYS}" != "${OBMC_CONSOLE_HOST_TTY}" ]; then |
Andrew Jeffery | abf95ef | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 40 | rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf |
Vivekanand Veeracholan | e298243 | 2021-12-03 17:09:52 -0800 | [diff] [blame] | 41 | for CONSOLE in ${OBMC_CONSOLE_TTYS} |
| 42 | do |
| 43 | if test -f "${WORKDIR}/server.${CONSOLE}.conf" ; then |
| 44 | install -m 0644 ${WORKDIR}/server.${CONSOLE}.conf ${D}${sysconfdir}/${BPN}/ |
| 45 | else |
| 46 | bberror "Must provide port specific config files when using OBMC_CONSOLE_TTYS" \ |
| 47 | "Missing server.${CONSOLE}.conf" |
| 48 | fi |
| 49 | done |
Andrew Jeffery | abf95ef | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 50 | else |
Vivekanand Veeracholan | e298243 | 2021-12-03 17:09:52 -0800 | [diff] [blame] | 51 | # Port specific config file is prioritized over generic conf file. |
| 52 | # If port specific config file is not present and generic "obmc-console.conf" |
| 53 | # exists, it will be used. |
| 54 | if test -f "${WORKDIR}/server.${OBMC_CONSOLE_TTYS}.conf" ; then |
| 55 | # Remove the upstream-provided server configuration |
| 56 | rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf |
| 57 | # Install the package-provided new-style configuration |
| 58 | install -m 0644 ${WORKDIR}/server.${OBMC_CONSOLE_TTYS}.conf ${D}${sysconfdir}/${BPN}/ |
| 59 | elif test -f "${WORKDIR}/${BPN}.conf"; then |
| 60 | # Remove the upstream-provided server configuration |
| 61 | rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf |
| 62 | # Install the old-style server configuration |
| 63 | install -m 0644 ${WORKDIR}/${BPN}.conf ${D}${sysconfdir}/ |
| 64 | # Link the custom configuration to the required location |
| 65 | ln -sr ${D}${sysconfdir}/${BPN}.conf ${D}${sysconfdir}/${BPN}/server.${OBMC_CONSOLE_TTYS}.conf |
| 66 | else |
| 67 | # Otherwise, remove socket-id from the shipped configuration to |
| 68 | # align with the lack of a client configuration file |
| 69 | sed -ri '/^socket-id =/d' ${D}${sysconfdir}/${BPN}/server.${OBMC_CONSOLE_TTYS}.conf |
| 70 | fi |
Andrew Jeffery | abf95ef | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 71 | fi |
Jeremy Kerr | 882199e | 2016-03-17 17:35:27 +0800 | [diff] [blame] | 72 | } |
Ed Tanous | 9936f86 | 2022-09-19 09:13:20 -0700 | [diff] [blame] | 73 | |
Andrew Geissler | 99f5c87 | 2023-04-14 13:40:56 -0500 | [diff] [blame] | 74 | FILES:${PN} += "${systemd_system_unitdir}" |
Ed Tanous | 9936f86 | 2022-09-19 09:13:20 -0700 | [diff] [blame] | 75 | |
| 76 | TARGET_CFLAGS += "-fpic -O2" |
| 77 | |
| 78 | REGISTERED_SERVICES:${PN} += "obmc_console:tcp:2200:" |
| 79 | OBMC_CONSOLE_HOST_TTY ?= "ttyVUART0" |
| 80 | # Support multiple TTY ports using space separated list. |
| 81 | # Ex. OBMC_CONSOLE_TTYS = "ttyS1 ttyS2" |
| 82 | OBMC_CONSOLE_TTYS ?= "${OBMC_CONSOLE_HOST_TTY}" |