Fedora 9 on a Sony Vaio VGN-NR160E

Filed under: sony vaio fedora 

First of all, let me note that I tried to install Foresight 2.0 on this laptop only to find the process too annoying to continue. Fedora, for all its shortcomings, remains one of the best distros for dealing with laptops and less-common hardware.

As expected, the Fedora install went flawlessly. I used the defaults except for filesystem layout (sorry, but I will not use ext3 on my machines).

After installing Fedora, the next item on the list was to change /etc/fstab and add noatime to all the mount options. One day the distros will wake up to what a bad idea access timestamps are. Until then this is requisite, especially on laptops, which tend to have slower disks than servers or desktop machines.

Next, replace Fedora's pathetic package management utilities with SmartPM. You must use the bazaar checkout in order to have Fedora's new mirror system supported. Smart has few dependencies and I can't recall any that aren't included with the base Fedora install.

At this point you have a functional system, but there's still a few things missing:

  1. suspend, hibernate and resume
  2. Vaio function keys (volume up/down, lcd brightness, etc)

Pretty much everything else should already work, so these two will be the focus for the rest of this article.

The very first thing you'll want to verify is that the sony_laptop kernel module is loaded. Most likely it already is, but you should verify this:

# lsmod | grep sony
sony_laptop            30684  0

If it isn't loaded, you'll need to load it by hand using:

# modprobe sony_laptop

and also add an appropriate line to /etc/modprobe.d/sony.conf or something similar so that it's loaded on boot.

At the time I installed this laptop, gnome-power-manager was at version 2.22. This version will not work properly on a Vaio. You can find the 2.23 version in Rawhide that should work properly.

Next, we need to enable HAL quirks for our model. You can get your exact model string with the following command:

# lshal | grep -i system.hardware.product
system.hardware.product = 'VGN-NR160E'  (string)

You'll need this string when you edit quirks files.

Next, edit /usr/share/hal/fdi/information/10freedesktop/30-keymap-module-sony-laptop.fdi and add a section like this:

<match key="/org/freedesktop/Hal/devices/computer:system.hardware.product" string_outof="VGN-NR160E">
  <append key="input.keymap.data" type="strlist">0x06:mute</append>
  <append key="input.keymap.data" type="strlist">0x07:volumedown</append>
  <append key="input.keymap.data" type="strlist">0x08:volumeup</append>
  <append key="input.keymap.data" type="strlist">0x09:brightnessdown</append>
  <append key="input.keymap.data" type="strlist">0x0a:brightnessup</append>
  <append key="input.keymap.data" type="strlist">0x0b:switchvideomode</append>
  <append key="input.keymap.data" type="strlist">0x10:suspend</append>
  <append key="info.capabilities" type="strlist">input.keymap</append>
</match>

You also need to edit /etc/X11/xorg.conf and add the following:

Section "ServerLayout"
       ...
       InputDevice    "Vaio keys" "SendCoreEvents"
EndSection

and:

Section "InputDevice"
       Identifier  "Vaio keys"
       Driver      "evdev"
       Option      "Name" "Sony Vaio Keys"
       Option      "XkbLayout" "jp"
       Option      "XkbModel" "jp106"
EndSection

Add this as a new section, do not replace the existing InputDevice section.

This will enable the Vaio function keys. It also enables the lid closed sensor (which, like the function keys, is an ACPI button). They won't actually work until you've restarted the computer, but don't do that yet.

Next up, we need to set the HAL quirks for the Intel G965 video so that the laptop will resume properly from suspend or hibernate.

Edit the file /usr/share/hal/fdi/information/10freedesktop/20-video-quirk-pm-sony.fdi and add the following section:

<match key="system.hardware.product" string_outof="VGN-NR160E">
  <merge key="power_management.quirk.s3_bios" type="bool">true</merge>
  <merge key="power_management.quirk.s3_mode" type="bool">true</merge>
</match>

Finally, you'll most likely discover that even though the brightness up/down function key invokes the little onscreen indicator in GNOME, nothing actually happens. To fix this, you must run this command:

$ xrandr --output LVDS --set BACKLIGHT_CONTROL native

Note that this must be run every time X is restarted, so you'll probably want to add it to your session (System->Preferences->Session).

You'll probably need to restart your laptop (I've had mixed results restarting hal-daemon), but at this point you should have a fully functional system.

I'd like to add that the integrated Intel G965 video provides more than adequate performance for a non-gamer and works fine with compiz (I haven't tried compiz-fusion because, well... I just don't care).

References:

  1. http://www.pihhan.info/sony/sony-hotkeys.html
  2. http://ubuntuforums.org/showthread.php?t=626406&page=2
  3. http://www.linux.it/~malattia/wiki/index.php/Vaio_VGN-SZ72B


0 comments Leave a comment