Package: powertop
Version: 1.10-2
Severity: normal
Tags: patch

Hi,

I get a warning about an unloadable module:

PowerTOP 1.10    (C) 2007, 2008 Intel Corporation 

Sammle Daten für 5 Sekunden 


FATAL: Module cpufreq_stats not found.

This is due to powertop uses non‐Posix output redirection for the
modprobe call. Here's a patch.

Bye, Jörg.

-- System Information:
Debian Release: unstable/experimental
  APT prefers unstable
  APT policy: (900, 'unstable'), (700, 'experimental')
Architecture: powerpc (ppc)

Kernel: Linux 2.6.28-rc9
Locale: LANG=C, LC_CTYPE=C (charmap=UTF-8) (ignored: LC_ALL set to de_DE.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages powertop depends on:
ii  libc6                     2.7-16         GNU C Library: Shared libraries
ii  libncursesw5              5.7+20081213-1 shared libraries for terminal hand

powertop recommends no packages.

Versions of packages powertop suggests:
pn  cpufrequtils                  <none>     (no description available)
pn  laptop-mode-tools             <none>     (no description available)

-- no debconf information
commit c55a81a3dc152e198e908e46e742b321d05db380
Author: Jörg Sommer <jo...@alea.gnuu.de>
Date:   Fri Dec 26 18:03:49 2008 +0100

    Remove bashism in output redirection
    
    The redirection &> to redirect stdout and stderr is not valid for Posix
    shells like dash. Better use >… 2>&1.

diff --git a/cpufreq.c b/cpufreq.c
index ab84dc4..a291fdf 100644
--- a/cpufreq.c
+++ b/cpufreq.c
@@ -39,7 +39,7 @@ static void activate_ondemand(void)
        FILE *file;
        char filename[PATH_MAX];
 
-       system("/sbin/modprobe cpufreq_ondemand &> /dev/null");
+       system("/sbin/modprobe cpufreq_ondemand > /dev/null 2>&1");
 
 
        dir = opendir("/sys/devices/system/cpu");
diff --git a/powertop.c b/powertop.c
index fc605ec..4d18de8 100644
--- a/powertop.c
+++ b/powertop.c
@@ -798,7 +798,7 @@ int main(int argc, char **argv)
        if (!dump)
                ticktime = 5.0;
  
-       system("/sbin/modprobe cpufreq_stats &> /dev/null");
+       system("/sbin/modprobe cpufreq_stats > /dev/null 2>&1");
        read_data(&start_usage[0], &start_duration[0]);
 
 

Attachment: signature.asc
Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP

Reply via email to