X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=9218b7b0f63e136ab99ac541ac714ee450f1e644;hp=06e5168358d358b712bbaf8f00c0044879c9a43a;hb=8f1a96e977ce1ea9bf38523717a2331ad0e027a9;hpb=116e4450535d67c4008b6c18b4b9e5fffc029196 diff --git a/autoconfig.functions b/autoconfig.functions index 06e5168..9218b7b 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 @@ -1497,7 +1504,7 @@ else ERROR=$(aumix -w $VOL -v $VOL -p $VOL -m $VOL 2>&1) ; RC=$? if [ -n "$ERROR" ] ; then eindent - eerror "Problem setting mixer volumes: $ERROR" + eerror "Problem setting mixer volumes: $ERROR (no soundcard?)" eoutdent fi eend $RC @@ -2097,7 +2104,7 @@ config_lvm(){ if ! [ -x /sbin/lvm -a -x /etc/init.d/lvm2 -a -x /sbin/lvdisplay ] ; then eerror "LVM not available, can not execute it." ; eend 1 else - if lvdisplay 1>/dev/null 2>&1 ; then + if lvdisplay 2>&1 | grep -v 'No volume groups found' 1>/dev/null 2>&1 ; then einfo "You seem to have logical volumes (LVM) on your system." eindent einfo "Just run 'Start lvm2' to activate them or boot using 'lvm' as bootoption for autostart."