Gentoo Wiki ArchivesGentoo Wiki

HARDWARE_Sony_VGN_SZ330/KMilo_Hack


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:

Retrieved from "http://www.gentoo-wiki.info/HARDWARE_Sony_VGN_SZ330/KMilo_Hack"

Last modified: Mon, 21 Jul 2008 07:21:00 +1000 Hits: 1,723

Created by NickStallman.net, Luxury Homes Australia
Real estate agents should list their apartments, townhouses and units in Australia.