Initial commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
SUMMARY = "Debug trigger"
|
||||
DESCRIPTION = "Forcibly crash an unresponsive system to collect debug data"
|
||||
HOMEPAGE = "https://github.com/openbmc/debug-trigger"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/debug-trigger;branch=master;protocol=https"
|
||||
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit meson
|
||||
inherit pkgconfig
|
||||
inherit systemd
|
||||
|
||||
PR = "r1"
|
||||
PV = "0.1+git${SRCPV}"
|
||||
SRCREV = "1161642d2288f71549f0c9f89d09807ca251b58f"
|
||||
|
||||
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
|
||||
|
||||
DEBUG_TRIGGERS ?= ""
|
||||
|
||||
PACKAGECONFIG[systemd] = " \
|
||||
-Dsystemd=true, \
|
||||
-Dsystemd=false, \
|
||||
systemd"
|
||||
|
||||
PACKAGECONFIG[triggers] = " \
|
||||
-Dtriggers=${DEBUG_TRIGGERS}, \
|
||||
-Dtriggers=[], \
|
||||
systemd udev"
|
||||
|
||||
SYSTEMD_SERVICE:${PN} += "debug-trigger@.service"
|
||||
@@ -0,0 +1,5 @@
|
||||
HOMEPAGE = "https://github.com/openbmc/phosphor-debug-collector"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||
SRC_URI += "git://github.com/openbmc/phosphor-debug-collector;branch=master;protocol=https"
|
||||
SRCREV = "05ef81639c1fb7fc2fc78b29ca7e7486a86ddfb2"
|
||||
@@ -0,0 +1,8 @@
|
||||
# This configuration file will help in
|
||||
# removing all the hidden files in the
|
||||
# coredump folder at boot time.
|
||||
#
|
||||
# See tmpfiles.d for more details
|
||||
|
||||
R! /var/lib/systemd/coredump/.[^.] - - - -
|
||||
R! /var/lib/systemd/coredump/.??* - - - -
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Phosphor Dump core monitor.
|
||||
ConditionPathExists=/var/lib/systemd/coredump
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/env phosphor-dump-monitor
|
||||
SyslogIdentifier=phosphor-dump-monitor
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Ramoops monitor.
|
||||
ConditionPathExistsGlob=/var/lib/systemd/pstore/dmesg-ramoops-*
|
||||
After=xyz.openbmc_project.Dump.Manager.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/phosphor-ramoops-monitor
|
||||
SyslogIdentifier=ramoops-monitor
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Phosphor Dump Manager
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/bin/sh -c 'mkdir -p {BMC_DUMP_PATH}'
|
||||
ExecStart=/usr/bin/env phosphor-dump-manager
|
||||
SyslogIdentifier=phosphor-dump-manager
|
||||
Restart=always
|
||||
Type=dbus
|
||||
BusName={BUSNAME}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,179 @@
|
||||
SUMMARY = "Phosphor Debug Collector"
|
||||
DESCRIPTION = "Phosphor Debug Collector provides mechanisms \
|
||||
to collect various log files and system parameters. \
|
||||
This will be helpful for troubleshooting the problems in OpenBMC \
|
||||
based systems."
|
||||
DEPENDS += " \
|
||||
phosphor-dbus-interfaces \
|
||||
phosphor-logging \
|
||||
sdbusplus \
|
||||
${PYTHON_PN}-sdbus++-native \
|
||||
autoconf-archive-native \
|
||||
virtual/phosphor-debug-errors \
|
||||
${PYTHON_PN}-native \
|
||||
${PYTHON_PN}-pyyaml-native \
|
||||
${PYTHON_PN}-setuptools-native \
|
||||
${PYTHON_PN}-mako-native \
|
||||
fmt \
|
||||
"
|
||||
PACKAGECONFIG ??= "${@bb.utils.contains_any('DISTRO_FEATURES', \
|
||||
'obmc-ubi-fs phosphor-mmc obmc-static-norootfs', '', 'jffs-workaround', d)}"
|
||||
PACKAGECONFIG[jffs-workaround] = "-Djffs-workaround=enabled, \
|
||||
-Djffs-workaround=disabled"
|
||||
PACKAGECONFIG[host-dump-transport-pldm] = " \
|
||||
-Dhost-transport=pldm,, \
|
||||
libpldm \
|
||||
"
|
||||
PACKAGECONFIG[openpower-dumps-extension] = " \
|
||||
-Dopenpower-dumps-extension=enabled, \
|
||||
-Dopenpower-dumps-extension=disabled \
|
||||
"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI += "file://coretemp.conf"
|
||||
|
||||
SYSTEMD_PACKAGES = "${PN}-monitor"
|
||||
SYSTEMD_SUBSTITUTIONS += "BMC_DUMP_PATH:${bmc_dump_path}:${MGR_SVC}"
|
||||
SYSTEMD_SERVICE:${PN}-monitor += "obmc-dump-monitor.service"
|
||||
SYSTEMD_SERVICE:${PN}-monitor += "ramoops-monitor.service"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit pkgconfig meson \
|
||||
obmc-phosphor-dbus-service \
|
||||
python3native \
|
||||
phosphor-debug-collector
|
||||
|
||||
EXTRA_OEMESON = " \
|
||||
-DBMC_DUMP_PATH=${bmc_dump_path} \
|
||||
-DERROR_MAP_YAML=${STAGING_DIR_NATIVE}/${datadir}/dump/errors_watch.yaml \
|
||||
"
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}${exec_prefix}/lib/tmpfiles.d
|
||||
install -m 644 ${WORKDIR}/coretemp.conf ${D}${exec_prefix}/lib/tmpfiles.d/
|
||||
}
|
||||
do_install[postfuncs] += "install_dreport"
|
||||
do_install[postfuncs] += "install_dreport_conf_file"
|
||||
do_install[postfuncs] += "install_dreport_plugins_scripts"
|
||||
do_install[postfuncs] += "install_dreport_include_scripts"
|
||||
do_install[postfuncs] += "install_dreport_user_scripts"
|
||||
|
||||
RDEPENDS:${PN}-manager += " \
|
||||
${PN}-dreport \
|
||||
"
|
||||
RDEPENDS:${PN}-dreport += " \
|
||||
systemd \
|
||||
${VIRTUAL-RUNTIME_base-utils} \
|
||||
bash \
|
||||
xz \
|
||||
"
|
||||
RDEPENDS:${PN}-scripts += " \
|
||||
bash \
|
||||
"
|
||||
|
||||
FILES:${PN}-manager += " \
|
||||
${bindir}/phosphor-dump-manager \
|
||||
${bindir}/phosphor-offload-handler \
|
||||
${exec_prefix}/lib/tmpfiles.d/coretemp.conf \
|
||||
${datadir}/dump/ \
|
||||
"
|
||||
FILES:${PN}-monitor += "${bindir}/phosphor-dump-monitor"
|
||||
FILES:${PN}-monitor += "${bindir}/phosphor-ramoops-monitor"
|
||||
FILES:${PN}-dreport += "${bindir}/dreport"
|
||||
FILES:${PN}-scripts += "${dreport_dir}"
|
||||
|
||||
require phosphor-debug-collector.inc
|
||||
|
||||
ALLOW_EMPTY:${PN} = "1"
|
||||
|
||||
DEBUG_COLLECTOR_PKGS = " \
|
||||
${PN}-manager \
|
||||
${PN}-monitor \
|
||||
${PN}-dreport \
|
||||
${PN}-scripts \
|
||||
"
|
||||
PACKAGE_BEFORE_PN += "${DEBUG_COLLECTOR_PKGS}"
|
||||
DBUS_PACKAGES = "${PN}-manager"
|
||||
MGR_SVC ?= "xyz.openbmc_project.Dump.Manager.service"
|
||||
DBUS_SERVICE:${PN}-manager += "${MGR_SVC}"
|
||||
# Install dreport script
|
||||
# From tools/dreport.d/dreport to /usr/bin/dreport
|
||||
install_dreport() {
|
||||
install -d ${D}${bindir}
|
||||
install -m 0755 ${S}/tools/dreport.d/dreport \
|
||||
${D}${bindir}/dreport
|
||||
}
|
||||
# Install dreport sample configuration file
|
||||
# From tools/dreport.d/sample.conf
|
||||
# to /usr/share/dreport.d/conf.d/dreport.conf
|
||||
install_dreport_conf_file() {
|
||||
install -d ${D}${dreport_conf_dir}
|
||||
install -m 0644 ${S}/tools/dreport.d/sample.conf \
|
||||
${D}${dreport_conf_dir}/dreport.conf
|
||||
}
|
||||
# Install dreport plugins
|
||||
# From tools/dreport.d/plugins.d to /usr/share/dreport.d/plugins.d
|
||||
install_dreport_plugins_scripts() {
|
||||
install -d ${D}${dreport_plugin_dir}
|
||||
install -m 0755 ${S}/tools/dreport.d/plugins.d/* ${D}${dreport_plugin_dir}/
|
||||
}
|
||||
# Install dreport utility functions
|
||||
# From tools/dreport.d/include.d to /usr/share/dreport.d/include.d
|
||||
install_dreport_include_scripts() {
|
||||
install -d ${D}${dreport_include_dir}
|
||||
install -m 0755 ${S}/tools/dreport.d/include.d/* \
|
||||
${D}${dreport_include_dir}/
|
||||
}
|
||||
# Make the links for a single user plugin script
|
||||
# Create user directories based on the dump type value in the config section
|
||||
# Create softlinks for the base scripts in the user directories
|
||||
def install_dreport_user_script(script_path, d):
|
||||
import re
|
||||
import configparser
|
||||
#Read the user types from the dreport.conf file
|
||||
configure = configparser.ConfigParser()
|
||||
conf_dir = d.getVar('D', True) + d.getVar('dreport_conf_dir', True)
|
||||
confsource = os.path.join(conf_dir, "dreport.conf")
|
||||
configure.read(confsource)
|
||||
config = ("config:")
|
||||
section = "DumpType"
|
||||
dreport_dir = d.getVar('D', True) + d.getVar('dreport_dir', True)
|
||||
script = os.path.basename(script_path)
|
||||
srclink = os.path.join(d.getVar('dreport_plugin_dir', True), script)
|
||||
file = open(script_path, "r")
|
||||
for line in file:
|
||||
if not config in line:
|
||||
continue
|
||||
revalue = re.search('[0-9]+.[0-9]+', line)
|
||||
if not revalue:
|
||||
bb.warn("Invalid format for config value =%s" % line)
|
||||
continue
|
||||
parse_value = revalue.group(0)
|
||||
config_values = re.split(r'\W+', parse_value, 1)
|
||||
if(len(config_values) != 2):
|
||||
bb.warn("Invalid config value=%s" % parse_value)
|
||||
break;
|
||||
priority = config_values[1]
|
||||
types = [int(d) for d in str(config_values[0])]
|
||||
for type in types:
|
||||
if not configure.has_option(section, str(type)):
|
||||
bb.warn("Invalid dump type id =%s" % (str(type)))
|
||||
continue
|
||||
typestr = configure.get(section, str(type))
|
||||
destdir = os.path.join(dreport_dir, ("pl_" + typestr + ".d"))
|
||||
if not os.path.exists(destdir):
|
||||
os.makedirs(destdir)
|
||||
linkname = "E" + priority + script
|
||||
destlink = os.path.join(destdir, linkname)
|
||||
os.symlink(srclink, destlink)
|
||||
file.close()
|
||||
#Make the links for all the plugins
|
||||
python install_dreport_user_scripts() {
|
||||
source = d.getVar('S', True)
|
||||
source_path = os.path.join(source, "tools", "dreport.d", "plugins.d")
|
||||
scripts = os.listdir(source_path)
|
||||
for script in scripts:
|
||||
srcname = os.path.join(source_path, script)
|
||||
install_dreport_user_script(srcname, d)
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
SUMMARY = "Debug collector error watch config file"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
PROVIDES += "virtual/phosphor-debug-errors"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI += "file://errors_watch.yaml"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
inherit native
|
||||
|
||||
do_install:append() {
|
||||
DEST=${D}${datadir}/dump
|
||||
install -d ${DEST}
|
||||
install errors_watch.yaml ${DEST}/
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
elog:
|
||||
- xyz.openbmc_project.Common.Error.InternalFailure
|
||||
Reference in New Issue
Block a user