Gentoo Linux on a Sony Vaio PCG-R505GL

Specifications
Config files
Installation
ACPI
External video
Framebuffer
Sound
CD-RW/DVD
Modem
PCMCIA
Wireless
Sonypi
Links

Specs

CPUIntel Pentium III-M 1.2 GHz
RAM256 MB SDRAM (128 MB onboard, one 128 MB SODIMM)*
HDHitachi DK23DA-30, 30MB, DMA, ATA100
DVD/CDMatshita UJDA730 DVD/CDRW
VideoIntel i830MG graphics chipset
EthernetIntel 82801CAM (ICH3) Chipset
ModemConexant Ambit SoftK56 Data/Fax ICH Modem
SoundIntel ICH 82801AA (AC'97 compatible)

* Sony claims the maximum amount of RAM for this model is 384 MB, but the 128 MB SODIMM can be replaced by up to a 512 MB SODIMM, for a total of 640 MB of RAM. I've heard tales of it not working, but I bought a 512 MB SODIMM (Part# CT276917) from crucial.com, and it's working just fine.

Here's the output of 'lspci':

00:00.0 Host bridge: Intel Corp. 82830 830 Chipset Host Bridge (rev 04)
00:02.0 VGA compatible controller: Intel Corp. 82830 CGC [Chipset Graphics Controller] (rev 04)
00:02.1 Display controller: Intel Corp. 82830 CGC [Chipset Graphics Controller]
00:1d.0 USB Controller: Intel Corp. 82801CA/CAM USB (Hub #1) (rev 02)
00:1d.1 USB Controller: Intel Corp. 82801CA/CAM USB (Hub #2) (rev 02)
00:1d.2 USB Controller: Intel Corp. 82801CA/CAM USB (Hub #3) (rev 02)
00:1e.0 PCI bridge: Intel Corp. 82801BAM/CAM PCI Bridge (rev 42)
00:1f.0 ISA bridge: Intel Corp. 82801CAM ISA Bridge (LPC) (rev 02)
00:1f.1 IDE interface: Intel Corp. 82801CAM IDE U100 (rev 02)
00:1f.3 SMBus: Intel Corp. 82801CA/CAM SMBus (rev 02)
00:1f.5 Multimedia audio controller: Intel Corp. 82801CA/CAM AC'97 Audio (rev 02)
00:1f.6 Modem: Intel Corp. 82801CA/CAM AC'97 Modem (rev 02)
02:02.0 FireWire (IEEE 1394): Texas Instruments TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link)
02:05.0 CardBus bridge: Ricoh Co Ltd RL5c475 (rev 80)
02:08.0 Ethernet controller: Intel Corp. 82801CAM (ICH3) PRO/100 VE (LOM) Ethernet Controller (rev 42)

Or perhaps you want to see everything from 'lspci -vv'?

Config files

/usr/src/linux/.config (vanilla-sources-2.4.21 patched with acpi-20030619-2.4.21.diff)
/etc/X11/XF86Config (4.3.0, from 4.3.0-r3 ebuild)
/etc/modules.autoload
/etc/fstab
/boot/grub/grub.conf

Installation

Use a Gentoo 1.2 install CD to boot. It should autodetect the built-in network card (eepro100), after which you can set up your network ('dhcpcd eth0' if you're using DHCP). You won't be able to see the CD once you're at the shell, so you'll have to get one of the stage tarballs from the net. For example,

# wget http://distro.ibiblio.org/pub/Linux/distributions/gentoo/releases/1.4_rc2/x86/x86/stages/stage1-x86-1.4_rc2.tbz2

From there, you should be able to follow the Gentoo install instructions to get the whole system built.

ACPI

One of the first things you should get up and running is ACPI -- Advanced Configuration and Power Interface. This is useful for power and thermal management, and crucial for proper IRQ routing. There are two basic routes to this with Gentoo:

After either of these, enable ACPI in the kernel, and disable APM. If you build the various ACPI components as modules, then you probably want to add them to /etc/modules.autoload.

External video

If you have an Intel graphics chipset, you may be able to use i810switch (emerge i810switch) to turn the external display and the LCD display on and off.

Otherwise, the external video display will probably be enabled if a device is attached at boot time.

Framebuffer

To avoid having the text-mode console take up just the center of the screen, you have to enable framebuffer support. For i830M/845G/852GM/855GM/865G chipsets, you can use the intelfb driver included in the 2.4.21 kernel. Enable this driver (compile into the kernel), under Console drivers --> Frame-buffer support. Then add an option "vga=0x305" (passed to the kernel) to your grub.conf. Unfortunately, it doesn't look like the driver currently supports any video modes higher than 1024x768 at 8 bpp. See http://www.xfree86.org/~dawes/intelfb.html for more info on this driver.

For i810/i815 framebuffer support, I'd suggest looking at this project: http://i810fb.sourceforge.net/.

Sound

Add CONFIG_SOUND_ICH ("Intel ICH (i8xx), SiS 7012, NVidia nForce Audio or AMD 768/811x") under "Sound card support". If you don't have ACPI patched, as mentioned above, you may get problems with choppy sound.

If you prefer, you can use ALSA drivers instead. See the Gentoo ALSA guide for info on ALSA setup. This sound card uses the snd-intel8x0 driver.

CD-RW/DVD

Add IEEE1394 support and SCSI support to your kernel. Under IEEE1394, you'll need OHCI-1394 support and SBP-2 support. Under SCSI, add SCSI CD-ROM support.

Then you should see a /dev/scsi/host1/bus0/target0/lun0/cd entry, as well as a link, /dev/cdroms/cdrom0, to it.

Modem

# emerge hsflinmodem
# hsfconfig

This should create a /dev/ttySHSF0 entry (with /dev/modem pointing to it), which you can then use to access the modem.

PCMCIA

For the PCMCIA slot, you'll need to use the drivers in the pcmcia-cs package, instead of those in the kernel. This is because this laptop has a PCI-PCMCIA bridge, which isn't supported by the kernel drivers at the time of this writing. pcmcia-cs will also give you cardbus management tools (cardctl and cardmgr).

To do this, turn OFF "PCMCIA/CardBus support" in General setup. If you want to use a PCMCIA wireless card, turn ON "Wireless LAN (non-hamradio)" in Network device support, but leave the specific drivers all OFF. Then:

# emerge sys-apps/pcmcia-cs

To use the PCMCIA slot, you'll then need to load the modules pcmcia_core and i82365. When /etc/init.d/pcmcia runs, it will also load the ds module.

Wireless

I didn't get a model with built-in wireless, so I'm using a PCMCIA wireless card instead. See the PCMCIA section and the card-specific sections below for info on getting the card up and running.

You'll probably want the wireless-tools package, for things like iwconfig, which allow you to configure your wireless card (SSID, channel/frequency, etc.):

# emerge net-wireless/wireless-tools

If you run into CardServices version number mismatch errors when you try to modprobe, one solution is to

# ebuild /usr/portage/sys-apps/pcmcia-cs/pcmcia-cs-3.2.3-r1.ebuild unpack

and then copy the CS_RELEASE and CS_RELEASE_CODE version numbers from /var/tmp/portage/pcmcia-cs-3.2.3-r1/work/pcmcia-cs-3.2.3/include/static/pcmcia/version.h to /usr/src/linux/include/pcmcia/version.h. I wouldn't recommend copying the whole file over, however.

Linksys WPC11

I first got a Linksys WPC11 v. 3 PCMCIA card. If you're using pcmcia-cs-3.2.4 or later, it should work automatically.

If you're using an earlier version of pcmcia-cs, you may get an error from the cardbus (PCMCIA) manager ("Unsupported card in socket 0"). If so, add a section to /etc/pcmcia/config.opts:

card "Instant Wireless Network PC Card"
  manfid 0x0274, 0x1613
  bind "orinoco_cs"

You can get the card name and the manfid from syslog (/var/log/everything/current on mine) or by calling 'cardctl ident' with the card in the PCMCIA slot. Then restart /etc/init.d/pcmcia and it should be correctly set up as eth1.

3Com XJACK

The antenna on the WPC11 stuck out a bit too much for me, so I got a 3Com XJACK 3CRWE62092A card, with a retractable antenna. These use the poldhu_cs driver, found at http://www.xs4all.nl/~bvermeul/swallow/. I grabbed the poldhu tarball and tried to use that. It needs the pcmcia-cs source, so I had to do

# ebuild /usr/portage/sys-apps/pcmcia/pcmcia-cs-3.2.3.ebuild unpack

and then tell the poldhu_cs build process to look in /var/tmp/portage/pcmcia-cs-3.2.3/work/pcmcia-cs-3.2.3/. Then it built and worked.

Sonypi

To get things like screen brightness working, include support in the kernel for sonypi under character devices. Two lines should be added to /etc/modules.d/aliases:

alias char-major-10-250 sonypi
options sonypi minor=250

This will set the minor device number to 250, so there won't be a likely chance it'll conflict with another auto-detected "misc" device (see the sonypi page for more detail). To set screen brightness and get stats on the battery:

# emerge app-misc/spicctrl

To use the jogdial, you also have to have a user-space daemon watching the sonypi device for events, and taking appropriate actions. There are a few available -- sjog, sonypid, jogmouse, and jogdiald. Personally, I'm using sjog.

Add a line to your /etc/X11/XF86Config file under the trackpad's "InputDevice" section (Identifier "Mouse0" in my case). This will prevent Gdk "BadValue" errors when scrolling the jogdial.

Option      "ZAxisMapping" "4 5"

Then just set your user-space daemon to run at the appropriate time (e.g., in your .xinitrc file if you want it running while in X).

Links

Linux-Sony mailing list, very helpful.
Linux-Sony Wiki, with other Linux-Sony stories.
Linux Laptop for other accounts of installing Linux on these laptops
Sony's PCG-R505GL support site has some specifications lists.
Gentoo Linux