blob: 1073f1603aa1e81ba9c148fe9c1f57ce422ec58f [file] [log] [blame]
Artem Senichev8135af92018-11-02 16:46:13 +03001SUMMARY = "Phosphor Host logger"
2DESCRIPTION = "Save log messages from host's console to the persistent storage."
3HOMEPAGE = "https://github.com/openbmc/phosphor-hostlogger"
4PR = "r1"
5PV = "1.0+git${SRCPV}"
6
Artem Senichevc4fddbe2020-06-16 09:49:50 +03007inherit meson
Artem Senichev8135af92018-11-02 16:46:13 +03008inherit systemd
9
10# License info
11LICENSE = "Apache-2.0"
12LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
13
14# Dependencies
Artem Senichevc4fddbe2020-06-16 09:49:50 +030015DEPENDS += " \
16 phosphor-logging \
17 zlib \
Alexander Filippov74dc8702019-01-10 12:38:09 +030018 "
Artem Senichev8135af92018-11-02 16:46:13 +030019RDEPENDS_${PN} += "obmc-console"
20RRECOMMENDS_${PN} += "phosphor-debug-collector"
21
Artem Senichev8135af92018-11-02 16:46:13 +030022# Source code repository
23S = "${WORKDIR}/git"
24SRC_URI = "git://github.com/openbmc/phosphor-hostlogger"
Artem Senichevc4fddbe2020-06-16 09:49:50 +030025SRCREV = "e8837d59c789b4e4b928afc0d6ba38110a394d07"
26
27# Systemd service template
28SYSTEMD_PACKAGES = "${PN}"
29SYSTEMD_SERVICE_${PN} = "hostlogger@.service"
30
31# Default service instance to install (single-host mode)
32DEFAULT_INSTANCE = "ttyVUART0"
33DEFAULT_SERVICE = "hostlogger@${DEFAULT_INSTANCE}.service"
34
35# Multi-host mode setup - list of configuration files to install, can be added
36# via SRC_URI in a bbappend. The file name is the name of the service instance,
37# which should match the corresponding instance of the obmc-console service.
38CUSTOM_CONFIGS = "${@custom_configs('${WORKDIR}')}"
39CUSTOM_SERVICES = "${@custom_services('${CUSTOM_CONFIGS}')}"
40
41# Preset systemd units
42SYSTEMD_SERVICE_${PN} += "${@'${CUSTOM_SERVICES}' if len('${CUSTOM_SERVICES}') \
43 else '${DEFAULT_SERVICE}'}"
44
45# Gets list of custom config files in a directory
46def custom_configs(workdir):
47 if os.path.exists(workdir):
48 return ' '.join([f for f in os.listdir(workdir) if f.endswith('.conf')])
49
50# Get list of custom service instances
51def custom_services(configs):
52 return ' '.join(['hostlogger@' + i.replace('.conf', '.service') \
53 for i in configs.split()])
54
55do_install_append() {
56 # Install config files
57 if [ -n "${CUSTOM_CONFIGS}" ]; then
58 for CONFIG_FILE in ${CUSTOM_CONFIGS}; do
59 install -Dm 0644 ${WORKDIR}/${CONFIG_FILE} \
60 ${D}${sysconfdir}/hostlogger/${CONFIG_FILE}
61 done
62 else
63 install -Dm 0644 ${S}/default.conf \
64 ${D}${sysconfdir}/hostlogger/${DEFAULT_INSTANCE}.conf
65 fi
66}