rickenbacherus
08-12-2003, 04:32 AM
Does your laptop need ACPI becasue it overheats? Tired of using a power strip to shut down your desktop becasue it won't power down correctly with APM? ACPI might just be your answer. It should be noted that ACPI does not work on all machines.
This is the easiest way I know of to get acpi working.
First you need an acpi patched kernel.. Oh No! you say- I Don't know how to build an acpi patched kernel. Not to worry. Thanks to the excellent efforts of Kano this couldn't possibly be any easier. It's already built!- you just have to install it and that's easier than falling off a dead horse. You can get the kernel and install scripts here:
http://debian.tu-bs.de/knoppix/Kano
For laptop owners get the kernel-2.4.21-acpi.zip . For desktop owners get the kernel-2.4.21-ck3.zip . Everything you need is in the .zip file.
Make a new directory to unzip all of this into unless you want an entire herd of files floating around.
mkdir newkernel
Become root:
su
<password>
Download your kernel.zip into your newly created directory.
cd newkernel
unzip kernel-2.4.21-acpi.zip
*NOTE* Before continuing you should do uname -r . if you have a 2.4.20-xfs kernel then no changes are necessary. If you have 2.4.21-xfs then you need to either edit the next to last line of ./install-kernel-knoppix.sh to reflect your kernel version. It should look like this after editing:
ln -sf boot/vmlinuz-2.4.21-xfs /vmlinuz.old
or give this command in the newkernel directory:
perl -pi -e 's/2.4.20-xfs/2.4.21-xfs/' install-kernel-knoppix.sh
Now, on with the show.....
./install-kernel-knoppix.sh
cd /boot
ls
You should see a new symlink called vmlinuz
ls -al vmlinuz
lrwxrwxrwx 1 root root 19 Aug 2 06:07 vmlinuz -> vmlinuz-2.4.21-acpi
or... if you installed 2.4.21-ck3:
lrwxrwxrwx 1 root root 18 Aug 15 21:27 vmlinuz -> vmlinuz-2.4.21-ck3
Yes! The new kernel is installed.
Now you need to edit LILO.
sudo xedit /etc/lilo.conf
(of course you may use any editor that you prefer).
The installation script linked your original kernel to LinuxOLD and you no longer need to use initrd! So, you need to move initrd to LinuxOLD. Here is an example for the new LILO entry for the new vmlinuz kernel and an example of what vmlinuz.old should look like:
default=Linux
image=/boot/vmlinuz
label=Linux
read-only
image=/vmlinuz.old
label=LinuxOLD
initrd=/boot/initrd.gz
This way you can still boot your old kernel by selecting LinuxOLD. In fact-you could copy/paste the above and comment (add a '#' to the front of) the other kernel entries if you like.
After everything looks right in LILO you need to run it.
/sbin/lilo
It should return
Added Linux
Added LinuxOLD
Of course if there were any errors you'll need to fix them and rerun LILO.
*NOTE* According to the acpi documentation if you have problems with acpi it may be necessary to add the following to the append="" line in /etc/lilo.conf:
acpi=off
reboot
uname -r
*If you don't see 2.4.21-acpi (or 2.4.21-ck3)then you did not boot the new kernel. Go back and fix lilo.*
cd newkernel
Become root.
If you installed kernel-2.4.21-acpi then do the following:
./install-acpi-modules.sh | tee acpi.log
If you've installed kernel-2.4.21-ck3 then do this:
./install-ospm-modules.sh | tee acpi.log
That's the only difference in installation procedures for the two kernels.
You should now have a file called acpi.log in your newkernel directory. Have a look at it- see what installed. *Note that not every machine will support every option. When viewing the acpi.log the message NOT WORKING should not necessarily be determined as a failed installation.*
apt-get remove --purge apmd
apt-get install acpid
If you installed 2.4.21-acpi you can also do this:
apt-get install acpi
That's it!
Now you should be able to determine some info about your hardware.
acpi -V
Should return something like so:
Battery 1: unknown, 100%
Thermal 1: ok, 62.0 degrees C
AC Adapter 1: on-line
That's with the ac adapter plugged in of course. :)
cat /proc/acpi/info
version: 20030619
states: S0 S1 S3 S4 (swsusp) S5
cat /proc/acpi/battery/BAT1/info
present: yes
design capacity: 3600 mAh
last full capacity: 3031 mAh
battery technology: rechargeable
design voltage: 10800 mV
design capacity warning: 61 mAh
design capacity low: 0 mAh
capacity granularity 1: 36 mAh
capacity granularity 2: 36 mAh
model number: P71048002110
serial number: 1600242472
battery type: Li-ION
OEM info:
Is this cool or what?? Go ahead and cd /proc/acpi and have a look around. Different systems will support different options. This is really only the beginning as acpi is a rather broad subject. Unfortunately the standards for acpi are not strictly adhered to.
This kernel also has the swsusp patch (software suspend) since suspend isn't supported in the Linux kernel this is an alternative wat to use suspend. The documentation can be found here:
/usr/share/doc/kernel-doc-2.4.21-acpi/Documentation/swsusp.txt.gz
http://swsusp.sourceforge.net/
If you're using KDE then you can set up acpi from the Control Center>Power Control>Laptop Battery. Additionally you may choose to have an icon in your system tray indicating the charge state of your battery. By right clicking the icon you can also set up acpi. Be aware that acpi doesn't work on every machine. Fortunately Kano was also kind enough to include scripts to uninstall the kernel and acpi patch.
Commands you can issue to put your machine into various sleep states:
http://acpi.sourceforge.net/documentation/sleep.html
ACPI documentation can be found here:
/usr/share/doc/kernel-doc-2.4.21-acpi
ACPI project page:
http://acpi.sourceforge.net/
Great girlgeek doc:
http://xtrinsic.com/geek/articles/acpi.phtml
Tuxmobil:
http://tuxmobil.org/apm_linux.html
http://www.cpqlinux.com/acpi-howto.html
If you have any tips/tricks experiences or otherwise for ACPI in Linux please feel free to add them here.
*** No wimpdoze users were harmed either emotionally or physically during the installation of this bitchin' kernel.*** ;)
This is the easiest way I know of to get acpi working.
First you need an acpi patched kernel.. Oh No! you say- I Don't know how to build an acpi patched kernel. Not to worry. Thanks to the excellent efforts of Kano this couldn't possibly be any easier. It's already built!- you just have to install it and that's easier than falling off a dead horse. You can get the kernel and install scripts here:
http://debian.tu-bs.de/knoppix/Kano
For laptop owners get the kernel-2.4.21-acpi.zip . For desktop owners get the kernel-2.4.21-ck3.zip . Everything you need is in the .zip file.
Make a new directory to unzip all of this into unless you want an entire herd of files floating around.
mkdir newkernel
Become root:
su
<password>
Download your kernel.zip into your newly created directory.
cd newkernel
unzip kernel-2.4.21-acpi.zip
*NOTE* Before continuing you should do uname -r . if you have a 2.4.20-xfs kernel then no changes are necessary. If you have 2.4.21-xfs then you need to either edit the next to last line of ./install-kernel-knoppix.sh to reflect your kernel version. It should look like this after editing:
ln -sf boot/vmlinuz-2.4.21-xfs /vmlinuz.old
or give this command in the newkernel directory:
perl -pi -e 's/2.4.20-xfs/2.4.21-xfs/' install-kernel-knoppix.sh
Now, on with the show.....
./install-kernel-knoppix.sh
cd /boot
ls
You should see a new symlink called vmlinuz
ls -al vmlinuz
lrwxrwxrwx 1 root root 19 Aug 2 06:07 vmlinuz -> vmlinuz-2.4.21-acpi
or... if you installed 2.4.21-ck3:
lrwxrwxrwx 1 root root 18 Aug 15 21:27 vmlinuz -> vmlinuz-2.4.21-ck3
Yes! The new kernel is installed.
Now you need to edit LILO.
sudo xedit /etc/lilo.conf
(of course you may use any editor that you prefer).
The installation script linked your original kernel to LinuxOLD and you no longer need to use initrd! So, you need to move initrd to LinuxOLD. Here is an example for the new LILO entry for the new vmlinuz kernel and an example of what vmlinuz.old should look like:
default=Linux
image=/boot/vmlinuz
label=Linux
read-only
image=/vmlinuz.old
label=LinuxOLD
initrd=/boot/initrd.gz
This way you can still boot your old kernel by selecting LinuxOLD. In fact-you could copy/paste the above and comment (add a '#' to the front of) the other kernel entries if you like.
After everything looks right in LILO you need to run it.
/sbin/lilo
It should return
Added Linux
Added LinuxOLD
Of course if there were any errors you'll need to fix them and rerun LILO.
*NOTE* According to the acpi documentation if you have problems with acpi it may be necessary to add the following to the append="" line in /etc/lilo.conf:
acpi=off
reboot
uname -r
*If you don't see 2.4.21-acpi (or 2.4.21-ck3)then you did not boot the new kernel. Go back and fix lilo.*
cd newkernel
Become root.
If you installed kernel-2.4.21-acpi then do the following:
./install-acpi-modules.sh | tee acpi.log
If you've installed kernel-2.4.21-ck3 then do this:
./install-ospm-modules.sh | tee acpi.log
That's the only difference in installation procedures for the two kernels.
You should now have a file called acpi.log in your newkernel directory. Have a look at it- see what installed. *Note that not every machine will support every option. When viewing the acpi.log the message NOT WORKING should not necessarily be determined as a failed installation.*
apt-get remove --purge apmd
apt-get install acpid
If you installed 2.4.21-acpi you can also do this:
apt-get install acpi
That's it!
Now you should be able to determine some info about your hardware.
acpi -V
Should return something like so:
Battery 1: unknown, 100%
Thermal 1: ok, 62.0 degrees C
AC Adapter 1: on-line
That's with the ac adapter plugged in of course. :)
cat /proc/acpi/info
version: 20030619
states: S0 S1 S3 S4 (swsusp) S5
cat /proc/acpi/battery/BAT1/info
present: yes
design capacity: 3600 mAh
last full capacity: 3031 mAh
battery technology: rechargeable
design voltage: 10800 mV
design capacity warning: 61 mAh
design capacity low: 0 mAh
capacity granularity 1: 36 mAh
capacity granularity 2: 36 mAh
model number: P71048002110
serial number: 1600242472
battery type: Li-ION
OEM info:
Is this cool or what?? Go ahead and cd /proc/acpi and have a look around. Different systems will support different options. This is really only the beginning as acpi is a rather broad subject. Unfortunately the standards for acpi are not strictly adhered to.
This kernel also has the swsusp patch (software suspend) since suspend isn't supported in the Linux kernel this is an alternative wat to use suspend. The documentation can be found here:
/usr/share/doc/kernel-doc-2.4.21-acpi/Documentation/swsusp.txt.gz
http://swsusp.sourceforge.net/
If you're using KDE then you can set up acpi from the Control Center>Power Control>Laptop Battery. Additionally you may choose to have an icon in your system tray indicating the charge state of your battery. By right clicking the icon you can also set up acpi. Be aware that acpi doesn't work on every machine. Fortunately Kano was also kind enough to include scripts to uninstall the kernel and acpi patch.
Commands you can issue to put your machine into various sleep states:
http://acpi.sourceforge.net/documentation/sleep.html
ACPI documentation can be found here:
/usr/share/doc/kernel-doc-2.4.21-acpi
ACPI project page:
http://acpi.sourceforge.net/
Great girlgeek doc:
http://xtrinsic.com/geek/articles/acpi.phtml
Tuxmobil:
http://tuxmobil.org/apm_linux.html
http://www.cpqlinux.com/acpi-howto.html
If you have any tips/tricks experiences or otherwise for ACPI in Linux please feel free to add them here.
*** No wimpdoze users were harmed either emotionally or physically during the installation of this bitchin' kernel.*** ;)