Monday, June 04, 2007

Gentoo 2007.0 On A Dell Latitude D610 Laptop

Tonight I must sing the praises of Gentoo.

Earlier I wrote about my experience trying to build a useful laptop system using CentOS 5 and came to the conclusion that its like trying to hammer a square peg into a round hole. CentOS 5 (and, by extension, RedHat) is a server-oriented distribution; it doesn't have very good (or any, in some cases) support for random ass software like Xine that has no business being on an enterprise server. I tried RPMS, SRPMS, tarballs, and any combination thereof, but I couldn't manage to get Xine working under CentOS 5. That's saying a lot, considering that I've been working with Linux since 1994 (yeah, I used to order Slackware CDs from Walnut Creek). That might not seem like a big deal, but I travel a lot and I'd really like to be able to watch DVDs when I'm stuck in an airport somewhere. I had some downtime so I decided to try my luck with Gentoo.

Switching to Gentoo was well worth the effort. It has built-in support for Xine via their portage system. Not only that, but it has support for a huge number of other applications as well, even obscure ones like the tipa and Ion. It didn't take very long to get Gentoo installed on my laptop following the Gentoo Handbook and I'm pretty happy with the result. Now onto the details:

00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)
00:01.0 PCI bridge: Intel Corporation Mobile 915GM/PM Express PCI Express Root Port (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 03)
00:1d.3 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d3)
00:1e.2 Multimedia audio controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 03)
00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 03)
00:1f.2 IDE interface: Intel Corporation 82801FBM (ICH6M) SATA Controller (rev 03)
01:00.0 VGA compatible controller: ATI Technologies Inc M22 [Radeon Mobility M300]
02:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5751 Gigabit Ethernet PCI Express (rev 01)
03:01.0 CardBus bridge: Texas Instruments PCI6515 Cardbus Controller
03:01.5 Communication controller: Texas Instruments PCI6515 SmartCard Controller
03:03.0 Network controller: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller (rev 02)

Wireless

So, first thing first, let's get wireless working. As noted previously, the stock drivers for the BCM4318 don't work so well; I've had much better luck with Ndiswrapper. To blacklist the module create /etc/modprobe.d, create /etc/modprobe.d/blacklist and include the line

blacklist bcm43xx

Copy /etc/modprobe.d/blacklist to /etc/modules.d and then run modules-update to regenerate all the module configuration files in /etc. This will prevent udev from automatically loading the module.

Next it's time to install Ndiswrapper, but first before you do that you should fix your /etc/make.profile/make.defaults. Here's what mine looks like:

# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/profiles/default-linux/x86/2007.0/desktop/make.defaults,v 1.1 2007/04/13 22:02:31 wolf31o2 Exp $

USE="3dnow a52 aac acpi alsa -arts -berkdb cairo cddb cdr -cups dbus dga dvd \
     dvdr dvdread -eds -esd -emboss -encode esd evo fam fbcon firefox flac \
     -fortran gif gnome gpm gstreamer gtk hal imagemagick -ipv6 java jpeg -kde \
     -kerberos -ldap mad -mikmod mmap mmx mp3 mpeg musepack -nls nsplugin ogg \
     opengl oss pdf png -qt3 -qt3support -qt4 quicktime real sdl speex -spell \
     sse svg svga -tcpd theora threads tiff truetype vcd vidix vorbis wavpack \
     wifi win32codecs unicode wmf X xcb xinerama xml xv xvid xvmc"

VIDEO_CARDS="radeon"

INPUT_DEVICES="keyboard synaptics"
Note that as you are emerging packages the system may try to install gcc-3.3.6 in order to fill dependencies. This is a problem as that particular package may fail to compile. The workaround is to emerge libstdc++-v3 instead.

Kernel

Once you've tweaked your make.defaults to your liking do an emerge ndiswrapper. Then download the latest drivers from Dell; the .exe file is a self-extracting archive that can be expanded via unzip. After expanding cd to the DRIVERS subdirectory and do a ndiswrapper -i bcmwl5.inf to install the driver. modprobe ndiswrapper to load the module (loading it will create eth1) and then configure via iwconfig per usual.

Next, fix the kernel. First I created a fallback/default kernel using the genkernel package, and then went on to compile a custom kernel. The stock Gentoo kernel is pretty lightweight (which is a good thing, IMHO, since its quick to compile), which means that it doesn't have built in support for some of the features of the D610.

As the time of this writing the current gentoo-sources installs kernel v2.6.20-r8; your mileage may vary. You'll probably want to do the following:

  • Include support for the Intel AC97 sound card. You should build the drivers as modules; including them in the kernel seems to confuse the ALSA configuration utility.
  • Include support for the Intel PIIX SATA controller.
  • Remove ATA/ATAPI support; this will allow the built-in DVD to be serviced by the Intel PIIX driver as a PATA device.

Sound

Following the compilation of the kernel the next thing you probably want to do it get sound working. Once you've booted into the new kernel with the AC97 sound drivers the sound is technically working, but the ALSA volume/mute defaults means that you won't be able to hear anything if you try to play an MP3 out of the box. Do an emerge alsa-utils to build the ALSA configuration utilities followed by an alsaconf. The alsaconf utility should automatically detect the sound card and configure the ALSA subsystem. Make sure you set up ALSA to run at boot time via rc-update add alsasound default otherwise the sound levels won't be restored at reboot.

Video/X11

There are two choices for video: use the open source Radeon driver or use ATI's closed-source driver. Specifying VIDEO_CARDS="radeon" uses the open source driver while VIDEO_CARDS="fglrx" uses the ATI driver. I'm using the open source driver right now because ATI's driver kept dying with signal 11; googling around makes it look like there's some issues with the new ATI drivers. Also note the INPUT_DEVICES="keyboard synaptics" line; this will install the Synaptics touchpad driver instead of a regular mouse. Then emerge xorg-x11 to build X11 and Xorg -configure to create a basic xorg.conf. I had to edit the configuration file by hand to include Synaptics support; see /usr/share/doc/synaptics-*/INSTALL.bz2 for modification directions.

Summary

As a general observation Gentoo is much more oriented towards the desktop/laptop than is CentOS. I've been able to get almost every application I need working without too much hassle. Xine, which drove me to switch in the first place, is mostly working. The only problem I'm having is that video seems to play back at 1.5x normal speed; I'm hoping that an update will fix that. Anyone who has any insights on that particular issue should leave a comment. CentOS has a little bit better support when it comes to configuring X11, and its easier to make an init image, but those are minor issues.

1 Comments:

Anonymous pci compliance said...

I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.

4:12 AM  

Post a Comment

<< Home

Blog Information Profile for gg00