diff options
author | Roy Li <rongqing.li@windriver.com> | 2016-07-21 22:54:41 -0400 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2016-07-29 11:00:58 +0200 |
commit | a63b404c30956da561f32cbb6d299871f3ba50d2 (patch) | |
tree | 4ac3cf9a90e16b35fa22ebb23ccbdaf9d159d85d /meta-oe/recipes-kernel | |
parent | 014c361d80fc4105f279b9a9976355365892d298 (diff) | |
download | meta-openembedded-a63b404c30956da561f32cbb6d299871f3ba50d2.tar.gz |
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>
Diffstat (limited to 'meta-oe/recipes-kernel')
3 files changed, 82 insertions, 0 deletions
diff --git a/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.init b/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.init new file mode 100644 index 000000000..90ef7fa37 --- /dev/null +++ b/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.init | |||
@@ -0,0 +1,40 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # minicoredumper This shell script takes care of starting and stopping minicoredumper. | ||
4 | # | ||
5 | # chkconfig: 2345 24 89 | ||
6 | # description: minicoredumper. | ||
7 | # | ||
8 | # processname: | ||
9 | # config: /etc/minicoredumper/ | ||
10 | |||
11 | ### BEGIN INIT INFO | ||
12 | # Provides: minicoredumper | ||
13 | # Default-Start: 2 3 4 5 | ||
14 | # Default-Stop: 0 1 6 | ||
15 | # Should-Start: $syslog $network | ||
16 | # Should-Stop: $syslog $network | ||
17 | # Short-Description: | ||
18 | # Description: | ||
19 | ### END INIT INFO | ||
20 | |||
21 | . /etc/init.d/functions | ||
22 | |||
23 | case "$1" in | ||
24 | start) | ||
25 | echo "|/usr/bin/minicoredumper %p %u %g %s %t %h %e" > /proc/sys/kernel/core_pattern | ||
26 | ;; | ||
27 | stop) | ||
28 | echo "core" > /proc/sys/kernel/core_pattern | ||
29 | ;; | ||
30 | status) | ||
31 | if grep -q minicoredumper /proc/sys/kernel/core_pattern ; then | ||
32 | echo "minicoredumper is running" | ||
33 | else | ||
34 | echo "minicoredumper is stopped" | ||
35 | fi | ||
36 | ;; | ||
37 | *) | ||
38 | echo $"Usage: $0 {start|stop|status}" | ||
39 | exit 2 | ||
40 | esac | ||
diff --git a/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.service b/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.service new file mode 100644 index 000000000..851b54ccc --- /dev/null +++ b/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Enable minicoredumper. | ||
3 | |||
4 | [Service] | ||
5 | Type=oneshot | ||
6 | RemainAfterExit=yes | ||
7 | ExecStart=/bin/sh -c '/bin/echo "|/usr/bin/minicoredumper %%p %%u %%g %%s %%t %%h %%e" > /proc/sys/kernel/core_pattern' | ||
8 | ExecStop=/bin/sh -c '/bin/echo "core" > /proc/sys/kernel/core_pattern' | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
diff --git a/meta-oe/recipes-kernel/minicoredumper/minicoredumper_1.0.2.bb b/meta-oe/recipes-kernel/minicoredumper/minicoredumper_1.0.2.bb new file mode 100644 index 000000000..babe54448 --- /dev/null +++ b/meta-oe/recipes-kernel/minicoredumper/minicoredumper_1.0.2.bb | |||
@@ -0,0 +1,31 @@ | |||
1 | SUMMARY = "minicoredumper provides an alternate core dump facility for Linux \ | ||
2 | to allow minimal and customized crash dumps" | ||
3 | LICENSE = " LGPLv2.1 & BSD" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=45445387350de96a0e70410470ee5cab" | ||
5 | DEPENDS = "elfutils dbus dbus-glib-native glib-2.0 dbus-glib util-linux" | ||
6 | |||
7 | inherit autotools pkgconfig systemd update-rc.d | ||
8 | |||
9 | SRC_URI = "https://linutronix.de/${BPN}/files/${BPN}-${PV}.tar.gz \ | ||
10 | file://minicoredumper.service \ | ||
11 | file://minicoredumper.init \ | ||
12 | " | ||
13 | SRC_URI[md5sum] = "5ba9d116b52a8e2fb93456260644e753" | ||
14 | SRC_URI[sha256sum] = "1b0eeb3d70dbd2ad6f2f673e4e3446e5dd784e132730e21d8f9dc0977e47dd9a" | ||
15 | |||
16 | SYSTEMD_SERVICE_${PN} = "minicoredumper.service" | ||
17 | SYSTEMD_AUTO_ENABLE = "enable" | ||
18 | |||
19 | INITSCRIPT_PACKAGES = "${PN}" | ||
20 | INITSCRIPT_NAME_${PN} = "minicoredumper" | ||
21 | INITSCRIPT_PARAMS_${PN} = "defaults 89" | ||
22 | |||
23 | do_install_append() { | ||
24 | install -d ${D}/${sysconfdir}/minicoredumper | ||
25 | cp -rf ${S}/etc/* ${D}/${sysconfdir}/ | ||
26 | |||
27 | install -d ${D}${systemd_system_unitdir} | ||
28 | install -m 0644 ${WORKDIR}/minicoredumper.service ${D}${systemd_system_unitdir} | ||
29 | install -d ${D}${sysconfdir}/init.d | ||
30 | install -m 0644 ${WORKDIR}/minicoredumper.init ${D}${sysconfdir}/init.d/minicoredumper | ||
31 | } | ||