Installing Debian Sarge on a Dell Latitude D610 is a little hairier than it should be. I’ve installed deb on both a d500 and a d610 and the 610 is quite the little bugger. Why? Serial ATA (SATA).
Debian Sarge (3.1) includes v2.6.8 of the kernel which doesn’t have serial ata support built in, but the Latitude D610 has sata drives. When that kernel loads on this laptop it can’t find any drives, and apparently those are needed to properly operate your machine.
There are a few other sites that do a great job of showing you how to get over this hurdle, but most involve using testing or unstable packages – something I explicitly want to avoid – or reference debian kernel-source packages that I can’t seem to find (see resources at the bottom for those other sites). I want this to be an all-stable installation of deb that I can refer to in the future independent of the kernel source already made available as a package. The solution is somewhat simple, but does involve compiling your own kernel plus some other nuances that are easy to get hung up on. Let’s see what it’s going to take to get Deb up and running on a D610…
Installation
Because of the aforementioned SATA incompatability, you’re going to need to initially install the 2.4 version of the kernel.
- Get a copy of the debian sarge installation CD (I like to use the net install)
- Make sure your laptop is plugged into a working ethernet jack (the internal wireless card won’t work during installation)
- Boot up with
expertorlinuxat the boot prompt, whatever you’re comfortable with (just avoidexpert26orlinux26) - Go through a normal installation except when it asks you what version of the kernel to install – choose the 2.4.x version.
- When it asks you what packages to pull from apt – choose the “Stable” option
- Reboot into your 2.4 kernel. If you can’t get to this point, then we’ve got issues. If so, comment below and I’ll see if I’ve run across your issue.
Kernel Upgrade
Now that we’re comfortably sitting in our new 2.4 kernel, we need to compile our own 2.6 kernel with SATA support. If you want to skip all the details and are on a latitude d610, then you may be able to use my kernel packages. If you want to give it a try, download these two files and then skip to the step below where it says ‘dpkg -i kernel2.6.12.deb’
If you’re not into using my kernel packages, then proceed from the first step here:
# Install the necessary kernel compilation packages:
apt-get install module-init-tools kernel-package libncurses5-dev fakeroot wget bzip2
# Change into the /usr/src directory
cd /usr/src
# Download the vanilla kernel source - I've had the most success with the 2.6.12 version...
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.6.tar.bz2
# Download my kernel config file (probably a good base for any setup but should only be used confidently on Dell Latitude D610)
wget http://ryandaigle.com/files/linux/config-2.6.12.6
# Unpack the kernel source
tar xjf linux-2.6.12.6.tar.bz2
# Change into the source dir
cd linux-2.6.12.6
# Copy the kernel config to the source dir (as .config)
cp ../config-2.6.12.6 .config
# Make the kernel and headers image deb packages (this will take some time and should complete with no errors)
make-kpkg clean
fakeroot make-kpkg --initrd --revision=custom.1.0 kernel_image kernel_headers
# At this point you should have two .deb files in /usr/src that can be used to install
# the kernel image and its headers (kernel-image-2.6.12.6_custom.1.0_i386.deb
# and kernel-headers-2.6.12.6_custom.1.0_i386.deb)
cd ..
dpkg -i kernel*2.6.12*.deb
# Now we have to change the references in /etc/fstab and /boot/grub/menu.lst from
# hda to sda.
#
# Where it has
# kernel /vmlinuz-2.6.12.6 root=/dev/hdaX ro
#
# Change to
# kernel /vmlinuz-2.6.12.6 root=/dev/sdaX ro
nano -w /boot/grub/menu.lst
# And do the same for /etc/fstab.
# Every reference to hdaX, change to sdaX
nano -w /etc/fstab
At this point you should be able to successfully reboot into your new v2.6.12.6 kernel. I’ve done this several times so I don’t doubt that I’m taking some step for granted. If you’ve found I missed a step or something needs some clarification, definitely let me know.
Wireless
If you’re at this step then chances are you’re running a 2.6 kernel but are still tethered to your ethernet chord. Unacceptable! Let’s get rollin’ with wireless.
The Latitude D610 uses the Intel PRO/Wireless 2200BG chipset, which has pretty good driver support thanks to an open source project Intel created for the purpose (as well as the ieee80211 project). Getting this network interface up is a matter of downloading some source and compiling, which has usually gone off without a hitch. These steps below were mainly derived at after reading over this official howto. Don’t be intimidated, just take my lead…
# Install the wireless tools package
apt-get install wireless-tools
# Change back into our trusty /usr/src dir
cd /usr/src
# Download the stable versions of the required source (both ieee80211 and ipw2200 source files)
wget http://umn.dl.sourceforge.net/sourceforge/ipw2200/ipw2200-1.1.0.tgz
wget http://umn.dl.sourceforge.net/sourceforge/ieee80211/ieee80211-1.1.13.tgz
# Download the latest ipw firmware. Normally you would have have to do this via a
# browser since they don't allow direct downloads, but here is the bundle I used
# (since text-based browsers like lynx didn't want to download it from their
# sourceforge page: http://ipw2200.sourceforge.net/firmware.php?i_agree_to_the_license=yes&f=ipw2200-fw-2.4.tgz)
wget http://ryandaigle.com/files/linux/ipw2200-fw-2.4.tgz
# Unpack, compile and install the ipw2200 and ieee80211 source
tar xvzf ipw2200-1.1.0.tgz
tar xvzf ieee80211-1.1.13.tgz
cd ieee80211-1.1.13/
make
make install
cd ../ipw2200-1.1.0/
make
make install
# Unpack and install the ipw2200 firmware
cd /usr/src
mkdir ipw2200-fw
mv ipw2200-fw-2.4.tgz ipw2200-fw/
cd ipw2200-fw/
tar -xvzf ipw2200-fw-2.4.tgz
cp *.fw /usr/lib/hotplug/firmware
# Now load the modules
modprobe ieee80211
modprobe ipw2200
# Make sure you see the proper device recognition in dmesg..
dmesg
At this point you should now be able to configure your wireless settings to connect to your AP. These are the commands I use to connect to mine (I have this in a script so I can reuse it when I roam to other APs)
# Take down our landline
ifconfig eth0 down
# Configure wireless card for WEP encrypted AP
iwconfig eth1 essid "MYSSID" mode Managed key restricted MY_HEX_KEY
# Or if we have an un-encrypted AP
# iwconfig eth1 essid "MYSSID" mode Managed key off
# Get our IP (assumes DHCP)
dhclient eth1
Now, ping google or run ifconfig to see your new wireless device. There you have it, a working wireless connection, how sweet it is. If it’s not so sweet, let me know what problems you run into…
Suspend/Hibernate
In the past I’ve installed software suspend 2 on my personal Dell Latitude D500 to get hibernation working, but now need to get it up and running on my work Latitude D610. I went through most of the steps trying to get software suspend 2 to work on the d610, but in the end I couldn’t get suspend with X running to work and ended up falling back to the already available software suspend. I’ll outline how I got to my stopping point on software suspend 2 after I talk about the suspend that actually works for me. Maybe somebody else can pick up the software suspend 2 process…
Software Suspend working
Getting the natively support software suspend up and running is real simple – and works quite well so I’m not sure what advantages software suspend 2 has over it.
# Install the hibernate script
apt-get install hibernate
Now all we need to do is edit a few files. The /etc/hibernate/hibernate.conf file should be updated to remove references to software suspend 2 properties, and we need to update the /boot/grub/menu.lst file to specify our swap partition.
# Edit /etc/hibernate/hibernate.conf
#
# Comment out the whole first block of software suspend 2 specific properties,
# from "#UseSwsusp2 yes" all the way to "# VerifyFilewriterResume2 yes"
#
# Add "UseSysfsPowerState disk"
nano -w /etc/hibernate/hibernate.conf
With all the extraneous comments taken out, my hibernate.conf file looks like this:
UseSysfsPowerState disk Verbosity 0 LogFile /var/log/hibernate.log LogVerbosity 1 Distribution debian UnloadBlacklistedModules yes LoadModules auto
Now let’s update /boot/grub/menu.lst
# Edit /boot/grub/menu.lst to tell the kernel what partition you want to use to hibernate.
# This should be set to your swap partition. If you don't know what it is, run
# this command:
#
# cat /etc/fstab | grep swap | cut -c0-12
#
# Add a resume=my_swap_partition argument to the swsuspend kernel line
# Mine looks like this:
#
# kernel /vmlinuz-2.6.12.6 root=/dev/sda9 resume=/dev/sda3 ro
#
nano -w /boot/grub/menu.lst
Once you’ve done this you’re going to need to reboot into your kernel before you try hibernating (so the resume partition is set). Once you’ve rebooted into your kernel you should be able to run the following as root to hibernate:
/usr/sbin/hibernate
Tada – a hibernating laptop. Man, what a useful feature that you don’t really appreciate till you don’t have it.
Software Suspend 2 not working w/ X
Compile Kernel
What! Compile again? Yeah, I hear ya. That’s life in the Debian-on-a-laptop world. There are quite a few steps involved in getting software suspend working, but the first necessary evil is patching and compiling the kernel.
# I like to copy the existing source to a new directory to work with
cd /usr/src
cp -r linux-2.6.12.6 linux-2.6.12.6.swsuspend
# Make the linux symlink
ln -s /usr/src/linux-2.6.12.swsuspend linux
# Download the software suspend patch for kernel v2.6.12
wget http://www.suspend2.net/downloads/all/software-suspend-2.1.9.9-for-2.6.12.tar.bz2
tar -xvjf software-suspend-2.1.9.9-for-2.6.12.tar.bz2
# Patch the kernel for software suspend
cd /usr/src/linux
../software-suspend-2.1.9.9-for-2.6.12/apply
# Patch mkinitrd
wget http://dagobah.ucc.asn.au/swsusp/2.0.0.102/swsusp-initrd.sh
cp swsusp-initrd.sh /etc/mkinitrd/scripts/
chmod +x /etc/mkinitrd/scripts/swsusp-initrd.sh
# Edit this one kernel source file:
# /usr/src/linux/fs/jffs2/background.c
#
# go to line 95 and change remove the "0" method arg
# from this "if ( try_to_freeze(0))"
# to this "if ( try_to_freeze())"
#
# Save the file
#
# OR - download my file with the change already included at
# http://ryandaigle.com/files/linux/background.c
#
nano -w /usr/src/linux/fs/jffs2/background.c
# Compile the kernel with the following settings in the kernel menuconfig:
#
# In the kernel menu config make sure of the following selections
# Power management options ---> Software Suspend 2
# Power management options ---> Software Suspend 2 --> Swap Writer
# Power management options ---> Software Suspend 2 --> Allow Keep Image Mode
#
# and DE-select
# Power management options ---> Software Suspend (EXPERIMENTAL)
#
make-kpkg clean
make-kpkg --append-to-version -swsuspend --config menuconfig kernel_image kernel_headers
After the compile you should have two deb packages in /usr/src ready to be installed. Let’s do so
cd /usr/src
dpkg -i kernel-*2.6.12.6-swsuspend*.deb
You may see the following error when installing kernel-image-2.6.12.6-swsuspend_10.00.Custom_i386.deb
Setting up kernel-image-2.6.12.6-swsuspend (10.00.Custom) ...
/usr/sbin/mkinitrd: add_modules_dep_2_5: modprobe failed
FATAL: Module sd_mod not found.
WARNING: This failure MAY indicate that your kernel will not boot!
but it can also be triggered by needed modules being compiled into
the kernel.
Searching for GRUB installation directory ... found: /boot/grub
It’s OK! The sd_mod module should be built into the kernel and there’s no need to load it as a module.
At this point you need to edit your /boot/grub/menu.lst file and replace all occurances of hda with sda for all kernels listed. Everytime I’ve installed a newly compiled kernel, it has reverted all the kernels listed back to their IDE equivalents, and if you’re on a D610 they’re actually represented as scsi devices.
At this point I like to reboot into my new kernel just to make sure I can run it – you won’t be able to hibernate yet, but at least you’ll know everything else is all right.
Note: When you reboot into your new swsuspend kernel you’re going to have to recompile any modules that you compiled under your old kernel. In my case that included the ieee80211 and ipw2200 wireless modules. Once you’re in your new kernel that should be as easy as:
cd /usr/src/ieee80211-1.1.13
make && make install
cd /usr/src/ipw2200-1.1.0
make && make install
If that doesn’t work for you, see the wireless setup howto in the previous section.
Suspend Configuration
If you’re at this point you should be humming along with your new suspend-enabled kernel. We have to do a few more things before we can actually hibernate, though they’re all pretty simple:
# Edit /boot/grub/menu.lst to tell the kernel what partition you want to use to hibernate.
# This should be set to your swap partition. If you don't know what it is, run
# this command:
#
# cat /etc/fstab | grep swap | cut -c0-12
#
# Add a resume2=swap:my_swap_partition argument to the swsuspend kernel line
# Mine looks like this:
#
# kernel /vmlinuz-2.6.12.6-swsuspend root=/dev/sda9 resume2=swap:/dev/sda3 ro
#
nano -w /boot/grub/menu.lst
Now you need to install the hibernate script that actually invokes the suspend functionality. It’s available as a debian package “hibernate”, but I downloaded and installed from the package available on the software suspend site.
cd /usr/src
wget http://download.berlios.de/softwaresuspend/hibernate-script-1.05.tar.gz
tar -xvzf hibernate-script-1.05.tar.gz
cd hibernate-script-1.05
./install.sh
ln -s /usr/local/sbin/hibernate /usr/sbin/hibernate
At this point I attempted to reboot into my new kernel, but was met with the following error:
=== Software Suspend ===
BIG FAT WARNING!! Initrd not properly configured for resuming.
I did some searching and it appears that initrd and software suspend sometimes don’t play nice. I was able to comment out the initrd line in /boot/grub/menu.lst for my kernel so that it looked like this:
kernel /vmlinuz-2.6.12.6-swsuspend root=/dev/sda9 resume2=swap:/dev/sda3 ro
#initrd /initrd.img-2.6.12.6-swsuspend
With this configuration I was able to boot into the kernel and hibernate from the console, but I could never resume when X was running.
And this is where I stopped with software suspend 2. Let me know if you have better luck…
Next
I foresee X11 and other configs coming soon…
Other Debian Resources
- http://home.comcast.net/~canez/d610/
- http://www.howtoforge.com/forums/showthread.php?t=21
- http://newbiedoc.sourceforge.net/system/kernel-pkg.html
tags: dell latitude, debian, linux, software suspend
