diff options
5 files changed, 155 insertions, 1 deletions
diff --git a/meta-oe/dynamic-layers/perl-layer/recipes-core/packagegroups/packagegroup-meta-oe.bbappend b/meta-oe/dynamic-layers/perl-layer/recipes-core/packagegroups/packagegroup-meta-oe.bbappend index 69bc788a86..2aee5975d7 100644 --- a/meta-oe/dynamic-layers/perl-layer/recipes-core/packagegroups/packagegroup-meta-oe.bbappend +++ b/meta-oe/dynamic-layers/perl-layer/recipes-core/packagegroups/packagegroup-meta-oe.bbappend | |||
@@ -1 +1 @@ | |||
RDEPENDS_packagegroup-meta-oe-support += "debsums" | RDEPENDS_packagegroup-meta-oe-support += "debsums rasdaemon" | ||
diff --git a/meta-oe/dynamic-layers/perl-layer/recipes-support/rasdaemon/files/0001-Fix-system-header-includes.patch b/meta-oe/dynamic-layers/perl-layer/recipes-support/rasdaemon/files/0001-Fix-system-header-includes.patch new file mode 100644 index 0000000000..0164321312 --- /dev/null +++ b/meta-oe/dynamic-layers/perl-layer/recipes-support/rasdaemon/files/0001-Fix-system-header-includes.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From 18786db1ad03716267927d983c83275469a1478a Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 8 May 2020 12:27:19 -0700 | ||
4 | Subject: [PATCH] Fix system header includes | ||
5 | |||
6 | Use poll.h instead of sys/poll.h | ||
7 | Fixes | ||
8 | warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp] | ||
9 | |||
10 | Include limits.h for PATH_MAX | ||
11 | |||
12 | Fixes | ||
13 | ras-events.c:359:16: error: 'PATH_MAX' undeclared (first use in this function) | ||
14 | 359 | char pipe_raw[PATH_MAX]; | ||
15 | | ^~~~~~~~ | ||
16 | |||
17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
18 | --- | ||
19 | ras-events.c | 3 ++- | ||
20 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
21 | |||
22 | diff --git a/ras-events.c b/ras-events.c | ||
23 | index 511c93d..400e740 100644 | ||
24 | --- a/ras-events.c | ||
25 | +++ b/ras-events.c | ||
26 | @@ -18,13 +18,14 @@ | ||
27 | #include <dirent.h> | ||
28 | #include <errno.h> | ||
29 | #include <fcntl.h> | ||
30 | +#include <limits.h> | ||
31 | +#include <poll.h> | ||
32 | #include <stdio.h> | ||
33 | #include <stdlib.h> | ||
34 | #include <string.h> | ||
35 | #include <unistd.h> | ||
36 | #include <sys/stat.h> | ||
37 | #include <sys/types.h> | ||
38 | -#include <sys/poll.h> | ||
39 | #include <signal.h> | ||
40 | #include <sys/signalfd.h> | ||
41 | #include "libtrace/kbuffer.h" | ||
42 | -- | ||
43 | 2.26.2 | ||
44 | |||
diff --git a/meta-oe/dynamic-layers/perl-layer/recipes-support/rasdaemon/files/init b/meta-oe/dynamic-layers/perl-layer/recipes-support/rasdaemon/files/init new file mode 100644 index 0000000000..216677e73e --- /dev/null +++ b/meta-oe/dynamic-layers/perl-layer/recipes-support/rasdaemon/files/init | |||
@@ -0,0 +1,43 @@ | |||
1 | #! /bin/sh | ||
2 | # /etc/init.d/rasdaemon: start rasdaemon service | ||
3 | |||
4 | . /etc/init.d/functions | ||
5 | |||
6 | # Defaults | ||
7 | PIDFILE=/var/run/rasdaemon.pid | ||
8 | BINFILE=/usr/sbin/rasdaemon | ||
9 | SCRIPTNAME=/etc/init.d/rasdaemon | ||
10 | |||
11 | [ -x $BINFILE ] || exit 0 | ||
12 | |||
13 | case "$1" in | ||
14 | start) | ||
15 | echo -n "Starting RASdaemon services: " | ||
16 | if [ ! -f "$PIDFILE" ]; then | ||
17 | start-stop-daemon --start --quiet --exec $BINFILE -- --enable &> /dev/null | ||
18 | start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $BINFILE -- --record | ||
19 | pidof $BINFILE > $PIDFILE | ||
20 | fi | ||
21 | [ -f $PIDFILE ] && echo "done." || echo "fail." | ||
22 | ;; | ||
23 | stop) | ||
24 | echo -n "Stopping RASdaemon services: " | ||
25 | if [ -f "$PIDFILE" ] ; then | ||
26 | start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $BINFILE -- --disable &> /dev/null | ||
27 | killproc $BINFILE | ||
28 | rm $PIDFILE | ||
29 | fi | ||
30 | [ ! -f $PIDFILE ] && echo "done." || echo "fail." | ||
31 | ;; | ||
32 | restart) | ||
33 | $0 stop | ||
34 | sleep 1 | ||
35 | $0 start | ||
36 | ;; | ||
37 | status) | ||
38 | status $BINFILE | ||
39 | ;; | ||
40 | *) | ||
41 | echo "Usage: $SCRIPTNAME {start|stop|restart|status}" | ||
42 | exit 1 | ||
43 | esac | ||
diff --git a/meta-oe/dynamic-layers/perl-layer/recipes-support/rasdaemon/files/rasdaemon.service b/meta-oe/dynamic-layers/perl-layer/recipes-support/rasdaemon/files/rasdaemon.service new file mode 100644 index 0000000000..4fbf23142a --- /dev/null +++ b/meta-oe/dynamic-layers/perl-layer/recipes-support/rasdaemon/files/rasdaemon.service | |||
@@ -0,0 +1,12 @@ | |||
1 | [Unit] | ||
2 | Description=RAS daemon to log the RAS events | ||
3 | After=syslog.target | ||
4 | |||
5 | [Service] | ||
6 | ExecStart=/usr/sbin/rasdaemon -f -r | ||
7 | ExecStartPost=/usr/sbin/rasdaemon --enable | ||
8 | ExecStop=/usr/sbin/rasdaemon --disable | ||
9 | Restart=on-abort | ||
10 | |||
11 | [Install] | ||
12 | WantedBy=multi-user.target | ||
diff --git a/meta-oe/dynamic-layers/perl-layer/recipes-support/rasdaemon/rasdaemon_0.6.5.bb b/meta-oe/dynamic-layers/perl-layer/recipes-support/rasdaemon/rasdaemon_0.6.5.bb new file mode 100644 index 0000000000..93f624882d --- /dev/null +++ b/meta-oe/dynamic-layers/perl-layer/recipes-support/rasdaemon/rasdaemon_0.6.5.bb | |||
@@ -0,0 +1,55 @@ | |||
1 | DESCRIPTION = "Tools to provide a way to get Platform Reliability, Availability and Serviceability (RAS) reports made via the Kernel tracing events" | ||
2 | HOMEPAGE = "http://git.infradead.org/users/mchehab/rasdaemon.git" | ||
3 | LICENSE = "GPLv2" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=d3070efe0afa3dc41608bd82c00bb0dc" | ||
5 | |||
6 | SRC_URI = "git://git.infradead.org/users/mchehab/rasdaemon.git;branch=master \ | ||
7 | file://0001-Fix-system-header-includes.patch \ | ||
8 | file://rasdaemon.service \ | ||
9 | file://init" | ||
10 | |||
11 | SRCREV = "25533c0c55426eeb2ad25dcbdb2b5e4ba4e83d80" | ||
12 | |||
13 | S = "${WORKDIR}/git" | ||
14 | |||
15 | RDEPENDS_${BPN} = "perl perl-module-file-basename perl-module-file-find perl-module-file-spec perl-module-getopt-long \ | ||
16 | perl-module-posix perl-module-file-glob libdbi-perl libdbd-sqlite-perl" | ||
17 | |||
18 | inherit autotools pkgconfig update-rc.d systemd | ||
19 | |||
20 | PACKAGECONFIG ??= "sqlite3 mce aer extlog devlink diskerror" | ||
21 | PACKAGECONFIG[sqlite3] = "--enable-sqlite3,--disable-sqlite3,sqlite3" | ||
22 | PACKAGECONFIG[mce] = "--enable-mce,--disable-mce" | ||
23 | PACKAGECONFIG[aer] = "--enable-aer,--disable-aer" | ||
24 | PACKAGECONFIG[extlog] = "--enable-extlog,--disable-extlog" | ||
25 | PACKAGECONFIG[devlink] = "--enable-devlink,--disable-devlink" | ||
26 | PACKAGECONFIG[diskerror] = "--enable-diskerror,--disable-diskerror" | ||
27 | PACKAGECONFIG[arm] = "--enable-arm,--disable-arm" | ||
28 | PACKAGECONFIG[hisi-ns-decode] = "--enable-hisi-ns-decode,--disable-hisi-ns-decode" | ||
29 | PACKAGECONFIG[non-standard] = "--enable-non-standard,--disable-non-standard" | ||
30 | PACKAGECONFIG[abrt-report] = "--enable-abrt-report,--disable-abrt-report" | ||
31 | |||
32 | DEPENDS_append_libc-musl = " argp-standalone" | ||
33 | LDFLAGS_append_libc-musl = " -largp" | ||
34 | |||
35 | do_configure_prepend () { | ||
36 | ( cd ${S}; autoreconf -vfi ) | ||
37 | } | ||
38 | |||
39 | do_install_append() { | ||
40 | install -d ${D}${sysconfdir}/init.d | ||
41 | install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/rasdaemon | ||
42 | install -d ${D}${systemd_unitdir}/system | ||
43 | install -m 0644 ${WORKDIR}/rasdaemon.service ${D}${systemd_unitdir}/system | ||
44 | } | ||
45 | |||
46 | FILES_${PN} += "${sbindir}/rasdaemon \ | ||
47 | ${sysconfdir}/init.d \ | ||
48 | ${systemd_unitdir}/system/rasdaemon.service" | ||
49 | |||
50 | SYSTEMD_SERVICE_${PN} = "rasdaemon.service" | ||
51 | SYSTEMD_AUTO_ENABLE = "enable" | ||
52 | |||
53 | INITSCRIPT_PACKAGES = "${PN}" | ||
54 | INITSCRIPT_NAME_${PN} = "rasdaemon" | ||
55 | INITSCRIPT_PARAMS_${PN} = "defaults 89" | ||