Running Debian Linux on the Sony T-Series

The Sony Vaio T-series is an ultra-light (1.38kg) sub-notebook series of many models, depending on where you live. In the US, the models are VGN-T140 through VGN-T370, in Japan the models are VGN-T50/51/70/71, in Hong Hong there is only one, the VGN-T37 and in the UK there is the VGN-T2XP.

These models are all very similar in specification. They all have the same 10 inch 1280×768 wide screen LCD, a Firewire interface, two USB2 ports, a PC Card (PCMCIA) slot, memory stick slot and built-in 100 Mbps Ethernet and VGA connector.
Most (if not all) models have Bluetooth and IEEE802.11 WiFi, and a Losemodem.

Mostly, the difference is a change in colour of the case (Japanese customers have four choices, others one or two), the size of the hard disk (40 to 80 GB), the amount of RAM in the machine (512MB or 1 GB), and the optical drive (DVD/CDRW or DVD-RW). The CPU is also somewhat different (1.1 GHz or 1.2 GHz Pentium M variants) but that is unlikely to make a real difference.

In September 2005 I picked up my VGN-T140 in the Star House Computer Centre in Hong Kong, which as a non-official import comes without the full warranty, but is about HK$2000 cheaper than the official VGN-T37. It has a 1.1GHz CPU, 40 GB disk, 512 MB RAM, DVD/CDRW.

Partitioning

Apparently the VGN-T140 comes with Windows XP Professional installed, but you do not have to use this, nor do you have to agree to its T&Cs if you remember to bring a copy of Slax 5.0. Slax can be burned on a 8cm CD-R, which is a handy size to carry around and comes with lots of useful tools. It can read the NTFS partitions on the Vaio without problems.

The hard disk comes partitioned in two, a 5 GB partition which contains a rescue image and is normally not visible to the user, and a 35 GB Windows (C: drive) partition. The larger disks on some of the T-series models have another, empty D: partition.

Unless you are feeling very cocky you should make a backup of the two disk partitions onto writable CDs. For this, download and compile (on another PC) the cdbackup and cdrestore programs. These two programs work with cdrecord and your favourite archiver (e.g tar) to write CD-Rs without first going through mkisofs. My commandline looked like

   tar czf - /mnt/hda2 | \
      /root/cdbackup -d /dev/hdc -r /dev/hdc \
      -a "Vaio T-Series HDA2" -m -v -l 690

Doing this for hda1 and hda2 may take perhaps a dozen CD-Rs. Remember to use cdrestore to verify that the backup can be restored. Note that the disks created by cdbackup do not have a filesystem on them, and appear blank when you try to read them as you would a normal CD-ROM.
At this point you should also make copies of the partition table:

   dd if=/dev/hda of=hda-partition bs=512 count=1
then save the hda-partition file somewhere.

It should also be possible to use ntfsclone to make the backup. This can be done (untested) like

   ntfsclone -o- -s /dev/hda2 | \
      /root/cdbackup -d /dev/hdc -r /dev/hdc \
      -a "Vaio T-Series HDA2 ntfsclone" -m -v -l 690

The benefit is that you get an exact replica of the file system rather than one that just stores the files.

Now download the statically linked ntfsresize program, and read its manual.

Sketch out on paper what the new disk layout will be like.
You have to work out this layout before shrinking the NFTS partitions, because you'll need to make sure that the new size of the NTFS file system is no greater than the size of the partition. So do dry runs of fdisk and ntfsresize until you are certain that the number of blocks in the file system and that in the partition agree with each other.

Here is my original partition table. I decided that the rescue partition probably should stay unchanged, and that I would leave about 10 GB for Windows in case I ever were to need it. A 500 MB primary partition is more than enough for the / filesystem, leaving a 24 GB extended partition. The extended partition holds swap and several other partitions (/usr /var and /home).

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

   Device Boot Start   End    Blocks   Id  System
/dev/hda1   *      1   654   5253223+   7  HPFS/NTFS
/dev/hda2        655  1865   9727357+   7  HPFS/NTFS
/dev/hda3       1866  1927    498015   83  Linux       /
/dev/hda4       1928  4863  23583420    5  Extended
/dev/hda5       1928  2052   1004031   82  Linux swap
/dev/hda6       2053  2301   2000061   83  Linux       /tmp
/dev/hda7       2302  3546  10000431   83  Linux       /usr
/dev/hda8       3547  4520   7823623+  83  Linux       /home
/dev/hda9       4521  4863   2755116   83  Linux       /var

I needed some more free space so deleted the NTFS crap, and moved the other partitions around a bit. I've merged the /var and /tmp partitions, so they now use 4.4 GB instead of around 5 GB. All other data partitions have grown. I noticed something had installed in /opt, so I made a bind mount to /usr/opt.

   Device Boot Start   End    Blocks   Id  System
/dev/hda1   *      1    74    594373+  83  Linux       /
/dev/hda2         75   199   1004062+  82  Linux swap
/dev/hda3        200  1927  13880160   83  Linux       /usr and /opt
/dev/hda4       1928  4863  23583420    5  Extended
/dev/hda5       1928  2475   4401778+  83  Linux       /var and /tmp
/dev/hda6       2476  4863  19181578+  83  Linux       /home

Installing

A fast internet connection and a CD-writer are enough to allow you to install any Linux distribution. I downloaded Debian 3.1r0a, wrote the CD-R and installed as normal. The remainder of this document describes additional configuration to the Debian distribution.

Debian now installs the GRUB boot loader, and this will also boot the rescue partition and Windows if you want, although I haven't tried this.

Kernel

Download a recent kernel (I have 2.6.13.2) and the tools needed to build it, this includes kernel-package to get make-kpkg. Here is my .config.

Make the kernel as usual, then run make-kpkg kernel_image which drops a .deb in a directory one up. Then dpkg --install that .deb, and it will install the kernel and make it available in GRUB.

Touchpad Hell

The touchpad in the T-series is a very nice one that is said to work electrostatically rather than something more mechanical. This means that it is very easy to accidentally activate this when typing. For pointer movements this is usually not a problem, but with mouse tapping enabled you enter Tapping Hell where the continuous tapping distracts and destroys. This is fixed in three steps.

  1. First install xfree86-driver-synaptics. Build a kernel with evdev.
  2. With that installed, change your /etc/X11/XFree86Config-4 to include this
    Section "InputDevice"
      Driver     "synaptics"
      Identifier "TouchPad"
      Option     "Device"          "/dev/psaux"
      Option     "Protocol"        "auto-dev"
      Option     "LeftEdge"        "1700"
      Option     "RightEdge"       "5300"
      Option     "TopEdge"         "1700"
      Option     "BottomEdge"      "4200"
      Option     "FingerLow"       "25"
      Option     "FingerHigh"      "30"
      Option     "MaxTapTime"      "0"
      Option     "MaxTapMove"      "0"
      Option     "VertScrollDelta" "100"
      Option     "MinSpeed"        "0.25"
      Option     "MaxSpeed"        "0.5"
      Option     "AccelFactor"     "0.015"
      Option     "SHMConfig"       "on"
    EndSection
    
    The important setting here is MinTapTime which is the time in miliseconds below which a touch or slide accross the touchpad is interpreted as a tap. You can also adjust the MinSpeed, MaxSpeed and AccelFactor to control the pointer movement in gdm; but in GNOME you can adjust these in the desktop preferences.
  3. Then remove the existing PS2 mouse driver in the ServerLayout section and replace it one that refers to the touchpad driver: InputDevice "Touchpad" "CorePointer". You'll need to stop and restart gdm to get the new settings.

Sound

The sound output is very quiet, impossible to hear through the internal speaker, and very quiet through headphones. This is because the sound hardware is configured to use an external amplifier, instead of the one internal to the AD1981. The usual mixer software (gnome-volume-control or aumix) do not have an option to control this. Instead, use gnome-alsamixer and untick the box External Amplifier.

IEEE802.11 WiFi wireless LAN

The kernel needs the options CONFIG_NET_WIRELESS=m

Use wpa_supplicant for managing the keys.

Bluetooth wireless

The kernel needs several bluetooth options. Not working yet, also I don't have another bluetooth device.

Install the bluez-hcidump, bluez-pin and bluez-utils packages.

Battery Monitor

Install the acpid and make sure it is running. The Battery Charge Monitor can now be added to the GNOME panel.
Alternatively, the wmbattery package can be used which does not require acpid.

GNOME splash screen

Turning off the Debian splash screen as GNOME starts is done through gconf-editor. Turn off the tickbox in apps → gnome session → options → show_splash_screen.

Fonts

Read debianfonts on how to install TrueType fonts for X from the .ttf fonts provided on your Vaio by Sony. In brief:

   cp /mnt/hda2/WINDOWS/Fonts/*{ttf,TTF} /usr/local/share/fonts
   cd /usr/local/share/fonts
   mkfontdir
   mkfontscale

If it does not yet exist, add a line

   FontPath "/usr/local/share/fonts"

to /etc/X11/XF86Config-4. Add the text

   <fontconfig>
      <dir>/usr/local/share/fonts</dir>
   </fontconfig>

to /etc/fonts/local.conf. You may skip this if such a line already exists in /etc/fonts/fonts.conf.

Font size in gdm

With such a high resolution screen the gdm login screen has very small fonts for entering the username and password. This setting is independent from one theme to the next, but all the themes are controlled in a similar way.

The hantzley theme is controlled through the file /usr/share/gdm/themes/hantzley/hantzley.xml. Look for the user-pw-entry item and add a line so that it reads:

   <fixed>
     <item type="entry" id="user-pw-entry">
       <pos anchor="nw" x="1" y="1" height="-2" width="-2"/>
       <normal color="#000000" font="Sans 16"/>
     </item>
   </fixed>

Keys

The T series keyboard has two windoze keys, there are five buttons that are intended to control the DVD playback under the LCD (marked DVD and the icons for Play/Pause, Stop, Previous and Next track) and three buttons on the front of the machine for mute, volume down and volume up.

The windows keys can be enabled in X windows using Xmodmap.

To assign programs to the DVD controls, run gnome-keybinding-properties and assign the keys to the music player. It is also possible to use gconf-editor and assign the keys in the Metacity window manager.

Metacity

To stop the window manager automatically raising any window you click in, turn off the tickbox in gconf-editor in apps → metacity → general → raise_on_click. You can still raise a window by clicking on its titlebar.

Back home.