From 49466be320a4a791d4c448656965fc139f1fb66f Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Tue, 2 Nov 2021 22:17:59 -0300 Subject: [PATCH] msr: init at 20060208 --- .../linux/msr/000-include-sysmacros.patch | 11 +++++ pkgs/os-specific/linux/msr/default.nix | 40 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 53 insertions(+) create mode 100644 pkgs/os-specific/linux/msr/000-include-sysmacros.patch create mode 100644 pkgs/os-specific/linux/msr/default.nix diff --git a/pkgs/os-specific/linux/msr/000-include-sysmacros.patch b/pkgs/os-specific/linux/msr/000-include-sysmacros.patch new file mode 100644 index 000000000000..5fa96cd14699 --- /dev/null +++ b/pkgs/os-specific/linux/msr/000-include-sysmacros.patch @@ -0,0 +1,11 @@ +diff -Naur msr-old/msr.c msr-20060208/msr.c +--- msr-old/msr.c 1969-12-31 21:00:01.000000000 -0300 ++++ msr-20060208/msr.c 2021-11-02 21:19:34.576722617 -0300 +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/pkgs/os-specific/linux/msr/default.nix b/pkgs/os-specific/linux/msr/default.nix new file mode 100644 index 000000000000..0ffc46012096 --- /dev/null +++ b/pkgs/os-specific/linux/msr/default.nix @@ -0,0 +1,40 @@ +{ lib +, stdenv +, fetchzip +, installShellFiles +}: + +stdenv.mkDerivation rec { + pname = "msr"; + version = "20060208"; + + src = fetchzip { + name = "${pname}-${version}"; + url = "http://www.etallen.com/msr/${pname}-${version}.src.tar.gz"; + hash = "sha256-e01qYWbOALkXp5NpexuVodMxA3EBySejJ6ZBpZjyT+E="; + }; + + nativeBuildInputs = [ + installShellFiles + ]; + + patches = [ + ./000-include-sysmacros.patch + ]; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin/ + cp msr $out/bin/ + installManPage msr.man + runHook postInstall + ''; + + meta = with lib; { + homepage = "http://www.etallen.com/msr.html"; + description = "Linux tool to display or modify x86 model-specific registers (MSRs)"; + license = licenses.bsd0; + maintainers = with maintainers; [ AndersonTorres ]; + platforms = [ "i686-linux" "x86_64-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 657202c64a7b..5b3cf13146b3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1577,6 +1577,8 @@ with pkgs; cpuid = callPackage ../os-specific/linux/cpuid { }; + msr = callPackage ../os-specific/linux/msr { }; + ctrtool = callPackage ../tools/archivers/ctrtool { }; crowbar = callPackage ../tools/security/crowbar { };