HARDWARE Sony VGN SZ330/KMilo Hack

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the Hardware series.
Laptops TV Tuner Cards Wireless Servers Storage Other Hardware Motherboards Related

I've modified KMilo to adjust brightness on the SZ330 (Intel video). This should work on all Vaio laptops supporting the Linux kernel-based sony controls. If you have a file /sys/class/backlight/sony/brightness, you can use Fn-F6/F7 to adjust your brightness now!

First download the modified source files and put them somewhere sensible. I used /usr/src/kmilo/kmilo_vaio

Enable overlays in make.conf

Code:
# cat /etc/make.conf | grep PORTDIR_OVERLAY
PORTDIR_OVERLAY="/usr/local/portage"

Configure portage overlay for kmilo:

Code:
mkdir -p /usr/local/portage
mkdir -p /usr/local/portage/kde-base/kmilo
cp /usr/portage/kde-base/kmilo/* /usr/local/portage/kde-base/kmilo/*

Modify kmilo-3.5.5.ebuild to copy over new files during emerge:

File: /usr/local/portage/kde-base/kmilo/kmilo-3.5.2.ebuild
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/kde-base/kmilo/kmilo-3.5.5.ebuild,v 1.9 2006/12/11 13:38:31 kloeri Exp $

KMNAME=kdeutils
MAXKDEVER=$PV
KM_DEPRANGE="$PV $MAXKDEVER"
inherit kde-meta eutils

DESCRIPTION="kmilo - a kded module that can be extended to support various types of hardware
input devices that exist, such as those on keyboards."
KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86 ~x86-fbsd"
IUSE="kdehiddenvisibility pbbuttonsd"
DEPEND="pbbuttonsd? ( app-laptop/pbbuttonsd )"
RDEPEND="${DEPEND}"

src_compile() {
	local myconf="$(use_with pbbuttonsd powerbook)"

	echo *** +++++++++++++++ COPY kvaiodriverinterface.cpp +++++++++++++++++ ***
	cp -f /usr/src/kmilo/kmilo_vaio/kvaio.cpp /var/tmp/portage/kde-base/kmilo-3.5.5/work/kmilo-3.5.5/kmilo/kmilo_kvaio/kvaio.cpp
	cp -f /usr/src/kmilo/kmilo_vaio/kvaiodriverinterface.cpp /var/tmp/portage/kde-base/kmilo-3.5.5/work/kmilo-3.5.5/kmilo/kmilo_kvaio/kvaiodriverinterface.cpp

	kde-meta_src_compile
}

(Note this is not a proper ebuild because some paths are hardcoded, and these source files should be patches. But this howto is based on HARDWARE_Sony_VGN_S580/kvaio.cpp_hack and it does work, just don't submit this to Gentoo!)

Update digest on kmilo-3.5.5.ebuild

Code:
ebuild /usr/local/portage/kde-base/kmilo/kmilo-3.5.5.ebuild digest

Build kmilo, this will rebuild kde libs dependent on kvaio

Code:
emerge kmilo

Restart kde

Done.

Troubleshooting:

Make sure your user has read/write access to /sys/class/backlight/sony/brightness! This can be accomplished by adding the following line to your startup scripts:

File: /etc/conf.d/local.start
# /etc/conf.d/local.start

# This is a good place to load any misc programs
# on startup (use &>/dev/null to hide output)

chmod 666 /sys/class/backlight/sony/brightness

This gives all users on the system write access, so consider the security implications of someone changing your backlight brightness ;)

If /sys/class/backlight/sony/brightness does not exist, you may need to upgrade your kernel version or enable the following kernel options:

  • CONFIG_SONY_LAPTOP
  • CONFIG_SONYPI
Personal tools