1d29807a0SPatrick VentureSUMMARY = "Phosphor Debug Collector"
2d29807a0SPatrick VentureDESCRIPTION = "Phosphor Debug Collector provides mechanisms \
3d29807a0SPatrick Ventureto collect various log files and system parameters. \
4d29807a0SPatrick VentureThis will be helpful for troubleshooting the problems in OpenBMC \
5d29807a0SPatrick Venturebased systems."
6d29807a0SPatrick VentureDEPENDS += " \
7d29807a0SPatrick Venture        phosphor-dbus-interfaces \
8d29807a0SPatrick Venture        phosphor-logging \
9d29807a0SPatrick Venture        sdbusplus \
104b32c9aeSPatrick Williams        ${PYTHON_PN}-sdbus++-native \
11d29807a0SPatrick Venture        autoconf-archive-native \
125035fcf9SMarri Devender Rao        virtual/phosphor-debug-errors \
1339f5a6b4SJayanth Othayoth        ${PYTHON_PN}-native \
1439f5a6b4SJayanth Othayoth        ${PYTHON_PN}-pyyaml-native \
1539f5a6b4SJayanth Othayoth        ${PYTHON_PN}-setuptools-native \
1639f5a6b4SJayanth Othayoth        ${PYTHON_PN}-mako-native \
17595de4bbSAndrew Geissler        nlohmann-json \
18d29807a0SPatrick Venture"
199936f86dSEd TanousPACKAGECONFIG ??= "${@bb.utils.contains_any('DISTRO_FEATURES', \
20547aef9fSPatrick Williams         'obmc-ubi-fs phosphor-mmc obmc-static-norootfs', '', 'jffs-workaround', d)}"
219936f86dSEd TanousPACKAGECONFIG[jffs-workaround] = "-Djffs-workaround=enabled, \
229936f86dSEd Tanous        -Djffs-workaround=disabled"
239936f86dSEd TanousPACKAGECONFIG[host-dump-transport-pldm] = " \
249936f86dSEd Tanous        -Dhost-transport=pldm,, \
25c593475fSManojkiran Eda        libpldm \
269936f86dSEd Tanous        "
279936f86dSEd TanousPACKAGECONFIG[openpower-dumps-extension] = " \
289936f86dSEd Tanous       -Dopenpower-dumps-extension=enabled, \
299936f86dSEd Tanous       -Dopenpower-dumps-extension=disabled  \
309936f86dSEd Tanous"
319936f86dSEd TanousPV = "1.0+git${SRCPV}"
329936f86dSEd TanousPR = "r1"
339936f86dSEd Tanous
349936f86dSEd TanousSRC_URI += "file://coretemp.conf"
359936f86dSEd Tanous
369936f86dSEd TanousSYSTEMD_PACKAGES = "${PN}-monitor"
379936f86dSEd TanousSYSTEMD_SUBSTITUTIONS += "BMC_DUMP_PATH:${bmc_dump_path}:${MGR_SVC}"
389936f86dSEd TanousSYSTEMD_SERVICE:${PN}-monitor += "obmc-dump-monitor.service"
399936f86dSEd TanousSYSTEMD_SERVICE:${PN}-monitor += "ramoops-monitor.service"
409936f86dSEd TanousS = "${WORKDIR}/git"
419936f86dSEd Tanous
429936f86dSEd Tanousinherit pkgconfig meson \
439936f86dSEd Tanous        obmc-phosphor-dbus-service \
449936f86dSEd Tanous        python3native \
459936f86dSEd Tanous        phosphor-debug-collector
469936f86dSEd Tanous
479936f86dSEd TanousEXTRA_OEMESON = " \
489de62e5cSPatrick Williams    -Dtests=disabled \
499936f86dSEd Tanous    -DBMC_DUMP_PATH=${bmc_dump_path} \
509936f86dSEd Tanous    -DERROR_MAP_YAML=${STAGING_DIR_NATIVE}/${datadir}/dump/errors_watch.yaml \
519936f86dSEd Tanous    "
529936f86dSEd Tanous
539936f86dSEd Tanousdo_install:append() {
549936f86dSEd Tanous    install -d ${D}${exec_prefix}/lib/tmpfiles.d
559936f86dSEd Tanous    install -m 644 ${WORKDIR}/coretemp.conf ${D}${exec_prefix}/lib/tmpfiles.d/
569936f86dSEd Tanous}
579936f86dSEd Tanousdo_install[postfuncs] += "install_dreport"
589936f86dSEd Tanousdo_install[postfuncs] += "install_dreport_conf_file"
599936f86dSEd Tanousdo_install[postfuncs] += "install_dreport_plugins_scripts"
609936f86dSEd Tanousdo_install[postfuncs] += "install_dreport_include_scripts"
619936f86dSEd Tanousdo_install[postfuncs] += "install_dreport_user_scripts"
62d29807a0SPatrick Venture
6312fc939cSPatrick WilliamsRDEPENDS:${PN}-manager += " \
64d29807a0SPatrick Venture        ${PN}-dreport \
65d29807a0SPatrick Venture"
6612fc939cSPatrick WilliamsRDEPENDS:${PN}-dreport += " \
67d29807a0SPatrick Venture        systemd \
68d29807a0SPatrick Venture        ${VIRTUAL-RUNTIME_base-utils} \
69d29807a0SPatrick Venture        bash \
70d29807a0SPatrick Venture        xz \
71d29807a0SPatrick Venture"
7212fc939cSPatrick WilliamsRDEPENDS:${PN}-scripts += " \
73d29807a0SPatrick Venture        bash \
74d29807a0SPatrick Venture"
75d29807a0SPatrick Venture
7612fc939cSPatrick WilliamsFILES:${PN}-manager += " \
7774b8a09bSAndrew Geissler    ${bindir}/phosphor-dump-manager \
786bec723dSDhruvaraj Subhashchandran    ${bindir}/phosphor-offload-handler \
795035fcf9SMarri Devender Rao    ${exec_prefix}/lib/tmpfiles.d/coretemp.conf \
805035fcf9SMarri Devender Rao    ${datadir}/dump/ \
815035fcf9SMarri Devender Rao    "
8212fc939cSPatrick WilliamsFILES:${PN}-monitor += "${bindir}/phosphor-dump-monitor"
8312fc939cSPatrick WilliamsFILES:${PN}-monitor += "${bindir}/phosphor-ramoops-monitor"
8412fc939cSPatrick WilliamsFILES:${PN}-dreport += "${bindir}/dreport"
8512fc939cSPatrick WilliamsFILES:${PN}-scripts += "${dreport_dir}"
86d29807a0SPatrick Venture
879936f86dSEd Tanousrequire phosphor-debug-collector.inc
88d29807a0SPatrick Venture
899936f86dSEd TanousALLOW_EMPTY:${PN} = "1"
909936f86dSEd Tanous
919936f86dSEd TanousDEBUG_COLLECTOR_PKGS = " \
929936f86dSEd Tanous    ${PN}-manager \
939936f86dSEd Tanous    ${PN}-monitor \
949936f86dSEd Tanous    ${PN}-dreport \
959936f86dSEd Tanous    ${PN}-scripts \
965035fcf9SMarri Devender Rao"
979936f86dSEd TanousPACKAGE_BEFORE_PN += "${DEBUG_COLLECTOR_PKGS}"
989936f86dSEd TanousDBUS_PACKAGES = "${PN}-manager"
999936f86dSEd TanousMGR_SVC ?= "xyz.openbmc_project.Dump.Manager.service"
1009936f86dSEd TanousDBUS_SERVICE:${PN}-manager += "${MGR_SVC}"
101d29807a0SPatrick Venture# Install dreport script
102d29807a0SPatrick Venture# From tools/dreport.d/dreport to /usr/bin/dreport
103d29807a0SPatrick Ventureinstall_dreport() {
104d29807a0SPatrick Venture    install -d ${D}${bindir}
105d29807a0SPatrick Venture    install -m 0755 ${S}/tools/dreport.d/dreport \
106d29807a0SPatrick Venture                    ${D}${bindir}/dreport
107d29807a0SPatrick Venture}
108d29807a0SPatrick Venture# Install dreport sample configuration file
109d29807a0SPatrick Venture# From tools/dreport.d/sample.conf
110d29807a0SPatrick Venture# to /usr/share/dreport.d/conf.d/dreport.conf
111d29807a0SPatrick Ventureinstall_dreport_conf_file() {
112d29807a0SPatrick Venture    install -d ${D}${dreport_conf_dir}
113d29807a0SPatrick Venture    install -m 0644 ${S}/tools/dreport.d/sample.conf \
114d29807a0SPatrick Venture                        ${D}${dreport_conf_dir}/dreport.conf
115d29807a0SPatrick Venture}
116d29807a0SPatrick Venture# Install dreport plugins
117d29807a0SPatrick Venture# From tools/dreport.d/plugins.d to /usr/share/dreport.d/plugins.d
118d29807a0SPatrick Ventureinstall_dreport_plugins_scripts() {
119d29807a0SPatrick Venture    install -d ${D}${dreport_plugin_dir}
120d29807a0SPatrick Venture    install -m 0755 ${S}/tools/dreport.d/plugins.d/* ${D}${dreport_plugin_dir}/
121d29807a0SPatrick Venture}
122d29807a0SPatrick Venture# Install dreport utility functions
123d29807a0SPatrick Venture# From tools/dreport.d/include.d to /usr/share/dreport.d/include.d
124d29807a0SPatrick Ventureinstall_dreport_include_scripts() {
125d29807a0SPatrick Venture    install -d ${D}${dreport_include_dir}
126d29807a0SPatrick Venture    install -m 0755 ${S}/tools/dreport.d/include.d/* \
127d29807a0SPatrick Venture                ${D}${dreport_include_dir}/
128d29807a0SPatrick Venture}
129*ce34a267SGopichand Paturi
130d29807a0SPatrick Venture#Make the links for all the plugins
131d29807a0SPatrick Venturepython install_dreport_user_scripts() {
132d29807a0SPatrick Venture    source = d.getVar('S', True)
133d29807a0SPatrick Venture    source_path = os.path.join(source, "tools", "dreport.d", "plugins.d")
134d29807a0SPatrick Venture    scripts = os.listdir(source_path)
135d29807a0SPatrick Venture    for script in scripts:
136d29807a0SPatrick Venture        srcname = os.path.join(source_path, script)
137*ce34a267SGopichand Paturi        install_dreport_user_script("dreport.conf", srcname, d)
138d29807a0SPatrick Venture}
139