Artem Senichev | 8135af9 | 2018-11-02 16:46:13 +0300 | [diff] [blame] | 1 | SUMMARY = "Phosphor Host logger" |
| 2 | DESCRIPTION = "Save log messages from host's console to the persistent storage." |
| 3 | HOMEPAGE = "https://github.com/openbmc/phosphor-hostlogger" |
| 4 | PR = "r1" |
| 5 | PV = "1.0+git${SRCPV}" |
| 6 | |
Artem Senichev | c4fddbe | 2020-06-16 09:49:50 +0300 | [diff] [blame] | 7 | inherit meson |
Artem Senichev | 8135af9 | 2018-11-02 16:46:13 +0300 | [diff] [blame] | 8 | inherit systemd |
| 9 | |
| 10 | # License info |
| 11 | LICENSE = "Apache-2.0" |
| 12 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" |
| 13 | |
| 14 | # Dependencies |
Artem Senichev | c4fddbe | 2020-06-16 09:49:50 +0300 | [diff] [blame] | 15 | DEPENDS += " \ |
| 16 | phosphor-logging \ |
| 17 | zlib \ |
Alexander Filippov | 74dc870 | 2019-01-10 12:38:09 +0300 | [diff] [blame] | 18 | " |
Artem Senichev | 8135af9 | 2018-11-02 16:46:13 +0300 | [diff] [blame] | 19 | RDEPENDS_${PN} += "obmc-console" |
| 20 | RRECOMMENDS_${PN} += "phosphor-debug-collector" |
| 21 | |
Artem Senichev | 8135af9 | 2018-11-02 16:46:13 +0300 | [diff] [blame] | 22 | # Source code repository |
| 23 | S = "${WORKDIR}/git" |
| 24 | SRC_URI = "git://github.com/openbmc/phosphor-hostlogger" |
Andrew Geissler | 4e81e67 | 2020-10-21 16:41:24 +0000 | [diff] [blame] | 25 | SRCREV = "e9af83c6f5cc14a7493de5359b3c65b8832c99f0" |
Artem Senichev | c4fddbe | 2020-06-16 09:49:50 +0300 | [diff] [blame] | 26 | |
| 27 | # Systemd service template |
| 28 | SYSTEMD_PACKAGES = "${PN}" |
| 29 | SYSTEMD_SERVICE_${PN} = "hostlogger@.service" |
| 30 | |
| 31 | # Default service instance to install (single-host mode) |
| 32 | DEFAULT_INSTANCE = "ttyVUART0" |
| 33 | DEFAULT_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. |
| 38 | CUSTOM_CONFIGS = "${@custom_configs('${WORKDIR}')}" |
| 39 | CUSTOM_SERVICES = "${@custom_services('${CUSTOM_CONFIGS}')}" |
| 40 | |
| 41 | # Preset systemd units |
| 42 | SYSTEMD_SERVICE_${PN} += "${@'${CUSTOM_SERVICES}' if len('${CUSTOM_SERVICES}') \ |
| 43 | else '${DEFAULT_SERVICE}'}" |
| 44 | |
| 45 | # Gets list of custom config files in a directory |
| 46 | def 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 |
| 51 | def custom_services(configs): |
| 52 | return ' '.join(['hostlogger@' + i.replace('.conf', '.service') \ |
| 53 | for i in configs.split()]) |
| 54 | |
| 55 | do_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 | } |