Ubuntu On Sony Vaio FW Series

Tips & Tricks related to Sony Vaio FW series laptops

Posts Tagged ‘patch

AV Mode media key patch for 9.10 (Karmic Koala)

with 6 comments

I have made a patch for latest sony-laptop module in 2.6.31 kernel to fix broken AV Mode key handling.

If you want to apply this patch please follow fourth step in Finally a brightness How To post but apply this new patch instead of old one.

From: Anton Veretenenko <anton@veretenenko.ru>
Subject: [PATCH] UBUNTU: sony-laptop: Sony Vaio FW series media keys: AV Mode key support broken

Bug: #502751

AV Mode media key support broken on sony-laptop kernel module.

Signed-off-by: Anton Veretenenko <anton@veretenenko.ru>
---
 drivers/platform/x86/sony-laptop.c |    2 ++
 1 file changed, 2 insertions(+)
--- /usr/src/linux-2.6.31/drivers/platform/x86/sony-laptop.c	2010-01-03 23:21:05.000000000 +0500
+++ drivers/platform/x86/sony-laptop.c	2010-01-04 03:32:20.000000000 +0500
@@ -868,6 +868,8 @@ static struct sony_nc_event sony_100_eve
 	{ 0x10, SONYPI_EVENT_ANYBUTTON_RELEASED },
 	{ 0x91, SONYPI_EVENT_PKEY_P2 },
 	{ 0x11, SONYPI_EVENT_ANYBUTTON_RELEASED },
+	{ 0xA1, SONYPI_EVENT_PKEY_P3 },
+	{ 0x21, SONYPI_EVENT_ANYBUTTON_RELEASED },
 	{ 0x81, SONYPI_EVENT_FNKEY_F1 },
 	{ 0x01, SONYPI_EVENT_FNKEY_RELEASED },
 	{ 0x82, SONYPI_EVENT_FNKEY_F2 },

Bugreport on lanuchpad.net.

Written by egaistek

January 22, 2010 at 14:29

Posted in Vaio

Tagged with , , , ,

Brightness patch for FW4x models

with 31 comments

Thanks to Olivier Grégoire for supplying DSDT.aml for FW4 model. I have updated quick brightness guide post with new patch links, take a look.

Written by egaistek

July 20, 2009 at 23:22

Posted in Vaio

Tagged with , , , ,

Quick brightness guide for Jaunty

with 62 comments

This little guide is faster an easier version of previous brightness how to. Since Jaunty already have sony-laptop patch included, we need to patch our DSDT bios table only and override default one with patched, while kernel is loading. I saw many people have problems with DSDT compiling, so I removed dsdt-error.patch patches from pack, and changed it with another line in terminal.

I have made a script which will make all what needed, you just need to select right patch for your model. Download new patches pack. Unpack it, then pop up your terminal and go into that directory, where you’ve unpacked it. There is 3 patches included dsdt-ati-fix-fw1x.patch, dsdt-ati-fix-fw2x.patch, dsdt-ati-fix-fw3x.patch. If you have FW3x(x) model, then use dsdt-ati-fix-fw3x.patch and so on for FW1x(x)/FW2x(x). Ok, you’ve made your choice, now just type this in terminal:

Ok, I have changed script and make him choose the right patch for you, just type this in terminal then:

sudo ./dsdt-patch

That’s all 🙂

Here is a source code of that script, for those who interested:

#!/bin/bash
# by Anton Veretenenko
# version: 0.2

patch_temp_dir=vaio_fw_patch
isroot=`whoami`

if [ ! $# -eq 0 ]
then
echo “Use: sudo ./dsdt-patch”
exit
fi

if [ ! “$isroot” == “root” ]
then
echo “Error: Make sure you run this script with sudo”
exit
fi

echo “Creating temp directory”
mkdir “/tmp/$patch_temp_dir”

if [ ! -x /usr/sbin/dmidecode ]
then
# if dmidecode isn’t found, let’s install it too
echo “Installing dmidecode”
apt-get install dmidecode
else
echo “dmidecode found”
fi

isfw1=`dmidecode –type system | grep -i -c -P -e “Product Name: VGN-FW(1).*”`
isfw2=`dmidecode –type system | grep -i -c -P -e “Product Name: VGN-FW(2).*”`
isfw3=`dmidecode –type system | grep -i -c -P -e “Product Name: VGN-FW(3).*”`
isfw4=`dmidecode –type system | grep -i -c -P -e “Product Name: VGN-FW(4).*”`
if [ “$isfw1” == “1” ]
then
patch_file=dsdt-ati-fix-fw1x.patch
elif [ “$isfw2” == “1” ]
then
patch_file=dsdt-ati-fix-fw2x.patch
elif [ “$isfw3” == “1” ]
then
patch_file=dsdt-ati-fix-fw3x.patch
elif [ “$isfw4” == “1” ]
then
patch_file=dsdt-ati-fix-fw4x.patch
else
echo “Could not select the right patch for you, does it FW model? Contact me.”
rm -rfd “/tmp/$patch_temp_dir/”
exit
fi

if [ ! -r “$patch_file” ]
then
echo “Error: Could not read $patch_file file”
rm -rfd “/tmp/$patch_temp_dir/”
exit
else
echo “Selected $patch_file patch for you”
fi

cp “$patch_file” “/tmp/$patch_temp_dir/”
cd “/tmp/$patch_temp_dir”

if [ ! -x /usr/bin/iasl ]
then
# if iasl isn’t found, let’s install it
echo “Installing iasl”
apt-get install iasl
else
echo “iasl found”
fi

if [ ! -x /usr/bin/acpidump ]
then
# if acpidump isn’t found, let’s install it too
echo “Installing acpidump”
apt-get install acpidump
else
echo “acpidump found”
fi

if [ ! -x /usr/bin/patch ]
then
echo “Installing patch command”
apt-get install patch
else
echo “patch command found”
fi

echo “Dumping DSDT table to DSDT.aml”
acpidump -b -t DSDT -o DSDT.aml
if [ ! $? -eq 0 ]
then
# if acpidump failed, show error
echo “acpidump failed”
rm -rfd “/tmp/$patch_temp_dir/”
exit
fi

echo “Decompiling DSDT.aml to DSDT.dsl”
iasl -d DSDT.aml
rm DSDT.aml
if [ ! $? -eq 0 ]
then
# if iasl failed, show error
echo “iasl failed”
rm -rfd “/tmp/$patch_temp_dir/”
exit
fi

echo “Patching DSDT.dsl with $patch_file”
patch < "$patch_file" if [ ! $? -eq 0 ] then # if patching failed, show error echo "$patch_file patch failed" rm -rfd "/tmp/$patch_temp_dir/" exit fi echo "Fixing _T_0 errors in DSDT.dsl" sed -i 's/_T_0/T_0/g' DSDT.dsl if [ ! $? -eq 0 ] then # if sed failed, show error echo "_T_0 fixing failed" rm -rfd "/tmp/$patch_temp_dir/" exit fi echo "Compiling patched DSDT" iasl DSDT.dsl if [ -f DSDT.aml ] then echo "Compilation successfull, updating initramfs" cp DSDT.aml /etc/initramfs-tools/ dpkg-reconfigure linux-image-`uname -r` else echo "Error: DSDT compilation error" fi # deleting temp dir rm -rfd "/tmp/$patch_temp_dir/" if [ -f /etc/initramfs-tools/DSDT.aml ] then echo "DSDT patch applied, you should reboot your system now" fi [/sourcecode]

Written by egaistek

May 28, 2009 at 03:54

Posted in Vaio

Tagged with , , , , , ,

VT-x/VMX Virtualization patch for Sony Vaio FW

with 47 comments

At this time thanks going to Peter Crees for pointing me to HOWTO Enable Intel VT on Sony VAIO by Igor Levicki (big thanks to him!), all you need is to do a bootable usb flash drive with DOS, put there VTPATCH files from downloads section of that howto. Then reboot into DOS from usb and run PATCH.BAT. Pretty easy 🙂

Here is a little howto make you flash drive bootable. Yea, it’s for windows, I did it in virtualbox, because I have windows installed there to test sites with IE. You can find another linux only solution, and I’ll put it here.

Cheers!

Written by egaistek

March 26, 2009 at 04:44

Posted in Vaio

Tagged with , , , ,

sony-laptop patch included in 2.6.28-11.36 jaunty update

with 7 comments

Just a bit of good news. My patch was accepted into 2.6.28-11.36 jaunty kernel update.

I’m working on new brightness changing method, stay tuned.

Written by egaistek

March 21, 2009 at 03:06

Posted in Vaio

Tagged with , , , ,

Undervolt for Intrepid

with 10 comments

Well, Happy New Year! I guess this is the last post in this year, so let’s get our undervolting back with 2.6.27 kernels.

First of all go to phc.athousandnights.de and download 0.3.2 version of patch. Put this into directory where you have or will have kernel sources.

If you have not sources yet, do things like in the 4th step from the post about brightness:

sudo apt-get build-dep linux-source-2.6.27
sudo apt-get install linux-source-2.6.27
cp /usr/src/linux-source-2.6.27.tar.bz2 ./
tar jxvf linux-source-2.6.27.tar.bz2
cd linux-source-2.6.27

Put linux-phc-0.3.2-kernel-vanilla-2.6.26.patch.tar.gz in your current dir (linux-source-2.6.27) and unpack it, then patch the kernel sources:

tar zxvf linux-phc-0.3.2-kernel-vanilla-2.6.26.patch.tar.gz
patch -p1 < linux-phc-0.3.2-kernel-vanilla-2.6.26.patch [/sourcecode] Now go into cpufreq module dir and compile it and then install new compiled version: [sourcecode language="python"] cd arch/x86/kernel/cpu/cpufreq/ make -C /lib/modules/`uname -r`/build/ M=`pwd` modules strip --strip-debug acpi-cpufreq.ko sudo install -m644 -b acpi-cpufreq.ko /lib/modules/`uname -r`/kernel/arch/x86/kernel/cpu/cpufreq [/sourcecode] Now reboot and check for module success: [sourcecode language="python"] cat /sys/devices/system/cpu/cpu0/cpufreq/phc_vids [/sourcecode] If you see voltage numbers then you can start optimizing voltages for your cpu or take mine as reference from the previous post about undervolting.

P.S. Fan almost stops at 40C and starts at 50C.

Written by egaistek

December 27, 2008 at 04:24

Posted in Vaio

Tagged with , , , , ,

Finally a brightness How To for Vaio FW Series

with 230 comments

WARN: This how to is only for laptops with Ati graphics. Do not apply any changes to DSDT if you have Intel graphics.

WARN: Remember, when you update your kernel, you should remake all this again for new kernel.

WARN: DSDT update cause kernel panic during boot on 64bit kernels <= 2.6.27-9. Use noacpi option in grub to boot without DSDT.

UPD: S1/AV mode keys are enabled in new patch for sony-laptop module.

Hello there guys. Long time no updates, and here is a big one )

Thanks to Anze for pointing me to 11682 bug. I have managed to make easy howto on enabling brightness control.

First of all we need to install iasl and acpidump:


sudo apt-get install acpidump iasl

Second, download my patches (alternate link). And unpack it somewhere. Then go into that directory in your terminal.

Third, we need to patch our default DSDT table:

UPD: If you have Sony Vaio FW2xx or FW2x models, please use dsdt-error-fw21.patch and dsdt-ati-fix-fw21.patch here.

UPD: If you have Sony Vaio FW3xx or FW3x models, use dsdt-error-fw21.patch then dsdt-error.patch and then dsdt-ati-fix-fw21.patch here.

sudo acpidump -b -t DSDT -o DSDT.aml
iasl -d DSDT.aml
sudo rm DSDT.aml
patch < dsdt-error.patch
patch < dsdt-ati-fix.patch
iasl DSDT.dsl
sudo cp DSDT.aml /etc/initramfs-tools/
sudo dpkg-reconfigure linux-image-`uname -r`
&#91;/sourcecode&#93;

Here we dumped our DSDT table and then decompilled it. Then patched with <strong>dsdt-error.patch</strong>, this patch fix wrong name ("_T_0") produced by disassembler. Without this patch we can not recompile this table back. Then we patch with <strong>dsdt-ati-fix.patch</strong>, this is the actual fix made by <strong>Zhang Rui</strong> from bugzilla, and recompile table back. And then we put our patched DSDT into initramfs, to allow kernel load it instead of original DSDT.

Fourth, we need to patch <strong>sony-laptop</strong> module to make our Fn keys for brightness work correctly:

<span style="color:#ff0000;">UPD</span>: If you have Jaunty kernel version &gt;= 2.6.28-11.36, do not do this step, this patch is included already.

Install kernel source and all packages needed for compiling it (who knows a better way to not download so many packages by build-dep? or build-essential is enough).


sudo apt-get build-dep linux-source-2.6.27
sudo apt-get install linux-source-2.6.27
cp /usr/src/linux-source-2.6.27.tar.bz2 ./
tar jxvf linux-source-2.6.27.tar.bz2
cd linux-source-2.6.27

Then put here (linux-source-2.6.27) sony-laptop.patch patch and make this:

patch -p0 < sony-laptop.patch
cd drivers/misc/
make -C /lib/modules/`uname -r`/build/ M=`pwd` modules
strip --strip-debug sony-laptop.ko
sudo install -m644 -b sony-laptop.ko /lib/modules/`uname -r`/kernel/drivers/misc
&#91;/sourcecode&#93;

This will compile and install our new patched <strong>sony-laptop</strong> module.

Now we need to reboot.

After rebooting we can check if all ok:


dmesg | grep -i sony-laptop
dmesg | grep -i dsdt

We should get something like this:

[   16.045201] sony-laptop: Sony Notebook Control Driver v0.6.
[   16.190130] sony-laptop: detected Sony Vaio FW Series

and this:

[    0.000000] ACPI: DSDT BFE06010, 8016 (r1   Sony     VAIO 20080605 INTL 20051117)
[    0.044471] ACPI: Checking initramfs for custom DSDT
[    0.359780] ACPI: Found DSDT in DSDT.aml.
[    0.359785] ACPI: Override [DSDT-    VAIO], this is unsafe: tainting kernel
[    0.359793] ACPI: Table DSDT replaced by host OS

Now try to use Fn brightness keys. This should work =)

Color your Sony Vaio laptop Thinnest Laptop Ever Free Laptop

Written by egaistek

December 4, 2008 at 12:08

Posted in Vaio

Tagged with , , , , ,