at 22.05-pre 51 lines 1.6 kB view raw
1{ lib, stdenv, fetchFromGitHub, util-linux }: 2 3stdenv.mkDerivation rec { 4 pname = "mcelog"; 5 version = "178"; 6 7 src = fetchFromGitHub { 8 owner = "andikleen"; 9 repo = "mcelog"; 10 rev = "v${version}"; 11 sha256 = "sha256-++R/R3oRw0O0MoDnASdVr9UIiI0yS4UcIO8nV62PLzE="; 12 }; 13 14 postPatch = '' 15 for i in mcelog.conf paths.h; do 16 substituteInPlace $i --replace /etc $out/etc 17 done 18 touch mcelog.conf.5 # avoid regeneration requiring Python 19 20 substituteInPlace Makefile --replace '"unknown"' '"${version}"' 21 22 for i in triggers/*; do 23 substituteInPlace $i --replace 'logger' '${util-linux}/bin/logger' 24 done 25 ''; 26 27 enableParallelBuilding = true; 28 29 installFlags = [ "DESTDIR=$(out)" "prefix=" "DOCDIR=/share/doc" ]; 30 31 postInstall = '' 32 mkdir -p $out/lib/systemd/system 33 substitute mcelog.service $out/lib/systemd/system/mcelog.service \ 34 --replace /usr/sbin $out/bin 35 ''; 36 37 meta = with lib; { 38 description = "Log x86 machine checks: memory, IO, and CPU hardware errors"; 39 longDescription = '' 40 The mcelog daemon accounts memory and some other errors in various ways 41 on modern x86 Linux systems. The daemon can be queried and/or execute 42 triggers when configurable error thresholds are exceeded. This is used to 43 implement a range of automatic predictive failure analysis algorithms, 44 including bad page offlining and automatic cache error handling. All 45 errors are logged to /var/log/mcelog or syslog or the journal. 46 ''; 47 homepage = "http://mcelog.org/"; 48 license = licenses.gpl2Plus; 49 platforms = platforms.linux; 50 }; 51}