Jeremy Kerr | 49208ee | 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" |
Patrick Venture | e7a76eb | 2018-11-03 09:41:57 -0700 | [diff] [blame] | 5 | LICENSE = "Apache-2.0" |
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" |
Jeremy Kerr | 49208ee | 2016-03-17 17:35:27 +0800 | [diff] [blame] | 7 | |
Cheng C Yang | 5e9d339 | 2019-01-30 14:31:56 +0800 | [diff] [blame] | 8 | inherit autotools pkgconfig |
Ratan Gupta | 653779c | 2016-10-01 14:57:15 -0500 | [diff] [blame] | 9 | inherit obmc-phosphor-discovery-service |
Andrew Jeffery | 6e0e25f | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 10 | inherit systemd |
Jeremy Kerr | 49208ee | 2016-03-17 17:35:27 +0800 | [diff] [blame] | 11 | |
Andrew Jeffery | 6e0e25f | 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 | 49208ee | 2016-03-17 17:35:27 +0800 | [diff] [blame] | 21 | |
Cheng C Yang | 5e9d339 | 2019-01-30 14:31:56 +0800 | [diff] [blame] | 22 | DEPENDS += "autoconf-archive-native \ |
| 23 | systemd \ |
Andrew Jeffery | 6e0e25f | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 24 | " |
Matthew Barth | 3cc6f40 | 2016-09-26 16:26:27 -0500 | [diff] [blame] | 25 | |
Jeremy Kerr | 49208ee | 2016-03-17 17:35:27 +0800 | [diff] [blame] | 26 | SRC_URI += "git://github.com/openbmc/obmc-console" |
Brad Bishop | b9a91af | 2019-06-19 16:42:18 -0400 | [diff] [blame] | 27 | SRC_URI += "file://${BPN}.conf" |
Jeremy Kerr | ed9fafd | 2016-04-12 13:10:12 +0800 | [diff] [blame] | 28 | |
Andrew Geissler | 11b52d2 | 2020-04-25 01:01:38 +0000 | [diff] [blame] | 29 | SRCREV = "d802b11942abc8a4641976e70d567758ef0bbd58" |
Brad Bishop | bd6ae76 | 2018-04-12 11:11:49 -0400 | [diff] [blame] | 30 | PV = "1.0+git${SRCPV}" |
Jeremy Kerr | 49208ee | 2016-03-17 17:35:27 +0800 | [diff] [blame] | 31 | |
asmithakarun | 2d6aedf | 2019-06-24 05:28:05 -0500 | [diff] [blame] | 32 | REGISTERED_SERVICES_${PN} += "obmc_console:tcp:2200:" |
Ratan Gupta | 653779c | 2016-10-01 14:57:15 -0500 | [diff] [blame] | 33 | |
Andrew Jeffery | 6e0e25f | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 34 | SYSTEMD_SERVICE_${PN} += "obmc-console-ssh@.service \ |
| 35 | obmc-console-ssh.socket \ |
| 36 | obmc-console@.service \ |
| 37 | " |
| 38 | |
| 39 | FILES_${PN} += "/lib/systemd/system/obmc-console-ssh@.service.d/use-socket.conf" |
| 40 | |
Jeremy Kerr | 49208ee | 2016-03-17 17:35:27 +0800 | [diff] [blame] | 41 | do_install_append() { |
Andrew Jeffery | 6e0e25f | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 42 | # Install the server configuration |
| 43 | install -m 0755 -d ${D}${sysconfdir}/${BPN} |
| 44 | if test -f "${WORKDIR}/${BPN}.conf"; then |
| 45 | # Remove the upstream-provided server configuration |
| 46 | rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf |
| 47 | # Install the old-style server configuration |
| 48 | install -m 0644 ${WORKDIR}/${BPN}.conf ${D}${sysconfdir}/ |
| 49 | # Link the custom configuration to the required location |
| 50 | ln -sr ${D}${sysconfdir}/${BPN}.conf ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf |
| 51 | elif test -f "${WORKDIR}/server.ttyVUART0.conf" ; then |
| 52 | # Remove the upstream-provided server configuration |
| 53 | rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf |
| 54 | # Install the package-provided new-style configuration |
| 55 | install -m 0644 ${WORKDIR}/server.ttyVUART0.conf ${D}${sysconfdir}/${BPN}/ |
| 56 | else |
| 57 | # Otherwise, remove socket-id from the shipped configuration to |
| 58 | # align with the lack of a client configuration file |
| 59 | sed -ri '/^socket-id =/d' ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf |
| 60 | fi |
Jeremy Kerr | 49208ee | 2016-03-17 17:35:27 +0800 | [diff] [blame] | 61 | } |