Initial commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
SUMMARY = "Enable Linux trace events"
|
||||
DESCRIPTION = "Enable Linux trace events based on a configuration file"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
|
||||
SRC_URI += " file://trace-enable"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
SYSTEMD_SERVICE:${PN} = "trace-enable.service"
|
||||
|
||||
inherit obmc-phosphor-systemd
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}${sysconfdir}
|
||||
for event in ${TRACE_EVENTS}
|
||||
do
|
||||
echo ${event} >> ${D}${sysconfdir}/trace-events.conf
|
||||
done
|
||||
echo >> ${D}${sysconfdir}/trace-events.conf
|
||||
chmod 0644 ${D}${sysconfdir}/trace-events.conf
|
||||
install -d ${D}${libexecdir}
|
||||
install -m 0755 ${WORKDIR}/trace-enable ${D}${libexecdir}
|
||||
}
|
||||
|
||||
RDEPENDS:${PN} = " \
|
||||
${@d.getVar('PREFERRED_PROVIDER_u-boot-fw-utils', True) or 'u-boot-fw-utils'} \
|
||||
bash \
|
||||
"
|
||||
|
||||
FILES:${PN} += "${sysconfdir}/trace-events.conf"
|
||||
FILES:${PN} += "${libexecdir}/trace-enable"
|
||||
|
||||
TRACE_EVENTS = ""
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
events=""
|
||||
|
||||
while read -r line
|
||||
do
|
||||
if echo "${line}" >> /sys/kernel/debug/tracing/set_event;
|
||||
then
|
||||
if [ -n "${events}" ]
|
||||
then
|
||||
events="${events},${line}"
|
||||
else
|
||||
events="${line}"
|
||||
fi
|
||||
fi
|
||||
done < "${1}"
|
||||
|
||||
if [ -n "${events}" ]
|
||||
then
|
||||
events="trace_events=${events}"
|
||||
fw_setenv trace_args "${events}"
|
||||
else
|
||||
fw_setenv trace_args
|
||||
fi
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Enable Linux trace events in the boot loader
|
||||
RequiresMountsFor=/etc
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/libexec/trace-enable /etc/trace-events.conf
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user