mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-10 16:40:03 +00:00
minicoredumper: add the recipe
minicoredumper provides an alternate core dump facility for Linux to allow minimal and customized crash dumps Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# minicoredumper This shell script takes care of starting and stopping minicoredumper.
|
||||||
|
#
|
||||||
|
# chkconfig: 2345 24 89
|
||||||
|
# description: minicoredumper.
|
||||||
|
#
|
||||||
|
# processname:
|
||||||
|
# config: /etc/minicoredumper/
|
||||||
|
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: minicoredumper
|
||||||
|
# Default-Start: 2 3 4 5
|
||||||
|
# Default-Stop: 0 1 6
|
||||||
|
# Should-Start: $syslog $network
|
||||||
|
# Should-Stop: $syslog $network
|
||||||
|
# Short-Description:
|
||||||
|
# Description:
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
. /etc/init.d/functions
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
echo "|/usr/bin/minicoredumper %p %u %g %s %t %h %e" > /proc/sys/kernel/core_pattern
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
echo "core" > /proc/sys/kernel/core_pattern
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
if grep -q minicoredumper /proc/sys/kernel/core_pattern ; then
|
||||||
|
echo "minicoredumper is running"
|
||||||
|
else
|
||||||
|
echo "minicoredumper is stopped"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo $"Usage: $0 {start|stop|status}"
|
||||||
|
exit 2
|
||||||
|
esac
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Enable minicoredumper.
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
ExecStart=/bin/sh -c '/bin/echo "|/usr/bin/minicoredumper %%p %%u %%g %%s %%t %%h %%e" > /proc/sys/kernel/core_pattern'
|
||||||
|
ExecStop=/bin/sh -c '/bin/echo "core" > /proc/sys/kernel/core_pattern'
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
SUMMARY = "minicoredumper provides an alternate core dump facility for Linux \
|
||||||
|
to allow minimal and customized crash dumps"
|
||||||
|
LICENSE = " LGPLv2.1 & BSD"
|
||||||
|
LIC_FILES_CHKSUM = "file://COPYING;md5=45445387350de96a0e70410470ee5cab"
|
||||||
|
DEPENDS = "elfutils dbus dbus-glib-native glib-2.0 dbus-glib util-linux"
|
||||||
|
|
||||||
|
inherit autotools pkgconfig systemd update-rc.d
|
||||||
|
|
||||||
|
SRC_URI = "https://linutronix.de/${BPN}/files/${BPN}-${PV}.tar.gz \
|
||||||
|
file://minicoredumper.service \
|
||||||
|
file://minicoredumper.init \
|
||||||
|
"
|
||||||
|
SRC_URI[md5sum] = "5ba9d116b52a8e2fb93456260644e753"
|
||||||
|
SRC_URI[sha256sum] = "1b0eeb3d70dbd2ad6f2f673e4e3446e5dd784e132730e21d8f9dc0977e47dd9a"
|
||||||
|
|
||||||
|
SYSTEMD_SERVICE_${PN} = "minicoredumper.service"
|
||||||
|
SYSTEMD_AUTO_ENABLE = "enable"
|
||||||
|
|
||||||
|
INITSCRIPT_PACKAGES = "${PN}"
|
||||||
|
INITSCRIPT_NAME_${PN} = "minicoredumper"
|
||||||
|
INITSCRIPT_PARAMS_${PN} = "defaults 89"
|
||||||
|
|
||||||
|
do_install_append() {
|
||||||
|
install -d ${D}/${sysconfdir}/minicoredumper
|
||||||
|
cp -rf ${S}/etc/* ${D}/${sysconfdir}/
|
||||||
|
|
||||||
|
install -d ${D}${systemd_system_unitdir}
|
||||||
|
install -m 0644 ${WORKDIR}/minicoredumper.service ${D}${systemd_system_unitdir}
|
||||||
|
install -d ${D}${sysconfdir}/init.d
|
||||||
|
install -m 0644 ${WORKDIR}/minicoredumper.init ${D}${sysconfdir}/init.d/minicoredumper
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user