package: add rasdaemon support.
PATCH 2/2 support/testing: add rasdaemon tests
In reply to Bastien Curutchet via buildrootRasdaemon was added in previous patch.
Add a test_rasdaemon that allows to build-test it. The test only consists of getting rasdaemon's version.
--- DEVELOPERS | 1 + support/testing/tests/package/test_rasdaemon.py | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+)
DEVELOPERS +1 -0
@@ -343,6 +343,7 @@ F: package/uhubctl/ N: Bastien Curutchet <[email protected]> F: package/rasdaemon/ +F: support/testing/tests/package/test_rasdaemon.py N: Baxiche Su <[email protected]> F: package/qt6/qt6multimedia/
support/testing/tests/package/test_rasdaemon.py new file +25 -0
@@ -0,0 +1,25 @@ +import os + +import infra.basetest + + +class TestRasdaemon(infra.basetest.BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ + """ + BR2_PACKAGE_RASDAEMON=y + BR2_PACKAGE_RASDAEMON_AER=y + BR2_PACKAGE_LIBTRACEEVENT=y + BR2_PACKAGE_SQLITE=y + BR2_PACKAGE_PCIUTILS=y + BR2_TARGET_ROOTFS_CPIO=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + + def test_run(self): + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv7", + kernel="builtin", + options=["-initrd", cpio_file]) + self.emulator.login() + + self.assertRunOk("/usr/sbin/rasdaemon --version")
Signature · 6 lines
2.51.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
cover package: add rasdaemon support.
Hi all,
Rasdaemon is a tool that provides a way to collect all hardware error events reported by the Linux kernel in a common framework.
My use case is on a PowerPC P2020. I use to it to monitor and react to the PCIe AER events caught by the SoC's EDAC.
The first patch adds the package. The second one adds a small test for it in support/testing.
---
Bastien Curutchet (2):
package/rasdaemon: Add rasdaemon package
support/testing: add rasdaemon tests
DEVELOPERS | 4 ++ package/Config.in | 1 + package/rasdaemon/Config.in | 23 +++++++++ package/rasdaemon/S95rasdaemon | 62 +++++++++++++++++++++++++ package/rasdaemon/rasdaemon.hash | 1 + package/rasdaemon/rasdaemon.mk | 33 +++++++++++++ support/testing/tests/package/test_rasdaemon.py | 25 ++++++++++ 7 files changed, 149 insertions(+)
---
base-commit: c8cb1a238de5a803228f12ad32b36cae2acfc778
change-id: 20251125-rasdaemon-1df4904ddfde
Best regards,
Signature · 6 lines
Bastien Curutchet <[email protected]> _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 1/2 package/rasdaemon: Add rasdaemon package
Rasdaemon is a tool that aims to replace the edac-tool and provide a way to collect all hardware error events reported by the Linux kernel in a common framework.
Add a new package to support rasdaemon in the 'Hardware handling' section. It depends on libtraceevents to detect the ftrace events generated by the kernel and on sqlite to store these events.
Support for the PCIe AER events is optionnal and implies a dependency on pciutils so also add a dedicated 'sub-option' to enable it.
Add a SYSV init script to start / stop the daemon
Add myself to the DEVELOPERS file.
--- DEVELOPERS | 3 ++ package/Config.in | 1 + package/rasdaemon/Config.in | 23 +++++++++++++++ package/rasdaemon/S95rasdaemon | 62 ++++++++++++++++++++++++++++++++++++++++ package/rasdaemon/rasdaemon.hash | 1 + package/rasdaemon/rasdaemon.mk | 33 +++++++++++++++++++++ 6 files changed, 123 insertions(+)
DEVELOPERS +3 -0
@@ -341,6 +341,9 @@ F: package/tcpdump/ F: package/ti-uim/ F: package/uhubctl/ +N: Bastien Curutchet <[email protected]> +F: package/rasdaemon/ + N: Baxiche Su <[email protected]> F: package/qt6/qt6multimedia/
package/Config.in +1 -0
@@ -584,6 +584,7 @@ endmenu source "package/pru-software-support/Config.in" source "package/pulseview/Config.in" source "package/qoriq-cadence-dp-firmware/Config.in" + source "package/rasdaemon/Config.in" source "package/raspi-gpio/Config.in" source "package/rdma-core/Config.in" source "package/read-edid/Config.in"
package/rasdaemon/Config.in new file +23 -0
@@ -0,0 +1,23 @@ +config BR2_PACKAGE_RASDAEMON + bool "rasdaemon" + depends on !BR2_STATIC_LIBS # libtraceevent + select BR2_PACKAGE_LIBTRACEEVENT + select BR2_PACKAGE_SQLITE + select BR2_PACKAGE_ARGP_STANDALONE if BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_MUSL + help + rasdaemon is a tool that collects all hardware error events + reported by the Linux Kernel from several sources (EDAC, MCE + PCI, ...) into one common framework. + See https://github.com/mchehab/rasdaemon for details. + +if BR2_PACKAGE_RASDAEMON + +config BR2_PACKAGE_RASDAEMON_AER + bool "Enable AER support" + default y + select BR2_PACKAGE_PCIUTILS + help + Enable handling of AER (Advanced Error Reporting) events on + PCIe + +endif
package/rasdaemon/S95rasdaemon new file +62 -0
62 lines not on this page · raw message
package/rasdaemon/rasdaemon.hash new file +1 -0
@@ -0,0 +1 @@ +sha256 7e12459f9477036491ac2b1e4c07cc3e8efea6dcd30525a263ab1f83910b773a rasdaemon-0.8.4.tar.gz
package/rasdaemon/rasdaemon.mk new file +33 -0
@@ -0,0 +1,33 @@ +################################################################################ +# +# rasdaemon +# +################################################################################ + +RASDAEMON_VERSION = 0.8.4 +RASDAEMON_SITE = $(call github,mchehab,rasdaemon,v$(RASDAEMON_VERSION)) +RASDAEMON_LICENSE = GPL-2.0+ +RASDAEMON_LICENSE_FILES = COPYING +RASDAEMON_AUTORECONF = YES + +RASDAEMON_DEPENDENCIES = libtraceevent sqlite +# rasdaemon uses argp.h which is not provided by uclibc or musl by default. +# Use the argp-standalone package to provide this. +ifeq ($(BR2_PACKAGE_ARGP_STANDALONE),y) +RASDAEMON_DEPENDENCIES += argp-standalone +RASDAEMON_CONF_ENV += LIBS="-largp" +endif + +ifeq ($(BR2_PACKAGE_RASDAEMON_AER),y) +RASDAEMON_DEPENDENCIES += pciutils +RASDAEMON_CONF_OPTS += --enable-aer +else +RASDAEMON_CONF_OPTS += --disable-aer +endif + +define RASDAEMON_INSTALL_INIT_SYSV + $(INSTALL) -m 0755 -D package/rasdaemon/S95rasdaemon \ + $(TARGET_DIR)/etc/init.d/S95rasdaemon +endef + +$(eval $(autotools-package))
Signature · 6 lines
2.51.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 1/2] package/rasdaemon: Add rasdaemon package
Hello Bastien,
Thanks for the patch! Some comments below.
Quoted 19 lines · On Wed, 26 Nov 2025 11:20:09 +0100 Bastien Curutchet…
package/rasdaemon/Config.in new file +13
-0@@ -0,0 +1,23 @@ +config BR2_PACKAGE_RASDAEMON + bool "rasdaemon" + depends on !BR2_STATIC_LIBS # libtraceevent + select BR2_PACKAGE_LIBTRACEEVENT + select BR2_PACKAGE_SQLITE + select BR2_PACKAGE_ARGP_STANDALONE if BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_MUSL + help + rasdaemon is a tool that collects all hardware error events + reported by the Linux Kernel from several sources (EDAC, MCE + PCI, ...) into one common framework. + See https://github.com/mchehab/rasdaemon for details. + +if BR2_PACKAGE_RASDAEMON
package/rasdaemon/Config.in line 23
Quoted 10 lines
package/rasdaemon/Config.in new file +10
-0+ +config BR2_PACKAGE_RASDAEMON_AER + bool "Enable AER support" + default y + select BR2_PACKAGE_PCIUTILS + help + Enable handling of AER (Advanced Error Reporting) events on + PCIe + +endif
You need here:
comment "rasdaemon needs a toolchain w/ dynamic library"
depends on BR2_STATIC_LIBS
Also, I'm in fact not sure the "default y" is good for BR2_PACKAGE_RASDAEMON_AER. We generally try to keep optional features disabled by default in Buildroot, and especially if they bring additional dependencies.
package/rasdaemon/rasdaemon.hash
Quoted 6 lines
package/rasdaemon/rasdaemon.hash new file +0
-0@@ -0,0 +1 @@
Please add:
# Locally calculated
here
package/rasdaemon/rasdaemon.hash line 1
Quoted 1 line
package/rasdaemon/rasdaemon.hash new file +1
-0+sha256 7e12459f9477036491ac2b1e4c07cc3e8efea6dcd30525a263ab1f83910b773a rasdaemon-0.8.4.tar.gz
And also, add the hash of the license file.
Thanks!
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 2/2] support/testing: add rasdaemon tests
In reply to Bastien Curutchet via buildrootHello,
Quoted 10 lines · On Wed, 26 Nov 2025 11:20:10 +0100 Bastien Curutchet…
support/testing/tests/package/test_rasdaemon.py new file +10
-0+class TestRasdaemon(infra.basetest.BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ + """ + BR2_PACKAGE_RASDAEMON=y + BR2_PACKAGE_RASDAEMON_AER=y + BR2_PACKAGE_LIBTRACEEVENT=y + BR2_PACKAGE_SQLITE=y + BR2_PACKAGE_PCIUTILS=y + BR2_TARGET_ROOTFS_CPIO=y + # BR2_TARGET_ROOTFS_TAR is not set
support/testing/tests/package/test_rasdaemon.py line 25
Quoted 10 lines
support/testing/tests/package/test_rasdaemon.py new file +10
-0+ """ + + def test_run(self): + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv7", + kernel="builtin", + options=["-initrd", cpio_file]) + self.emulator.login() + + self.assertRunOk("/usr/sbin/rasdaemon --version")
Since it installs an init script, what about checking that the daemon is actually running?
Bonus point if you're actually able to inject an error, and verify that rasdaemon reacts to it by running some arbitrary action :-)
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 1/2] package/rasdaemon: Add rasdaemon package
In reply to Bastien Curutchet via buildrootHi Bastien!
Am 26.11.25 um 11:20 schrieb Bastien Curutchet:
Quoted 89 lines
Rasdaemon is a tool that aims to replace the edac-tool and provide a way to collect all hardware error events reported by the Linux kernel in a common framework.
Add a new package to support rasdaemon in the 'Hardware handling' section. It depends on libtraceevents to detect the ftrace events generated by the kernel and on sqlite to store these events.
Support for the PCIe AER events is optionnal and implies a dependency on pciutils so also add a dedicated 'sub-option' to enable it.
Add a SYSV init script to start / stop the daemon
Add myself to the DEVELOPERS file.
Signed-off-by Bastien Curutchet <[email protected]>--- DEVELOPERS | 3 ++ package/Config.in | 1 + package/rasdaemon/Config.in | 23 +++++++++++++++ package/rasdaemon/S95rasdaemon | 62 ++++++++++++++++++++++++++++++++++++++++ package/rasdaemon/rasdaemon.hash | 1 + package/rasdaemon/rasdaemon.mk | 33 +++++++++++++++++++++ 6 files changed, 123 insertions(+)DEVELOPERS +3
-0@@ -341,6 +341,9 @@ F: package/tcpdump/ F: package/ti-uim/ F: package/uhubctl/ +N: Bastien Curutchet <[email protected]> +F: package/rasdaemon/ + N: Baxiche Su <[email protected]> F: package/qt6/qt6multimedia/package/Config.in +1
-0@@ -584,6 +584,7 @@ endmenu source "package/pru-software-support/Config.in" source "package/pulseview/Config.in" source "package/qoriq-cadence-dp-firmware/Config.in" + source "package/rasdaemon/Config.in" source "package/raspi-gpio/Config.in" source "package/rdma-core/Config.in" source "package/read-edid/Config.in"package/rasdaemon/Config.in new file +23
-0@@ -0,0 +1,23 @@ +config BR2_PACKAGE_RASDAEMON + bool "rasdaemon" + depends on !BR2_STATIC_LIBS # libtraceevent + select BR2_PACKAGE_LIBTRACEEVENT + select BR2_PACKAGE_SQLITE + select BR2_PACKAGE_ARGP_STANDALONE if BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_MUSL + help + rasdaemon is a tool that collects all hardware error events + reported by the Linux Kernel from several sources (EDAC, MCE + PCI, ...) into one common framework. + See https://github.com/mchehab/rasdaemon for details. + +if BR2_PACKAGE_RASDAEMON + +config BR2_PACKAGE_RASDAEMON_AER + bool "Enable AER support" + default y + select BR2_PACKAGE_PCIUTILS + help + Enable handling of AER (Advanced Error Reporting) events on + PCIe + +endifpackage/rasdaemon/S95rasdaemon new file +3
-0@@ -0,0 +1,62 @@ +#!/bin/sh +# +# S95rasdaemon Starts Rasdaemon.
package/rasdaemon/S95rasdaemon line 13
Quoted 10 lines
package/rasdaemon/S95rasdaemon new file +10
-0+# +# shellcheck disable=SC2317 # functions are called via variable + +DAEMON="rasdaemon" + +start() { + printf "Starting %s: " "$DAEMON" + + if ! grep -q debugfs /proc/mounts ; then + # rasdaemon fails silently if debugfs isn't mounted
Printing that instead of a comment would be helpful, so users without debugfs know why rasdaemon fails to start.
package/rasdaemon/S95rasdaemon line 15
Quoted 2 lines
package/rasdaemon/S95rasdaemon new file +2
-0+ echo "FAIL" + return $?
This would return the exit status of "echo", which is practically always going to be 0. "return 1" would probably be more appropriate.
Quoted 13 lines
package/rasdaemon/S95rasdaemon new file +13
-0+ fi + + start-stop-daemon --start --exec "/usr/sbin/$DAEMON" + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +stop() {
package/rasdaemon/S95rasdaemon line 38
Quoted 10 lines
package/rasdaemon/S95rasdaemon new file +10
-0+ printf "Stopping %s: " "$DAEMON" + start-stop-daemon --stop --exec "/usr/sbin/$DAEMON" + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + # $DAEMON deletes its PID file on exit, wait for it to be gone + while [ -f "$PIDFILE" ]; do
The PIDFILE variable isn't defined anywhere, that can't be right. Generally *all* start-stop-daemon calls should use --pidfile $PIDFILE so start-stop-daemon can keep track of exact process (in addition to --exec). Exactly how to manage the PID file depends on the behavior of the daemon, please see:
https://nightly.buildroot.org/#_handling_the_pid_file
(or docs/manual/adding-packages-directory.adoc in the repo, search for PID to find the section)
In any case, you need to set the PIDFILE variable in the init script. ;-)
Best regards,
Fiona
Quoted 61 lines
package/rasdaemon/S95rasdaemon new file +24
-0+ sleep 0.1 + done + return "$status" +} + +restart() { + stop + start +} + +reload() { + restart +} + +case "$1" in + start|stop|reload|restart) + "$1" + ;; + *) + echo "Usage: $0 {start|stop|reload|restart}" + exit 1 +esac + +exit $?package/rasdaemon/rasdaemon.hash new file +1
-0@@ -0,0 +1 @@ +sha256 7e12459f9477036491ac2b1e4c07cc3e8efea6dcd30525a263ab1f83910b773a rasdaemon-0.8.4.tar.gzpackage/rasdaemon/rasdaemon.mk new file +23
-0@@ -0,0 +1,33 @@ +################################################################################ +# +# rasdaemon +# +################################################################################ + +RASDAEMON_VERSION = 0.8.4 +RASDAEMON_SITE = $(call github,mchehab,rasdaemon,v$(RASDAEMON_VERSION)) +RASDAEMON_LICENSE = GPL-2.0+ +RASDAEMON_LICENSE_FILES = COPYING +RASDAEMON_AUTORECONF = YES + +RASDAEMON_DEPENDENCIES = libtraceevent sqlite +# rasdaemon uses argp.h which is not provided by uclibc or musl by default. +# Use the argp-standalone package to provide this. +ifeq ($(BR2_PACKAGE_ARGP_STANDALONE),y) +RASDAEMON_DEPENDENCIES += argp-standalone +RASDAEMON_CONF_ENV += LIBS="-largp" +endif + +ifeq ($(BR2_PACKAGE_RASDAEMON_AER),y) +RASDAEMON_DEPENDENCIES += pciutils +RASDAEMON_CONF_OPTS += --enable-aer
package/rasdaemon/rasdaemon.mk line 33
Quoted 10 lines
package/rasdaemon/rasdaemon.mk new file +10
-0+else +RASDAEMON_CONF_OPTS += --disable-aer +endif + +define RASDAEMON_INSTALL_INIT_SYSV + $(INSTALL) -m 0755 -D package/rasdaemon/S95rasdaemon \ + $(TARGET_DIR)/etc/init.d/S95rasdaemon +endef + +$(eval $(autotools-package))
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 1/2] package/rasdaemon: Add rasdaemon package
Hi Fiona,
Quoted 96 lines · Fiona Klute
Hi Bastien!
Am 26.11.25 um 11:20 schrieb Bastien Curutchet:
Quoted 93 lines
Rasdaemon is a tool that aims to replace the edac-tool and provide a way to collect all hardware error events reported by the Linux kernel in a common framework.
Add a new package to support rasdaemon in the 'Hardware handling' section. It depends on libtraceevents to detect the ftrace events generated by the kernel and on sqlite to store these events.
Support for the PCIe AER events is optionnal and implies a dependency on pciutils so also add a dedicated 'sub-option' to enable it.
Add a SYSV init script to start / stop the daemon
Add myself to the DEVELOPERS file.
Signed-off-by Bastien Curutchet <[email protected]>---
DEVELOPERS | 3 ++ package/Config.in | 1 + package/rasdaemon/Config.in | 23 +++++++++++++++ package/rasdaemon/S95rasdaemon | 62 ++++++++++++++++++++++++++++++
++++++++++
package/rasdaemon/rasdaemon.hash | 1 + package/rasdaemon/rasdaemon.mk | 33 +++++++++++++++++++++6 files changed, 123 insertions(+)DEVELOPERS +0
-0@@ -341,6 +341,9 @@ F: package/tcpdump/F: package/ti-uim/
F: package/uhubctl/DEVELOPERS +3
-0+N: Bastien Curutchet <[email protected]> +F: package/rasdaemon/ +N: Baxiche Su <[email protected]>
F: package/qt6/qt6multimedia/package/Config.in +0
-0@@ -584,6 +584,7 @@ endmenusource "package/pru-software-support/Config.in" source "package/pulseview/Config.in"
source "package/qoriq-cadence-dp-firmware/Config.in" + source "package/rasdaemon/Config.in"
source "package/raspi-gpio/Config.in" source "package/rdma-core/Config.in"
source "package/read-edid/Config.in"package/rasdaemon/Config.in new file +6
-0@@ -0,0 +1,23 @@ +config BR2_PACKAGE_RASDAEMON + bool "rasdaemon" + depends on !BR2_STATIC_LIBS # libtraceevent + select BR2_PACKAGE_LIBTRACEEVENT + select BR2_PACKAGE_SQLITE + select BR2_PACKAGE_ARGP_STANDALONE if BR2_TOOLCHAIN_USES_UCLIBC||
BR2_TOOLCHAIN_USES_MUSL
+ help
+ rasdaemon is a tool that collects all hardware error events + reported by the Linux Kernel from several sources (EDAC, MCE + PCI, ...) into one common framework.
+ See https://github.com/mchehab/rasdaemon for details.package/rasdaemon/Config.in new file +12
-0+ +if BR2_PACKAGE_RASDAEMON + +config BR2_PACKAGE_RASDAEMON_AER + bool "Enable AER support" + default y + select BR2_PACKAGE_PCIUTILS + help + Enable handling of AER (Advanced Error Reporting) events on + PCIe + +endifpackage/rasdaemon/S95rasdaemon new file +7
-0@@ -0,0 +1,62 @@ +#!/bin/sh +# +# S95rasdaemon Starts Rasdaemon. +# +# shellcheck disable=SC2317 # functions are called via variable + +DAEMON="rasdaemon"
Quoted 9 lines
package/rasdaemon/S95rasdaemon line 13
Quoted 6 lines
package/rasdaemon/S95rasdaemon new file +6
-0+ +start() { + printf "Starting %s: " "$DAEMON" + + if ! grep -q debugfs /proc/mounts ; then + # rasdaemon fails silently if debugfs isn't mountedPrinting that instead of a comment would be helpful, so users without debugfs know why rasdaemon fails to start.
True, will do
Quoted 5 lines
package/rasdaemon/S95rasdaemon line 15
Quoted 2 lines
package/rasdaemon/S95rasdaemon new file +2
-0+ echo "FAIL" + return $?This would return the exit status of "echo", which is practically always going to be 0. "return 1" would probably be more appropriate.
Indeed, thanks
Quoted 17 lines
Quoted 17 lines
package/rasdaemon/S95rasdaemon new file +17
-0+ fi + + start-stop-daemon --start --exec "/usr/sbin/$DAEMON" + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +stop() { + printf "Stopping %s: " "$DAEMON" + start-stop-daemon --stop --exec "/usr/sbin/$DAEMON" + status=$? + if [ "$status" -eq 0 ]; then
Quoted 8 lines
package/rasdaemon/S95rasdaemon line 38
Quoted 6 lines
package/rasdaemon/S95rasdaemon new file +6
-0+ echo "OK" + else + echo "FAIL" + fi + # $DAEMON deletes its PID file on exit, wait for it to be gone + while [ -f "$PIDFILE" ]; doThe PIDFILE variable isn't defined anywhere, that can't be right.
Indeed ...
Quoted 2 lines
Generally *all* start-stop-daemon calls should use --pidfile $PIDFILE so start-stop-daemon can keep track of exact process (in addition to -- exec). Exactly how to manage the PID file depends on the behavior of the daemon, please see:
https://nightly.buildroot.org/#_handling_the_pid_file
Thanks for the pointer, I didn't know about the --make-pidfile option, I'll use it.
Quoted 4 lines
(or docs/manual/adding-packages-directory.adoc in the repo, search for PID to find the section)
In any case, you need to set the PIDFILE variable in the init script. ;-)
Best regards,
Bastien
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 1/2] package/rasdaemon: Add rasdaemon package
In reply to Thomas Petazzoni via buildrootHi Thomas,
Quoted 40 lines · Thomas Petazzoni
Hello Bastien,
Thanks for the patch! Some comments below.
Quoted 19 lines · On Wed, 26 Nov 2025 11:20:09 +0100 Bastien Curutchet…
package/rasdaemon/Config.in new file +13
-0@@ -0,0 +1,23 @@ +config BR2_PACKAGE_RASDAEMON + bool "rasdaemon" + depends on !BR2_STATIC_LIBS # libtraceevent + select BR2_PACKAGE_LIBTRACEEVENT + select BR2_PACKAGE_SQLITE + select BR2_PACKAGE_ARGP_STANDALONE if BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_MUSL + help + rasdaemon is a tool that collects all hardware error events + reported by the Linux Kernel from several sources (EDAC, MCE + PCI, ...) into one common framework. + See https://github.com/mchehab/rasdaemon for details. + +if BR2_PACKAGE_RASDAEMONpackage/rasdaemon/Config.in line 23
Quoted 10 lines
package/rasdaemon/Config.in new file +10
-0+ +config BR2_PACKAGE_RASDAEMON_AER + bool "Enable AER support" + default y + select BR2_PACKAGE_PCIUTILS + help + Enable handling of AER (Advanced Error Reporting) events on + PCIe + +endifYou need here:
Quoted 3 lines
comment "rasdaemon needs a toolchain w/ dynamic library"
depends onBR2_STATIC_LIBS
Ok.
Quoted 6 lines
Also, I'm in fact not sure the "default y" is good for
BR2_PACKAGE_RASDAEMON_AER. We generally try to keep optional features disabled by default in Buildroot, and especially if they bring additional dependencies.
Yep, I agree, I'll remove it.
Quoted 9 lines
package/rasdaemon/rasdaemon.hash
Quoted 6 lines
package/rasdaemon/rasdaemon.hash new file +0
-0@@ -0,0 +1 @@Please add:
Quoted 8 lines
# Locally calculated
here
package/rasdaemon/rasdaemon.hash line 1
Quoted 1 line
package/rasdaemon/rasdaemon.hash new file +1
-0+sha256 7e12459f9477036491ac2b1e4c07cc3e8efea6dcd30525a263ab1f83910b773a rasdaemon-0.8.4.tar.gzAnd also, add the hash of the license file.
Ok, I'll do it.
Best regards,
Bastien
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 2/2] support/testing: add rasdaemon tests
In reply to Thomas Petazzoni via buildrootHi,
Quoted 30 lines · Thomas Petazzoni
Hello,
Quoted 10 lines · On Wed, 26 Nov 2025 11:20:10 +0100 Bastien Curutchet…
support/testing/tests/package/test_rasdaemon.py new file +10
-0+class TestRasdaemon(infra.basetest.BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ + """ + BR2_PACKAGE_RASDAEMON=y + BR2_PACKAGE_RASDAEMON_AER=y + BR2_PACKAGE_LIBTRACEEVENT=y + BR2_PACKAGE_SQLITE=y + BR2_PACKAGE_PCIUTILS=y + BR2_TARGET_ROOTFS_CPIO=y + # BR2_TARGET_ROOTFS_TAR is not setsupport/testing/tests/package/test_rasdaemon.py line 25
Quoted 10 lines
support/testing/tests/package/test_rasdaemon.py new file +10
-0+ """ + + def test_run(self): + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv7", + kernel="builtin", + options=["-initrd", cpio_file]) + self.emulator.login() + + self.assertRunOk("/usr/sbin/rasdaemon --version")Since it installs an init script, what about checking that the daemon is actually running?
Quoted 3 lines
Bonus point if you're actually able to inject an error, and verify that rasdaemon reacts to it by running some arbitrary action :-)
I'll do my best to get that bonus point :)
Best regards,
Bastien
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 1/2] package/rasdaemon: Add rasdaemon package
In reply to Bastien Curutchet via buildrootAm 26.11.25 um 15:46 schrieb Bastien Curutchet:
Quoted 145 lines
Hi Fiona,
Quoted 96 lines · Fiona Klute
Hi Bastien!
Am 26.11.25 um 11:20 schrieb Bastien Curutchet:
Quoted 93 lines
Rasdaemon is a tool that aims to replace the edac-tool and provide a way to collect all hardware error events reported by the Linux kernel in a common framework.
Add a new package to support rasdaemon in the 'Hardware handling' section. It depends on libtraceevents to detect the ftrace events generated by the kernel and on sqlite to store these events.
Support for the PCIe AER events is optionnal and implies a dependency on pciutils so also add a dedicated 'sub-option' to enable it.
Add a SYSV init script to start / stop the daemon
Add myself to the DEVELOPERS file.
Signed-off-by Bastien Curutchet <[email protected]>---
DEVELOPERS | 3 ++ package/Config.in | 1 + package/rasdaemon/Config.in | 23 +++++++++++++++ package/rasdaemon/S95rasdaemon | 62 +++++++++++++++++++++++++++++
+ ++++++++++
package/rasdaemon/rasdaemon.hash | 1 + package/rasdaemon/rasdaemon.mk | 33 +++++++++++++++++++++6 files changed, 123 insertions(+)DEVELOPERS +0
-0@@ -341,6 +341,9 @@ F: package/tcpdump/F: package/ti-uim/
F: package/uhubctl/DEVELOPERS +3
-0+N: Bastien Curutchet <[email protected]> +F: package/rasdaemon/ +N: Baxiche Su <[email protected]>
F: package/qt6/qt6multimedia/package/Config.in +0
-0@@ -584,6 +584,7 @@ endmenusource "package/pru-software-support/Config.in" source "package/pulseview/Config.in"
source "package/qoriq-cadence-dp-firmware/Config.in" + source "package/rasdaemon/Config.in"
source "package/raspi-gpio/Config.in" source "package/rdma-core/Config.in"
source "package/read-edid/Config.in"package/rasdaemon/Config.in new file +6
-0@@ -0,0 +1,23 @@ +config BR2_PACKAGE_RASDAEMON + bool "rasdaemon" + depends on !BR2_STATIC_LIBS # libtraceevent + select BR2_PACKAGE_LIBTRACEEVENT + select BR2_PACKAGE_SQLITE + select BR2_PACKAGE_ARGP_STANDALONE if BR2_TOOLCHAIN_USES_UCLIBC||
BR2_TOOLCHAIN_USES_MUSL
+ help
+ rasdaemon is a tool that collects all hardware error events + reported by the Linux Kernel from several sources (EDAC, MCE + PCI, ...) into one common framework.
+ See https://github.com/mchehab/rasdaemon for details.package/rasdaemon/Config.in new file +12
-0+ +if BR2_PACKAGE_RASDAEMON + +config BR2_PACKAGE_RASDAEMON_AER + bool "Enable AER support" + default y + select BR2_PACKAGE_PCIUTILS + help + Enable handling of AER (Advanced Error Reporting) events on + PCIe + +endifpackage/rasdaemon/S95rasdaemon new file +7
-0@@ -0,0 +1,62 @@ +#!/bin/sh +# +# S95rasdaemon Starts Rasdaemon. +# +# shellcheck disable=SC2317 # functions are called via variable + +DAEMON="rasdaemon"Quoted 9 lines
package/rasdaemon/S95rasdaemon line 13
Quoted 6 lines
package/rasdaemon/S95rasdaemon new file +6
-0+ +start() { + printf "Starting %s: " "$DAEMON" + + if ! grep -q debugfs /proc/mounts ; then + # rasdaemon fails silently if debugfs isn't mountedPrinting that instead of a comment would be helpful, so users without debugfs know why rasdaemon fails to start.
True, will do
Quoted 5 lines
package/rasdaemon/S95rasdaemon line 15
Quoted 2 lines
package/rasdaemon/S95rasdaemon new file +2
-0+ echo "FAIL" + return $?This would return the exit status of "echo", which is practically always going to be 0. "return 1" would probably be more appropriate.
Indeed, thanks
Quoted 17 lines
Quoted 17 lines
package/rasdaemon/S95rasdaemon new file +17
-0+ fi + + start-stop-daemon --start --exec "/usr/sbin/$DAEMON" + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +stop() { + printf "Stopping %s: " "$DAEMON" + start-stop-daemon --stop --exec "/usr/sbin/$DAEMON" + status=$? + if [ "$status" -eq 0 ]; thenQuoted 8 lines
package/rasdaemon/S95rasdaemon line 38
Quoted 6 lines
package/rasdaemon/S95rasdaemon new file +6
-0+ echo "OK" + else + echo "FAIL" + fi + # $DAEMON deletes its PID file on exit, wait for it to be gone + while [ -f "$PIDFILE" ]; doThe PIDFILE variable isn't defined anywhere, that can't be right.
Quoted 8 lines
Indeed ...
Quoted 4 lines
Generally *all* start-stop-daemon calls should use --pidfile $PIDFILE so start-stop-daemon can keep track of exact process (in addition to -- exec). Exactly how to manage the PID file depends on the behavior
of the daemon, please see:
https://nightly.buildroot.org/#_handling_the_pid_fileThanks for the pointer, I didn't know about the --make-pidfile option, I'll use it.
Just to make sure, --pidfile and --make-pidfile are very different things. Generally you should always use the former, but the latter only if the service doesn't create a PID file on its own (and then only for the start operation). I'm not familiar with rasdaemon, so can't say if you need it. :-)
Best regards,
Fiona
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 1/2] package/rasdaemon: Add rasdaemon package
Hi Fiona,
Quoted 148 lines · Fiona Klute
Am 26.11.25 um 15:46 schrieb Bastien Curutchet:
Quoted 147 lines
Hi Fiona,
Quoted 96 lines · Fiona Klute
Hi Bastien!
Am 26.11.25 um 11:20 schrieb Bastien Curutchet:
Quoted 93 lines
Rasdaemon is a tool that aims to replace the edac-tool and provide a way to collect all hardware error events reported by the Linux kernel in a common framework.
Add a new package to support rasdaemon in the 'Hardware handling' section. It depends on libtraceevents to detect the ftrace events generated by the kernel and on sqlite to store these events.
Support for the PCIe AER events is optionnal and implies a dependency on pciutils so also add a dedicated 'sub-option' to enable it.
Add a SYSV init script to start / stop the daemon
Add myself to the DEVELOPERS file.
Signed-off-by Bastien Curutchet <[email protected]>---
DEVELOPERS | 3 ++ package/Config.in | 1 + package/rasdaemon/Config.in | 23 +++++++++++++++ package/rasdaemon/S95rasdaemon | 62 ++++++++++++++++++++++++++++
+ + ++++++++++
package/rasdaemon/rasdaemon.hash | 1 + package/rasdaemon/rasdaemon.mk | 33 +++++++++++++++++++++6 files changed, 123 insertions(+)DEVELOPERS +0
-0@@ -341,6 +341,9 @@ F: package/tcpdump/F: package/ti-uim/
F: package/uhubctl/DEVELOPERS +3
-0+N: Bastien Curutchet <[email protected]> +F: package/rasdaemon/ +N: Baxiche Su <[email protected]>
F: package/qt6/qt6multimedia/package/Config.in +0
-0@@ -584,6 +584,7 @@ endmenusource "package/pru-software-support/Config.in" source "package/pulseview/Config.in"
source "package/qoriq-cadence-dp-firmware/Config.in" + source "package/rasdaemon/Config.in"
source "package/raspi-gpio/Config.in" source "package/rdma-core/Config.in"
source "package/read-edid/Config.in"package/rasdaemon/Config.in new file +6
-0@@ -0,0 +1,23 @@ +config BR2_PACKAGE_RASDAEMON + bool "rasdaemon" + depends on !BR2_STATIC_LIBS # libtraceevent + select BR2_PACKAGE_LIBTRACEEVENT + select BR2_PACKAGE_SQLITE + select BR2_PACKAGE_ARGP_STANDALONE if BR2_TOOLCHAIN_USES_UCLIBC||
BR2_TOOLCHAIN_USES_MUSL
+ help
+ rasdaemon is a tool that collects all hardware error events + reported by the Linux Kernel from several sources (EDAC, MCE + PCI, ...) into one common framework.
+ See https://github.com/mchehab/rasdaemon for details.package/rasdaemon/Config.in new file +12
-0+ +if BR2_PACKAGE_RASDAEMON + +config BR2_PACKAGE_RASDAEMON_AER + bool "Enable AER support" + default y + select BR2_PACKAGE_PCIUTILS + help + Enable handling of AER (Advanced Error Reporting) events on + PCIe + +endifpackage/rasdaemon/S95rasdaemon new file +7
-0@@ -0,0 +1,62 @@ +#!/bin/sh +# +# S95rasdaemon Starts Rasdaemon. +# +# shellcheck disable=SC2317 # functions are called via variable + +DAEMON="rasdaemon"Quoted 9 lines
package/rasdaemon/S95rasdaemon line 13
Quoted 6 lines
package/rasdaemon/S95rasdaemon new file +6
-0+ +start() { + printf "Starting %s: " "$DAEMON" + + if ! grep -q debugfs /proc/mounts ; then + # rasdaemon fails silently if debugfs isn't mountedPrinting that instead of a comment would be helpful, so users without debugfs know why rasdaemon fails to start.
True, will do
Quoted 5 lines
package/rasdaemon/S95rasdaemon line 15
Quoted 2 lines
package/rasdaemon/S95rasdaemon new file +2
-0+ echo "FAIL" + return $?This would return the exit status of "echo", which is practically always going to be 0. "return 1" would probably be more appropriate.
Indeed, thanks
Quoted 17 lines
Quoted 17 lines
package/rasdaemon/S95rasdaemon new file +17
-0+ fi + + start-stop-daemon --start --exec "/usr/sbin/$DAEMON" + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +stop() { + printf "Stopping %s: " "$DAEMON" + start-stop-daemon --stop --exec "/usr/sbin/$DAEMON" + status=$? + if [ "$status" -eq 0 ]; thenQuoted 8 lines
package/rasdaemon/S95rasdaemon line 38
Quoted 6 lines
package/rasdaemon/S95rasdaemon new file +6
-0+ echo "OK" + else + echo "FAIL" + fi + # $DAEMON deletes its PID file on exit, wait for it to be gone + while [ -f "$PIDFILE" ]; doThe PIDFILE variable isn't defined anywhere, that can't be right.
Indeed ...
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Generally *all* start-stop-daemon calls should use --pidfile $PIDFILE so start-stop-daemon can keep track of exact process (in addition to -- exec). Exactly how to manage the PID file depends on the behavior
of the daemon, please see:
https://nightly.buildroot.org/#_handling_the_pid_fileThanks for the pointer, I didn't know about the --make-pidfile option, I'll use it.
Just to make sure, --pidfile and --make-pidfile are very different things. Generally you should always use the former, but the latter only if the service doesn't create a PID file on its own (and then only for the start operation). I'm not familiar with rasdaemon, so can't say if you need it. :-)
Yes that was clear to me. rasdaemon doesn't create any PID file, this is why I hadn't used the --pidfile initially.
Below how the start()/stop() looks like now (I still need to work on the selftest part before sending a new iteration):
```
start() {
printf "Starting %s: " "$DAEMON"
if ! grep -q debugfs /proc/mounts ; then
echo "FAIL : debugfs is missing"
return 1
fi
start-stop-daemon --start --pidfile "$PIDFILE" --make-pidfile \
--exec "/usr/sbin/$DAEMON"
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
# rasdaemon automatically forks itself into background
# so the $PIDFILE created by start-stop-daemon doesn't match
# the final's rasdaemon PID.
pidof "/usr/sbin/$DAEMON" > "$PIDFILE"
else
echo "FAIL"
fi
return "$status"
}
stop() {
printf "Stopping %s: " "$DAEMON"
start-stop-daemon --stop --pidfile "$PIDFILE" --exec "/usr/sbin/$DAEMON"
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
return "$status"
fi
while start-stop-daemon --stop --test --quiet --pidfile "$PIDFILE" \
--exec "/sbin/$DAEMON"; do
sleep 0.1
done
rm -f "$PIDFILE"
return "$status"
}
```Best regards,
Bastien
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot