lkml.org 
[lkml]   [2001]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: kernel apm code
John Fremlin wrote:
>
> David Balazic <david.balazic@uni-mb.si> writes:
>
> > The newer version has among other things support for
> > the APM_IOC_REJECT ioctl which is useful for example
> > when implementing "run /sbin/shutdown -h when the power
> > button is pressed".
> >
> > While isn't this merged into the official kernel ?
>
> The maintainer hasn't the time to do it. He promised me he would in
> February, when I telephone, but hasn't bothered to do anything
> AFAICS. I hacked together the following patch for it a while ago,
> which updated APM_IOC_REJECT for slightly more recent kernels (be
> warned, I think I made some mistakes)

It uses the same version number ( 1.15 ) as the "official" apm.c
( at linuxcare.com.au/apm ). I don't think that is a good idea.
Maybe 1.14b ?

>------------------------------------------------------------
>
> I made a (IMHO) better version called pmpolicy, based on different
> principles. More information is available at
>
> http://john.snoop.dk/programs/linux/offbutton/

To implement off-button you only need the APM_IOC_REJECT ioctl and apmd 3.0
and a slight change to the apm_proxy script.
It must be changed to execute "poweroff" and return a value of 1 ( so that
the apmd/kernel/apm-driver reject the event ) in case of "system suspend" event.
The only problem might be synchronization ( "poweroff" might kill apmd
before is sends the REJECT call to kernel ).


--
David Balazic
--------------
"Be excellent to each other." - Bill & Ted
- - - - - - - - - - - - - - - - - - - - - -
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:17    [W:0.064 / U:4.492 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site