[ltp] ACPI or APM on X24?

Steve Nicholson linux-thinkpad@linux-thinkpad.org
Wed, 15 Dec 2004 03:28:08 -0800


Niko Ehrenfeuchter wrote:
> On Mon, 2004-12-13 at 17:52 -0800, Steve Nicholson wrote:
> [...]
> 
>>What are others with X22-X24 using?
> 
> 
> my X24 here works like a charm with ACPI.

Would you mind sharing what you did to get it to work and the 
/etc/acip/actions scripts with me?

When I do a sleep (suspend to RAM) it shuts down (backlighting doesn't 
go off but don't think it's that important yet) but wont start again, 
I have to hard reset, unplugging the power and removing battery. Also, 
since I have enabled acpi I have had random system lockups when the 
laptop just stops responding to mouse/keyboard and have to power off 
again.

Any pointers would be great fully accepted, once I get it right I'm 
putting together a dummies how to.

This is what I've done so far for X24 Mandrake 10.1:
-----------------------------------
[root@snlaptop ibm-acpi-0.8]# make
make -C /lib/modules/2.6.8.1-20mdk/build 
SUBDIRS=/home/steve/tmp/ibm-acpi-0.8 modules
make[1]: Entering directory `/lib/modules/2.6.8.1-20mdk/build'
make[1]: *** No rule to make target `modules'.  Stop.
make[1]: Leaving directory `/lib/modules/2.6.8.1-20mdk/build'
make: *** [default] Error 2


need to get kernel sources.
To satisfy dependencies, the following 8 packages are going to be 
installed (95 MB):
gcc-3.4.1-4mdk.i586
gcc-cpp-3.4.1-4mdk.i586
glibc-2.3.3-21mdk.i586
glibc-devel-2.3.3-21mdk.i586
kernel-source-stripped-2.6-2.6.8.1-20mdk.i586
libgpm1-devel-1.20.1-11mdk.i586
libncurses5-5.4-1.20040529.2mdk.i586
libncurses5-devel-5.4-1.20040529.2mdk.i586

after installing sources and dependencies above.

[root@snlaptop ibm-acpi-0.8]# make
make -C /lib/modules/2.6.8.1-20mdk/build 
SUBDIRS=/home/steve/tmp/ibm-acpi-0.8 modules
make[1]: Entering directory `/usr/src/linux-2.6.8.1-20mdk'
   CC [M]  /home/steve/tmp/ibm-acpi-0.8/ibm_acpi.o
   Building modules, stage 2.
   MODPOST
   CC      /home/steve/tmp/ibm-acpi-0.8/ibm_acpi.mod.o
   LD [M]  /home/steve/tmp/ibm-acpi-0.8/ibm_acpi.ko
make[1]: Leaving directory `/usr/src/linux-2.6.8.1-20mdk'

do: make install

[root@snlaptop ibm-acpi-0.8]# make install
install -d /lib/modules/2.6.8.1-20mdk/acpi/
install -m 644 -c ibm_acpi.ko /lib/modules/2.6.8.1-20mdk/acpi/
depmod -a

do: modprobe ibm_acpi

[root@snlaptop ibm-acpi-0.8]# modprobe ibm_acpi
[root@snlaptop ibm-acpi-0.8]# lsmod
Module                  Size  Used by
ibm_acpi               18100  0
cpufreq_powersave       1312  0
--snip--

enable the hotkeys and play a little with things:
[root@snlaptop ibm-acpi-0.8]# cat /proc/acpi/ibm/driver
driver:         IBM ThinkPad ACPI Extras
version:        0.8
[root@snlaptop ibm-acpi-0.8]# cat /proc/acpi/ibm/hotkey
status:         disabled
mask:           not supported
commands:       enable, disable, reset
[root@snlaptop ibm-acpi-0.8]# echo enable > /proc/acpi/ibm/hotkey
[root@snlaptop ibm-acpi-0.8]# cat /proc/acpi/ibm/hotkey
status:         enabled
mask:           not supported
commands:       enable, disable, reset
[root@snlaptop ibm-acpi-0.8]# cat /proc/acpi/ibm/light
status:         off
commands:       on, off
[root@snlaptop ibm-acpi-0.8]# echo on > /proc/acpi/ibm/light

copy actions & event scipts to /etc
cp ibm-acpi-0.8/config/etc/acpi/events/* /etc/acpi/events/
cp ibm-acpi-0.8/config/etc/acpi/actions/* /etc/acpi/actions/

change /etc/acpi/actions/blank.sh to
----
#!/bin/bash

RADEONTOOL='/usr/sbin/radeontool'

status=`$RADEONTOOL light|sed s/The\ radeon\ backlight\ looks\ //`;

if [[ "$status" = "on" ]] ; then
           $RADEONTOOL light off
   elif [[ "$status" = "off" ]] ; then
             $RADEONTOOL light on
     fi
----

copy laptop_mode & idectl to /usr/local/sbin/

create file "/etc/acpi/event/lid" with the following:
event=(button/lid|ibm/hotkey HKEY 00000080 00005001)
action=/etc/acpi/actions/sleep.sh

add "ibm_acpi hotkey=enable" to /etc/modprobe.preload for module to 
auto load on boot
(note modprobe.preload is for kernel 2.5 or later, earlier kernel use 
/etc/modules)

add acpi_sleep=s3_bios to kernel paramiters in lilo.

I've also turned off apmd and apic but seem to need apicl for kernel 
to boot past "Calibrating delay loop..."

Begining dmesg=
Kernel command line: BOOT_IMAGE=2681-20 ro root=305 noapic 
devfs=nomount resume=/dev/hda6 acpi_slee=s3_bios

---end what's been done-----------