blob: 4da5b49f7ae78954ca9b259d0be66eb10d32bc75 [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"
Artem Senichevfb695132018-11-02 16:46:13 +03004# License info
5LICENSE = "Apache-2.0"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
Artem Senichevfb695132018-11-02 16:46:13 +03007# Dependencies
Artem Senichev6be7f862020-06-16 09:49:50 +03008DEPENDS += " \
9 phosphor-logging \
10 zlib \
Alexander Filippov874d23e2019-01-10 12:38:09 +030011 "
Ed Tanous9936f862022-09-19 09:13:20 -070012SRCREV = "d68863396c608912a820926d8d98d92499f49ac2"
13PV = "1.0+git${SRCPV}"
14PR = "r1"
15
16SRC_URI = "git://github.com/openbmc/phosphor-hostlogger;branch=master;protocol=https"
Artem Senichevfb695132018-11-02 16:46:13 +030017
Artem Senichevfb695132018-11-02 16:46:13 +030018# Source code repository
19S = "${WORKDIR}/git"
Ed Tanous9936f862022-09-19 09:13:20 -070020# Systemd service template
21SYSTEMD_PACKAGES = "${PN}"
22SYSTEMD_SERVICE:${PN} = "hostlogger@.service"
23# Preset systemd units
24SYSTEMD_SERVICE:${PN} += "${@'${CUSTOM_SERVICES}' if len('${CUSTOM_SERVICES}') \
25 else '${DEFAULT_SERVICE}'}"
26
27inherit pkgconfig meson
28inherit systemd
Artem Senichev6be7f862020-06-16 09:49:50 +030029
Brandon Kimbea44e82021-07-30 00:06:27 -070030# Disable unit tests
Patrick Williamsed104d42021-08-31 13:19:27 -050031EXTRA_OEMESON:append = " -Dtests=disabled"
Brandon Kimbea44e82021-07-30 00:06:27 -070032
Ed Tanous9936f862022-09-19 09:13:20 -070033RDEPENDS:${PN} += "obmc-console"
34
35RRECOMMENDS:${PN} += "phosphor-debug-collector"
Artem Senichev6be7f862020-06-16 09:49:50 +030036
37# Default service instance to install (single-host mode)
38DEFAULT_INSTANCE = "ttyVUART0"
39DEFAULT_SERVICE = "hostlogger@${DEFAULT_INSTANCE}.service"
Artem Senichev6be7f862020-06-16 09:49:50 +030040# Multi-host mode setup - list of configuration files to install, can be added
41# via SRC_URI in a bbappend. The file name is the name of the service instance,
42# which should match the corresponding instance of the obmc-console service.
43CUSTOM_CONFIGS = "${@custom_configs('${WORKDIR}')}"
44CUSTOM_SERVICES = "${@custom_services('${CUSTOM_CONFIGS}')}"
Artem Senichev6be7f862020-06-16 09:49:50 +030045# 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')])
Artem Senichev6be7f862020-06-16 09:49:50 +030049# Get list of custom service instances
50def custom_services(configs):
51 return ' '.join(['hostlogger@' + i.replace('.conf', '.service') \
52 for i in configs.split()])
Patrick Williams12fc9392021-08-06 09:16:53 -050053do_install:append() {
Artem Senichev6be7f862020-06-16 09:49:50 +030054 # Install config files
55 if [ -n "${CUSTOM_CONFIGS}" ]; then
56 for CONFIG_FILE in ${CUSTOM_CONFIGS}; do
57 install -Dm 0644 ${WORKDIR}/${CONFIG_FILE} \
58 ${D}${sysconfdir}/hostlogger/${CONFIG_FILE}
59 done
60 else
61 install -Dm 0644 ${S}/default.conf \
62 ${D}${sysconfdir}/hostlogger/${DEFAULT_INSTANCE}.conf
63 fi
64}