# No lid sensor with acpi

## subterraneus

I have tried multiple other distros and have always come back to gentoo, I always feel like the only thing I'm missing that others have provided me flawlessly is full functionality of acpi. I have finally gotten to the point where I've got a working battery monitor, and I have some little parts of acpi working, but my biggest thing now is I would love to have hibernate-ram triggered when I close my laptop lid...sadly when I close the lid, wait a little while and open, dmesg doesn't tell me acpi has gotten any events. Any ideas?

----------

## Sadako

Do you have acpid running?

If so, does /var/log/acpid report anything after closing and opening the lid?

----------

## subterraneus

acpid is on, and I get

```

[Sun Apr 15 12:25:22 2007] completed event "button/lid LID 00000080 00000004"

```

in /var/log/acpid, looks like good news.

I feel like the next step should be easy, but I'm can't dredge up in my mind what to edit now.

----------

## Sadako

 *subterraneus wrote:*   

> I feel like the next step should be easy, but I'm can't dredge up in my mind what to edit now.

 

```
man acpid
```

  :Twisted Evil: 

The rude RTFM aside, it really does look like the best place to start.

----------

## subterraneus

Lord knows how many times I have told people to do this, it's only fair for me to be on this side of it.

I edited /etc/acpi/actions/lm_lid.sh

and added /usr/sbin/hibernate-ram to it

it now reads as:

```

#!/bin/bash

test -f /usr/sbin/laptop_mode || exit 0

# lid button pressed/released event handler

/usr/sbin/laptop_mode auto

/usr/sbin/hibernate-ram

```

works great...ish. I close the lid, and it hibernates. I open the lid and the screen never comes back on, although it does seem to wake up (the power light stops flashing when I open the lid)

----------

## Sadako

Can you hear the hard drive spinning up when you open the lid back up?

Does it work properly from the console instead of X?

Did you select the acpi video option in the kernel?

Edit; s/pinning/spinning/

----------

## subterraneus

yes

no

Do you mean the boot kernel options, or in the actual kernel configuration?

either way, I don't know what you're talking about (sadly) and it's most likely not turned on

grub.conf

```

Compy ~ # cat /boot/grub/grub.conf

default 0

timeout 30

splashimage=(hd0,1)/boot/grub/splash.xpm.gz

title Suspend2

root (hd0,1)

kernel /boot/kernel-genkernel-x86_64-2.6.19-suspend2-r3 resume2=swap:/dev/hda3 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda4 udev

initrd /boot/initramfs-genkernel-x86_64-2.6.19-suspend2-r3

title=Gentoo Linux 2.6.19-r5

root (hd0,1)

kernel /boot/kernel-genkernel-x86_64-2.6.19-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda4 udev

initrd /boot/initramfs-genkernel-x86_64-2.6.19-gentoo-r5

#Only in case you want to dual-boot

title=Windows XP

rootnoverify (hd0,0)

makeactive

chainloader +1

```

everything having to do with acpi in the kernel config:

```

Compy ~ # cat /usr/src/linux/.config | grep ACPI

CONFIG_X86_64_ACPI_NUMA=y

# ACPI (Advanced Configuration and Power Interface) Support

CONFIG_ACPI=y

CONFIG_ACPI_SLEEP=y

CONFIG_ACPI_SLEEP_PROC_FS=y

# CONFIG_ACPI_SLEEP_PROC_SLEEP is not set

CONFIG_ACPI_AC=m

CONFIG_ACPI_BATTERY=m

CONFIG_ACPI_BUTTON=m

CONFIG_ACPI_VIDEO=m

CONFIG_ACPI_HOTKEY=m

CONFIG_ACPI_FAN=m

# CONFIG_ACPI_DOCK is not set

CONFIG_ACPI_PROCESSOR=m

CONFIG_ACPI_HOTPLUG_CPU=y

CONFIG_ACPI_THERMAL=m

CONFIG_ACPI_NUMA=y

CONFIG_ACPI_ASUS=m

CONFIG_ACPI_IBM=m

# CONFIG_ACPI_IBM_DOCK is not set

CONFIG_ACPI_TOSHIBA=m

CONFIG_ACPI_BLACKLIST_YEAR=0

# CONFIG_ACPI_DEBUG is not set

CONFIG_ACPI_EC=y

CONFIG_ACPI_POWER=y

CONFIG_ACPI_SYSTEM=y

CONFIG_ACPI_CONTAINER=m

# CONFIG_ACPI_SBS is not set

CONFIG_X86_POWERNOW_K8_ACPI=y

CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI=y

CONFIG_X86_ACPI_CPUFREQ=m

# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set

CONFIG_PNPACPI=y

```

Hope that helps

----------

## Sadako

 *subterraneus wrote:*   

> Do you mean the boot kernel options, or in the actual kernel configuration?
> 
> either way, I don't know what you're talking about (sadly) and it's most likely not turned on

 Sorry, I should have been clearer, I meant in the kernel configuration, and you have it as a module (CONFIG_ACPI_VIDEO=m).

You also seem to have most of the other options enabled as modules too, so could you show me which modules are loaded (lsmod), and if the video module isn't loaded, load it.

I don't actually know whether or not it'll make a blind bit of difference, but at least it's something to try.

----------

## subterraneus

```

nero@Compy ~ $ lsmod | grep video

video                  22280  0 

```

the reason for this being:

```

nero@Compy ~ $ cat /etc/modules.autoload.d/kernel-2.6 | grep video

video

```

----------

## subterraneus

Ok, so I have an idea:

when I use hibernate (not hibernate-ram) this happens:

```

nero@Compy ~ $ sudo hibernate

hibernate: Suspend reported the following errors:

 - Suspend was aborted (see dmesg).

nero@Compy ~ $ dmesg | tail

Suspend2 2.2.9: Software suspend is disabled.

This may be because you haven't put something along the lines of

resume2=swap:/dev/hda1

in lilo.conf or equivalent. (Where /dev/hda1 is your swap partition).

ACPI: Power Button (FF) [PWRF]

ACPI: Sleep Button (FF) [SLPF]

ACPI: Lid Switch [LID]

ACPI: Power Button (CM) [PWRB]

nero@Compy ~ $ sudo mount /dev/hda2 /boot/

nero@Compy ~ $ cat /boot/grub/grub.conf | grep resume2

kernel /boot/kernel-genkernel-x86_64-2.6.19-suspend2-r3 resume2=swap:/dev/hda3 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda4 udev

```

----------

## widan

 *subterraneus wrote:*   

> works great...ish. I close the lid, and it hibernates. I open the lid and the screen never comes back on, although it does seem to wake up (the power light stops flashing when I open the lid)

 

What model of laptop is it ? Maybe the backlight is not enabled again on resume, and/or you need to use vbetool to re-run the video BIOS.

----------

## subterraneus

forget it, got it all to work on my own, it's probably not the reccomended way, but it actually works, so it's all good now.

----------

