rasdaemon: 0.8.0 -> 0.8.2

This commit is contained in:
Matei Dibu
2025-02-28 11:46:33 +02:00
parent 03528fb772
commit 498c2d6827
2 changed files with 52 additions and 59 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ import ./make-test-python.nix (
machine.wait_for_unit("multi-user.target")
# confirm rasdaemon is running and has a valid database
# some disk errors detected in qemu for some reason ¯\_()_/¯
machine.succeed("ras-mc-ctl --errors | tee /dev/stderr | grep -q 'No .* errors.'")
machine.wait_until_succeeds("ras-mc-ctl --errors | tee /dev/stderr | grep -q 'No .* errors.'")
# confirm the supplied labels text made it into the system
machine.succeed("grep -q 'vendor: none' /etc/ras/dimm_labels.d/labels >&2")
machine.shutdown()
+51 -58
View File
@@ -1,65 +1,56 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
pkg-config,
glibcLocales,
kmod,
coreutils,
perl,
dmidecode,
hwdata,
sqlite,
fetchFromGitHub,
lib,
libtraceevent,
fetchpatch,
nix-update-script,
nixosTests,
perl,
pkg-config,
sqlite,
stdenv,
# Options
enableDmidecode ? stdenv.hostPlatform.isx86_64,
dmidecode,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "rasdaemon";
version = "0.8.0";
version = "0.8.2";
src = fetchFromGitHub {
owner = "mchehab";
repo = "rasdaemon";
rev = "v${version}";
sha256 = "sha256-BX3kc629FOh5cnD6Sa/69wKdhmhT3Rpz5ZvhnD4MclQ=";
tag = "v${finalAttrs.version}";
hash = "sha256-veaqAbSJvoUzkn1OLYY3t3y9Bh8dzuenpLGO2yz/yaM=";
};
patches = [
(fetchpatch {
# fix #295002 (segfault on AMD), will be in the release after 0.8.0
name = "fix crash on AMD";
url = "https://github.com/mchehab/rasdaemon/commit/f1ea76375281001cdf4a048c1a4a24d86c6fbe48.patch";
hash = "sha256-1VPDTrAsvZGiGbh52EUdG6tYV/n6wUS0mphOSXzran0=";
})
];
strictDeps = true;
enableParallelBuilding = true;
nativeBuildInputs = [
autoreconfHook
pkg-config
];
buildInputs = [
coreutils
glibcLocales
hwdata
kmod
sqlite
libtraceevent
(perl.withPackages (
ps: with ps; [
DBI
DBDSQLite
]
))
] ++ lib.optionals (!stdenv.hostPlatform.isAarch64) [ dmidecode ];
buildInputs =
[
libtraceevent
(perl.withPackages (
ps: with ps; [
DBDSQLite
]
))
sqlite
]
++ lib.optionals enableDmidecode [
dmidecode
];
configureFlags = [
"--sysconfdir=/etc"
"--localstatedir=/var"
"--with-sysconfdefdir=${placeholder "out"}/etc/sysconfig"
"--enable-all"
];
@@ -83,9 +74,15 @@ stdenv.mkDerivation rec {
# easy way out, ends up installing /nix/store/...rasdaemon/bin in $out
postConfigure = ''
substituteInPlace Makefile \
--replace '"$(DESTDIR)/etc/ras/dimm_labels.d"' '"$(prefix)/etc/ras/dimm_labels.d"'
postPatch = ''
patchShebangs contrib/
'';
preConfigure = ''
substituteInPlace Makefile.am \
--replace-fail '"$(DESTDIR)@sysconfdir@/ras/dimm_labels.d"' '"$(prefix)@sysconfdir@/ras/dimm_labels.d"' \
--replace-fail '"$(DESTDIR)@SYSCONFDEFDIR@/rasdaemon"' '"$(prefix)@SYSCONFDEFDIR@/rasdaemon"' \
--replace-fail '"$(DESTDIR)@sysconfdir@/ras/triggers' '"$(prefix)@sysconfdir@/ras/triggers'
'';
outputs = [
@@ -100,20 +97,16 @@ stdenv.mkDerivation rec {
install -Dm 0755 contrib/edac-tests $inject/bin/edac-tests
'';
postFixup =
''
# Fix dmidecode and modprobe paths
substituteInPlace $out/bin/ras-mc-ctl \
--replace 'find_prog ("modprobe") or exit (1)' '"${kmod}/bin/modprobe"'
''
+ lib.optionalString (!stdenv.hostPlatform.isAarch64) ''
substituteInPlace $out/bin/ras-mc-ctl \
--replace 'find_prog ("dmidecode")' '"${dmidecode}/bin/dmidecode"'
'';
postFixup = lib.optionalString enableDmidecode ''
substituteInPlace $out/bin/ras-mc-ctl \
--replace-fail 'find_prog ("dmidecode")' '"${dmidecode}/bin/dmidecode"'
'';
passthru.tests = nixosTests.rasdaemon;
meta = with lib; {
passthru.updateScript = nix-update-script { };
meta = {
description = ''
A Reliability, Availability and Serviceability (RAS) logging tool using EDAC kernel tracing events
'';
@@ -125,9 +118,9 @@ stdenv.mkDerivation rec {
drivers for other architectures like arm also exists.
'';
homepage = "https://github.com/mchehab/rasdaemon";
license = licenses.gpl2Plus;
platforms = platforms.linux;
changelog = "https://github.com/mchehab/rasdaemon/blob/v${version}/ChangeLog";
maintainers = with maintainers; [ evils ];
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.linux;
changelog = "${finalAttrs.meta.homepage}/releases/tag/v${finalAttrs.version}";
maintainers = with lib.maintainers; [ evils ];
};
}
})