2018-01-21 06:53:35 -08:00
|
|
|
{ stdenv, fetchFromGitHub, makeWrapper, coreutils, binutils-unwrapped }:
|
2018-01-14 06:38:36 -08:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "spectre-meltdown-checker";
|
2020-11-11 20:32:14 -08:00
|
|
|
version = "0.44";
|
2018-01-14 06:38:36 -08:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "speed47";
|
|
|
|
repo = "spectre-meltdown-checker";
|
|
|
|
rev = "v${version}";
|
2020-11-11 20:32:14 -08:00
|
|
|
sha256 = "1b47wlc52jnp2d5c7kbqnxmlm4g3cfbv25q30llv5mlmzs6d7bam";
|
2018-01-14 06:38:36 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace spectre-meltdown-checker.sh \
|
2018-01-14 13:50:42 -08:00
|
|
|
--replace /bin/echo ${coreutils}/bin/echo
|
2018-01-14 06:38:36 -08:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = with stdenv.lib; ''
|
2018-08-15 19:53:31 -07:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm755 spectre-meltdown-checker.sh $out/bin/spectre-meltdown-checker
|
2018-04-18 23:20:40 -07:00
|
|
|
wrapProgram $out/bin/spectre-meltdown-checker \
|
2018-01-14 06:38:36 -08:00
|
|
|
--prefix PATH : ${makeBinPath [ binutils-unwrapped ]}
|
2018-08-15 19:53:31 -07:00
|
|
|
|
|
|
|
runHook postInstall
|
2018-01-14 06:38:36 -08:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Spectre & Meltdown vulnerability/mitigation checker for Linux";
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://github.com/speed47/spectre-meltdown-checker";
|
2018-01-14 06:38:36 -08:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
2018-08-15 19:53:31 -07:00
|
|
|
platforms = platforms.linux;
|
2018-01-14 06:38:36 -08:00
|
|
|
};
|
|
|
|
}
|