Running Linux on a Vaio PCG-Z600LEK

(Last updated: 2005-03-03)

Disclaimer

The information below is accurate to my knowledge, however I provide no guarantees to this effect and consequently accept no liability whatsoever for any bad things that may happen as a result of the reader using this information in practice. Use at your own risk. Oh, and backup your data while you're at it.

Introduction

I switched to Linux over 2 years ago, when one of my friends helped me install Debian on this laptop. This happened long before I wrote this document and I don't really remember how we did it. Therefore, I probably would not have written this HOWTO, but for my own stupidity that resulted in me trashing my root partition and hence having to reinstall. Never mind, I learnt rather a lot as a result of doing it, so it was probably for the better.

I used boot-floppies to boot the installer and installed the rest over FTP.

Summary

I am writing this page from my laptop, which is currently running Debian GNU/Linux with a 2.4.27 kernel. I use Debian primarily because of APT, the Debian package-management system. It simply rocks! I have tried using the 2.6.x kernels, but they are still a bit buggy and, more importantly, run noticeably slower on the laptop (apparently they are optimised for faster machines at the expense of slower ones). Below is a summary of what does and does not work:

(x) Ethernet (eepro100)
(x) Hardware Video Acceleration
(x) Memory Stick
(x) PCMCIA
(x) Power Management (APM)
(x) Sound (ymfpci)
(x) Touchpad
(x) USB
(x) XFree86
(?) Firewire (nothing to test it with)
(?) Jogdial (probably works, use the sonypi driver)
(?) Modem (winmodem, may work with commercial drivers)
( ) Special Hardware Fn keys (i.e. Fn+Esc and Fn+F3-5,6,12)
( ) Special extra functions of the touchpad.

Key: (x) OK, (?) maybe/not tested, ( ) not working

Be aware that you will need to compile your own custom kernel to get everything working. See the bottom of this page for a link to my kernel .config file.

Hardware

Here's my lspci output:

0000:00:00.0 Host bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 03)
0000:00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03)
0000:00:07.0 ISA bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 02)
0000:00:07.1 IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 01)
0000:00:07.2 USB Controller: Intel Corp. 82371AB/EB/MB PIIX4 USB (rev 01)
0000:00:07.3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 03)
0000:00:08.0 FireWire (IEEE 1394): Sony Corporation CXD3222 i.LINK Controller (rev 02)
0000:00:09.0 Multimedia audio controller: Yamaha Corporation YMF-744B [DS-1S Audio Controller] (rev 02)
0000:00:0a.0 Communication controller: Conexant HSF 56k Data/Fax Modem (Mob WorldW SmartDAA) (rev 01)
0000:00:0b.0 Ethernet controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (rev 08)
0000:00:0c.0 CardBus bridge: Ricoh Co Ltd RL5c475 (rev 80)
0000:01:00.0 VGA compatible controller: ATI Technologies Inc Rage Mobility P/M AGP 2x (rev 64)

Booting Debian install

It so happens that when I had to reinstall, I did not have my CD-ROM drive with me. This means that I am unable to say whether it is possible to install Debian from the external CD-ROM. I know that I was not able to do it when I first installed Debian a few years ago (I could boot from it, but the installer would not detect it afterwards). That said, it was rather a long time ago and it probably works fine now. The new Debian installer is a joy to use.

Anyway, back to the issue at hand. I booted the installer from the USB Floppy drive that came with the laptop. This meant that I could not use the official Debian install floppies, as they don't support USB Floppy Drives. The Debian installation manual (section 5.3) did provide this link to some custom boot floppies that would do the job.

Partitions

I am dual-booting with a Windows 2000 install. I use this when I want to play some games and to code some Excel VBA macros that earn me some money. Below is my partitions table. With hindsight I would have given my root partition an extra 500MB at least (it can get a bit cramped at times), at the expense of removing some of the Windows programs I never use these days (most of them are still there from 2 years ago).

Filesystem
/dev/hda1
tmpfs
/dev/hda3
/dev/hda4
/dev/hda5
Size
1.9G
94M
3.9G
7.3G
958M
Used
1.2G
0
3.5G
6.8G
396M
Avail
627M
94M
347M
542M
514M
Use%
66%
0%
92%
93%
44%
Mounted on
/
/dev/shm
/mnt/ntfs
/mnt/fat32
/home

Notice I have a FAT32 partition. If you also plan to dual-boot then I strongly recommend having one, as it can serve as a nice go-in-between partition. By default Windows can't read Linux partitions (and I like it that way), while Linux still can not safely write to NTFS (I have mine mounted as read-only).

Configure Ethernet

You will need to use the eepro100 driver. The rest is straightforward enough.

Install Base System

I did this over FTP using ftp.uk.debian.org/debian

Configure APT

I have long been a fan of Debian Unstable on anything except gateway/router/server boxes. Stable is just too stale. Therefore, I manually configured my APT sources to be:

deb ftp://ftp.de.debian.org/debian/ unstable main non-free contrib
deb ftp://ftp.uk.debian.org/debian-non-US unstable/non-US main non-free contrib
deb-src ftp://ftp.de.debian.org/debian/ unstable main non-free contrib
deb-src ftp://ftp.uk.debian.org/debian-non-US unstable/non-US main non-free contrib

After this it's just plain sailing. Using aptitude I selected what I wanted to install and then had a few cups of tea while I waited for the lot to download. One thing though, you might want to install only the basics at first and then add things later, otherwise you may run out of tea.

XFree86

This works fine. I installed this by selecting the x-window-system-core package. Make sure you also install a 'display manager' program to auto-start X for you (I use wdm for this but there are others).

Hardware Video Acceleration

This laptop uses the ATI mach64 driver and XFree86 will not natively provide hardware acceleration for it, therefore you have to look to the DRI project to get it working. Please note that this involves modifying the Debian XFree86 install, which probably means that the hardware acceleration will have to be re-enabled every time you upgrade the XFree86 packages, as the upgrade will probably undo the changes. Debian packages are provided here.

Mouse

The touchpad works fine from the start. The USB mouse will work providing the necessary kernel options are selected and the necessary modules are loaded (more on this below).

One important note: by default the USB mouse needs to be connected at the time X start, otherwise X will not see it until you restart X. Naturally this is a bit of crap solution on a laptop as you will not necessarily have the USB mouse plugged in all the time. Fortunately someone on the net managed to find a solution for this, so I added the following lines to my /etc/modules file:

mousedev
hid
usb-uhci

This should force-create the appropriate device that X will see as a USB mouse, even if one is not connected when X starts.

Sound

I use the ALSA ymfpci driver to get sound working. You can either use a pre-compiled alsa-modules-kernel_version package (where 'kernel_version' is replaced with your kernel version number), or compile your own from the alsa-source package. The appropriate configuration file was automatically created by Debian when you install the alsa-base package.

There are two more things to note. Firstly, you will need to add your user to the audio group, otherwise you will not be able to access the appropriate devices. Secondly, you will need to use the alsamixer tool to 'un-mute' the appropriate audio channels (they are muted by default) and raise the volume (it's set to 0 by default).

There seems to be some sort of odd bug in the sound card: if I boot into Windows and then reboot into Linux then the sound card stops working (i.e. Linux can't find it). The solution is to always shut down (rather that reboot) Windows prior to booting into Linux.

USB stuff

Most of my USB-related drivers are compiled as modules. Here is a summary of what modules need to be loaded for various stuff to work:

General USB support: usb-uhci, usbcore
USB keyboard and mouse: hid, keybdev, mousedev
MemoryStick and USB floppy: usb-storage, sd_mod, scsi_mod.
USB printer: printer

If a USB device does not work, the first thing to check is whether or not you have the necessary modules loaded. Use the lsmod to list modules that are currently loaded and the modprobe module_name command (as root) to load a specific module (replace 'module_name' with the actual module name).

Memory Stick drive

Providing the right modules are loaded, this is detected as /dev/sda. However, for some strange reason, I have to mount it using /dev/sda1, otherwise it does not work (mount does not recognise the file system).

USB Floppy drive

Providing the right modules are loaded, this is detected as /dev/sdb.

PCMCIA CD-ROM

This is detected as /dev/hde. You may wish to create a symbolic /dev/cdrom link pointing to it (as that is the default of quite a few programs). Also, you will probably want to change the group ownership on the device to cdrom and then add your user to this group (remember that you will need to restart X for the latter to take effect).

The CD-ROM drive is a bit temperamental when it comes to playing audio CD's, as PCMCIA drives sometimes are. For instance, under Windows I had to use the line-out port on the drive itself to get sound from it. Linux turned out to be better in this respect. With XMMS and using the 'digital audio extraction' feature in the 'CD Audio Player' plug-in, I can listen to CD's without a problem.

Modem

The Z600LEK comes with a Conexant 'winmodem'. At the moment, your only hope of getting this to work under Linux is to buy a driver from here. In all fairness, the price is quite reasonable. It should work and you do get some free cripple-ware to try out, but I have not tried it, as I don't need to use a modem.

Power Management

This is done through Advanced Power Management. Using the power button I can put the laptop on standby. In kernels above 2.4.20 I have had problems with DMA and standby. The laptop would sometimes freeze on standby/resume. Even if the resume worked fine, often it would take up to 20 seconds after resume for the hard disk drive to power up. Having got fed up, I did some research and I think I've managed to fix it using apmd and hdparm. After installing these I wrote two scripts. One runs before just before standby and turns off DMA on the hard drive, and one runs just after resume to turn DMA back on. Here they are:

#!/bin/sh
# This script is saved as /etc/apm/suspend.d/98ide_dma

PROG="$1"

case "$PROG" in
   suspend|standby) hdparm -d0 -q /dev/hda ;;
esac

exit 0
#!/bin/sh
# This script is saved as /etc/apm/resume.d/01ide_dma

PROG="$1"

case "$PROG" in
   resume) hdparm -m16 -d1 -q /dev/hda ;;
esac

exit 0

Files

  • My XF86Config-4 file. Most of this is auto-generated, so it is not all that useful.
  • My kernel .config file for the 2.4.27 kernel. When compiling your own kernel it is usually best to use the Debian kernel-source-kernel_version package (again replace 'kernel_version' with the appropriate kernel version number).

Links