From b1edc7909a116bf48ea95c41c6702941cf62a792 Mon Sep 17 00:00:00 2001 From: Charles Strahan Date: Thu, 15 Oct 2015 14:25:43 -0400 Subject: powertop: fix --auto-tune See https://lists.01.org/pipermail/powertop/2014-December/001727.html --- pkgs/os-specific/linux/powertop/auto-tune.patch | 11 +++++++++++ pkgs/os-specific/linux/powertop/default.nix | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 pkgs/os-specific/linux/powertop/auto-tune.patch (limited to 'pkgs') diff --git a/pkgs/os-specific/linux/powertop/auto-tune.patch b/pkgs/os-specific/linux/powertop/auto-tune.patch new file mode 100644 index 00000000000..c9095336e8d --- /dev/null +++ b/pkgs/os-specific/linux/powertop/auto-tune.patch @@ -0,0 +1,11 @@ +diff --git a/src/devices/devfreq.cpp b/src/devices/devfreq.cpp +index d2e56e3..4de5c9b 100644 +--- a/src/devices/devfreq.cpp ++++ b/src/devices/devfreq.cpp +@@ -247,6 +247,7 @@ void create_all_devfreq_devices(void) + fprintf(stderr, "Devfreq not enabled\n"); + is_enabled = false; + closedir(dir); ++ dir = NULL; + return; + } diff --git a/pkgs/os-specific/linux/powertop/default.nix b/pkgs/os-specific/linux/powertop/default.nix index 9e32cd70cfb..82ca746d6a4 100644 --- a/pkgs/os-specific/linux/powertop/default.nix +++ b/pkgs/os-specific/linux/powertop/default.nix @@ -10,7 +10,11 @@ stdenv.mkDerivation rec { buildInputs = [ gettext libnl ncurses pciutils pkgconfig zlib ]; - patchPhase = '' + # Fix --auto-tune bug: + # https://lists.01.org/pipermail/powertop/2014-December/001727.html + patches = [ ./auto-tune.patch ]; + + postPatch = '' substituteInPlace src/main.cpp --replace "/sbin/modprobe" "modprobe" ''; -- cgit 1.4.1