* [Buildroot] [PATCH v3 0/2] package: add rasdaemon support.
@ 2025-12-01 14:08 Bastien Curutchet via buildroot
2025-12-01 14:08 ` [Buildroot] [PATCH v3 1/2] package/rasdaemon: Add rasdaemon package Bastien Curutchet via buildroot
2025-12-01 14:08 ` [Buildroot] [PATCH v3 2/2] support/testing: add rasdaemon tests Bastien Curutchet via buildroot
0 siblings, 2 replies; 7+ messages in thread
From: Bastien Curutchet via buildroot @ 2025-12-01 14:08 UTC (permalink / raw)
To: buildroot; +Cc: Thomas Petazzoni, Fiona Klute, Bastien Curutchet
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.
Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
---
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/20251127-rasdaemon-v2-0-c57284751172@bootlin.com
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/20251126-rasdaemon-v1-0-38c590f3e591@bootlin.com
---
Bastien Curutchet (2):
package/rasdaemon: Add rasdaemon package
support/testing: add rasdaemon tests
DEVELOPERS | 4 ++
package/Config.in | 1 +
package/rasdaemon/Config.in | 25 +++++++++
package/rasdaemon/S95rasdaemon | 63 ++++++++++++++++++++++
package/rasdaemon/rasdaemon.hash | 3 ++
package/rasdaemon/rasdaemon.mk | 33 ++++++++++++
support/testing/tests/package/test_rasdaemon.py | 46 ++++++++++++++++
.../package/test_rasdaemon/linux-debugfs.fragment | 8 +++
8 files changed, 183 insertions(+)
---
base-commit: c8cb1a238de5a803228f12ad32b36cae2acfc778
change-id: 20251125-rasdaemon-1df4904ddfde
Best regards,
--
Bastien Curutchet <bastien.curutchet@bootlin.com>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 7+ messages in thread* [Buildroot] [PATCH v3 1/2] package/rasdaemon: Add rasdaemon package 2025-12-01 14:08 [Buildroot] [PATCH v3 0/2] package: add rasdaemon support Bastien Curutchet via buildroot @ 2025-12-01 14:08 ` Bastien Curutchet via buildroot 2025-12-01 16:26 ` Fiona Klute via buildroot 2025-12-13 22:11 ` Julien Olivain via buildroot 2025-12-01 14:08 ` [Buildroot] [PATCH v3 2/2] support/testing: add rasdaemon tests Bastien Curutchet via buildroot 1 sibling, 2 replies; 7+ messages in thread From: Bastien Curutchet via buildroot @ 2025-12-01 14:08 UTC (permalink / raw) To: buildroot; +Cc: Thomas Petazzoni, Fiona Klute, Bastien Curutchet 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 <bastien.curutchet@bootlin.com> --- DEVELOPERS | 3 ++ package/Config.in | 1 + package/rasdaemon/Config.in | 25 ++++++++++++++++ package/rasdaemon/S95rasdaemon | 63 ++++++++++++++++++++++++++++++++++++++++ package/rasdaemon/rasdaemon.hash | 3 ++ package/rasdaemon/rasdaemon.mk | 33 +++++++++++++++++++++ 6 files changed, 128 insertions(+) diff --git a/DEVELOPERS b/DEVELOPERS index db001d6bb0707a5877c0849fa85fa736377e60dd..b1ead6d26c4e8ff160bcc7ed85b0945ac5e551dc 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -341,6 +341,9 @@ F: package/tcpdump/ F: package/ti-uim/ F: package/uhubctl/ +N: Bastien Curutchet <bastien.curutchet@bootlin.com> +F: package/rasdaemon/ + N: Baxiche Su <baxiche@gmail.com> F: package/qt6/qt6multimedia/ diff --git a/package/Config.in b/package/Config.in index 12f327cb273526781d931b834e24d0df5024e80e..1a93cec2fa22e3a6e70acbf799b32b00d5e8b5de 100644 --- a/package/Config.in +++ b/package/Config.in @@ -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" diff --git a/package/rasdaemon/Config.in b/package/rasdaemon/Config.in new file mode 100644 index 0000000000000000000000000000000000000000..68cef3a313bf2b82a8306ed5e0ec581cd618531d --- /dev/null +++ b/package/rasdaemon/Config.in @@ -0,0 +1,25 @@ +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" + select BR2_PACKAGE_PCIUTILS + help + Enable handling of AER (Advanced Error Reporting) events on + PCIe + +endif + +comment "rasdaemon needs a toolchain w/ dynamic library" + depends on BR2_STATIC_LIBS diff --git a/package/rasdaemon/S95rasdaemon b/package/rasdaemon/S95rasdaemon new file mode 100644 index 0000000000000000000000000000000000000000..390ff9c9029ba9122217f13eb88bac7715c1c05f --- /dev/null +++ b/package/rasdaemon/S95rasdaemon @@ -0,0 +1,63 @@ +#!/bin/sh +# +# S95rasdaemon Starts Rasdaemon. +# +# shellcheck disable=SC2317 # functions are called via variable + +DAEMON="rasdaemon" +PIDFILE="/var/run/$DAEMON.pid" + +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 \ + --background --exec "/usr/sbin/$DAEMON" -- -f + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + 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" +} + +restart() { + stop + start +} + +reload() { + restart +} + +case "$1" in + start|stop|reload|restart) + "$1" + ;; + *) + echo "Usage: $0 {start|stop|reload|restart}" + exit 1 +esac diff --git a/package/rasdaemon/rasdaemon.hash b/package/rasdaemon/rasdaemon.hash new file mode 100644 index 0000000000000000000000000000000000000000..e1b600a4893bef2f58c86f6d742fb7cbcb480fc8 --- /dev/null +++ b/package/rasdaemon/rasdaemon.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 7e12459f9477036491ac2b1e4c07cc3e8efea6dcd30525a263ab1f83910b773a rasdaemon-0.8.4.tar.gz +sha256 39bc367cd7cd291d217447632b28a74be414a52b142b1875ac8789184aeca7b2 COPYING diff --git a/package/rasdaemon/rasdaemon.mk b/package/rasdaemon/rasdaemon.mk new file mode 100644 index 0000000000000000000000000000000000000000..50ac97a37dcbe63443bddca505ebc7c929116e53 --- /dev/null +++ b/package/rasdaemon/rasdaemon.mk @@ -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)) -- 2.51.1 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH v3 1/2] package/rasdaemon: Add rasdaemon package 2025-12-01 14:08 ` [Buildroot] [PATCH v3 1/2] package/rasdaemon: Add rasdaemon package Bastien Curutchet via buildroot @ 2025-12-01 16:26 ` Fiona Klute via buildroot 2025-12-13 22:11 ` Julien Olivain via buildroot 1 sibling, 0 replies; 7+ messages in thread From: Fiona Klute via buildroot @ 2025-12-01 16:26 UTC (permalink / raw) To: Bastien Curutchet, buildroot; +Cc: Thomas Petazzoni Am 01.12.25 um 15:08 schrieb Bastien Curutchet: > 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 <bastien.curutchet@bootlin.com> Reviewed-by: Fiona Klute <fiona.klute@gmx.de> (SysV init script) Best regards, Fiona > --- > DEVELOPERS | 3 ++ > package/Config.in | 1 + > package/rasdaemon/Config.in | 25 ++++++++++++++++ > package/rasdaemon/S95rasdaemon | 63 ++++++++++++++++++++++++++++++++++++++++ > package/rasdaemon/rasdaemon.hash | 3 ++ > package/rasdaemon/rasdaemon.mk | 33 +++++++++++++++++++++ > 6 files changed, 128 insertions(+) > > diff --git a/DEVELOPERS b/DEVELOPERS > index db001d6bb0707a5877c0849fa85fa736377e60dd..b1ead6d26c4e8ff160bcc7ed85b0945ac5e551dc 100644 > --- a/DEVELOPERS > +++ b/DEVELOPERS > @@ -341,6 +341,9 @@ F: package/tcpdump/ > F: package/ti-uim/ > F: package/uhubctl/ > > +N: Bastien Curutchet <bastien.curutchet@bootlin.com> > +F: package/rasdaemon/ > + > N: Baxiche Su <baxiche@gmail.com> > F: package/qt6/qt6multimedia/ > > diff --git a/package/Config.in b/package/Config.in > index 12f327cb273526781d931b834e24d0df5024e80e..1a93cec2fa22e3a6e70acbf799b32b00d5e8b5de 100644 > --- a/package/Config.in > +++ b/package/Config.in > @@ -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" > diff --git a/package/rasdaemon/Config.in b/package/rasdaemon/Config.in > new file mode 100644 > index 0000000000000000000000000000000000000000..68cef3a313bf2b82a8306ed5e0ec581cd618531d > --- /dev/null > +++ b/package/rasdaemon/Config.in > @@ -0,0 +1,25 @@ > +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" > + select BR2_PACKAGE_PCIUTILS > + help > + Enable handling of AER (Advanced Error Reporting) events on > + PCIe > + > +endif > + > +comment "rasdaemon needs a toolchain w/ dynamic library" > + depends on BR2_STATIC_LIBS > diff --git a/package/rasdaemon/S95rasdaemon b/package/rasdaemon/S95rasdaemon > new file mode 100644 > index 0000000000000000000000000000000000000000..390ff9c9029ba9122217f13eb88bac7715c1c05f > --- /dev/null > +++ b/package/rasdaemon/S95rasdaemon > @@ -0,0 +1,63 @@ > +#!/bin/sh > +# > +# S95rasdaemon Starts Rasdaemon. > +# > +# shellcheck disable=SC2317 # functions are called via variable > + > +DAEMON="rasdaemon" > +PIDFILE="/var/run/$DAEMON.pid" > + > +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 \ > + --background --exec "/usr/sbin/$DAEMON" -- -f > + status=$? > + if [ "$status" -eq 0 ]; then > + echo "OK" > + 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" > +} > + > +restart() { > + stop > + start > +} > + > +reload() { > + restart > +} > + > +case "$1" in > + start|stop|reload|restart) > + "$1" > + ;; > + *) > + echo "Usage: $0 {start|stop|reload|restart}" > + exit 1 > +esac > diff --git a/package/rasdaemon/rasdaemon.hash b/package/rasdaemon/rasdaemon.hash > new file mode 100644 > index 0000000000000000000000000000000000000000..e1b600a4893bef2f58c86f6d742fb7cbcb480fc8 > --- /dev/null > +++ b/package/rasdaemon/rasdaemon.hash > @@ -0,0 +1,3 @@ > +# Locally calculated > +sha256 7e12459f9477036491ac2b1e4c07cc3e8efea6dcd30525a263ab1f83910b773a rasdaemon-0.8.4.tar.gz > +sha256 39bc367cd7cd291d217447632b28a74be414a52b142b1875ac8789184aeca7b2 COPYING > diff --git a/package/rasdaemon/rasdaemon.mk b/package/rasdaemon/rasdaemon.mk > new file mode 100644 > index 0000000000000000000000000000000000000000..50ac97a37dcbe63443bddca505ebc7c929116e53 > --- /dev/null > +++ b/package/rasdaemon/rasdaemon.mk > @@ -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)) > _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH v3 1/2] package/rasdaemon: Add rasdaemon package 2025-12-01 14:08 ` [Buildroot] [PATCH v3 1/2] package/rasdaemon: Add rasdaemon package Bastien Curutchet via buildroot 2025-12-01 16:26 ` Fiona Klute via buildroot @ 2025-12-13 22:11 ` Julien Olivain via buildroot 2025-12-17 15:30 ` Bastien Curutchet via buildroot 1 sibling, 1 reply; 7+ messages in thread From: Julien Olivain via buildroot @ 2025-12-13 22:11 UTC (permalink / raw) To: Bastien Curutchet; +Cc: buildroot, Thomas Petazzoni, Fiona Klute Hi Bastien, Thanks for the patch. I have few comments. See below. On 01/12/2025 15:08, Bastien Curutchet via buildroot wrote: > 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 <bastien.curutchet@bootlin.com> > --- [...] > diff --git a/package/rasdaemon/Config.in b/package/rasdaemon/Config.in > new file mode 100644 > index > 0000000000000000000000000000000000000000..68cef3a313bf2b82a8306ed5e0ec581cd618531d > --- /dev/null > +++ b/package/rasdaemon/Config.in > @@ -0,0 +1,25 @@ > +config BR2_PACKAGE_RASDAEMON > + bool "rasdaemon" > + depends on !BR2_STATIC_LIBS # libtraceevent rasdaemon seems to use unconditionally threads. See: https://github.com/mchehab/rasdaemon/blob/v0.8.4/ras-events.h#L10 So you probably miss here a "depends on BR2_TOOLCHAIN_HAS_THREADS". The Config.in comment also needs to be updated at the end of the file. > + select BR2_PACKAGE_LIBTRACEEVENT > + select BR2_PACKAGE_SQLITE SQLite is an optional dependency. See: https://github.com/mchehab/rasdaemon/blob/v0.8.4/configure.ac#L28 So you don't need to select BR2_PACKAGE_SQLITE here, and you could preferably have in the .mk file something like: ifeq ($(BR2_PACKAGE_SQLITE),y) RASDAEMON_CONF_OPTS += --enable-sqlite3 RASDAEMON_DEPENDENCIES += sqlite else RASDAEMON_CONF_OPTS += --disable-sqlite3 endif > + 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. Could format the help string like other Buildroot packages, please? You should have a blank line, followed by just the homepage url: https://github.com/mchehab/rasdaemon > + See https://github.com/mchehab/rasdaemon for details. > + > +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/ dynamic library" The comment should become: comment "rasdaemon needs a toolchain w/ threads, dynamic library" > + depends on BR2_STATIC_LIBS Here the condition should become: depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS > diff --git a/package/rasdaemon/rasdaemon.mk > b/package/rasdaemon/rasdaemon.mk > new file mode 100644 > index > 0000000000000000000000000000000000000000..50ac97a37dcbe63443bddca505ebc7c929116e53 > --- /dev/null > +++ b/package/rasdaemon/rasdaemon.mk > @@ -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 The "sqlite" dependency could be removed and added in a conditional block, as I suggested. > +# 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)) > > -- > 2.51.1 Could you send an updated patch, please? Best regards, Julien. _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH v3 1/2] package/rasdaemon: Add rasdaemon package 2025-12-13 22:11 ` Julien Olivain via buildroot @ 2025-12-17 15:30 ` Bastien Curutchet via buildroot 2025-12-17 16:28 ` Thomas Petazzoni via buildroot 0 siblings, 1 reply; 7+ messages in thread From: Bastien Curutchet via buildroot @ 2025-12-17 15:30 UTC (permalink / raw) To: Julien Olivain; +Cc: buildroot, Thomas Petazzoni, Fiona Klute Hi Julien, On 12/13/25 11:11 PM, Julien Olivain wrote: > Hi Bastien, > > Thanks for the patch. I have few comments. See below. > > On 01/12/2025 15:08, Bastien Curutchet via buildroot wrote: >> 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 <bastien.curutchet@bootlin.com> >> --- > [...] >> diff --git a/package/rasdaemon/Config.in b/package/rasdaemon/Config.in >> new file mode 100644 >> index >> 0000000000000000000000000000000000000000..68cef3a313bf2b82a8306ed5e0ec581cd618531d >> --- /dev/null >> +++ b/package/rasdaemon/Config.in >> @@ -0,0 +1,25 @@ >> +config BR2_PACKAGE_RASDAEMON >> + bool "rasdaemon" >> + depends on !BR2_STATIC_LIBS # libtraceevent > > rasdaemon seems to use unconditionally threads. See: > https://github.com/mchehab/rasdaemon/blob/v0.8.4/ras-events.h#L10 > > So you probably miss here a "depends on BR2_TOOLCHAIN_HAS_THREADS". > The Config.in comment also needs to be updated at the end of the file. > Indeed, I'll add it. >> + select BR2_PACKAGE_LIBTRACEEVENT >> + select BR2_PACKAGE_SQLITE > > SQLite is an optional dependency. See: > https://github.com/mchehab/rasdaemon/blob/v0.8.4/configure.ac#L28 > > So you don't need to select BR2_PACKAGE_SQLITE here, and you could > preferably have in the .mk file something like: > > ifeq ($(BR2_PACKAGE_SQLITE),y) > RASDAEMON_CONF_OPTS += --enable-sqlite3 > RASDAEMON_DEPENDENCIES += sqlite > else > RASDAEMON_CONF_OPTS += --disable-sqlite3 > endif > So far the rasdaemon's build without --enable-sqlite3 fails, this is why I had added it unconditionally. But you're right, it isn't the proper of doing so I just opened a PR on rasdaemon's github to fix this. >> + 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. > > Could format the help string like other Buildroot packages, > please? > > You should have a blank line, followed by just the homepage url: > > https://github.com/mchehab/rasdaemon > Sure, will do. >> + See https://github.com/mchehab/rasdaemon for details. >> + >> +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/ dynamic library" > > The comment should become: > comment "rasdaemon needs a toolchain w/ threads, dynamic library" > Ok, thanks. >> + depends on BR2_STATIC_LIBS > > Here the condition should become: > depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS > Ok, thanks. >> diff --git a/package/rasdaemon/rasdaemon.mk b/package/rasdaemon/ >> rasdaemon.mk >> new file mode 100644 >> index >> 0000000000000000000000000000000000000000..50ac97a37dcbe63443bddca505ebc7c929116e53 >> --- /dev/null >> +++ b/package/rasdaemon/rasdaemon.mk >> @@ -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 > > The "sqlite" dependency could be removed and added in a conditional > block, as I suggested. > Ok, I'll do this. >> +# 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)) >> >> -- >> 2.51.1 > > Could you send an updated patch, please? Sure, I'll just wait for my PR to be merged before doing so. Best regards, Bastien _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH v3 1/2] package/rasdaemon: Add rasdaemon package 2025-12-17 15:30 ` Bastien Curutchet via buildroot @ 2025-12-17 16:28 ` Thomas Petazzoni via buildroot 0 siblings, 0 replies; 7+ messages in thread From: Thomas Petazzoni via buildroot @ 2025-12-17 16:28 UTC (permalink / raw) To: Bastien Curutchet; +Cc: Julien Olivain, buildroot, Fiona Klute On Wed, 17 Dec 2025 16:30:22 +0100 Bastien Curutchet <bastien.curutchet@bootlin.com> wrote: > Sure, I'll just wait for my PR to be merged before doing so. Your upstream patch is simple enough that you can take it into Buildroot and put it in package/rasdaemon/. Make sure to add an Upstream: tag that points to the upstream PR. Indeed, it may be some time before upstream (1) merges it and (2) makes a new release with it. Thanks a lot! Thomas -- Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH v3 2/2] support/testing: add rasdaemon tests 2025-12-01 14:08 [Buildroot] [PATCH v3 0/2] package: add rasdaemon support Bastien Curutchet via buildroot 2025-12-01 14:08 ` [Buildroot] [PATCH v3 1/2] package/rasdaemon: Add rasdaemon package Bastien Curutchet via buildroot @ 2025-12-01 14:08 ` Bastien Curutchet via buildroot 1 sibling, 0 replies; 7+ messages in thread From: Bastien Curutchet via buildroot @ 2025-12-01 14:08 UTC (permalink / raw) To: buildroot; +Cc: Thomas Petazzoni, Fiona Klute, Bastien Curutchet 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. Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com> --- DEVELOPERS | 1 + support/testing/tests/package/test_rasdaemon.py | 46 ++++++++++++++++++++++ .../package/test_rasdaemon/linux-debugfs.fragment | 8 ++++ 3 files changed, 55 insertions(+) diff --git a/DEVELOPERS b/DEVELOPERS index b1ead6d26c4e8ff160bcc7ed85b0945ac5e551dc..c9aaa8c9c8aa3d54c930476d9d450e7f990d9aac 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -343,6 +343,7 @@ F: package/uhubctl/ N: Bastien Curutchet <bastien.curutchet@bootlin.com> F: package/rasdaemon/ +F: support/testing/tests/package/test_rasdaemon.py N: Baxiche Su <baxiche@gmail.com> F: package/qt6/qt6multimedia/ diff --git a/support/testing/tests/package/test_rasdaemon.py b/support/testing/tests/package/test_rasdaemon.py new file mode 100644 index 0000000000000000000000000000000000000000..bc800b6ccbea1c18f4c970d87bea0395c64ad952 --- /dev/null +++ b/support/testing/tests/package/test_rasdaemon.py @@ -0,0 +1,46 @@ +import os + +import infra.basetest + + +class TestRasdaemon(infra.basetest.BRTest): + config = f""" + BR2_x86_64=y + BR2_x86_corei7=y + BR2_INIT_SYSV=y + 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")}" + 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): + kernel = os.path.join(self.builddir, "images", "bzImage") + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot( + arch="x86_64", + kernel=kernel, + kernel_cmdline=["console=ttyS0"], + options=["-cpu", "Nehalem", "-initrd", cpio_file], + ) + self.emulator.login() + + self.assertRunOk("/usr/sbin/rasdaemon --version") + self.assertRunOk("mount -t debugfs nodev /sys/kernel/debug") + self.assertRunOk("/etc/init.d/S95rasdaemon start") + self.assertRunOk("pidof /usr/sbin/rasdaemon") + self.assertRunOk("/etc/init.d/S95rasdaemon restart") + self.assertRunOk("pidof /usr/sbin/rasdaemon") + self.assertRunOk("/etc/init.d/S95rasdaemon stop") + _, ret = self.emulator.run("pidof /usr/sbin/rasdaemon") + self.assertNotEqual(ret, 0) diff --git a/support/testing/tests/package/test_rasdaemon/linux-debugfs.fragment b/support/testing/tests/package/test_rasdaemon/linux-debugfs.fragment new file mode 100644 index 0000000000000000000000000000000000000000..a334bc373179623f3c5b2c3727ee7738a0c2542e --- /dev/null +++ b/support/testing/tests/package/test_rasdaemon/linux-debugfs.fragment @@ -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 -- 2.51.1 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-12-17 16:28 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-12-01 14:08 [Buildroot] [PATCH v3 0/2] package: add rasdaemon support Bastien Curutchet via buildroot 2025-12-01 14:08 ` [Buildroot] [PATCH v3 1/2] package/rasdaemon: Add rasdaemon package Bastien Curutchet via buildroot 2025-12-01 16:26 ` Fiona Klute via buildroot 2025-12-13 22:11 ` Julien Olivain via buildroot 2025-12-17 15:30 ` Bastien Curutchet via buildroot 2025-12-17 16:28 ` Thomas Petazzoni via buildroot 2025-12-01 14:08 ` [Buildroot] [PATCH v3 2/2] support/testing: add rasdaemon tests Bastien Curutchet via buildroot
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.