Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SCRIPT]s to handle ACPI events (incl. laptop-mode)
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
squash_buckler
n00b
n00b


Joined: 29 Feb 2004
Posts: 2

PostPosted: Sun Mar 07, 2004 4:05 pm    Post subject: Reply with quote

hei,
I have the file laptop-mode.txt in my kernel (/usr/src/linux/Documentation/laptop-mode.txt) but I dont have the file /sbin/laptop-mode.
How do I create it? I found the kernel patch in here
[url] ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.2-rc1/2.6.2-rc1-mm1/broken-out/laptop-mode-2.patch[/url]
but I don't know which part of it to copy to /sbin/laptop-mode

Can someone help me?
Thanks, Nadi
Back to top
View user's profile Send private message
noneckturtle
n00b
n00b


Joined: 29 Jun 2003
Posts: 12

PostPosted: Fri Apr 30, 2004 12:28 pm    Post subject: ACPI problems Reply with quote

I'm having problems getting ACPI to work. If I do cat /proc/acpi/event I get cat: /proc/acpi/event: Device or resource busy.

Anyone got eny ideas?

NOTE: acpid is installed = acpid-1.0.2-r2
kernel is = gentoo-sources-2.4.25-r2

ACPI is compiled into the kernel



??????? I've no clue what to do from here?
Back to top
View user's profile Send private message
friday
n00b
n00b


Joined: 07 Feb 2003
Posts: 28
Location: Germany

PostPosted: Fri Apr 30, 2004 12:36 pm    Post subject: Reply with quote

noneckturtle:
I guess you have acpid running. So after '/etc/init.d/acpid stop' you should be able to 'cat /proc/acpi/event'.


squash_buckler:
AFAIR the script is inside laptop_mode.txt. Just copy and paste to /sbin/laptop-mode
Back to top
View user's profile Send private message
noneckturtle
n00b
n00b


Joined: 29 Jun 2003
Posts: 12

PostPosted: Sat May 01, 2004 3:01 am    Post subject: Reply with quote

friday,

I followed your instructions and the following happend:

glaptop portage # /etc/init.d/acpid stop
* WARNING: you are stopping a boot service.
* Stopping acpid... [ ok ]
glaptop portage # cat /proc/acpi/event
cat: /proc/acpi/event: Device or resource busy

I then tried restarting ACPID so that I could check the log file and this happend:


glaptop distfiles # /etc/init.d/acpid restart
* Starting acpid...
acpid: can't open /proc/acpi/event: Device or resource busy [ !! ]



Anyone got any ideas????
Back to top
View user's profile Send private message
friday
n00b
n00b


Joined: 07 Feb 2003
Posts: 28
Location: Germany

PostPosted: Sat May 01, 2004 8:55 am    Post subject: Reply with quote

noneckturtle:
Probably the acpid is still running.
To verify try one of the following:
Code:
ps -A | grep acpi

Code:
pidof acpid


If it is still running you can stop it by simply killing it:
Code:
killall acpid

or
Code:
kill `pidof acpid`
Back to top
View user's profile Send private message
noneckturtle
n00b
n00b


Joined: 29 Jun 2003
Posts: 12

PostPosted: Tue May 11, 2004 4:32 am    Post subject: Reply with quote

Any ideas what I would need to do to set eth0 to be brought down when I close the lid + brought up when I open the lid?

EDITED::

Forgot to say that I want to do this with an onboard network (eth0) and a PCMCIA network card (eth1)

Any ideas would be appreciated.
Back to top
View user's profile Send private message
quantumwire
Guru
Guru


Joined: 15 Oct 2003
Posts: 403
Location: Lausanne

PostPosted: Tue May 18, 2004 12:36 pm    Post subject: Reply with quote

When my AC Adapter is plugged OUT or IN I recive only one event per time in /proc/acpi/event.
For example if I plug OUT and IN my AC adapter several times I recive this events:

1 - plug OUT
Code:

hotkey HOTK 00000057 00000000
hotkey HOTK 00000069 00000000

2 - plug IN
Code:

hotkey HOTK 00000058 00000000
hotkey HOTK 00000069 00000001

3 - plug OUT
Code:

hotkey HOTK 00000057 00000001
hotkey HOTK 00000069 00000002

4 - plug IN
Code:

hotkey HOTK 00000058 00000001
hotkey HOTK 00000069 00000003

5 - plug OUT
Code:

hotkey HOTK 00000057 00000002
hotkey HOTK 00000069 00000004

and so on...

Note:
1 - if I wait 2 hours between step 3 and 4, for example, no more events are send to the event file in /proc/acpi.
2 - battery status is correctly reported on /proc/acpi/battery/BAT0/state... it means that I can see the battery is discharging etc... everything is fine here.

So in my case the battery scripts doesn't work because tha status check is done only one time.

Any idea?

[ASUS L5830 (L5C) - gentoo kernel 2.4.25 r2]
_________________
HOWTO 1: Spegnere il laptop!
HOWTO 2: Comprimere i DVDs!
Back to top
View user's profile Send private message
wickwire
n00b
n00b


Joined: 13 Dec 2003
Posts: 71

PostPosted: Mon Jul 19, 2004 5:00 pm    Post subject: Reply with quote

Hi there,
I own a Compaq Presario 731PT and I've been searching for ways to get automatic shutdown/power-off on low battery and shutting down using the Power Button - here's a big thanks to friday for the script, it solved everything neatly in one go - I only had to change BAT1 to BAT0 - thanks once again, great help!! :D

Next stop: trying to use those shortcut keys for email client and web browser...! ;)
Back to top
View user's profile Send private message
groovec
n00b
n00b


Joined: 29 Jun 2004
Posts: 28

PostPosted: Tue Jul 20, 2004 12:57 pm    Post subject: Reply with quote

i have a problem with the ac_adapter, i get no event when im plug it in and out

lid and powerbutten both work :
Code:
[Tue Jul 20 14:52:00 2004] received event "button/lid LID 00000080 00000001"
[Tue Jul 20 14:52:00 2004] executing action "/etc/acpi/action.sh button/lid LID 00000080 00000001"
[Tue Jul 20 14:52:00 2004] BEGIN HANDLER MESSAGES
[Tue Jul 20 14:52:01 2004] END HANDLER MESSAGES
[Tue Jul 20 14:52:01 2004] action exited with status 0
[Tue Jul 20 14:52:01 2004] completed event "button/lid LID 00000080 00000001"
[Tue Jul 20 14:52:01 2004] received event "button/lid LID 00000080 00000002"
[Tue Jul 20 14:52:01 2004] executing action "/etc/acpi/action.sh button/lid LID 00000080 00000002"
[Tue Jul 20 14:52:01 2004] BEGIN HANDLER MESSAGES
[Tue Jul 20 14:52:01 2004] END HANDLER MESSAGES
[Tue Jul 20 14:52:01 2004] action exited with status 0
[Tue Jul 20 14:52:01 2004] completed event "button/lid LID 00000080 00000002"


but when i plug the ac adapter in and out i only get the battery discharging event:
Code:
[Tue Jul 20 14:54:04 2004] received event "battery BAT1 00000080 00000001"
[Tue Jul 20 14:54:04 2004] executing action "/etc/acpi/action.sh battery BAT1 00000080 00000001"
[Tue Jul 20 14:54:04 2004] BEGIN HANDLER MESSAGES
[Tue Jul 20 14:54:04 2004] END HANDLER MESSAGES
[Tue Jul 20 14:54:04 2004] action exited with status 0
[Tue Jul 20 14:54:04 2004] completed event "battery BAT1 00000080 00000001"
[Tue Jul 20 14:54:04 2004] received event "battery BAT1 00000081 00000001"
[Tue Jul 20 14:54:04 2004] executing action "/etc/acpi/action.sh battery BAT1 00000081 00000001"
[Tue Jul 20 14:54:04 2004] BEGIN HANDLER MESSAGES
#### NO ACTION FOR EVENT:
[Tue Jul 20 14:54:04 2004] END HANDLER MESSAGES
[Tue Jul 20 14:54:04 2004] action exited with status 1
[Tue Jul 20 14:54:04 2004] completed event "battery BAT1 00000081 00000001"
[Tue Jul 20 14:54:23 2004] received event "battery BAT1 00000080 00000001"
[Tue Jul 20 14:54:23 2004] executing action "/etc/acpi/action.sh battery BAT1 00000080 00000001"
[Tue Jul 20 14:54:23 2004] BEGIN HANDLER MESSAGES
[Tue Jul 20 14:54:23 2004] END HANDLER MESSAGES
[Tue Jul 20 14:54:23 2004] action exited with status 0
[Tue Jul 20 14:54:23 2004] completed event "battery BAT1 00000080 00000001"
[Tue Jul 20 14:54:23 2004] received event "battery BAT1 00000081 00000001"
[Tue Jul 20 14:54:23 2004] executing action "/etc/acpi/action.sh battery BAT1 00000081 00000001"
[Tue Jul 20 14:54:23 2004] BEGIN HANDLER MESSAGES
#### NO ACTION FOR EVENT:
[Tue Jul 20 14:54:23 2004] END HANDLER MESSAGES
[Tue Jul 20 14:54:23 2004] action exited with status 1
[Tue Jul 20 14:54:23 2004] completed event "battery BAT1 00000081 00000001"


/proc/acpi/ac_adapter/ACAD/state gives me the correct status, so kernel support should be right
Back to top
View user's profile Send private message
Nicolinux
Apprentice
Apprentice


Joined: 22 Dec 2002
Posts: 204

PostPosted: Tue Aug 10, 2004 10:16 pm    Post subject: Reply with quote

Hi,

I am using this set of scripts with great success. One questions remains. How do I hunt/minimize the processes that make my harddrive spinup shortly after it has spindown? It make this nice feature pointless since the wearoff effect for the hard drive that keeps spin up and down defeats the advantage of longer batery life.

Thanks

Stefan
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum