Sunday, June 13, 2010

Sony
Vaio VPCZ11X9E, no keyboard/touchpad on_boot or after
suspend/hibernate

Asdescribed here we must add i8042.nopnp to the kernel boot parameters in order to use the touchpad at all. Anyhow it sometimes happens that you reboot or suspend/hibernate and end up without mouse and keyboard. Up to today I always had to hard power off the machine, i.e. holding down the power button. Even if this only happens about once every 10 reboots, it is really annoying, so today I attached an usb keyboard to the machine and started investigating.

I discovered that just reloading the psmouse module does the trick of bringing
both the keyboard and the mouse back to life.

In order to make this automatic I added a couple of scripts to
my system.

The first one goes into /etc/pm/sleep.d/99i8042
#!/bin/sh

case "$1" in
suspend|hybernate)
modprobe -r psmouse
;;


thaw|resume)
modprobe psmouse
;;
esac
and the other one, to be saved as /etc/init/fix_touchpad.conf is
# reload the psmouse module

description "Reload the psmouse driver because the buggy i8042 could mess it up after boot"
author "Vincenzo Di Massa <hawk.it@tiscali.it>"

start on starting-dm
task
script
modprobe -r psmouse
sleep 1
modprobe psmouse
end script

Saturday, June 05, 2010

Ubuntu lucid lynx 10.04 on the sony vaio core i7 2010 VPCZ11Z9E
switching the intel and nvidia cards

First of all read http://questier.com/2010/04/26/ubuntu-10-4-lucid-lynx-on-sony-vaio-vpcz11x9e/

To get suspend to ram working when using the intel ** card add
ADD_PARAMETERS="--quirk-test --quirk-s3-bios --quirk-s3-mode"

to /etc/pm/config.d/default (which does not exist by default) and install uswsusp.

To make the nvidia card working I used the the trick described above... I then made it work automatically like this:
1) set grub to automatically boot from the 2.6.32 kernel
2) create a script in /usr/local/bin/force_reboot which just calls /sbin/reboot -f
3) add a grub entry which boots the 2.6.31-20 kernel and add it the parameter init=/usr/local/bin/force_reboot
4) create the config file for nvidia and intel as /etc/X11/xorg.conf.{intel,nvidia}
5) add a boot time service (see the script below) which switches the 2 cards config (must change the xorg.conf file and setup ld.so making it able to find mesa/nvidia libglx.so versions)

# goes into /etc/init/vga_card_switch.conf
# setup the proper video-card

description "Detect wich videocard to use and st it up"
author "Vincenzo Di Massa <hawk.it@tiscali.it>"

start on filesystem
#console output
task
script
FOUND=intel
PCIID=$(dmesg | awk '/Boot video device/ {print $4}')
PCIID=${PCIID%:*}
PCIID=${PCIID#*:}
lspci | grep $PCIID | grep -q nVidia && FOUND=nvidia
if [ "$FOUND" = "nvidia" ]; then
ln -sf /etc/X11/xorg.conf.nvidia /etc/X11/xorg.conf
update-alternatives --set gl_conf /usr/lib/nvidia-current/ld.so.conf
else
ln -sf /etc/X11/xorg.conf.intel /etc/X11/xorg.conf
update-alternatives --set gl_conf /usr/lib/mesa/ld.so.conf
fi
exec ldconfig
end script





** to get intel and nvidia working properly you must install grub, as described above and remove the nomodeset option from the boot parameters

Of course all of the above is hackish.