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 | 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 | |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 43 | do_install:append() { |
Andrew Jeffery | abf95ef | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 44 | # Install the server configuration |
| 45 | install -m 0755 -d ${D}${sysconfdir}/${BPN} |
| 46 | if test -f "${WORKDIR}/${BPN}.conf"; then |
| 47 | # Remove the upstream-provided server configuration |
| 48 | rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf |
| 49 | # Install the old-style server configuration |
| 50 | install -m 0644 ${WORKDIR}/${BPN}.conf ${D}${sysconfdir}/ |
| 51 | # Link the custom configuration to the required location |
Oskar Senft | eefb1dd | 2021-11-24 15:19:25 -0500 | [diff] [blame^] | 52 | ln -sr ${D}${sysconfdir}/${BPN}.conf ${D}${sysconfdir}/${BPN}/server.${OBMC_CONSOLE_HOST_TTY}.conf |
| 53 | elif test -f "${WORKDIR}/server.${OBMC_CONSOLE_HOST_TTY}.conf" ; then |
Andrew Jeffery | abf95ef | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 54 | # Remove the upstream-provided server configuration |
| 55 | rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf |
| 56 | # Install the package-provided new-style configuration |
Oskar Senft | eefb1dd | 2021-11-24 15:19:25 -0500 | [diff] [blame^] | 57 | install -m 0644 ${WORKDIR}/server.${OBMC_CONSOLE_HOST_TTY}.conf ${D}${sysconfdir}/${BPN}/ |
Andrew Jeffery | abf95ef | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 58 | else |
| 59 | # Otherwise, remove socket-id from the shipped configuration to |
| 60 | # align with the lack of a client configuration file |
Oskar Senft | eefb1dd | 2021-11-24 15:19:25 -0500 | [diff] [blame^] | 61 | sed -ri '/^socket-id =/d' ${D}${sysconfdir}/${BPN}/server.${OBMC_CONSOLE_HOST_TTY}.conf |
Andrew Jeffery | abf95ef | 2020-02-13 16:30:43 +1030 | [diff] [blame] | 62 | fi |
Jeremy Kerr | 882199e | 2016-03-17 17:35:27 +0800 | [diff] [blame] | 63 | } |