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