# laptop apm problems

## yoccodog

i recently installed gentoo on my dell inspiron 8100 laptop.  i must say that it is the distro that i've been looking for.  portage rocks.  anyway..

whenever i shut the lid of my laptop, the computer crashes.  apm & laptop support are both compiled into the kernel.  when i try to emerge or compile apmd from source, i get the same error:

In file included from apmsleep.c:49:

/usr/src/linux/include/asm/spinlock.h: In function `spin_lock':

/usr/src/linux/include/asm/spinlock.h:138: parse error before `LOCK_SECTION_START'

/usr/src/linux/include/asm/spinlock.h: In function `read_lock':

/usr/src/linux/include/asm/spinlock.h:189: parse error before `LOCK_SECTION_START'

/usr/src/linux/include/asm/spinlock.h:189: warning: implicit declaration of function `LOCK_SECTION_START'

/usr/src/linux/include/asm/spinlock.h:189: parse error before string constant

/usr/src/linux/include/asm/spinlock.h: In function `write_lock':

/usr/src/linux/include/asm/spinlock.h:198: parse error before `LOCK_SECTION_START'

/usr/src/linux/include/asm/spinlock.h:198: parse error before string constant

make: *** [apmsleep.o] Error 1

anyone have any idea how to get around this and allow me to install apmd?  

OR

anyone have any idea of what i can do to set the laptop suspend/standby/power off settings?

Thanks.

----------

## fre

Hi, I had the exact same problem. I just removed the references to the problem-generating code, and it seemed to compile. I only use the utils to suspend my notebook and thusfar that worked just perfectly. This was on a Dell Latitude.

Good luck!

----------

## dnellans

apmd not compiling  is a known bug and is caused by the gentoo patch applied to the kernel, your options are either to stick it out untill its fixed or you can revert to plain 2.4.18 kernel which works, or some other variant of your own.  look in bugzilla for more info

dave

----------

## yoccodog

do you think this could be the reason it also crashes when the lid is closed?

----------

## torkar

I use a Dell L400 and I had the same problem.

I did this:

 :Arrow:  Do not compile the apmd package

 :Arrow:  Compile apm in the kernel as a module

 :Arrow:  Make sure apm is loaded first during start up (modules.autload)

 :Arrow:   The first time want to put the laptop to sleep use the special key on the keyboard (Fn-Esc)

 :Arrow:  After that it works great just to close or open the lid

/Richard

----------

## clacour

I had similar problems with the apmd compile. Following the suggestion of one of the bug reports, I emerged sys-kernel/linux-sources, version 2.4.19-r1, and it compiled ok.

"apm -s" works fine in KDE.  It's worked about 60% of the time in command line mode. Haven't tried the Fn-Suspend key, so I can't comment on that.

----------

## yoccodog

apm -s works for me too.. but apm -S does not.. 

putting the computer to sleep is nice if you are taking it places.. but if you want it to process information or just be on over night it is a nuisance to keep the screen open..

as a module... it still crashes when the lid is closed

i have tried the 2.4.18 kernel and this has not worked

at this point i am at a loss for possible solutions.. it worked with redhat..  i may reinstall that.. but portage vs rpm.... no contest.. geez...

 :Crying or Very sad: 

----------

