blob: f4f0d8a310ee2b8b93afddf0e6363b4ab6637db0 [file] [log] [blame]
Jeremy Kerr882199e2016-03-17 17:35:27 +08001SUMMARY = "OpenBMC console daemon"
2DESCRIPTION = "Daemon to handle UART console connections"
3HOMEPAGE = "http://github.com/openbmc/obmc-console"
Brad Bishop75f03872018-11-03 09:41:57 -07004LICENSE = "Apache-2.0"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
Ed Tanous9936f862022-09-19 09:13:20 -07006DEPENDS += "autoconf-archive-native \
7 systemd \
8 "
Andrew Geissler22059b72023-05-14 19:30:21 -05009SRCREV = "4e44c790ada85a0af47e0766471658e9f6cbc0b2"
Andrew Jeffery08413f22023-04-21 11:45:51 +093010PACKAGECONFIG ??= "udev"
11PACKAGECONFIG[udev] = "-Dudev=enabled,-Dudev=disabled,udev"
12PACKAGECONFIG[concurrent-servers] = "-Dconcurrent-servers=true,-Dconcurrent-servers=false,"
Ed Tanous9936f862022-09-19 09:13:20 -070013PV = "1.0+git${SRCPV}"
14PR = "r1"
Matthew Barth3e20a722016-09-26 16:26:27 -050015
Patrick Williamsbccaff32023-04-14 11:24:47 -050016SRC_URI = "git://github.com/openbmc/obmc-console;branch=master;protocol=https"
Brad Bishop58b6bd12019-06-19 16:42:18 -040017SRC_URI += "file://${BPN}.conf"
Ninad Palsule34d21442023-03-09 10:20:38 -060018SRC_URI += "file://dropbear.env"
Jeremy Kerr2a9a9d72016-04-12 13:10:12 +080019
Ed Tanous9936f862022-09-19 09:13:20 -070020S = "${WORKDIR}/git"
Patrick Williams12fc9392021-08-06 09:16:53 -050021SYSTEMD_SERVICE:${PN} += "obmc-console-ssh@.service \
Andrew Jefferyabf95ef2020-02-13 16:30:43 +103022 obmc-console-ssh.socket \
23 obmc-console@.service \
24 "
25
Andrew Jeffery08413f22023-04-21 11:45:51 +093026inherit meson pkgconfig
Ed Tanous9936f862022-09-19 09:13:20 -070027inherit obmc-phosphor-discovery-service
28inherit systemd
Vivekanand Veeracholane2982432021-12-03 17:09:52 -080029
Patrick Williams12fc9392021-08-06 09:16:53 -050030do_install:append() {
Andrew Jefferyabf95ef2020-02-13 16:30:43 +103031 # Install the server configuration
32 install -m 0755 -d ${D}${sysconfdir}/${BPN}
Ninad Palsule34d21442023-03-09 10:20:38 -060033
34 install -m 0644 ${WORKDIR}/dropbear.env ${D}${sysconfdir}/${BPN}/
35
Vivekanand Veeracholane2982432021-12-03 17:09:52 -080036 # If the OBMC_CONSOLE_TTYS variable is used without the default OBMC_CONSOLE_HOST_TTY
37 # the port specific config file should be provided. If it is just OBMC_CONSOLE_HOST_TTY,
38 # use the old style which supports both port specific or obmc-console.conf method.
Vivekanand Veeracholane7914122022-02-02 10:53:33 -080039 if [ "${OBMC_CONSOLE_TTYS}" != "${OBMC_CONSOLE_HOST_TTY}" ]; then
Andrew Jefferyabf95ef2020-02-13 16:30:43 +103040 rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf
Vivekanand Veeracholane2982432021-12-03 17:09:52 -080041 for CONSOLE in ${OBMC_CONSOLE_TTYS}
42 do
43 if test -f "${WORKDIR}/server.${CONSOLE}.conf" ; then
44 install -m 0644 ${WORKDIR}/server.${CONSOLE}.conf ${D}${sysconfdir}/${BPN}/
45 else
46 bberror "Must provide port specific config files when using OBMC_CONSOLE_TTYS" \
47 "Missing server.${CONSOLE}.conf"
48 fi
49 done
Andrew Jefferyabf95ef2020-02-13 16:30:43 +103050 else
Vivekanand Veeracholane2982432021-12-03 17:09:52 -080051 # Port specific config file is prioritized over generic conf file.
52 # If port specific config file is not present and generic "obmc-console.conf"
53 # exists, it will be used.
54 if test -f "${WORKDIR}/server.${OBMC_CONSOLE_TTYS}.conf" ; then
55 # Remove the upstream-provided server configuration
56 rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf
57 # Install the package-provided new-style configuration
58 install -m 0644 ${WORKDIR}/server.${OBMC_CONSOLE_TTYS}.conf ${D}${sysconfdir}/${BPN}/
59 elif test -f "${WORKDIR}/${BPN}.conf"; then
60 # Remove the upstream-provided server configuration
61 rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf
62 # Install the old-style server configuration
63 install -m 0644 ${WORKDIR}/${BPN}.conf ${D}${sysconfdir}/
64 # Link the custom configuration to the required location
65 ln -sr ${D}${sysconfdir}/${BPN}.conf ${D}${sysconfdir}/${BPN}/server.${OBMC_CONSOLE_TTYS}.conf
66 else
67 # Otherwise, remove socket-id from the shipped configuration to
68 # align with the lack of a client configuration file
69 sed -ri '/^socket-id =/d' ${D}${sysconfdir}/${BPN}/server.${OBMC_CONSOLE_TTYS}.conf
70 fi
Andrew Jefferyabf95ef2020-02-13 16:30:43 +103071 fi
Jeremy Kerr882199e2016-03-17 17:35:27 +080072}
Ed Tanous9936f862022-09-19 09:13:20 -070073
Andrew Geissler99f5c872023-04-14 13:40:56 -050074FILES:${PN} += "${systemd_system_unitdir}"
Ed Tanous9936f862022-09-19 09:13:20 -070075
76TARGET_CFLAGS += "-fpic -O2"
77
78REGISTERED_SERVICES:${PN} += "obmc_console:tcp:2200:"
79OBMC_CONSOLE_HOST_TTY ?= "ttyVUART0"
80# Support multiple TTY ports using space separated list.
81# Ex. OBMC_CONSOLE_TTYS = "ttyS1 ttyS2"
82OBMC_CONSOLE_TTYS ?= "${OBMC_CONSOLE_HOST_TTY}"