Home Linux on an HP ze4100
Red Hat Linux on an HP Pavilion ze4100 Notebook - Building a 2.4.23 Kernel Print E-mail
Written by Bruce R. Copeland   
Wednesday, 07 January 2004 22:12
Article Index
Red Hat Linux on an HP Pavilion ze4100 Notebook
Hardware Configuration
Building a 2.4.23 Kernel
Graphics Configuration
Other Useful Links
All Pages

Building a 2.4.23 Kernel (Red Hat 9)

A notebook computer is not much use without power management. Newer notebook computers use ACPI instead of APM for power management, and the HP ze4000/ze5000 series is no exception. Unfortunately several of the major Linux distributions (including Red Hat) provide prebuilt kernels that do not support ACPI (nor do they have any facililty for suspending a notebook which uses ACPI). A kernel build is required to implement ACPI and suspend capability.

To build the 2.4.23 kernel, I obtained vanilla 2.4.23 kernel source from the Linux Kernel Archives and applied the following patches: acpi-20031203-2.4.23.diff.gz (see also the ACPI Project), software-suspend-2.0-linux-2.4.23.bz2 and software-suspend-2.0-core-rc3A.bz2 from the SourceForge Software Suspend site, and linux-2.4.23-ntfs-2.1.5a.patch.gz from the Linux NTFS file system support project. (See current kernel configuration.) For those of you unfamiliar with kernel building or patching, I recommend the excellent discussions at digitalhermit.com and kernelnewbies.org. After building the kernel, I configured and built pcmcia-cs and linux-wlan-ng as described in the section on PCMCIA and WiFi above.

ACPI and Software Suspend

With ACPI support built into the kernel, many of the ACPI power management capabilities of this notebook become accessible. The kernel puts information about the current ACPI state in /proc/acpi. Examining the files and directory structure under /proc/acpi is a good way to gain familiarity with the ACPI capabilities. Currently information about AC adapter, battery, lid position, power button, fan, cpu, and temperature are available.

Most notebook users want some mechanism to monitor battery state. There are several ACPI battery monitors available. I personally like the GKrellM monitor with the gkacpi plugin. The GKrellM monitor itself is available as an rpm package on the Red Hat installation CDs. I built gkacpi from the gkacpi2-0.4 source code, and then added the gkacpi2.so file to the appropriate user .gkrellm/plugins directories. The Gnome panel battery charge monitor also works quite satisfactorily with ACPI in Red Hat 9 (but not in Red Hat 8).

The ACPI daemon project (acpid) offers another way to make use of the ACPI information produced by the kernel in /proc/acpi. This daemon implements an event/action system under /etc/acpi and logs acpi information to /var/log/acpid. There are various scripts around the web for responding to power related events (such as closing the notebook lid or pressing the power button). I use a powerbtn event file (located in /proc/acpi/event that contains the lines
    event=button[ /]power
    action=/etc/acpi/powerbtn.sh
where the powerbtn.sh script simply calls
    shutdown -h now
to do an orderly shutdown whenever the power button is pressed.

Software suspend works well with the 2.4.23 kernel after some careful configuration. I currently use the suspend-0.18 script from the SourceForge Software Suspend site. I have /etc/suspend.conf configured to run a script that uses cardctl eject to stop the WiFi card before suspension begins. On this notebook it is essential that the suspend script load the keyboardev and mousedev modules after resume. Even so, the scrollpad occasionally doesn't respond after resume. [This is easily remedied by using <Ctrl-Alt-F1> to switch to a text console and then <Ctrl-Alt-F7> to come back to XWindows.] It is also necessary to run the omke.pl script after software suspend/resume in order to enable the multimedia keys (see above). I have configured acpid so that closing the notebook lid suspends the system, and so that the system suspends automatically whenever battery power drops below 6%. [NOTE that there are serious computer security issues associated with leaving a notebook in the unresumed state after suspend!!!] You can get my acpid event/action scripts and suspend configuration.
Last Updated on Tuesday, 28 October 2008 17:56
 
Copyright © 2010 CyberSym Technologies, Template designed by SiteGround web hosting