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