blob: 195b276dfc8b596fa4628c07b7570cd9f561294c [file] [log] [blame]
Jeremy Kerr49208ee2016-03-17 17:35:27 +08001SUMMARY = "OpenBMC console daemon"
2DESCRIPTION = "Daemon to handle UART console connections"
3HOMEPAGE = "http://github.com/openbmc/obmc-console"
4PR = "r1"
Patrick Venturee7a76eb2018-11-03 09:41:57 -07005LICENSE = "Apache-2.0"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
Jeremy Kerr49208ee2016-03-17 17:35:27 +08007
Cheng C Yang5e9d3392019-01-30 14:31:56 +08008inherit autotools pkgconfig
Ratan Gupta653779c2016-10-01 14:57:15 -05009inherit obmc-phosphor-discovery-service
Andrew Jeffery6e0e25f2020-02-13 16:30:43 +103010inherit systemd
Jeremy Kerr49208ee2016-03-17 17:35:27 +080011
Andrew Jeffery6e0e25f2020-02-13 16:30:43 +103012S = "${WORKDIR}/git"
13
14TARGET_CFLAGS += "-fpic -O2"
15
16PACKAGECONFIG ??= "udev ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
17PACKAGECONFIG[udev] = "--with-udevdir=`pkg-config --variable=udevdir udev`,\
18 --without-udevdir,udev"
19PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir}, \
20 --without-systemdsystemunitdir"
Jeremy Kerr49208ee2016-03-17 17:35:27 +080021
Cheng C Yang5e9d3392019-01-30 14:31:56 +080022DEPENDS += "autoconf-archive-native \
23 systemd \
Andrew Jeffery6e0e25f2020-02-13 16:30:43 +103024 "
Matthew Barth3cc6f402016-09-26 16:26:27 -050025
Jeremy Kerr49208ee2016-03-17 17:35:27 +080026SRC_URI += "git://github.com/openbmc/obmc-console"
Brad Bishopb9a91af2019-06-19 16:42:18 -040027SRC_URI += "file://${BPN}.conf"
Jeremy Kerred9fafd2016-04-12 13:10:12 +080028
Andrew Geissler11b52d22020-04-25 01:01:38 +000029SRCREV = "d802b11942abc8a4641976e70d567758ef0bbd58"
Brad Bishopbd6ae762018-04-12 11:11:49 -040030PV = "1.0+git${SRCPV}"
Jeremy Kerr49208ee2016-03-17 17:35:27 +080031
asmithakarun2d6aedf2019-06-24 05:28:05 -050032REGISTERED_SERVICES_${PN} += "obmc_console:tcp:2200:"
Ratan Gupta653779c2016-10-01 14:57:15 -050033
Andrew Jeffery6e0e25f2020-02-13 16:30:43 +103034SYSTEMD_SERVICE_${PN} += "obmc-console-ssh@.service \
35 obmc-console-ssh.socket \
36 obmc-console@.service \
37 "
38
39FILES_${PN} += "/lib/systemd/system/obmc-console-ssh@.service.d/use-socket.conf"
40
Jeremy Kerr49208ee2016-03-17 17:35:27 +080041do_install_append() {
Andrew Jeffery6e0e25f2020-02-13 16:30:43 +103042 # 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 Kerr49208ee2016-03-17 17:35:27 +080061}