Yvan Pointurier

Yvan Pointurier (IPA)
Yvan Pointurier (Cyrillic/Russian) Yvan Pointurier (Cyrillic/Serb)

Yvan Pointurier (Greek) 
Yvan Pointurier (Japanese/Katakana)
Yvan Pointurier (Mandarin) 
Yvan Pointurier (Hindi)
Yvan Pointurier (Persian)

 
   
   

TuxMobil - Linux on Laptops, Notebooks, PDAs and Mobile Phones Linux on a Compaq Presario 2200 series

This webpage describes the setup of Linux on a Compaq laptop, namely, a Compaq Presario 2232us. Other Compaq Presario 22xx should behave similarly. Also, I am discussing the specifics of Gentoo Linux but this webpage can easily be adapted to other distributions.

Other webpages about the same topic

Thanks to the authors of this webpage from which I drew part of the information needed to set up Linux on my laptop:

Hardware

  • Intel Celeron M processor with frequency scaling ability
  • IDE Seagate hard drive (40GB, 4200 RPM) and Toshiba 24x/24x/24x/8x (CD-R/CD-RW/CD-ROM/DVD-ROM) CD-RW/DVD-ROM combo optical drive
  • Graphics: Intel 82852/855 GM (i810 chipset), 32MB video RAM drawn on the main RAM, on a 15" LCD screen
  • Sound: Intel I82801DB AC'97
  • Wireless 802.11g: Broadcom BCM94306
  • Ethernet: Realtek 8139
  • Modem: ALi Corporation Intel 537
  • Keyboard with 8 special keys
  • Synaptics touchpad
  • 2 USB 2.0 ports

Installation and configuration

Installation

Please refer to the Gentoo installation handbook for details. The following lines refer to Gentoo with a 2.6 kernel. A Stage 1 installation (everything will be compiled) is performed using a bootable Live CD. When you boot the Live CD, the wired network interface will be functional.

Prepare the hard drive partitions with fdisk, e.g., for a system with a 1GB swap partition:

# fdisk -l /dev/hda

Disk /dev/hda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

/dev/hda1 * 1 9 72261 83 Linux
/dev/hda2 10 4864 38997787+ 5 Extended
/dev/hda5 10 4733 37945498+ 83 Linux
/dev/hda6 4734 4864 1052226 82 Linux swap / Solaris

Format partitions:

# mke2fs /dev/hda1
# mke2fs -j /dev/hda5
# mkswap /dev/hda6
# swapon /dev/hda6
# mount /dev/hda5 /mnt/gentoo
# mkdir /mnt/gentoo/boot
# mount /dev/hda1 /mnt/gentoo

Set the date (date MMDDhhmm) and get a stage 1 archive and a portage snapshot from a mirror:

# cd /mnt/gentoo
# links2 http://www.gentoo.org/main/en/mirrors.xml
# tar -xvjpf stage?-*.tar.bz2
# tar -xvjf /mnt/gentoo/portage-*.tar.bz2 -C /mnt/gentoo/usr

Set up the /etc/make.conf file and adapt the USE flags to your requirements. Do not set the hardened, pic and pie USE flags unless you know what you are doing as these will break a number of multimedia applications.

Select download mirrors manually (mirrorselect -i -r -o >> /mnt/gentoo/etc/make.conf, fast) or automatically (mirrorselect -a -s3 -b10 -o >> /mnt/gentoo/etc/make.conf, very slow). Prepare to switch to your new gentoo system extracted from the stage 1 archive using chroot:

# cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
# mount -t proc none /mnt/gentoo/proc
# chroot /mnt/gentoo /bin/bash
# env-update
# source /etc/profile

Update portage and bootstrap the system (compile packages that are necessary for the system to run, most notably, the C library and the gcc compiler). This takes a few hours.

# emerge sync
# cd /usr/portage
# scripts/bootstrap.sh
# emerge -e system

Set up the time zone; adapt XXX according to your needs (ls /usr/share/zoneinfo):

# ln -sf /usr/share/zoneinfo/XXX /etc/localtime

Edit /etc/fstab. The usbfs line is required to support USB flash drives.

Set up a couple of network-related parameters:

# emerge dhcpcd
# echo HOSTNAME > /etc/hostname
# echo DOMAINNAME > /etc/dnsdomainname
# rc-update add domainname default
# rc-update add net.eth0 default

where HOSTNAME and DOMAINNAME are names you can usually choose yourself. Edit the /etc/conf.d/net file as needed.

Install important system packages (logging facility, cron):

# emerge metalog
# emerge vixie-cron
# rc-update add metalog default
# rc-update add vixie-cron default

Install and configure the kernel. First, prepare the system:

# cp /proc/mounts /etc/mtab
# emerge module-init-tools
# emerge udev
# mkdir -p /mnt/temp
# mount -o bind / /mnt/temp
# cd /mnt/temp/dev
# ls -l console null
# mknod -m 660 console c 5 1
# mknod -m 660 null c 1 3
# cd
# umount /mnt/temp
# rmdir /mnt/temp
# emerge hotplug coldplug
# rc-update add coldplug default
# emerge -a gentoo-sources
# emerge grub
# cd /usr/src/
# ln -sfn linux-* linux
# cd linux

Now configure the kernel. Here is a working .config file for kernel >= 2.6.15-suspend2-r8 . (This kernel configuration supports hibernation via suspend2; you need to emerge suspend2-sources instead of gentoo-sources to be able to hibernate.) Run make menuconfig to tune the parameters to your taste. Compile the kernel:

# make && make modules_install
# cp /arch/i386/boot/bzImage /boot/vmlinuz
# cp System.map /boot/

Edit the file /boot/grub/grub.conf first and install the kernel with grub as the bootloader:

# grub-install --root-directory=/boot /dev/hda

If you have compiled the kernel with modules you want to load at boot time (my .config compiles all necessary drivers within the kernel), edit the /etc/modules.autoload.d and run modules_update. You can reboot the system.

X configuration

The X server (emerge xorg-x11) needs some configuration to run properly. Simply use this /etc/X11/xorg.conf file.

The Synaptics touchpad is configured in the same file. More details are available here. Note that for the Compaq Presario 22xx laptop, the device file for the touchpad is /dev/input/event1.

Audio configuration

The audio adapter is supported natively by ALSA. Install the ALSA tools:

# emerge alsa-lib alsa-utils alsa-tools alsa-headers alsa-oss
# alsaconf
# rc-update add alsasound boot

and reboot. Make sure the sound is turned on using the mixer (alsamixer).



Popular media players sould be invoked as follows; for mplayer:

$ mplayer -ao alsa <source>

and, for xmms:

$ aoss xmms <source>

Skype 1.3 should also be invoked with aoss. Xine supports alsa natively with no additional tweaking. The simple sound player aplay should be preferred to play.

Wireless adapter

The wireless adapter runs fine using the Windows drivers and ndiswrapper. Get the drivers from the Compaq website. Extract the archive; you need the files bcmwl5.inf and bcmwl5.sys. Install ndiswrapper:

# emerge wireless-tools ndiswrapper
# echo "ndiswrapper" >> /etc/modules.autoload.d/kernel-2.6
# modules_update
# ndiswrapper -i bcmwl5.inf

If you want to enable wireless network at boot time, set the essid_AP line to the desired SSID for your access point in the /etc/conf.d/net file and put this net.wlan0 file in /etc/init.d. Add it to your default runlevel (rc-update add net.wlan0 default).
Refer to the 802.11X howto if you need more security.

USB sticks

The USB flash drives work fine with this laptop; just plug the stick into a USB port and mount it (mount -t vfat /dev/sda1/ /mnt/memstick - you need to create the /mnt/memstick directory first). Note that the device file may change if you unplug and replug the stick, from /dev/sda1 to /dev/sda2 for instance. Adapt the file /etc/fstab accordingly. Reference: Flash memory HOWTO.

Keyboard and extra keys

The keyboard comes with 9 extra keys including 3 to manage the sound volume, 1 to turn on/off the wireless adapter, and 5 keys above the keyboard. I will ignore text console problems and focus on X. First, here is how to get accents with the US keyboard. The standard method is to set a "deadkey" that will be used to produce the accents in combination with another key. For instance, deadkey+' followed by e will produce é. To set the deadkey to the "windows key" that is between the Fn and the left alt keys, add the line:

keycode 115 = Multi_key

to your ~/.Xmodmap file. Add xmodmap ~/.Xmodmap & to your .xinitrc file.

The Euro symbol (€) is obtained with deadkey+= followed by e. To display it, you may need to modify /usr/X11R6/lib/X11/fonts/misc/fonts.alias such the the fixed and variable fonts lines read, at the beginning:

fixed -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-15
variable -*-helvetica-bold-r-normal-*-*-120-*-*-*-*-iso8859-15

Notice the change of the -1 to -15 at the end of these two lines. Also, run

echo 'XTerm*font: fixed' >> .Xresources

More information is available here.

Here is how to bind the 8 extra keys to useful commands. First, bind the 5 buttons above the function keys tp keycodes and the wireless adapter button. Insert the following commands in /etc/conf.d/local.start or any file that is run at startup:

setkeycodes 0x9e 215 # Mail button
setkeycodes 0x9a 217 # Search button
setkeycodes e023 218 # Connect button
setkeycodes e00a 174 # Lock button
setkeycodes e031 214 # Question button
setkeycodes e078 219 # wireless LAN adapter button

The keycodes were found with xev and dmesg (press the key and observe the output in xev, dmesg or the system log).

Install lineak:

# emerge lineakd
# emerge lienakconfig

Append this customized keyboard definition file to /etc/lineakkb.def and configure lineak to use the new layout:

# cat CP2200.def >> /etc/lineakkb.def
# lineakd -c CP2200

and edit the file ~/.lineak/lineakd.conf to make it look like:

KeyboardType = CP2200
CdromDevice = /dev/cdrom
MixerDevice = /dev/mixer
Screensaver = _null_

Mail = # put some command here
Search = # put some command here
Connect = # put some command here
Exit = xlock
Question = # put some command here
Wireless = # put some command here
VolumeDown =amixer -q sset Master "5%-"
VolumeUp = amixer -q sset Master "5%+"
Mute = amixer -q sset Master toggle

Finally, add lineakd & to your .xinitrc and (re)launch your X server.

 

Creative Commons License Valid HTML 4.01! Valid CSS! Maintained by Yvan Pointurier.
Last modified: December 16 2012 11:16:53.