Skip to content

Commit 178f118

Browse files
committed
feat: add s0ix-selftest pkg with newer version
Signed-off-by: Fabian Wienand <fabian.wienand@9elements.com>
1 parent 6aac26a commit 178f118

2 files changed

Lines changed: 78 additions & 1 deletion

File tree

modules/base.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ let
2626

2727
amd-debug-tools = pkgs.python3Packages.callPackage ../pkgs/amd-debug-tools/default.nix { };
2828

29+
s0ix-selftest-tool = pkgs.callPackage ../pkgs/s0ix-selftest-tool/default.nix {
30+
linuxPackages = config.boot.kernelPackages;
31+
};
32+
2933
in
3034
{
3135
options.firmwareci.base = {
@@ -102,13 +106,13 @@ in
102106
dmidecode
103107
fwts
104108
sbctl
105-
s0ix-selftest-tool
106109
config.boot.kernelPackages.turbostat
107110
stress-ng
108111
sysbench
109112
bc
110113
powertop
111114
]
115+
++ [ s0ix-selftest-tool ]
112116
++ lib.optional cfg.includeChipSec chipsec
113117
++ lib.optional cfg.includeDefaultTools (pkgs.callPackage ../pkgs/default-tools/default.nix { })
114118
++ lib.optionals amdDebugCfg.enable [
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{ acpica-tools
2+
, bc
3+
, coreutils
4+
, fetchFromGitHub
5+
, gawk
6+
, gnugrep
7+
, gnused
8+
, linuxPackages
9+
, lib
10+
, pciutils
11+
, powertop
12+
, makeWrapper
13+
, stdenv
14+
, unstableGitUpdater
15+
, util-linux
16+
, xorg
17+
, xxd
18+
,
19+
}:
20+
21+
let
22+
deps = lib.makeBinPath [
23+
acpica-tools
24+
bc
25+
coreutils
26+
gawk
27+
gnugrep
28+
gnused
29+
linuxPackages.turbostat
30+
pciutils
31+
powertop
32+
util-linux
33+
xorg.xset
34+
xxd
35+
];
36+
in
37+
stdenv.mkDerivation {
38+
pname = "s0ix-selftest-tool";
39+
version = "0-unstable-2024-09-22";
40+
41+
src = fetchFromGitHub {
42+
owner = "intel";
43+
repo = "S0ixSelftestTool";
44+
rev = "2707d34bf8130feb21e5902efbdecbd2dc915148";
45+
sha256 = "sha256-2quAiVYt6elULJTqMFhnciNWork6ViTWcPTRJQfvu+I=";
46+
};
47+
48+
postPatch = ''
49+
substituteInPlace s0ix-selftest-tool.sh --replace-fail '"$DIR"/turbostat' 'turbostat'
50+
'';
51+
52+
nativeBuildInputs = [ makeWrapper ];
53+
dontConfigure = true;
54+
dontBuild = true;
55+
56+
installPhase = ''
57+
runHook preInstall
58+
install -Dm555 s0ix-selftest-tool.sh "$out/bin/s0ix-selftest-tool"
59+
wrapProgram "$out/bin/s0ix-selftest-tool" --prefix PATH : ${deps}
60+
runHook postInstall
61+
'';
62+
63+
passthru.updateScript = unstableGitUpdater { };
64+
65+
meta = with lib; {
66+
homepage = "https://github.com/intel/S0ixSelftestTool";
67+
description = "Tool for testing the S2idle path CPU Package C-state and S0ix failures";
68+
license = licenses.gpl2Only;
69+
platforms = platforms.linux;
70+
maintainers = with maintainers; [ adamcstephens ];
71+
mainProgram = "s0ix-selftest-tool";
72+
};
73+
}

0 commit comments

Comments
 (0)