More on Debian on the Toshiba R500

Previously, I wrote about installing Debian GNU/Linux on the Toshiba Portege R500. Most of the information is still current, but I’m writing a follow up to address other things I got working and questions people have posed me.

Bluetooth Support

I still need to patch the kernel to get bluetooth support working. At the moment I am patching toshiba_acpi which then allows the various commands (see the previous article) such as the one for enabling bluetooth. Glibly talking about patching the kernel is of very little help for those that don’t know how, so for Pere who requested that, here’s a set of commands, executed as root which should make that simpler. Note, you might want to edit the file mentioned below for SD support too if you need it before doing this.

# Install the source for the kernel, and the debian package that makes
# compiling it easier
aptitude install linux-source-2.6.26 kernel-package
# Go get it and open it all up, you might need to change paths based on
# exactly what kernel is fetched
cd /usr/src/
bunzip2 linux-source-2.6.26.tar.bz2
tar xvf linux-source-2.6.26.tar
# Go to where the patch will be applied
cd linux_source-2.6.26/drivers/acpi/
# Changes paths as required obviously! Note there is a new patch for
# 2.6.26
patch -p0 < ~colin/Install/toshiba_acpi-dev_toshiba_test5-linux_2.6.26.patch
cd ../../
# Copy the current kernel config, it's a good guess and suitable for Debian stock kernels
cp /boot/config-2.6.26-1-amd64 .config
# Actually compile the kernel, could take a while!
make-kpkg --initrd kernel_image
# Install the .deb created in the directory above
dpkg -i ../linux-image-2.6.26_2.6.26-10.00.Custom_amd64.deb
# That should be it


Headphones can work with the main sound muted. If you double click on the mixer icon in Gnome, and go to edit -> preferences you will see a number of controls that can be turned on. You will see a switch for "Headphones". Enable that. This switch now appears in a tab, and you can select it. When you mute the "Front" you should still get sound in the headphones, and indeed, the rotary control on the side still works. If you're a command line kind of person, alsamixer will be your friend.

SD Card Support

SD card support didn't work out of the box for me. I had to patch yet another file. I say patch, but I just directly edited a file as per instructions I found elsewhere. Essentially I just edited drivers/mmc/core/core.c

	 * This delay must be at least 74 clock sizes, or 1 ms, or the
	 * time required to reach a stable voltage.
        /* mmc_delay(2); -- too small on R500 */

Suspend to RAM

Pere, who comments on the previous article, wrote that changing the contents (in my case creating) /etc/pm/config.d/config and entering
makes it all work. I agree! Thanks Pere.

Fingerprint Reader

These packages are still experimental, so if you don't know how to install them, well you probably shouldn't. I have installed them, but found their enclosed documentation to be inaccurate. I have tried various ways to configure PAM to support it, but none of them work really as I want them to. I might play with this again sometime.

That's it. My initial good feelings have been more than confirmed. It's a great laptop, and great with Debian. I did have to poke with some BIOS settings with toshset to solve the problems of the grub screen not appearing and xrandr working with a second display. Unfortunately I can't remember what I changed.

Guided LVM in Debian

I recently reinstalled one of the boxes here, Lorien, from scratch. It was a brand new SATA disk and I used the Debian Lenny beta 2 installer. I’d never tried LVM before, I’d always used “normal” partitioning, but for some reason I figured I’d give this a shot. It all worked ok, but it left one problem. The amount of space Debian allocated to the root partition was pitifully small (less than 300 megabytes), and I hit a snag when a kernel upgrade came through, and wanted to install lots of stuff in that partition. So, first of all a warning, the guided partitioning is, and always has been in my opinion, not too optimal in the way it picks spaces for partitions. Secondly, here is how I fixed it, which is a slight pain since you can’t have the root partition mounted.

Since I was going to have to resize my root partition, I used my Debian install CD again, but this time in rescue mode (just type rescue at the prompt).

Then you can get a terminal up. I had inadvertently mounted my root partition as /target, so I began by unmounting it.

umount /target

Next we need to reduce a partition. I chose to resize my home partition, original 200G to 199G, since I reckoned an extra gigabyte would be more than enough on the root partition.

# Check the filesystem
e2fsck -f /dev/lorien/home
# Make it slightly smaller
resize2fs /dev/lorien/home 199G
# We are about to play with LVM
lvchange -a n /dev/lorien/home
# Tell it to reduce the size by 1 Gigabyte
lvreduce -L-1g /dev/lorien/home
# Done with LVM
lvchange -a y /dev/lorien/home
# Check the filesystem again
e2fsck -f /dev/lorien/home

Finally, increase the size of the root partition.

# Playing with LVM
lvchange -a n /dev/lorien/root
# Increase the LV by 1 G
lvextend -L+1g /dev/lorien/root
# Finished with LVM
lvchange -a y /dev/lorien/root
# Check the file system
e2fsck -f /dev/lorien/root
# resize it
resize2fs /dev/lorien/root
# Check one last time.
e2fsk -f /dev/lorien/root