rasdaemon: 0.8.0 -> 0.8.2 (#369375)

authored by zowoq and committed by GitHub 31782c65 7be7dbf6

+59 -64
+7 -5
nixos/modules/services/hardware/rasdaemon.nix
··· 14 15 enable = lib.mkEnableOption "RAS logging daemon"; 16 17 record = lib.mkOption { 18 type = lib.types.bool; 19 default = true; ··· 99 }; 100 }; 101 environment.systemPackages = 102 - [ pkgs.rasdaemon ] 103 ++ lib.optionals (cfg.testing) ( 104 with pkgs.error-inject; 105 [ ··· 151 StateDirectory = lib.optionalString (cfg.record) "rasdaemon"; 152 153 ExecStart = 154 - "${pkgs.rasdaemon}/bin/rasdaemon --foreground" + lib.optionalString (cfg.record) " --record"; 155 - ExecStop = "${pkgs.rasdaemon}/bin/rasdaemon --disable"; 156 Restart = "on-abort"; 157 158 # src/misc/rasdaemon.service.in shows this: 159 - # ExecStartPost = ${pkgs.rasdaemon}/bin/rasdaemon --enable 160 # but that results in unpredictable existence of the database 161 # and everything seems to be enabled without this... 162 }; ··· 167 wantedBy = [ "multi-user.target" ]; 168 serviceConfig = { 169 Type = "oneshot"; 170 - ExecStart = "${pkgs.rasdaemon}/bin/ras-mc-ctl --register-labels"; 171 RemainAfterExit = true; 172 }; 173 };
··· 14 15 enable = lib.mkEnableOption "RAS logging daemon"; 16 17 + package = lib.mkPackageOption pkgs "rasdaemon" { }; 18 + 19 record = lib.mkOption { 20 type = lib.types.bool; 21 default = true; ··· 101 }; 102 }; 103 environment.systemPackages = 104 + [ cfg.package ] 105 ++ lib.optionals (cfg.testing) ( 106 with pkgs.error-inject; 107 [ ··· 153 StateDirectory = lib.optionalString (cfg.record) "rasdaemon"; 154 155 ExecStart = 156 + "${cfg.package}/bin/rasdaemon --foreground" + lib.optionalString (cfg.record) " --record"; 157 + ExecStop = "${cfg.package}/bin/rasdaemon --disable"; 158 Restart = "on-abort"; 159 160 # src/misc/rasdaemon.service.in shows this: 161 + # ExecStartPost = ${cfg.package}/bin/rasdaemon --enable 162 # but that results in unpredictable existence of the database 163 # and everything seems to be enabled without this... 164 }; ··· 169 wantedBy = [ "multi-user.target" ]; 170 serviceConfig = { 171 Type = "oneshot"; 172 + ExecStart = "${cfg.package}/bin/ras-mc-ctl --register-labels"; 173 RemainAfterExit = true; 174 }; 175 };
+1 -1
nixos/tests/rasdaemon.nix
··· 29 machine.wait_for_unit("multi-user.target") 30 # confirm rasdaemon is running and has a valid database 31 # some disk errors detected in qemu for some reason ¯\_(ツ)_/¯ 32 - machine.succeed("ras-mc-ctl --errors | tee /dev/stderr | grep -q 'No .* errors.'") 33 # confirm the supplied labels text made it into the system 34 machine.succeed("grep -q 'vendor: none' /etc/ras/dimm_labels.d/labels >&2") 35 machine.shutdown()
··· 29 machine.wait_for_unit("multi-user.target") 30 # confirm rasdaemon is running and has a valid database 31 # some disk errors detected in qemu for some reason ¯\_(ツ)_/¯ 32 + machine.wait_until_succeeds("ras-mc-ctl --errors | tee /dev/stderr | grep -q 'No .* errors.'") 33 # confirm the supplied labels text made it into the system 34 machine.succeed("grep -q 'vendor: none' /etc/ras/dimm_labels.d/labels >&2") 35 machine.shutdown()
+51 -58
pkgs/by-name/ra/rasdaemon/package.nix
··· 1 { 2 - lib, 3 - stdenv, 4 - fetchFromGitHub, 5 autoreconfHook, 6 - pkg-config, 7 - glibcLocales, 8 - kmod, 9 - coreutils, 10 - perl, 11 - dmidecode, 12 - hwdata, 13 - sqlite, 14 libtraceevent, 15 - fetchpatch, 16 nixosTests, 17 }: 18 19 - stdenv.mkDerivation rec { 20 pname = "rasdaemon"; 21 - version = "0.8.0"; 22 23 src = fetchFromGitHub { 24 owner = "mchehab"; 25 repo = "rasdaemon"; 26 - rev = "v${version}"; 27 - sha256 = "sha256-BX3kc629FOh5cnD6Sa/69wKdhmhT3Rpz5ZvhnD4MclQ="; 28 }; 29 30 - patches = [ 31 - (fetchpatch { 32 - # fix #295002 (segfault on AMD), will be in the release after 0.8.0 33 - name = "fix crash on AMD"; 34 - url = "https://github.com/mchehab/rasdaemon/commit/f1ea76375281001cdf4a048c1a4a24d86c6fbe48.patch"; 35 - hash = "sha256-1VPDTrAsvZGiGbh52EUdG6tYV/n6wUS0mphOSXzran0="; 36 - }) 37 - ]; 38 39 nativeBuildInputs = [ 40 autoreconfHook 41 pkg-config 42 ]; 43 44 - buildInputs = [ 45 - coreutils 46 - glibcLocales 47 - hwdata 48 - kmod 49 - sqlite 50 - libtraceevent 51 - (perl.withPackages ( 52 - ps: with ps; [ 53 - DBI 54 - DBDSQLite 55 - ] 56 - )) 57 - ] ++ lib.optionals (!stdenv.hostPlatform.isAarch64) [ dmidecode ]; 58 59 configureFlags = [ 60 "--sysconfdir=/etc" 61 "--localstatedir=/var" 62 - "--with-sysconfdefdir=${placeholder "out"}/etc/sysconfig" 63 "--enable-all" 64 ]; 65 ··· 83 84 # easy way out, ends up installing /nix/store/...rasdaemon/bin in $out 85 86 - postConfigure = '' 87 - substituteInPlace Makefile \ 88 - --replace '"$(DESTDIR)/etc/ras/dimm_labels.d"' '"$(prefix)/etc/ras/dimm_labels.d"' 89 ''; 90 91 outputs = [ ··· 100 install -Dm 0755 contrib/edac-tests $inject/bin/edac-tests 101 ''; 102 103 - postFixup = 104 - '' 105 - # Fix dmidecode and modprobe paths 106 - substituteInPlace $out/bin/ras-mc-ctl \ 107 - --replace 'find_prog ("modprobe") or exit (1)' '"${kmod}/bin/modprobe"' 108 - '' 109 - + lib.optionalString (!stdenv.hostPlatform.isAarch64) '' 110 - substituteInPlace $out/bin/ras-mc-ctl \ 111 - --replace 'find_prog ("dmidecode")' '"${dmidecode}/bin/dmidecode"' 112 - ''; 113 114 passthru.tests = nixosTests.rasdaemon; 115 116 - meta = with lib; { 117 description = '' 118 A Reliability, Availability and Serviceability (RAS) logging tool using EDAC kernel tracing events 119 ''; ··· 125 drivers for other architectures like arm also exists. 126 ''; 127 homepage = "https://github.com/mchehab/rasdaemon"; 128 - license = licenses.gpl2Plus; 129 - platforms = platforms.linux; 130 - changelog = "https://github.com/mchehab/rasdaemon/blob/v${version}/ChangeLog"; 131 - maintainers = with maintainers; [ evils ]; 132 }; 133 - }
··· 1 { 2 autoreconfHook, 3 + fetchFromGitHub, 4 + lib, 5 libtraceevent, 6 + nix-update-script, 7 nixosTests, 8 + perl, 9 + pkg-config, 10 + sqlite, 11 + stdenv, 12 + # Options 13 + enableDmidecode ? stdenv.hostPlatform.isx86_64, 14 + dmidecode, 15 }: 16 17 + stdenv.mkDerivation (finalAttrs: { 18 pname = "rasdaemon"; 19 + version = "0.8.2"; 20 21 src = fetchFromGitHub { 22 owner = "mchehab"; 23 repo = "rasdaemon"; 24 + tag = "v${finalAttrs.version}"; 25 + hash = "sha256-veaqAbSJvoUzkn1OLYY3t3y9Bh8dzuenpLGO2yz/yaM="; 26 }; 27 28 + strictDeps = true; 29 + 30 + enableParallelBuilding = true; 31 32 nativeBuildInputs = [ 33 autoreconfHook 34 pkg-config 35 ]; 36 37 + buildInputs = 38 + [ 39 + libtraceevent 40 + (perl.withPackages ( 41 + ps: with ps; [ 42 + DBDSQLite 43 + ] 44 + )) 45 + sqlite 46 + ] 47 + ++ lib.optionals enableDmidecode [ 48 + dmidecode 49 + ]; 50 51 configureFlags = [ 52 "--sysconfdir=/etc" 53 "--localstatedir=/var" 54 "--enable-all" 55 ]; 56 ··· 74 75 # easy way out, ends up installing /nix/store/...rasdaemon/bin in $out 76 77 + postPatch = '' 78 + patchShebangs contrib/ 79 + ''; 80 + 81 + preConfigure = '' 82 + substituteInPlace Makefile.am \ 83 + --replace-fail '"$(DESTDIR)@sysconfdir@/ras/dimm_labels.d"' '"$(prefix)@sysconfdir@/ras/dimm_labels.d"' \ 84 + --replace-fail '"$(DESTDIR)@SYSCONFDEFDIR@/rasdaemon"' '"$(prefix)@SYSCONFDEFDIR@/rasdaemon"' \ 85 + --replace-fail '"$(DESTDIR)@sysconfdir@/ras/triggers' '"$(prefix)@sysconfdir@/ras/triggers' 86 ''; 87 88 outputs = [ ··· 97 install -Dm 0755 contrib/edac-tests $inject/bin/edac-tests 98 ''; 99 100 + postFixup = lib.optionalString enableDmidecode '' 101 + substituteInPlace $out/bin/ras-mc-ctl \ 102 + --replace-fail 'find_prog ("dmidecode")' '"${dmidecode}/bin/dmidecode"' 103 + ''; 104 105 passthru.tests = nixosTests.rasdaemon; 106 107 + passthru.updateScript = nix-update-script { }; 108 + 109 + meta = { 110 description = '' 111 A Reliability, Availability and Serviceability (RAS) logging tool using EDAC kernel tracing events 112 ''; ··· 118 drivers for other architectures like arm also exists. 119 ''; 120 homepage = "https://github.com/mchehab/rasdaemon"; 121 + license = lib.licenses.gpl2Plus; 122 + platforms = lib.platforms.linux; 123 + changelog = "${finalAttrs.meta.homepage}/releases/tag/v${finalAttrs.version}"; 124 + maintainers = with lib.maintainers; [ evils ]; 125 }; 126 + })