Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 66670

Summary: Default battery.sh script for acpid needs to be modified
Product: Gentoo Linux Reporter: Bharath Ramesh <krosswindz>
Component: Current packagesAssignee: Mobile Herd (OBSOLETE) <mobile+disabled>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: 2004.2   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch to check for BAT0 status as many Laptops use BAT0 instead of BAT1

Description Bharath Ramesh 2004-10-07 10:44:48 UTC
The default battery.sh script for setting the speedfreq option of to change the current policy to either performance or powersave only checks for BAT1. Most laptops use BAT0 instead of BAT1. I feel it should check the status of either of BAT0 or BAT1 to change the speedfreq policy. The following patch adds support for BAT0 as well.

14,27d13
<               BAT0)
<               if [ $4 -eq 00000001 ] && [ -f /proc/acpi/battery/BAT0/state ] ; then
<                       action="`cat /proc/acpi/battery/BAT0/state | grep charging | cut -c 26-`"
<                       case $action in
<                               charging)       /usr/bin/speedfreq -p performance
<                                               logger "A/C adapter plugged in"
<                                               ;;
<                               discharging)    /usr/bin/speedfreq -p powersave
<                                               logger "A/C adapter plugged out"
<                                               ;;
<                       esac
<               fi
<               ;;
<
Comment 1 Henrik Brix Andersen 2004-10-07 14:20:32 UTC
Could you please attach a unified diff instead? Thanks :)
Comment 2 Bharath Ramesh 2004-10-07 20:38:41 UTC
Created attachment 41337 [details, diff]
Patch to check for BAT0 status as many Laptops use BAT0 instead of BAT1
Comment 3 Doug Goldstein (RETIRED) gentoo-dev 2004-10-09 01:20:09 UTC
hrm... Now I was gonna go add this patch cause I agree with it however I came across one serious issue... battery.sh isn't created by acpid. it's created by speedfreq. Check with a quick qpkg -f /etc/acpi/battery.sh which package created yours.
Comment 4 Bharath Ramesh 2004-10-09 01:28:05 UTC
True, sorry about that. Speedfreq does create that file. I am sorry that I filed that bug against acpid. I should I file it agains speedfreq. What do I need to do, do I need to refile this bug against speedfreq.
Comment 5 Doug Goldstein (RETIRED) gentoo-dev 2004-10-09 02:31:25 UTC
new revision of speedfreq should hit a mirror near you soon.