blob: e536cbb41c0b6933624abe7b7ac70b592af1c02a [file] [log] [blame]
Artem Senichevfb695132018-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
Andrew Geisslerec34cc62021-11-03 09:57:52 -05007inherit pkgconfig meson
Artem Senichevfb695132018-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 Senichev6be7f862020-06-16 09:49:50 +030015DEPENDS += " \
16 phosphor-logging \
17 zlib \
Alexander Filippov874d23e2019-01-10 12:38:09 +030018 "
Patrick Williams12fc9392021-08-06 09:16:53 -050019RDEPENDS:${PN} += "obmc-console"
20RRECOMMENDS:${PN} += "phosphor-debug-collector"
Artem Senichevfb695132018-11-02 16:46:13 +030021
Artem Senichevfb695132018-11-02 16:46:13 +030022# Source code repository
23S = "${WORKDIR}/git"
Patrick Williamsbb99d222022-01-24 15:55:09 -060024SRC_URI = "git://github.com/openbmc/phosphor-hostlogger;branch=master;protocol=https"
Andrew Geissler7a2b4fc2021-10-26 06:41:41 +000025SRCREV = "1ecbb996d9c88871db20c455db02ee055bff10f2"
Artem Senichev6be7f862020-06-16 09:49:50 +030026
Brandon Kimbea44e82021-07-30 00:06:27 -070027# Disable unit tests
Patrick Williamsed104d42021-08-31 13:19:27 -050028EXTRA_OEMESON:append = " -Dtests=disabled"
Brandon Kimbea44e82021-07-30 00:06:27 -070029
Artem Senichev6be7f862020-06-16 09:49:50 +030030# Systemd service template
31SYSTEMD_PACKAGES = "${PN}"
Patrick Williams12fc9392021-08-06 09:16:53 -050032SYSTEMD_SERVICE:${PN} = "hostlogger@.service"
Artem Senichev6be7f862020-06-16 09:49:50 +030033
34# Default service instance to install (single-host mode)
35DEFAULT_INSTANCE = "ttyVUART0"
36DEFAULT_SERVICE = "hostlogger@${DEFAULT_INSTANCE}.service"
37
38# Multi-host mode setup - list of configuration files to install, can be added
39# via SRC_URI in a bbappend. The file name is the name of the service instance,
40# which should match the corresponding instance of the obmc-console service.
41CUSTOM_CONFIGS = "${@custom_configs('${WORKDIR}')}"
42CUSTOM_SERVICES = "${@custom_services('${CUSTOM_CONFIGS}')}"
43
44# Preset systemd units
Patrick Williams12fc9392021-08-06 09:16:53 -050045SYSTEMD_SERVICE:${PN} += "${@'${CUSTOM_SERVICES}' if len('${CUSTOM_SERVICES}') \
Artem Senichev6be7f862020-06-16 09:49:50 +030046 else '${DEFAULT_SERVICE}'}"
47
48# Gets list of custom config files in a directory
49def custom_configs(workdir):
50 if os.path.exists(workdir):
51 return ' '.join([f for f in os.listdir(workdir) if f.endswith('.conf')])
52
53# Get list of custom service instances
54def custom_services(configs):
55 return ' '.join(['hostlogger@' + i.replace('.conf', '.service') \
56 for i in configs.split()])
57
Patrick Williams12fc9392021-08-06 09:16:53 -050058do_install:append() {
Artem Senichev6be7f862020-06-16 09:49:50 +030059 # Install config files
60 if [ -n "${CUSTOM_CONFIGS}" ]; then
61 for CONFIG_FILE in ${CUSTOM_CONFIGS}; do
62 install -Dm 0644 ${WORKDIR}/${CONFIG_FILE} \
63 ${D}${sysconfdir}/hostlogger/${CONFIG_FILE}
64 done
65 else
66 install -Dm 0644 ${S}/default.conf \
67 ${D}${sysconfdir}/hostlogger/${DEFAULT_INSTANCE}.conf
68 fi
69}