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 | |
Jeremy Kerr | 882199e | 2016-03-17 17:35:27 +0800 | [diff] [blame] | 26 | SRC_URI += "git://github.com/openbmc/obmc-console" |
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 | 9020fc3 | 2021-04-27 23:50:46 +0000 | [diff] [blame] | 29 | SRCREV = "cabd9db06da91ecf2198c1baaf20360d1424c2f3" |
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 | |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 41 | do_install:append() { |
Andrew Jeffery | abf95ef | 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 | 882199e | 2016-03-17 17:35:27 +0800 | [diff] [blame] | 61 | } |