Ubuntu GNU/Linux on a Toshiba Satellite M45 S359 laptop

Update 2007-12-26: Report on dist-upgrade to Gutsy, change nerim.net to debian-multimedia.org.
Update 2007-1-1: Report on dist-upgrade to Edgy, change nerim.net to debian-multimedia.org.
Update 2006-10-10: More about DMA on DVD.
Update 2006-10-4: Change nerim.net notes.
Update 2006-9-20: Pierre Ossman has improved TIxx21 support in 2.6.17+ kernels; not tested yet.
Updated 2006-4-7: Note about i915 hardware random number generator.
Updated 2006-4-6: Change "dvd://1" to "dvd://".
Updated 2006-4-4: add notes about restoring Xv contrast after suspend/resume using xvattr, getting frame rate reports from glxgears (tx Wim), turning off sky2 ethernet for driver failure, enabling DMA support for DVD drive on SATA ATAPI (tx Paul).

In December 2005, my brother bought a Toshiba laptop without asking me first, and then asked me to load Linux on it. "This should be a challenge," I thought. Short summary for the impatient: everything can be made to work except the SD and "ExpressCard" (?) slots, and you can't have all three of sleep modes, ethernet, and wireless.

[UPDATE: In December 2006 I dist-upgraded it to Ubuntu "Edgy Eft". Several things stopped working. Although the ethernet driver probably works now, I had to delete the drivers because iftab and "interface mapping" both stopped working across ACPI suspend/resumes, breaking automatic wireless configuration. The waproamd daemon broke too and had to be replaced with wpa_supplicant and a hand-edited config file. Flash pages crashed Firefox until I added a magic line to its config file (it's said setting video to 24 bits would fix it too; that may be a good idea anyhow). Good news is, DVD DMA works now, and so does PCMCIA/CardBus, though the SD slot operated by the same chip still doesn't.]

[UPDATE: At some point much of it got upgraded to Feisty. In December 2007 I dist-upgraded it to Ubuntu "Gutsy Gibbon". I was able to eliminate most customizations (e.g. to /etc/acpi/suspend.sh), and enable the Sky2 ethernet driver and interface. However, my brother's px500 EVDO card stopped working. To get it working again I had to add "airprime" to /etc/modprobe.d/blacklist, and hand-edit etc/chatscripts/ppp0 with what amounted to random changes until it started working again. Wvdial still worked, which helped a bit. Flash had stopped working at some point until I set video depth to 24 bits.]

What is this thing?

  • 2GHz P4-M, 1GB RAM, 100 GB SATA disk, SATA DVD+/-RW, 1280x800 LCD, headphone and mike jacks (with an analog volume control thumbwheel!), RJ45 ethernet, built-in 802.11g (with an "off" switch!), S-Video and RGB sockets, 3 USB slots, 1 CardBus slot, "Bridge Media" (SD, SmartMedia, MMC, xD) slot, and a weird "ExpressCard" slot.
  • harman/kardon speakers and six "media buttons".
  • Intel 915GM/82801 chipset providing SVGA (via 8MB RAM stolen from main memory, feh.), USB2 and softmodem.
  • Analog Devices AD1891B audio, with hardware mixer.
  • Marvell 88E8036 100BaseT.
  • Intel ipw2200 802.11g wireless networking.
  • TI PCIxx21 "Integrated FlashMedia Controller" for talking to SD cards.
  • TI "OHCI compliant" Firewire IEEE 1394.
  • No floppy drive, no parallel port. (That's progress.)

Toshiba has a page of their own about running Linux on the M45, but the information there was limited. There's more to see (including this) at Tuxmobil.org's Toshiba and Ubuntu pages.

So, I downloaded and burned an Ubuntu GNU/Linux "Dapper" pre-release installer CD. The online CD image is updated every day; as of this writing it has a 2.6.15 Linux kernel.

I meant to resize the WinXP on the disk to make room, but when I powered up the first time it took me a while to figure out which key to hit to get into the BIOS (ESC, as it turned out), so Windows started coming up, and messed with the disk before I could get it shut off again. When I tried to resize the partition, the resizer said the Windows file system was damaged and would need to be fixed before it could resize it. So, I just blasted it. I did leave a 10GB primary partition (type 0, "Empty"), marked bootable, at the beginning of the disk in case we ever actually want to put Windows ("ack! spit!") or something there.

I deleted all but the original 200MB (fourth) primary partition, which appears to hold a separate OS the BIOS knows about, and uses for playing DVDs using the "media buttons" when the machine is otherwise shut down. Besides the blank 10G primary, I gave it a 100MB (second) primary partition for /boot, and the rest, almost 90G, as the extended (third) partition. In there, I made a 1G root (/) partition, a 10G /usr, a 1G swap, and used the rest for /home.

Installing from the Ubuntu CD was easy and took just a few minutes. After installation, I added Ubuntu universe and multiverse repositories to /etc/apt/sources.list, and installed lots of extra programs, e.g.

  waproamd
  ifplugd
  laptop-netconf
  laptop-mode-tools
  gnomebaker
  menu
  sdparm
  gamix
  audacity
  celestia-glut
  stellarium
  gthumb
and deleted a few. (I had to remove "ubuntu-standard" before dpkg would let me remove various things it expressed a dependency on.) Apparently laptop-mode and laptop-net would get in food-fights with laptop-mode-tools, ifrename and ifplugd, so the former set should not be installed.

Editing /etc/X11/xorg.conf, I added

  Option XkbOptions "ctrl:nocaps"
to the InputDevice section. (Gnome warns, albeit in a very obscure place, against setting this in the "Keyboard Preferences" control panel.) I changed the "Generic Video Card" entry for "Driver" to "i810". This last was all it took to make the i915 DRI stuff work OK: glxgears running at 1300 fps. (Note the glxgears that comes in Ubuntu's mesa-utils package doesn't report the frame rate by default; daniels (by way of Wim, thanks) reports that you must add "-printfps" to the glxgears command line to get the frame-rate reports. Frame rates here are from the Debian binary; Ubuntu's is a bit slower.) Setting the DefaultDepth to 16 makes glxgears run at 1900+ fps. (Note that the 915resolution package is not only unnecessary, it would not work right; likewise toshutils and probably toshset and fnfxd. Anyway on attempted installation the modules "toshiba" and "toshiba_acpi" report failure.)

I added the xserver-xorg-input-synaptics package (not to be confused with xfree86-driver-synaptics, or xorg-driver-synaptics, both for older X servers) and followed the instructions in /usr/share/doc/xser*ptics/README.Debian. They don't warn, there, that you must set

  Option "VertScrollDelta" "0"
  Option "HorizScrollDelta" "0"
or it will drive you insane with apparently-random scrolling every time you touch the pad. I enabled "TapButton2" and "TapButton3" according to the instructions, but tapping with two or three fingers has no effect. However, it also has "RTCornerButton=2" and "RBCornerButton=3" and, sure enough, tapping in those corners is like poking middle and right buttons. I added "syndaemon -d -i 1" to the Gnome Session "Startup programs" section so X will ignore the touchpad while the keyboard is in use. I installed i855-crt to enable switching the video to the S-Video output plug, so it can drive a (modern) TV, e.g. when playing a DVD, although I haven't tried it.

The Gnome panels took up too much screen space, so I told them to auto-hide. They still took too much space, so I had to use gconf-editor (feh!) to change the parameter

  /apps/panel/toplevels/bottom_panel_screen0/auto_hide_size
to "2", and likewise for top_panel_screen0. I fixed mouse focus to "sloppy". I had to use gconf-editor to set
  /desktop/gnome/interface/gtk_key_theme
to "Emacs", because they took away the regular config checkbox (double feh!).

I added XTerm, Evolution, Firefox, Gamix, Xine, and a bunch of flight simulators -- fl-117, XRunSabre, Flightgear, Airstrike, SearchAndRescue, acm -- to the top bar. I turned off the screen saver, but set it to turn the whole display off entirely after 30 minutes, just to avoid using up the screen backlight.

Getting sleep mode working was a bit of a chore. It turns out the "hibernate" package is obsolete (and didn't work too well); all the work is done by the ACPI apparatus (acpi, acpid, acpitool, and particularly acpi-support). To make ACPI work right, it turns out, you have to add "acpi_irq_balance" to the boot parameters listed in /boot/grub/menu.lst; be sure to add it to every line that contains "silent". I edited /etc/default/acpi-support, too, uncommenting "ACPI_SLEEP=true" and "ENABLE_LAPTOP_MODE=true". I had to rename /etc/acpi/lid.sh and then copy /etc/acpi/sleep.sh in its place so closing the lid would suspend it properly. The scripts use cardctl, from package pcmcia-cs rather than pccardctl from pcmciautils, the right tool for a 2.6.15 kernel -- not that it matters so much, since PCMCIA doesn't work anyway; however, suspend/resume doesn't work right, yet, without pcmcia-cs installed.

After suspend/resume, unfortunately, the DPMS setting (turn off screen backlight) seems to be ignored, so I added "xset dpms 0 0 1800" at the end of the /etc/acpi/resume.sh script. The display driver forgets the correct contrast setting during suspend, too, so I also added "xvattr -a XV_CONTRAST -v 64". Experiment with gxvattr if you're not happy with that value.

I added ",noatime" to all the disk partition entries in /etc/fstab. The default settings in /etc/laptop-mode/laptop-mode.conf seemed OK but I turned on verbose mode, for now, so I can see what decisions it's making.

Also unfortunately, when it comes back after a suspend, the network drivers (sky2 for the ethernet, ipw2200 for the wireless) get mixed up. On boot they're eth0 for wireless and eth2 for wired; after resume, they're eth0 for wired and eth1 for wireless (or something like that). I copied

  /usr/share/doc/ifupdown/examples/get-mac-address.sh
to /etc/network/ and made it executable. I changed the "mapping" section of /etc/network/interfaces to
  mapping eth*
    script /etc/network/get-mac-address.sh
    map 00:a0:d1:xx:xx:xx lan
    map 00:13:ce:xx:xx:xx wlan
(use "ifconfig -a" to find out your own MAC addresses) to tie those names to physical interfaces, and changed the "iface" stanza labels to "lan" and "wlan"; then I also edited /etc/iftab the same way (although I still don't know what reads this file), i.e.:
  # Assign persistent names to network interfaces.  See iftab(5).
  lan   mac 00:a0:d1:xx:xx:xx
  wlan  mac 00:13:ce:xx:xx:xx
Next, I added "lan" and "wlan" to INTERFACES in /etc/default/ifplugd, and just "wlan" in /etc/default/waproamd. (Note that the lan driver, sky2, sucks rocks at the moment, which is to say it fails at (attempted) high throughput rates. That might improve soon; in the meantime I turned it off entirely. The ipw2200 connection seems to max out at ~15 Mbps on a 54 Mbps channel; that might improve soon, too.)

I added

  deb http://www.debian-multimedia.org etch main contrib
to /etc/apt/sources.list, and installed w32codecs, ffmpeg and libdvdcss2 so that xine would work right, and xvattr. (Unfortunately w32codecs, libdvdcss2, and xvattr seem not to be there anymore; you'll have to find them somewhere else.) In the xine config, I told it to adjust window size to the resolution of the stream, to use Xv as the video output and ALSA for audio output, and to use mmap with ALSA. I changed the "Gnome / Preferences / Removable Drives and Media" response to inserting a DVD from "totem %f", which didn't work, to "xine dvd://".

Unfortunately DMA doesn't work with the SATA DVD drive, so it's unnecessarily slow, and burns quite a lot of CPU operating it. (Paul Eggleton offered suggestions for this, which I haven't tried. I did add a line "libata atapi_enabled=1" in /etc/modprobe.d/options, and similarly amended (two) appropriate places in /boot/grub/menu.lst. I haven't tested enough to know whether it helped. Reports welcome.) I have a report that

  echo "libata atapi_enabled=1" >> /etc/mkinitrd/modules
  cp /boot/initrd.img-`uname -r` /boot/initrd.img-`uname -r`.bak
  mkinitrd -o /boot/initrd.img-`uname -r`
does the job, after a reboot, but of course you need to install initrd-tools (and initramfs-tools?) first.

The box has a nice volume-control thumbwheel, so there's no reason for the mixer to set anything less than maximum volume on everything. So, I edited /etc/aumixrc to make the master volume, pcm, and cd volumes 100, and the rest 0. However, on startup I see in the log that because something saved the mixer settings, aumix doesn't touch them. My favorite mixer control program, after trying a great lot of them, is gamix.

The CardBus (PC-Card, PCMCIA) slot doesn't appear to work at all. There's also a nice slot in the front edge, behind a sliding door, that fits SD, Smartmedia, and MMC cards. The "mmc_core" and "sdhci" drivers load when they see it, but don't seem to know what to do with it, yet, either. Both of these slots seem to depend on a driver for a Texas Instruments PCIxx21 chip, which doesn't seem to be ready yet. Work on it seems to have begun in 2005/11.

I added a file /etc/modprobe.d/notgots that says

  alias sony_acpi off 
  alias pcc_acpi off 
  alias tc1100_wmi off 
  alias ibm_acpi off 
  alias asus_acpi off 
  alias floppy off 
  # toshiba_acpi appears to be meant for older models.
  alias toshiba_acpi off 
because it doesn't have any of that stuff, but the modules were being loaded anyhow. I ran dpkg-reconfigure on mdadm and turned it off, and edited /etc/default/nvidia-kernel to tell it we don't have any Nvidia hardware. I also added the modules above (as "skip") to /etc/discover.conf, and commented out "lp" from /etc/modules.

The hw_random module fails to find a hardware random number generator in the i915 chipset. Inspecting the source reveals only that the chip itself seems to claim not to support it. Googling reveals only this, suggesting it's really not there, and that Intel appears to have abandoned the feature. ("FWH" is "firmware hub", whatever that is.) Motherboard manufacturers must have found they could save $0.25 by omitting the chip with no loss of sales, and didn't order any; Intel must have decided there was no interest, and so broke their promise to integrate it into later chipsets.

What's left? As noted, I haven't tried the S-Video or SVGA connectors. I also have no Firewire equipment to try, and not even the manual mentions the "ExpressCard" slot. I haven't checked the microphone jack. I haven't been tempted to try out the modem, or even to configure it.

I installed firefox and lots of good firefox extensions. I deleted whatever Flash player junk I found (libswfdec0.3, etc.). They don't work well enough for anything but dancing web ads, and who wants those?

Of the flight simulators, acm crashes frequently -- perhaps something to do with sound output to NAS, which I did install. Flightgear, at first, failed to start up (reporting a GL failure, "GLXUnsupportedPrivateRequest", with minor opcode 16 ("X_GLXVendorPrivate"), but this was fixed before I had to hand over the machine. SearchAndRescue seems to get very confused about managing its window contents, during setup.

Upshot

If it's this much trouble to set up an Ubuntu system, how can we claim "Ubuntu is ready for the desktop"? If Toshiba were shipping laptops with Ubuntu already on them, they would be -- or ought to be -- doing much of the above, as they do the equivalent, more or less, with their Windows installation.

Copyright ©2006 by Nathan Myers. All Rights Reserved. URL: <http://www.cantrip.org/toshiba-m45.html>