Skip to contentSkip to conversation

package: add rasdaemon support.

PATCH Applied Bastien Curutchet via buildroot 1 participant 5 messages Dec 19, 2025 – Dec 31, 2025

lore
Share & tools
lore
#0 lore raw

v4 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. Adding fake error injections in the selftest isn't trivial so it only ensures the daemon does run.

---
Changes in v4:
- Add BR2_TOOLCHAIN_HAS_THREADS
- Make the sqlite dependency optional
- Fix Config.in format
- Add Fiona reviewed-by
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- PATCH 1: Init script: Run the daemon in foreground and use
--background to leave the PID file creation to start-stop-daemon
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- PATCH 1:
Init script: Use a PID file
Config.in: Add comment for the BR2_SHARED_LIBS dependency, fix the AER feature description rasdaemon.mk: Add License's hash
- PATCH 2:
Add a check to ensure the daemon does run once started by the init
script.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Bastien Curutchet (2):
package/rasdaemon: Add rasdaemon package
support/testing: add rasdaemon tests

 DEVELOPERS                                         |  4 ++
 package/Config.in                                  |  1 +
 ...aemon-fix-build-when-sqlite-isn-t-enabled.patch | 46 ++++++++++++++++
 package/rasdaemon/Config.in                        | 26 +++++++++
 package/rasdaemon/S95rasdaemon                     | 63 ++++++++++++++++++++++
 package/rasdaemon/rasdaemon.hash                   |  3 ++
 package/rasdaemon/rasdaemon.mk                     | 40 ++++++++++++++
 support/testing/tests/package/test_rasdaemon.py    | 46 ++++++++++++++++
 .../package/test_rasdaemon/linux-debugfs.fragment  |  8 +++
 9 files changed, 237 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
#1 lore raw

PATCH v4 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. There is currently a build issue when sqlite isn't availaible while it's supposed to be an optional dependency. This build issue is fixed by patch 0001 (which has been also submitted to the rasdaemon project itself).

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 +
 ...aemon-fix-build-when-sqlite-isn-t-enabled.patch | 46 ++++++++++++++++
 package/rasdaemon/Config.in                        | 26 +++++++++
 package/rasdaemon/S95rasdaemon                     | 63 ++++++++++++++++++++++
 package/rasdaemon/rasdaemon.hash                   |  3 ++
 package/rasdaemon/rasdaemon.mk                     | 40 ++++++++++++++
 7 files changed, 182 insertions(+)
DEVELOPERS +3 -0
index db001d6bb0707a5877c0849fa85fa736377e60dd..b1ead6d26c4e8ff160bcc7ed85b0945ac5e551dc 100644
@@ -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
index 12f327cb273526781d931b834e24d0df5024e80e..1a93cec2fa22e3a6e70acbf799b32b00d5e8b5de 100644
@@ -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/0001-rasdaemon-fix-build-when-sqlite-isn-t-enabled.patch new file +46 -0

46 lines not on this page · raw message

package/rasdaemon/Config.in new file +26 -0
new file mode 100644
index 0000000000000000000000000000000000000000..64ae4a82632db12f8915aee9b9d947945762438d
@@ -0,0 +1,26 @@
+config BR2_PACKAGE_RASDAEMON
+	bool "rasdaemon"
+	depends on !BR2_STATIC_LIBS # libtraceevent
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	select BR2_PACKAGE_LIBTRACEEVENT
+	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.
+
+	  https://github.com/mchehab/rasdaemon
+
+if BR2_PACKAGE_RASDAEMON
+
+config BR2_PACKAGE_RASDAEMON_AER
+	bool "Enable AER support"
+	select BR2_PACKAGE_PCIUTILS
+	help
+	  Enable handling of AER (Advanced Error Reporting) events on
+	  PCIe
+
+endif
+
+comment "rasdaemon needs a toolchain w/ threads, dynamic library"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
package/rasdaemon/S95rasdaemon new file +63 -0

63 lines not on this page · raw message

package/rasdaemon/rasdaemon.hash new file +3 -0
new file mode 100644
index 0000000000000000000000000000000000000000..e1b600a4893bef2f58c86f6d742fb7cbcb480fc8
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  7e12459f9477036491ac2b1e4c07cc3e8efea6dcd30525a263ab1f83910b773a  rasdaemon-0.8.4.tar.gz
+sha256  39bc367cd7cd291d217447632b28a74be414a52b142b1875ac8789184aeca7b2  COPYING
package/rasdaemon/rasdaemon.mk new file +40 -0
new file mode 100644
index 0000000000000000000000000000000000000000..a6f53a7b6abc898800d57b75235709875fcde7fa
@@ -0,0 +1,40 @@
+################################################################################
+#
+# 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
+# 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_SQLITE),y)
+RASDAEMON_CONF_OPTS += --enable-sqlite3
+RASDAEMON_DEPENDENCIES += sqlite
+else
+RASDAEMON_CONF_OPTS += --disable-sqlite3
+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.52.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH v4 1/2] package/rasdaemon: Add rasdaemon package

Hello Bastien,

Quoted 14 lines · On Fri, 19 Dec 2025 17:30:15 +0100 Bastien Curutchet via buildroot…

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. There is currently a build issue when sqlite isn't availaible while it's supposed to be an optional dependency. This build issue is fixed by patch 0001 (which has been also submitted to the rasdaemon project itself).

Support for the PCIe AER events is optionnal and implies a dependency on pciutils so also add a dedicated 'sub-option' to enable it.

Quoted 6 lines

Add a SYSV init script to start / stop the daemon

Add myself to the DEVELOPERS file.

Thanks, applied after adjusting the commit title to:

package/rasdaemon: new package

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
#3 lore raw

PATCH v4 2/2 support/testing: add rasdaemon tests

In reply to Bastien Curutchet via buildroot

Rasdaemon was added in previous patch.

Add a test_rasdaemon that allows to test it.
Test is done on x86. It first checks the daemon's version, then mounts debugfs and finally ensures that the init script allows to start/restart/stop the daemon.

---
 DEVELOPERS                                         |  1 +
 support/testing/tests/package/test_rasdaemon.py    | 46 ++++++++++++++++++++++
 .../package/test_rasdaemon/linux-debugfs.fragment  |  8 ++++
 3 files changed, 55 insertions(+)
DEVELOPERS +1 -0
index b1ead6d26c4e8ff160bcc7ed85b0945ac5e551dc..c9aaa8c9c8aa3d54c930476d9d450e7f990d9aac 100644
@@ -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 +46 -0

46 lines not on this page · raw message

support/testing/tests/package/test_rasdaemon/linux-debugfs.fragment new file +8 -0
new file mode 100644
index 0000000000000000000000000000000000000000..a334bc373179623f3c5b2c3727ee7738a0c2542e
@@ -0,0 +1,8 @@
+CONFIG_DEBUG_FS=y
+CONFIG_FTRACE=y
+CONFIG_USER_EVENTS=y
+CONFIG_TRACE_EVENT_INJECT=y
+CONFIG_PCI=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCIEAER=y
+CONFIG_MEMORY_FAILURE=y
Signature · 6 lines
2.52.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Re: [Buildroot] [PATCH v4 2/2] support/testing: add rasdaemon tests

Hello Bastien,

Quoted 8 lines · On Fri, 19 Dec 2025 17:30:16 +0100 Bastien Curutchet via buildroot…

Rasdaemon was added in previous patch.

Add a test_rasdaemon that allows to test it.
Test is done on x86. It first checks the daemon's version, then mounts debugfs and finally ensures that the init script allows to start/restart/stop the daemon.

I've applied, after doing some changes, see below.

support/testing/tests/package/test_rasdaemon.py line 10

Quoted 5 lines
support/testing/tests/package/test_rasdaemon.py new file +5 -0
+class TestRasdaemon(infra.basetest.BRTest):
+    config = f"""
+        BR2_x86_64=y
+        BR2_x86_corei7=y
+        BR2_INIT_SYSV=y

This was not needed, the default init system (Busybox) is fine.

support/testing/tests/package/test_rasdaemon.py line 17

Quoted 7 lines
support/testing/tests/package/test_rasdaemon.py new file +7 -0
+        BR2_LINUX_KERNEL=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+        BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.59"
+        BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+        BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/x86/linux.config"
+        BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="{infra.filepath("tests/package/test_rasdaemon/linux-debugfs.fragment")}"

This kernel wouldn't build as host-libelf and host-openssl were missing, so I've added:

+ BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+ BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y

Applied with those changes; 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