Вы находитесь на странице: 1из 5

Installing Linux on an HP Laptop

Matti J. Kärki <mjk@iki.fi>


2004-03-21

1 Introduction
This document explains the installation and configuration of a Linux operating
system on an HP ze4423 laptop.

1.1 System
Hardware:

• HP Pavilion ze4423ea

• AMD Athlon XP-M 2400+

• 512 MB RAM

• 30 GB hard drive

• PCMCIA 802.11g WLAN card (A-Link WL54PC, uses rt2500 chip-set)

Software:

• Mandrake Linux 10.1 Mini CD

• dkms-rt2500-1.4.4.0-2mdk.noarch.rpm

• cpufreq

• gnome-cpufreq

2 Installation
Installation is an easy task. Just pop in your favorite installation media and start
the machine. I used Mandrake Mini CD and fetched all packages over the Inter-
net. Mandrake is able to identify and configure automatically the display adapter,
monitor, mouse (both the touch pad and my optical USB mouse with wheel) and
the integrated network adapter.
At the end of the installation there is a boot manager configuration. Be careful,
when choosing the boot-time options. If you asked the installation program to
fetch latest updates from the Internet, it’s recommended that ACPI, APIC and
LAPIC are all on. If you didn’t fetch the updates or you did install the whole sys-
tem from CDs, then it’s better to leave APIC and LAPIC on and disable ACPI. All
this is necessary, because the older kernel (2.6.8.1-18mdk) has some issues
with all three options and the power management wont work at all. But updating
the system (at install time or after the first boot) will introduce a newer kernel
(2.6.8.1-24mdk), which has this issue fixed. So, if you want to have a power
management, it is strongly advised that you update the kernel as soon as possible.

3 Configuration

3.1 WLAN
Mandrake 10.1 does not have pre-compiled module for RA-Link rt2500 chip set.
Fortunately, RA-Link has released WLAN drivers under GPL license and pre-
packaged version of these drivers is available at ../devel/cooker/i586/media/contrib/
at your favorite Mandrake mirror site. Find the dkms-rt2500-1.4.4.0-2mdk.noarch.rpm
package and install it using urpmi as a root. If the urmpi asks for a kernel sources,
type uname -a and check the kernel version you are using. Then tell the urpmi,
which kernel source package can be installed.
The installation process of rt2500 module is simple. Urpmi fetches the kernel
source and unpacks the rt2500 module source. After that, the module will be
compiled against the kernel source and then installed to the system. The kernel
source is used only to satisfy the needs of the module source. Afterwards, you can
uninstall the kernel source package.
After installation, The /etc/modules.conf file has to be edited, because of
a small typo in the rt2500 installation script. Change the line “alias ra1 rt2500”
to “alias ra0 rt2500”.
The final step is to configure the card so it can automatically contact the wireless
access point. I tried to use drakconf for this task, but unfortunately there seems
to be be a bug in the configuration system and you have to create the connection
scripts by hand. Do not try to use ifup command to bring the wireless network up.
It wont work.
First, create a /etc/sysconfig/network-scripts/ifcfg-ra0 file with
the following contents:

DEVICE=ra0
BOOTPROTO=dhcp
ONBOOT=no
HWADDR=00:00:00:00:00:00
METRIC=10
MII_NOT_SUPPORTED=no
NEEDHOSTNAME=yes

00:00:00:00:00:00 is the MAC address of your WLAN card. The ONBOOT pa-
rameter is set to “no”, so system doesn’t try to bring up the card at the boot-time.
We need to initialize and set up the card separately, because we will need a custom
script for the job.
Then, create a directory for custom WLAN start up script, for example /etc/wlan.
To that directory, create the following files:
/etc/wlan/wlan:

#!/bin/sh

/etc/wlan/wlan.script

/etc/wlan/wlan.script:

#!/bin/sh

echo "Setting up WLAN connection..." && \


/sbin/ifconfig eth0 down && \
/sbin/ifconfig ra0 up && \
/sbin/iwconfig ra0 key AAAAAAAAAAAAAAAAAAAAAAAAAA && \
/sbin/iwconfig ra0 ap 00:00:00:00:00:00 && \
/sbin/iwconfig ra0 essid THESSID && \
/sbin/dhclient ra0 && \
echo "Connection established."

The AAAAAAAAAAAAAAAAAAAAAAAAAA part is your 128 bit WEP en-


cryption key. The 00:00:00:00:00:00 is the MAC address and the THESSID is the
SSID of you you wireless access point. For some reason, I wasn’t able to use 256
bit WEP keys or WPA encryption even if I installed the wpa_supplicant package.
Finally, add the following lines at the end of the /etc/rc.d/tc.local file:

# Enable WLAN:

/etc/wlan/wlan

This way, the wireless network will be brought up automatically at the boot pro-
cess.

3.2 Power Saving


Modern Linux distributions support power management of the ze4423 very well.
My goal was to have manually adjustable CPU frequency. This way I can run
programs always at the lower frequency when working at a battery power. It is also
possible to configure fully automatic power-saving scheme like with Windows
XP. Just install the cpufreqd package. It will provide a handy daemon for
controlling and adjusting the processor speed automatically. In my case, I just
installed cpufreq and gnome-cpufreq packages.
For what I want, I only needed to install the cpufreq and gnome-cpufreq
packages and add a Gnome CPU Frequency Scaling Monitor applet to the Gnome
panel. Cpufreq package adds a start up script, which will identify the CPU at the
boot-time and select one of the powernow modules for the loading. The powernow
module provides an interface for CPU frequency scaling. The monitoring applet
is used because it’s possible to use it to force the CPU to run at specified speed.
Available frequencies at an Athlon XP-M 2400+ processor are: 529 MHz, 662
MHz, 794 MHz, 1.06 GHz, 1.46 GHz and 1.79 GHz.
To my surprise, the software suspend works out-of-box. To suspend the running
Linux session to the disk, just call pmsuspend2 with root priviledges. Next time
you start the machine and Linux starts loading, it will automatically restore the
system to the state before calling the pmsuspend2 function.
4 Problems
The drakconf tool was unable to create working configuration scripts for wireles
network card. I’m sure that there is a way to fix the scripts so it would be possible
to use ifup and ifdown to bring network up/down. I just was too lazy to figure out,
what was wrong with the existing scripts, so it was easier to write my own. In
addition, I was able to get to know the mechanics behind the wireless networking
under the Linux better.
Also, I wasn’t able to configure the WPA encryption for my wireless connection.
I don’t know for sure, but I think that there was some APIs missing from the
wpa_supplicant and I should recompile the package myself.

5 Conclusions
I have tested several Linux distributions and I have to say, that the Mandrake
Linux 10.1 has been the easiest to install so far. Also, the hardware detection and
support have both been quite remarkable.

Вам также может понравиться