Archive for the 'Linux' category

Linux Debian with Enlightenment 17 on Sony VAIO VGN-S660/B

Jul 20 2007 Published by under Linux


I picked this notebook because it was the only one that I was familiar with at that time that fit my minimum expectations. It’s 4.3 pounds, which makes it pretty portable by my standards. It has a bright and sharp 13.3″ wide screen that’s not too big, and gives me lots of room for all my windows. The NVIDIA video card is well supported by Linux and carries 64 Mb of its own dedicated ram as well as borrows 64 Mb (shared) from my 1 Gb of ram. This video cards, although not the best, definitely has the advantage of showing me more detail, colour, texture and can keep up with most effects that I desire.

The Pentium M 1.8 GHz processor is more than I need. Unlike my previous laptops, this one came with a hardware wireless turn on/off button. That makes my life easier when I want to just cut the wireless access for both security and power conservative reasons. The speakers are decent and so is the sound card. The wireless card IPW2200bg is the most supported wireless card I know. Both Intel and the community are working together on the drivers. Currently the drivers for this card support every mode I know (Master, Ad-Hoc, Managed, Monitor, Promiscuous). The battery went a bit more than 3 hours under normal use (VMware, music, and some web browsing). With the extended battery it should go up to 8 hours. It also has a DVD burner (dual layer capable), the speeds are not the highest but they are fine for my needs. The hard disk is 100 Gb SATA and works great. What worries me are the hinges that attach the LCD, they look to me as if they are pretty thin. Over all it doesn’t have too many flashy and unnecessary things. I found its interface to be quite simple yet stylish.

Output of lspci

0000:00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)
0000:00:01.0 PCI bridge: Intel Corporation Mobile 915GM/PM Express PCI Express Root Port (rev 03)
0000:00:1b.0 0403: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller (rev 03)
0000:00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 03)
0000:00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 03)
0000:00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 03)
0000:00:1d.3 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 (rev 03)
0000:00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 03)
0000:00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d3)
0000:00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 03)
0000:00:1f.1 IDE interface: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller (rev 03)
0000:00:1f.2 IDE interface: Intel Corporation 82801FBM (ICH6M) SATA Controller (rev 03)
0000:00:1f.3 SMBus: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller (rev 03)
0000:01:00.0 VGA compatible controller: nVidia Corporation: Unknown device 0168 (rev a1)
0000:06:05.0 CardBus bridge: Texas Instruments PCI7420 CardBus Controller
0000:06:05.2 FireWire (IEEE 1394): Texas Instruments PCI7x20 1394a-2000 OHCI Two-Port PHY/Link-Layer Controller
0000:06:05.3 Mass storage controller: Texas Instruments PCI7420/PCI7620 Dual Socket CardBus and Smart Card Cont. w/ 1394a-2000 OHCI Two-Port PHY/Link-Layer Cont. an
0000:06:08.0 Ethernet controller: Intel Corporation 82562ET/EZ/GT/GZ - PRO/100 VE (LOM) Ethernet Controller Mobile (rev 03)
0000:06:0b.0 Network controller: Intel Corporation PRO/Wireless 2200BG (rev 05)

Device Drivers

Download kernel config.

Working devices:

  • Network Card — Intel PRO/100 — drivers: (e100, eepro100)
  • USB — Standard kernel drivers
  • Video Card — NVIDIA GeForce Go 6400 drivers: (nvidia) download from nvidia website
  • Firewire — Texas Instruments — standard kernel drivers
  • Wireless — IPW2200BG — drivers (ipw2200 ieee80211 ieee80211_crypt ieee80211_crypt_ccmp ieee80211_crypt_tkip ieee80211_crypt_wep)
  • Hard Disk — 100 Gb SATA — drivers (scsi_mod ata_piix)
  • Optical Drive — CD/DVD recorder — standard SCSI drivers in kernel
  • Sound Card — Intel “High Definition Audio” – drivers (snd-hda-intel snd_pcm)
  • Function keys (screen brightness, monitor/lcd switch, volume keys)
  • PCMCIA slot — standard Yenta drivers
  • Touchpad — drivers (synaptics drivers for X server)

Devices not yet fully functional or tested:

  • Memory stick slot
  • Winmodem


I used elive 0.4.2 CD from, though installation of other distributions should be similar. First time I tried it out, it seemed to pick up almost everything for me. This version of elive did not recognize the SATA hard disk automatically, so you have to load the ata_piix module before installing to hard disk. Open a terminal (leftmost button on the bottom pannel):

modprobe ata_piix

Next you can check if it found it by typing dmesg. You should see it displaying you that it found a SCSI drive e.g.: sda. Familiarize yourself with this distro before installing. Then proceed and install it by clicking the most right icon at the bottom panel. This should start the installation process.

If you have installed Linux before then the installation process should be easy. Make sure you load the ata_piix module!

A prompt will come up asking you if you have a sata disk. You should agree. Your disk name should be sda. Partition and install the system.

Warning! I did not want to keep any copies of Windows XP Home on the hard disk, I simply wiped the recovery partition created by Sony, if you are unsure about installing Linux on your laptop or want to dual boot Windows, be carefull not to remove that partition.

Once you boot into elive it will ask you for your language and timezone settings. Then it will throw you into shell. Login.

Kernel Compilation

You will need to download a kernel and set it up so that you can compile specific modules for it. We are currently interested in ipw2200 and nvidia modules. You can use your distribution’s binaries, if they exist, ipw2200 is also available as a built-in kernel module, but I prefer to use the one compiled from source, as it is more recent and has more features (for example, the newest versions of the driver have the ability to create a virtual promiscuous interface at the same time as the card is associated to a network in managed mode).

Set up your network interface so that you can get Internet access.After getting your networking set up you will need to install several packages to be able to compile. Then you will need to get and compile the kernel. The commands below will compile your kernel using my config file. Note that this is not minimalistic kernel, it also has support for bluetooth (via a USB adapter), all possible encryption algorithms (for use with WPA, for example) and some other thing which may be useful.

apt-get update
apt-get install make gcc libncurses5-dev
cd /usr/src/
tar -zxf linux-2.6.14.tar.gz
cd linux-2.6.14
cp config-2.6.14 .config
make modules && make modules_install && make && make install

Edit your bootloader and specify to boot your newly compiled Linux kernel. Elive uses GRUB by default, so edit/boot/grub/menu.lst in your favourite text editor.

At the bottom there will be a few lines to change. This is how it should look:

title MyVaio kernel 2.6.14
root (hd0,0)
kernel /boot/vmlinuz-2.6.14 root=/dev/sda1 vga=0x317

Then you will need to set the default value or you can select MyVaio each time you boot. Reboot your laptop into this kernel to continue installing drivers for it.

Check that you are running your new kernel:

uname -r

It should give you 2.6.14 as an answer. If not, check that you completed previous steps correctly and reboot again.

NVIDIA Graphics Driver

You will need to do this in a tty terminal (press Ctrl+Alt+F1). Make sure your network connection is up. Kill X, and download and install nvidia drivers:

killall -9 X
rm /tmp/.X0-lock
echo nvidia >> /etc/modules

You will need to change the screen resolution for Xorg to 1280×800 manually with this distribution. Download my xorg.confwith these corrections applied.

Start X again.

Wireless Drivers

Go to the project website and download latest drivers and firmware. You also need the ieee80211 stack.

Unarchive all three packages. Compile ieee80211 stack first, then ipw2200, then put all firmware files (including the license) into /lib/firmware/. Run load script located in the ipw2200 directory.

Run iwconfig to make sure you have your interface recongnized. Configure it using iwconfig and ifconfig. Consult their manual pages for specific options.

Sony Vaio Fn-keys

I found this section on the web and it seems to work very well. Basically what we will do is setup an event router. So a program that we will install will listen for any event we ask it to listen to, and if that event occurs it will run our command.

Download and install evrouter, nvclock and smartdimmer; nvclock is available from standard Debian repositories via apt-get.

To know which event device is associated with your keys we will use evrouter to probe it. evrouter -d /dev/input/event* | grep Keys | cut -f 2 -d “:”

Now whenever you press the Fn+ (F1-F12) it would give you a different key. This will tell you what is the number of the key to which you would want to assign something.

We will now create a file for each user that will match the keys to commands or scripts that you will want to execute when that key is pressed. This file will be located inside each user’s directory and it will be called .evrouterrc. You should also create this file for root in /root. The file should have read permissions.

Here is an example content of such file:

Window ""

"Sony Vaio Keys" "/dev/input/event1" none key/477 "Shell/hibernate -f"

"Sony Vaio Keys" "/dev/input/event1" none key/148 "Shell/"
"Sony Vaio Keys" "/dev/input/event1" none key/470 "Shell/smartdimmer -d"
"Sony Vaio Keys" "/dev/input/event1" none key/471 "Shell/smartdimmer -i"
"Sony Vaio Keys" "/dev/input/event1" none key/472 "Shell/smartdimmer -s1"
"Sony Vaio Keys" "/dev/input/event1" none key/468 "Shell/vol_decrease"
"Sony Vaio Keys" "/dev/input/event1" none key/469 "Shell/vol_increase"
"Sony Vaio Keys" "/dev/input/event1" none key/467 "Shell/mute"
"Sony Vaio Keys" "/dev/input/event1" none key/476 "Shell/xscreensaver&xscreensaver-command -lock"

Explanation for above file:

I will explain here what each line after the Window “” does.

  1. Assigns the Fn + F12 key to run the hibernate -f command. This puts your laptop into hibernate mode.
  2. Assigns the S1 and S2 keys (evrouter detects them as the same key) to run the script which puts the laptop into suspend. See Sleep and Hibernate section below.
  3. Assigns the Fn + F5 key to run smartdimmer command with -d (dim) parameter: everytime you press this key your screen should become dimmer and dimmer.
  4. Assigns the Fn + F6 key to run smartdimmer command with -i parameter: everytime you press this key your screen shuld become brighter and brighter.
  5. Assigns the Fn + F7 key to run smartdimmer command with -s1 parameter: everytime this key is pressed it sets brightness to 1 (turns off backlight).
  6. Assigns the Fn + F3 key to run vol_decrease script. It uses aumix to lower the sound by a score of 5 out of 100.
    cat > /usr/local/bin/vol_decrease
    aumix -S -v-5 -w-5 -p-5 -W-5
  7. Assigns the Fn + F4 key to run vol_increase script. It uses aumix to make the sound level louder by a score of 5 out of 100.
    cat > /usr/local/bin/vol_decrease aumix -S -v+5 -w+5 -p+5 -W+5
  8. Assigns the Fn + F3 key to run the mute script. Which uses aumix to mute and unmute the sound.
    cat > /usr/local/bin/mute
    volumes=$(aumix -vq -wq -pq -Wq |awk '{print $3}')
    for i in `echo $volumes`
    if [ $i -ne 0 ]; then
    echo $volumes > ~/.aumixr
    aumix -S -v 0 -w 0 -p 0 -W 0
    exit 0
    vol1=$(cat ~/.aumixr |awk ' {print $1} ')
    vol2=$(cat ~/.aumixr |awk ' {print $2} ')
    vol3=$(cat ~/.aumixr |awk ' {print $3} ')
    vol4=$(cat ~/.aumixr |awk ' {print $4} ')
    aumix -S -v $vol1 -w $vol2 -p $vol3 -W $vol4
  9. Assigns the Fn + F11 key to run xscreensaver daemon and lock the screen. This is usefull if you want to quickly leave your laptop, so you just press this key and it locks the laptop in screensaver mode. Note: For the lock to be effective you need to logout of other terminals that you access through alt + F(1-8).

For all of the above commands to work you need to get all the scripts and put them in the appropriate directories with appropriate (executable) permissions. You also need to have these packages installed: xscreensaver, aumix, hibernate.

The following commands need to be executed (preferably on startup) for the Fn keys to work.

echo "Changing Permissions on Sound Utilization..."
chmod 777 /dev/dsp
chmod 777 /dev/mixer
echo "Turning on Event Router..."
chmod 755 /dev/input/event1
rm /tmp/.evrouter*&
killall evrouter
evrouter /dev/input/event* |grep Keys |cut -f 2 -d ":" &

The above commands would allow a normal user to change sound volume. They would also allow the user to read events and after making sure that another evrouter script is not running, it will turn on evrouter. This script should be in a file that starts on boot.

Sleep and Hibernate

To hibernate (suspend to disk), which means that your computer will store everything to disk and then completely shutdown, you need to download and install the hibernate program (available from standard Debian repositories). Issuing hibernate -f put my laptop to hibernate, then by pressing the power key I turn it back on and after booting for a bit it returns me to the gui I was in.

To sleep (suspend to memory), which means that your computer will store everything to memory and continue powering it, you need to download the script and place it into /usr/local/sbin with executable permissions. Suspending to memory is much faster and waking up is also much faster.

Here is what the script looks like:


# discover video card's ID
ID=`lspci | grep VGA | awk '{ print $1 }' | sed -e 's@0000:@@' -e 's@:@/@'`

# securely create a temporary file
TMP_FILE=`mktemp /var/tmp/video_state.XXXXXX`
trap 'rm -f $TMP_FILE' 0 1 15
# switch to virtual terminal 1 to avoid graphics
# corruption in X
chvt 1
# write all unwritten data (just in case)
# dump current data from the video card to the
# temporary file
cat /proc/bus/pci/$ID > $TMP_FILE
# suspend
echo -n mem > /sys/power/state
# restore video card data from the temporary file
# on resume
cat $TMP_FILE > /proc/bus/pci/$ID
/etc/init.d/networking restart
# switch back to virtual terminal 7 (running X)
chvt 9
sleep 4
# remove temporary file
rm -f $TMP_FILE

Hibernate also has an option to lock after you wakeup using the vlock package. You can also run scripts and commands before you hibernate and after you wakeup. Same with sleep.

No responses yet

« Newer posts Older posts »