Artem Senichev | fb69513 | 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" |
Artem Senichev | fb69513 | 2018-11-02 16:46:13 +0300 | [diff] [blame] | 4 | # License info |
| 5 | LICENSE = "Apache-2.0" |
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" |
Artem Senichev | fb69513 | 2018-11-02 16:46:13 +0300 | [diff] [blame] | 7 | # Dependencies |
Artem Senichev | 6be7f86 | 2020-06-16 09:49:50 +0300 | [diff] [blame] | 8 | DEPENDS += " \ |
| 9 | phosphor-logging \ |
| 10 | zlib \ |
Alexander Filippov | 874d23e | 2019-01-10 12:38:09 +0300 | [diff] [blame] | 11 | " |
Andrew Geissler | ad95ae0 | 2022-12-09 07:40:27 -0600 | [diff] [blame] | 12 | SRCREV = "9376e692db4ccebeaed493c3ebf4dd467104c959" |
Ed Tanous | 9936f86 | 2022-09-19 09:13:20 -0700 | [diff] [blame] | 13 | PV = "1.0+git${SRCPV}" |
| 14 | PR = "r1" |
| 15 | |
| 16 | SRC_URI = "git://github.com/openbmc/phosphor-hostlogger;branch=master;protocol=https" |
Artem Senichev | fb69513 | 2018-11-02 16:46:13 +0300 | [diff] [blame] | 17 | |
Artem Senichev | fb69513 | 2018-11-02 16:46:13 +0300 | [diff] [blame] | 18 | # Source code repository |
| 19 | S = "${WORKDIR}/git" |
Ed Tanous | 9936f86 | 2022-09-19 09:13:20 -0700 | [diff] [blame] | 20 | # Systemd service template |
| 21 | SYSTEMD_PACKAGES = "${PN}" |
| 22 | SYSTEMD_SERVICE:${PN} = "hostlogger@.service" |
| 23 | # Preset systemd units |
| 24 | SYSTEMD_SERVICE:${PN} += "${@'${CUSTOM_SERVICES}' if len('${CUSTOM_SERVICES}') \ |
| 25 | else '${DEFAULT_SERVICE}'}" |
| 26 | |
| 27 | inherit pkgconfig meson |
| 28 | inherit systemd |
Artem Senichev | 6be7f86 | 2020-06-16 09:49:50 +0300 | [diff] [blame] | 29 | |
Brandon Kim | bea44e8 | 2021-07-30 00:06:27 -0700 | [diff] [blame] | 30 | # Disable unit tests |
Patrick Williams | ed104d4 | 2021-08-31 13:19:27 -0500 | [diff] [blame] | 31 | EXTRA_OEMESON:append = " -Dtests=disabled" |
Brandon Kim | bea44e8 | 2021-07-30 00:06:27 -0700 | [diff] [blame] | 32 | |
Ed Tanous | 9936f86 | 2022-09-19 09:13:20 -0700 | [diff] [blame] | 33 | RDEPENDS:${PN} += "obmc-console" |
| 34 | |
| 35 | RRECOMMENDS:${PN} += "phosphor-debug-collector" |
Artem Senichev | 6be7f86 | 2020-06-16 09:49:50 +0300 | [diff] [blame] | 36 | |
| 37 | # Default service instance to install (single-host mode) |
| 38 | DEFAULT_INSTANCE = "ttyVUART0" |
| 39 | DEFAULT_SERVICE = "hostlogger@${DEFAULT_INSTANCE}.service" |
Artem Senichev | 6be7f86 | 2020-06-16 09:49:50 +0300 | [diff] [blame] | 40 | # 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. |
| 43 | CUSTOM_CONFIGS = "${@custom_configs('${WORKDIR}')}" |
| 44 | CUSTOM_SERVICES = "${@custom_services('${CUSTOM_CONFIGS}')}" |
Artem Senichev | 6be7f86 | 2020-06-16 09:49:50 +0300 | [diff] [blame] | 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')]) |
Artem Senichev | 6be7f86 | 2020-06-16 09:49:50 +0300 | [diff] [blame] | 49 | # Get list of custom service instances |
| 50 | def custom_services(configs): |
| 51 | return ' '.join(['hostlogger@' + i.replace('.conf', '.service') \ |
| 52 | for i in configs.split()]) |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 53 | do_install:append() { |
Artem Senichev | 6be7f86 | 2020-06-16 09:49:50 +0300 | [diff] [blame] | 54 | # 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 | } |