From 823c8bdde72f80b6a1fbfa63939633f0a36c4328 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 11 Jul 2007 19:34:49 +0200 Subject: [PATCH] config_cpu(): check for Virtual Box --- autoconfig.functions | 11 +++++++++-- debian/changelog | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/autoconfig.functions b/autoconfig.functions index 07c3344..10f05f2 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Klaus Knopper , (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Mit Jul 04 12:02:35 CEST 2007 [mika] +# Latest change: Mit Jul 11 19:34:06 CEST 2007 [mika] ################################################################################ # {{{ path, variables, signals, umask, zsh @@ -1251,7 +1251,7 @@ else # Disclaimer: sorry for the tons of if/then/else... but this makes sure we use: # * it only if we have the according kernel modules available - # * cpufreq only on laptops (check via /usr/sbin/laptop-detect) + # * cpufreq only on laptops (check via /usr/sbin/laptop-detect) and not inside Virtual Box # * current version of /etc/init.d/loadcpufreq from Debian (to stay in sync) # -> parse output of the initscript and output it according to our look'n'feel # * our own cpufreq-detect.sh if /etc/init.d/loadcpufreq isn't present @@ -1259,6 +1259,13 @@ else ewarn "Skipping cpufreq setup as module dependencies are not fulfilled." ; eend 1 else if /usr/sbin/laptop-detect 1>/dev/null 2>&1 ; then + # Virtual Box supports ACPI and laptop-detect returns with '0', so check for it: + if [ -r /proc/acpi/battery/BAT0/info ] ; then + if grep -q 'OEM info: innotek' /proc/acpi/battery/BAT0/info ; then + einfo 'Virtual Box detected, skipping cpufreq setup.' ; eend 0 + return 0 + fi + fi einfo "Detected Laptop - trying to use cpu frequency scaling:" eindent if [ -x /etc/init.d/loadcpufreq ] ; then diff --git a/debian/changelog b/debian/changelog index fa97332..9f3b455 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ grml-autoconfig (0.7.6) unstable; urgency=low * config_lvm(): check for 'No volume groups found' as lvdisplay does not provide appropriate return code for us. + * config_cpu(): Virtual Box supports ACPI and laptop-detect returns + with '0', so check for it and skip it. -- Michael Prokop Wed, 11 Jul 2007 19:25:25 +0200 -- 2.1.4