summaryrefslogtreecommitdiff
path: root/meta-phosphor/recipes-phosphor/console/obmc-console_git.bb
blob: dccc05cc304278427c5f166035873ddde095e953 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
SUMMARY = "OpenBMC console daemon"
DESCRIPTION = "Daemon to handle UART console connections"
HOMEPAGE = "http://github.com/openbmc/obmc-console"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"

inherit autotools pkgconfig
inherit obmc-phosphor-discovery-service
inherit systemd

S = "${WORKDIR}/git"

TARGET_CFLAGS += "-fpic -O2"

PACKAGECONFIG ??= "udev ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
PACKAGECONFIG[udev] = "--with-udevdir=`pkg-config --variable=udevdir udev`,\
                       --without-udevdir,udev"
PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir}, \
                          --without-systemdsystemunitdir"

DEPENDS += "autoconf-archive-native \
            systemd \
           "

SRC_URI += "git://github.com/openbmc/obmc-console"
SRC_URI += "file://${BPN}.conf"

SRCREV = "467d3010344d974f3051162d29f13f49c0eb8ea3"
PV = "1.0+git${SRCPV}"

REGISTERED_SERVICES:${PN} += "obmc_console:tcp:2200:"

SYSTEMD_SERVICE:${PN} += "obmc-console-ssh@.service \
                obmc-console-ssh.socket \
                obmc-console@.service \
                "

FILES:${PN} += "${systemd_system_unitdir}/obmc-console-ssh@.service.d/use-socket.conf"

do_install:append() {
        # Install the server configuration
        install -m 0755 -d ${D}${sysconfdir}/${BPN}
        if test -f "${WORKDIR}/${BPN}.conf"; then
                # Remove the upstream-provided server configuration
                rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf
                # Install the old-style server configuration
                install -m 0644 ${WORKDIR}/${BPN}.conf ${D}${sysconfdir}/
                # Link the custom configuration to the required location
                ln -sr ${D}${sysconfdir}/${BPN}.conf ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf
        elif test -f "${WORKDIR}/server.ttyVUART0.conf" ; then
                # Remove the upstream-provided server configuration
                rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf
                # Install the package-provided new-style configuration
                install -m 0644 ${WORKDIR}/server.ttyVUART0.conf ${D}${sysconfdir}/${BPN}/
        else
                # Otherwise, remove socket-id from the shipped configuration to
                # align with the lack of a client configuration file
                sed -ri '/^socket-id =/d' ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf
        fi
}