Gentoo Logo
Gentoo Logo Side
Gentoo Spaceship

Contributors:
. Alec Warner
. Alex Alexander
. Alex Legler
. Alexis Ballier
. Andreas Proschofsky
. Andrew Gaffney
. Arun Raghavan
. Ben de Groot
. Bernard Cafarelli
. Bjarke Istrup Pedersen
. Brent Baude
. Caleb Tennis
. Christian Faulhammer
. Christian Zoffoli
. Damien Krotkine
. Daniel Drake
. Daniel Gryniewicz
. Daniel Ostrow
. David Abbott
. David Shakaryan
. Davide Italiano
. Denis Dupeyron
. Diego E. Pettenò
. Donnie Berkholz
. Doug Goldstein
. Fabio Erculiani
. Gentoo Haskell Herd
. Gentoo News
. Gilles Dartiguelongue
. Greg KH
. Gunnar Wrobel
. Gustavo Felisberto
. Hanno Böck
. Hans de Graaff
. Ioannis Aslanidis
. Jan Kundrát
. Jeffrey Gardner
. Jeremy Olexa
. Joe Peterson
. Jonathan Callen
. Jonathan Smith
. Jorge Manuel B. S. Vicetto
. Joseph Jezak
. Josh Saddler
. José Alberto Suárez López
. Kenneth Prugh
. Krzysiek Pawlik
. Lance Albertson
. Luca Barbato
. Luis Francisco Araujo
. Marcus Hanwell
. Mark Kowarsky
. Mark Loeser
. Markos Chandras
. Markus Ullmann
. Mart Raudsepp
. Matthias Geerdsen
. Michael Marineau
. Michal Januszewski
. Mike Doty
. Mike Pagano
. Mounir Lamouri
. Nathan Zachary
. Ned Ludd
. Nirbheek Chauhan
. Olivier Crête
. Patrick Kursawe
. Patrick Lauer
. Patrick McLean
. Paul de Vrieze
. Peter Weller
. Petteri Räty
. Pieter Van den Abeele
. Piotr Jaroszyński
. Remi Cardona
. Renat Lumpau
. Rob Cakebread
. Robert Buchholz
. Robin Johnson
. Romain Perier
. Ryan Hill
. Sebastian Pipping
. Serkan Kaba
. Shyam Mani
. Steev Klimaszewski
. Stefan Schweizer
. Steve Dibb
. Stuart Longland
. Sune Kloppenborg Jeppesen
. Sven Wegener
. Thilo Bangert
. Thomas Anderson
. Timothy Redaelli
. Tiziano Müller
. Tobias Klausmann
. Tobias Scherbaum
. Yuval Yaari
. Zack Medico
. Zhang Le

Last updated:
November 22, 2009, 02:03 UTC

Disclaimer:
Views expressed in the content published here do not necessarily represent the views of Gentoo Linux or the Gentoo Foundation.


Bugs? Comments? Suggestions? Contact us: planet@gentoo.org

Powered by:
Planet Venus

Welcome to Gentoo Universe, an aggregation of weblog articles on all topics written by Gentoo developers. For a more refined aggregation of Gentoo-related topics only, you might be interested in Planet Gentoo.

November 21, 2009
Diego E. Pettenò a.k.a. flameeyes (homepage, stats, bugs)
The importance of opaque types (November 21, 2009, 18:03 UTC)

I sincerely don’t remember whether I already discussed about this before or not; if I didn’t, I’ll try to explain here. When developing in C, C++ and other languages that support some kind of objects as type, you usually have two choices for a composited type: transparent or opaque. If the code using the type is able to see the content of the type, it’s a transparent type, if it cannot, it’s an opaque type.

There are though different grades of transparent and opaque types depending on the language and the way they would get implemented; to simplify the topic for this post, I’ll limit myself to the C language (not the C++ language, be warned) and comment about the practises connected to opaque types.

In C, an opaque type is a structure whose content is unknown; this usually is declared in ways such as the following code, in a header:

struct MyOpaqueType;
typedef struct MyOpaqueType MyOpaquetype;

At that point, the code including the header will have some limitations compared to transparent types; not knowing the object size, you cannot declare objects with that type directly, but you can only deal with pointers, which also means you cannot dereference them or allocate new objects. For this reason, you need to provide functions to access and handle the type itself, including allocation and deallocation of them, and these functions cannot simply be inline functions since they would need to access the content of the type to work.

All in all you can see that the use of opaque types tend to be a big hit for what concerns performance; instead of a direct memory dereference you need always to pass through a function call (note that this seems the same as accessor functions in C++, but those are usually inline functions that will be replaced at compile-time with the dereference anyway); and you might even have to pass through the PLT (Procedure Linking Table) which means further complication to get to the type.

So why should you ever use opaque types? Well they are very useful when you need to export the interface of a library: since you don’t know either the size or the internal ordering of an opaque type, the library can change the opaque type without changing ABI, and thus requiring a rebuild of the software using it. Repeat with me: changing the size of a transparent type, or the order of its content, will break ABI.

And this gets also particularly important when you’d like to reorder some structures, so that you can remove padding holes (with tools like pahole from the dwarves package, see this as well if you want to understand what I mean). For this reason, sometimes you might prefer having slower, opaque types in the interface, instead of faster but riskier transparent types.

Another place where opaque types are definitely helpful is when designing a plugin interface especially for software that was never designed as a library and has, thus, had an in-flux API. Which is one more reason why I don’t think feng is ready for plugins just yet.

Patrick Lauer a.k.a. bonsaikitten (homepage, stats, bugs)
Random things (November 21, 2009, 15:58 UTC)

Now with 3D working quite well on my radeon (HD4650) I've tested a few games. Somewhere in the last 3 days the performance got a good kick, the improvements are noticeable.
Quake3 by default is limited to 1600x1200 and pretty much maxes out at 90fps all the time. It feels really smooth, and the resolution is quite nice too :)
UT2004 runs at 1920x1200, looks awesome, but is a bit too slow. Around 1280x1024 the performance is high enough to play well.
Nexuiz at 1920x1200 has a rather wobbly performance. Sometimes it goes down to about one frame per second, then spikes back to 30+. Around 1280x1024 it too becomes nicely playable.
That's quite awesome for an open driver, and it's about the first time I've heard the graphics card fan kick in like that.

And people were right, you really only need the -9999 versions of mesa + libdrm + xf86-video-ati.

About the portage options and all that, darkside has blogged about some in the past. It's nice to have some numbers to put next to the --jobs magic :)
And KingTaco had found the CPU hotplugging madness quite some time before me. Plus ca change, plus c'est la meme chose.

I've been slacking a bit, now I'm feeling almost guilty for letting bugs rot. It's interesting to see how motivation works. Sometimes I even wonder why I spend any time on such things - as soon as I fix a bug upstream does a new release, a security issue is found or some other form of breakage. It's a bit frustrating to see this endless stream of "work" coming in ...
But I'm quite happy to see more and more involvement from users. It's good to see people trying to help. Most seem to lack confidence, what they lack in skills they make up for in learning at an insane pace. So as long as there is someone to guide them a bit they are totally awesome. Which means that if I can get some more people motivated I can finally resume infinite slacking because I've been made redundant. I think that should be the goal of every package maintainer :)

Diego E. Pettenò a.k.a. flameeyes (homepage, stats, bugs)
Garbage-collecting sections is not for production (November 21, 2009, 13:59 UTC)

Some time ago I wrote about using --gc-sections to avoid unused functions to creep into final code. Today instead I’d like to show how that can be quite a problem if it was used indiscriminately.

I’m still using at least for some projects the diagnostic of --gc-sections to identify stuff that is unused but still kept around. Today I noticed one bad thing with it and pulseaudio:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/../../../../x86_64-pc-linux-gnu/bin/ld: Removing unused section '.data.__padsp_disabled__' in file 'pulseaudio-main.o'

The __padsp_disabled__ symbol is declared in main.c to avoid pulseaudio’s access to OSS devices to be wrapped around by the padsp script. When I first have seen this, I thought the problem was a missing #ifdef directive: if I didn’t ask for the wrapper, it might still have declared the (unused) symbol. That was not the case.

Looking at the code, I found what the problem was: the symbol is (obviously) never used by pulseaudio itself; it is, rather, checked through dlsym() by the DSP wrapper library. For this reason, for compiler and linker, the symbol looks pretty much unused, and when asking for it to be dropped explicitly, it is. Since the symbol is loaded via the runtime linker, neither building nor executing pulseaudio will have any problem. And indeed, the only problem would be when running pulseaudio as a children of padsp, and using the OSS output module (so not on most Linux systems).

This shows how just using -fdata-sections -ffunction-sections -Wl,--gc-sections is not safe at all and why you shouldn’t get excited about GCC and ld optimisations without understanding how they work in detail.

In particular, even I thought that it would be easier to work around than it actually seem to be: while GCC provides a used attribute that allows to declare a variable (or a function) as used even though the compiler can’t tell that by itself (it’s often used together with inline hand-written ASM the compiler doesn’t check for), this does not propagate to the linker, so it won’t save the section from being emitted. The only solution I can think of is adding one instruction that sets the variable to itself, but that’s probably going to be optimised away. Or giving a way for gcc to explicit that the section is used.

Arun Raghavan a.k.a. ford_prefect (homepage, stats, bugs)
The times they are a-changin’ (November 21, 2009, 05:46 UTC)

Yesterday was my last day at NVidia. I’ve worked with the Embedded Software team there for the last 15 months, specifically on the system software for a Linux based stack that you will see some time next year. I’ve had a great time there, learning new things, and doing everything from tweaking bit-banging I²C implementations with a CRO to tracking down alleged compiler bugs (I’m looking at you -fstrict-aliasing) by wading through ARM assembly.

As some of you might already know, my next step, which has had me bouncing off the walls for the last month, is to join the great folks at Collabora Multimedia working on the PulseAudio sound server. I’ll be working from home here, in Bangalore (in your face, 1.5-hour commute!). It is incredibly exciting for me to be working with a talented bunch of folks and actively contributing to open source software as part of my work!

More updates as they happen. :)

Stuart Longland a.k.a. redhatter (homepage, stats, bugs)
Yes… I hate you too Microsoft (November 21, 2009, 02:53 UTC)

Just installed a wireless card in the laptop I use at Laidley… the wireless card is a pretty standard Intel Pro/Wireless 2915ABG mini-PCI card. It works flawlessly under Linux. I think it was originally from an IBM Thinkpad T41, as it has “FRU: 93P4239″ which when used as a search keyword, leads me to that page on the ThinkWiki site.

I’ve used it just fine in the Toshiba TE2100 I had no problems under Linux… never did get Windows to work with it.

I gave it another try today, after installing it into the Satellite PRO 6100 that I use at Laidley… The machine runs Windows XP as Texas Instruments likes to play all kinds of ridiculous proprietary games with their DSPs and MCUs (in particular, the TMS320LF2406A and the MSP430). So I’m stuck with this horrid OS.

I popped the card in… no problems, slots in nicely under the keyboard. Windows boots up, recognises the card as being a “network controller”, but doesn’t have the drivers… so far so good. Downloaded the drivers off the Lenovo site, and also grabbed the official Intel ones.  I’ve tried both thus far.

Upon installation, I see the following:
IPW2915 Device Properties

Okay… fine… let’s see what the Event Viewer can tell me.
Event Properties for IPW2915

Rightyo… there’s a link I can look at… what does this tell me?  I give it a try…

Event "details"... apparently

This wireless card works out-of-the-box in Linux with no stuffing around.  Yet… Windows won’t touch it…. and people wonder why I bag Microsoft.

If anyone knows of a solution to this gem (that doesn’t involve replacing the hardware or OS) I’m all ears.

David Abbott a.k.a. dabbott (homepage, stats, bugs)
Podcast 66 All About Me (November 21, 2009, 00:22 UTC)

perl
In this podcast comprookie talks about Gentoo and podcast procrastination.

LINKS:
SSH access to cvs.gentoo.org
http://www.gentoo.org/proj/en/infrastructure/cvs-sshkeys.xml
cvs
http://www-mrsrl.stanford.edu/~brian/cvstutorial/
http://www.gentoo.org/doc/en/cvs-tutorial.xml
git
http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html
perl-overlay
http://git.overlays.gentoo.org/gitweb/?p=proj/perl-overlay.git;a=summary
tove
http://cia.vc/stats/author/tove
Michele Beltrame
http://www.cattlegrid.info/
Kent Fredric
http://kent-fredric.fox.geek.nz/v1
Gentoo GuideXML
http://www.gentoo.org/doc/en/xml-guide.xml
Gorg
http://gentoo.neysx.org/mystuff/gorg/gorg.xml
Gentoo Tips
http://gentoo-pr.org/

irc network freenode channel #linuxcrazy

Download

ogg

mp3

November 20, 2009
Kenneth Prugh a.k.a. ken69267 (homepage, stats, bugs)
Quirks with Opera (November 20, 2009, 23:31 UTC)

So I’ve been a long time Opera user, but lately some bugs have really started to agitate me and are killing my user experience.

The first bug is Opera is unable to open certain long URL’s from the commandline, approximately if the URL is 86 characters or longer. This was fixed awhile ago in the Windows version of Opera, but it seems it never got corrected in the Linux builds. This causes me to be greatly annoyed as applications can no longer pass long URLs to Opera to be opened. Most notably in my case is links inside my email client. I click those links expecting Opera to happily open them, but all I get is no response. Manually copying and pasting links into Opera from email is a royal pain and has tempted me to try Chromium a bit more full time. I submitted a bug report about it to Opera but we will see if that changes anything. If it doesn’t get fixed soon I’ll have to switch to just maintain my sanity of clicking URLs.

The second bug is flash freezes all the time in Opera. This is incredibly annoying when I’m watching something on Hulu. The show will be playing fine and then suddenly the video will freeze, but the sound will keep playing. This doesn’t seem to occur in other browsers such as chromium or arora. Based on that, I’d assume its an Opera bug but I can’t be sure. Either way it’s quite annoying. I can’t tell if it was a recent Opera update or flash update that introduced this behavior though.

Hoping the next Opera beta/rc fixes at the least my url length problem

B2evolution upgraded to 3.3.2 Part II (November 20, 2009, 15:13 UTC)

Well it turns out that I need more caffeine. Today I fixed the issues I had yesterday after the upgrade to B2evoltuion 3.3.2.

It turns out that PHP error logging was disabled on the server, thus I didn't get to see the error PHP was throwing. Stupid me:-/
b2evolution-3.3.2 needs PHP with ctype support, which is simply enabled with the corresponding USE-flag. The error PHP was throwing was:

[Fri Nov 20 09:57:11 2009] [error] [client 208.115.111.247] PHP Fatal error: Call to undefined function ctype_space() in /var/www/site/htdocs/inc/_core/_misc.funcs.php on line 779

The funny thing is that apparently B2evolution is not using PHP ctype support for all posts, but only some posts (ie. with URLS). Thus making debuggin all the more fun. On top of that B2evolution now prerenders pages eventhough caching is disabled. Oh the fun of debugging.

Also I had a funny problem during the upgrade of the B2evolution MySQL tables. For future reference I'll post the details here as well. The installer threw this one:

Additional information about this error:
MySQL error!
Can't create table './b2evo/#sql-7735_1.frm' (errno: 135)(Errno=1005)
Your query:
ALTER TABLE evo_items__item ENGINE=innodb

The MySQL docs lists errno 135 as no space left in the record file and suggests way to fix this here.

At first I misintepreted the proposed solution but it simply turned out that I had to change the following line in MySQL my.cnf:

innodb_data_file_path = ibdata1:10M:autoextend:max:256M

I simply had to increase max.

Now it's time to actually see what new features B2evolution 3.3.x has...

Amarok-2.2.0/1 and >=binutils-2.20 (November 20, 2009, 03:28 UTC)

I've just bumped media-sound/amarok in the tree to 2.2.1-r1 which includes some missing deps.
Even though 2.2.1 hit the tree before the official release, I'm a few days behind in the bump and unmasking it - the mask should be out when you read this.
Unfortunately, amarok-2.2.0 and amarok-2.2.1 segfault on start when built with >=binutils-2.20 even though they have no issue starting with >=binutils-2.20 if built with a previous version of binutils - see bug #290662 for more details.
While the issue isn't solved, here is a quick workaround:

# emerge -1 =binutils-2.19.1-r1 && emerge -1 amarok && emerge -1 binutils

November 19, 2009
Diego E. Pettenò a.k.a. flameeyes (homepage, stats, bugs)
The routed network broadcast problem (November 19, 2009, 22:27 UTC)

Fragment of my topology

You might remember my network diagram that has shown you the absurd setup I have at home to connec tall the rooms where computers are located. Since then, something was reduced, and indeed now the network section between my bedroom and the office is over the usual Ethernet (should be Gigabit, but something doesn’t look right) cable. This actually should also reduce the power consume at home since the old Powerline adaptors were still an extra powered appliance; the main reason why I replaced the, though, was that the green LEDs definitely bothered me while trying to sleep, and at the same time, speed was quite an issue with some files’ streaming.

The result is that only two media are used here: WiFi and cabled Ethernet; unfortunately, I still lack a way to connect Yamato and Deep Space 9 (the router) via Ethernet directly, so they are connected via a standard infrastructure WiFi. This is not really exceptional, in the sense that the connection between them is not very stable (I use an ath9k card on Yamato, with 2.6.32rc7 kernel), and when I’m downloading stuff with bittorrent or similar, I need to restart the network connections about once every five minutes to keep it going properly, which you can guess is not that fun.

Now unfortunately there is one problem here, which I ignored for quite a while but I cannot ignore any longer (because I finally got the table I needed to play with Unreal Tournament 3 with my PlayStation 3!): the cabled ethernet segments fail to get UPnP support.

The whole network inside a single Class B IP range (172.28.0.0/16), fractioned into four main subnetworks (direct, and behind Yamato, known and unknown computers, they have different filters on the firewall) by the DHCP server running on Deep Space 9 (for simplicity, Yamato is the only box in the network to have a static IP address, in an unused subnetwork range together with Deep Space 9, beside the router/DHCP server itself). Yamato has two interfaces enabled: wlan0 which connects to the AP and then to DS9, and br0 which is the bridge of the remaining interfaces (eth0 and eth1 for the cabled network segments – the latter I only bring up when I need more ports for work devices – and vde0 for the virtual networks). Here start the problem: while a WiFi network is usually akin to a switched network, and of course my cabled segment is also switched, the two together are not switched but routed together, by Yamato which is a second router in the network.

Of course I built DS9 to reduce the load of Yamato (even though my original planning involved linking the cabled with that through a another, very long, cable), so the services are currently mostly running on DS9 rather than Yamato: DHCP server, DNS server, UPnP server and so on. The problem is that almost all the “zeroconf” kind of services, which include not only Apple’s Bonjour protocol, but UPnP and DHCP as well use the UDP transport and the broadcast address to look for the servers. And UDP broadcast only works within switched networks, not routed ones.

The obvious solution in these cases, which is more or less the only solution you’ll ever read proposed around when people ask about broadcast repeaters, is to use bridging instead of routing to merge the two networks together; a switch is, after all, just a multi-port bridge, so the result is again a switched network. Unfortunately this brings two issues with it: the first is that you effectively lose the boundary between the two networks, even when that was very transparent, like I’d like it to be, the filtering can still be useful for some things; the latter is that bridging WLAN interfaces is complex and pretty much suboptimal.

The problem with bridging WLAN is that putting the network card in promiscuous mode is not enough: the access point by default only sends over the air the PDUs whose destination is an associated mac address. And telling the access point to send all the PDUs might not be good either; while in my setup the problem is relatively small (the only two devices connected via Ethernet to DS9 are the AP and the Siemens VoIP phone — the Linux bridge software will still understand to only send the VoIP phone data to the connected network card and the rest to the AP), it doesn’t look like a very good long-term solution.

To solve part of the problem, at least the most common part of it, both ISC DHCP and Avahi provide support for transparently join two routed networks that would otherwise be isolated: dhcrelay and Avahi’s refector. The former is not just a simple repeater of DHCP requests, but it also adds a “circuit-id” to the requests, so that requests coming from behind it are tagged and can be treated differently (this is how I handle differently the clients behind Yamato — of course those have to get to a subnet that is routed through Yamato); the latter just picks up the service broadcasts and copy them to the various interfaces it listens on… but neither is perfect.

With dhcrelay the problem is deep inside the way it has been implemented: it has to listen on both the interface the requests will come from, and that where the responses come from… and it doesn’t discriminate between them; this means in the case of Yamato that I have to listen to both br0 and wlan0, but then the requests sent by the clients on WiFi will still reach the relay and would be sent back to DS9 through the relay; for this reason the “circuit-id” contains the interface the request came from, so I only check for that id to be br0 instead of just checking if it exists, before deciding how to divide the clients. The alternative is using iptables to filter the requests from the wlan0 interface, but let’s leave that for a moment.

The problem with Avahi seems more to be a bug, or rather an untested corner case; I have found no way to stop Linux from issuing link-local IPv6 addresses to the interfaces that result “up”; this unfortunately means that eth0, vde0 and br0 all have their IPv6 address… so the broadcasts coming from wlan0 are reflected on all three of them, and all the clients connected to the cabled (or virtual) segment will receive the broadcast twice. This wouldn’t be much of an issue if Apple’s compuers didn’t decide to rename themselves to “Whatever (2)” when they felt somebody else was using their hostname in the network. I should speak with Lennart about it but I haven’t had time to deal with that just yet.

There remains a third protocol there that I found no solution for yet: UPnP; with UPnP the problem is relatively easy: SSDP uses UDP broadcasts on port 1900 to find the router, before talking directly with it, so the only thing that I’d be needing is a repeater over that particular port. The best solution to me would have been using iptables directly, but since that’s not implemented for what I can see, I guess I’ll end up either writing my own UDP repeater, or look for something working, and properly written. If somebody has a clue about that, I’d be happy to hear the solutions.

Interestingly enough, UPnP during my analysis proven to be the only protocol I’m interested in that actually could be just re-broadcasted with a generic repeater; for DHCP, I need to discern proxied requests to assign them to properly routed subnetworks; for Bonjour, the port wouldn’t be free for a repeater since Avahi itself would be using it to begin with.

So bottom-line, I’d have three needs that somebody might want to help me with: get a better dhcrelay the current implementation sucks in more ways than a few, starting for the not being able to specify which is the input and which the output interface, or the lack of a configurable circuit-id string; fix the Avahi IPv6 reflector over bridged network, although I have no idea how (alternative: find a way to tell Linux/OpenRC not to issue a link-local IPv6 address to the interfaces); write a generic UDP broadcast repeater so that UPnP can work with a routed network — the last one is what I’ll probably work on tomorrow so I can get the PS3 to pass through the ports with DS9.

B2evolution upgraded to 3.3.2 (sort of) (November 19, 2009, 21:51 UTC)

After a stupid MySQL mistake I got b2evolution upgraded to 3.3.2. However it seems there is some problem in the rendering code, causing rendering to suddenly stop. So far I've hunted it down to being the last part of the function render in
inc/plugins/model/_plugins.class.php (line 1295 to 1327):


1272 function render( & $content, $renderers, $format, $params, $event_prefix = 'Render' )
...
1295 foreach( $renderer_Plugins as $loop_RendererPlugin )
1296 { // Go through whole list of renders
1297 // echo ' ',$loop_RendererPlugin->code, ':';
1298
1299 #return "Test";
1300 #$this->call_method( $loop_RendererPlugin->ID, $event, $params );
1301 switch( $loop_RendererPlugin->apply_rendering )
1302 {
1303 case 'stealth':
1304 case 'always':
1305 // echo 'FORCED ';
1306 $this->call_method( $loop_RendererPlugin->ID, $event, $params );
1307 break;
1308
1309 case 'opt-out':
1310 case 'opt-in':
1311 case 'lazy':
1312 if( in_array( $loop_RendererPlugin->code, $renderers ) )
1313 { // Option is activated
1314 // echo 'OPT ';
1315 $this->call_method( $loop_RendererPlugin->ID, $event, $par ams );
1316 }
1317 // else echo 'NOOPT ';
1318 break;
1319
1320 case 'never':
1321 // echo 'NEVER ';
1322 break; // STOP, don't render, go to next renderer
1323 }
1324 }
1325
1326 return $content;
1327 }

Seems like the above code is trying to determine wether to render stuff, disabling causes some rendering glitches but at least something is being displayed. But I'm not yet sure why it actually dies.

Kernel testing request 2.6.31 (November 19, 2009, 09:19 UTC)

Another testing request. Kernel 2.6.31 is planned to be stabled soon on all architectures. Hereby I now ask users on stable x86 systems to upgrade to gentoo-sources 2.6.31-r6 or vanilla-sources 2.6.31.6 and report back to me in all cases (failure or success). The other arches appreciate tests, too, but I can't speak for them. Thanks in advance.

Alex Alexander a.k.a. wired (homepage, stats, bugs)

So… qt-*-4.6.0_rc1 is now in the portage tree, masked (since its not a final release) and you can begin testing your shiny Qt applications with it.

But there’s a catch.

4.6.0_rc1 is not binary compatible with 4.6.0_beta1. [1]
This means that if you’re upgrading from 4.6.0_beta1 you have to rebuild every single app depending on qt-*, or they won’t start at all. This obviously includes all of KDE 4.

You can get portage to do that by using a command like this:
*update* it seems some shells didn’t like the old command, so I’ve updated it:

emerge -av1 $(for i in $(qlist -IC x11-libs/qt-); do equery -q d $i | grep -v 'x11-libs/qt-' | sed "s/^/=/"; done)

Note that this command assumes your system is up-to-date. If some installed packages don’t have ebuilds available for their version anymore, you’ll have to resolve that manually (probably by removing them and rerunning the command).

You’ll find equery in app-portage/gentoolkit and qlist in app-portage/portage-utils.

You don’t need to do this if you’re upgrading from Qt 4.5.3 (although you should). You’ll also be safe if you upgrade from 4.5.3 to 4.6.0 final when the time comes.

Portage will warn you about this when you upgrade qt-core to 4.6.0_rc1:

* Messages for package x11-libs/qt-core-4.6.0_rc1:

*
* Binary compatibility broke between 4.6.0_beta1 and 4.6.0_rc1.
* If you are upgrading from 4.6.0_beta1, you’ll have to
* re-emerge everything that depends on Qt.
* Use the following command:
*
* emerge -av1 $(for pkg in $(equery -q d \
* $(qlist -IC x11-libs/qt-) | grep -v “x11-libs/qt-” |
* sort -u); do echo “=$pkg”; done)
*
* YOU’VE BEEN WARNED
*

But users (my user side as well :p) tend to ignore ewarns from time to time ;)

Happy rebuilding!

[1] http://labs.trolltech.com/blogs/2009/11/12/bc-break-in-46-against-previous-46/

November 18, 2009
Patrick Lauer a.k.a. bonsaikitten (homepage, stats, bugs)
CPU Hotswapping and how to disable processors (November 18, 2009, 23:43 UTC)

Here's something awesome I found mostly by accident:
In recent kernels the support for hotswapping CPUs works on x86/amd64 architectures. I stumbled over it in the 2.6.32 menuconfig and couldn't wonder if it actually works. So I had a look and found this gem:

# cat /proc/interrupts | grep CPU
            CPU0       CPU1       CPU2       CPU3
Very boring, 4 processors.
echo 0 > /sys/devices/system/cpu/cpu3/online
And we just knocked out one!
We see that in dmesg:
kvm: disabling virtualization on CPU3                                                                                                                       
CPU 3 is now offline
Hmm, are you thinking what I'm thinking?
kvm: disabling virtualization on CPU2                                                                                                                       
CPU 2 is now offline                                                                                                                                        
kvm: disabling virtualization on CPU1                                                                                                                       
CPU 1 is now offline                                                                                                                                        
SMP alternatives: switching to UP code
Wheeee. I just castrated it to a single core! I actually didn't check if the kernel lets me take CPU0 offline. That would be hilarious. Anyway ...
echo  > /sys/devices/system/cpu/cpu1/online
And we just gained a CPU:
SMP alternatives: switching to SMP code                                                                                                                     
Booting processor 1 APIC 0x1 ip 0x6000                                                                                                                      
Initializing CPU#1                                                                                                                                          
Calibrating delay using timer specific routine.. 5200.20 BogoMIPS (lpj=10400418)                                                                            
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)                                                                                           
CPU: L2 Cache: 512K (64 bytes/line)                                                                                                                         
CPU 1/0x1 -> Node 0                                                                                                                                         
CPU: Physical Processor ID: 0                                                                                                                               
CPU: Processor Core ID: 1                                                                                                                                   
CPU1: AMD Phenom(tm) 9950 Quad-Core Processor stepping 03                                                                                                   
checking TSC synchronization [CPU#0 -> CPU#1]: passed.                                                                                                      
kvm: enabling virtualization on CPU1 
This is seriously wicked. Now I just need to figure out how to bolt that onto powermanagement so that the machine knocks out cores when idle and powersaves. Linux never gets boring ...

Diego E. Pettenò a.k.a. flameeyes (homepage, stats, bugs)
What distributions want (November 18, 2009, 12:58 UTC)

Or A 101 lesson on how to ensure that your software package is available to the distribution users (which, incidentally, are the Linux users; while already the conglomerate Linux marketshare is pretty low when compared with Windows and OS X, the marketshare of not-really-distributions like Slackware or Linux from scratch is probably so trivial that you don’t have to care about them most of the time. That, and their users are usually not so much scared about installing stuff by themselves.

I’m posting this quickie because I’d like to tell one other thing to Ryan… yes, you are a drama queen. And you proven it right with your latest rant and it really upsets me that instead of trying to understand the problem your solution seems to be closing yourslef even more inside your little world. It upsets me because I can see you as a capable programmer and I’d prefer your capacity being used for something that people can benefit from, rather than wasted on stuff pointless, like FatELF.

The fact that instead of trying to understand the technical points that me and others made, and tell us why you think they are not good enough, you’re just closing yourself further. By saying that “lots of people talked about it” you’re just proving what you’re looking for: fame and glory. Without actual substantial results to back it up. Just an hint: the people who matters aren’t those who continue saying “FatELF will make distributions useless, will make it possible to develop cross-platform software, will solve the world’s hunger”; the people who matters are those that review FatELF for its technical side, and most of us already deemed it pointless; I already explained what I think about it.

Any ISV that thinks FatELF will solve their cross-distribution or cross-architecture problems have no idea what an ELF file is; they don’t really understand the whole situation at all. I’m pretty sure there are such ISV out there… but I wouldn’t really look forward for them to decide what to put inside the kernel and the other projects.

Do you want your software (your games) to be available to as many people as possible? Start working with the freaking distributions! You don’t need to have mastered all the possible package managers, you don’t even need to know about any of them directly, but you got to listen if packagers ask for some changes. If a packager asks you to unbundle a library or allow selecting between bundled or system library; do it, they have their reasons and they know how to deal with eventual incompatibilities. If a packager asks you to either change your installation structure or at least make it flexible, that’s because with a very few exceptions, distributions are fine with following the FHS.

Take a look to “Distributions-friendly packages”: part 1 part 2 and part 3 .

But no, Ryan’s solution here is again taking cheap shots to distributions and packagers, without actually noticing that, after more than ten years distributions are not going away .

Oh and the first commenter who will try to say again that FatELF is the solution, can please tell me how’s that going to ensure that the people writing the code will understand the difference between little endian and big endian? Or that the size of a pointer is not always 32-bit? Count that in as a captcha; if you cannot give me an answer to those two questions, your comment supporting FatELF as The Solution will be deleted.

Watching Freeview HD DVB-T MPEG-4 channels (November 18, 2009, 07:29 UTC)

Last week before catching the H1N1 I had the chance to play around a bit with DVB-T.

Here in .dk the analog TV signal was turned off at the start of the month, and we got some new digital freeview channels. Most notably DR HD broadcasting unencrypted 720p movies in MPEG-4.

The MPEG-4 encoding can be a bit tricky since TVs from just a few years back (ie. both my Panasonic TVs) only support MPEG-2 decoding, so a lot of people had to buy new hardware MPEG-4 decoders. However not wanting yet another power consuming device I decided to solve it on the cheap (not speaking of yet another redundant remote control).

First off old DVB-T PCI cards/USB sticks should generally be able to receive DVB-T broadcasts in any encoding, including MPEG-4. I just had an old Hauppauge Nova-T DVB-T card lying around in the basement, what luck:)

I've collected a few notes here that might be helpful for others.

First figure out what kernel options you'll have to enable.

Getting the right channel list:

emerge linuxtv-dvb-apps linuxtv-dvb-firmware w_scan
w_scan -x > dvb_frequencies
dvbscan dvb_frequencies > channels.conf

Now watch the first channel with: vlc channels.conf. Note if vlc doesn't play anything you might have messed up the generation of channels.conf as I somehow managed to do the first time.

Then record the HD content:

gnutv -channels channels.conf -out file drhd.mp4 "DR HD"

Now come the not so great part, it seems like the MPEG-4 used by DR HD is not well supported in Linux or more precisely the HE-AAC audio codec.

Current stable vlc-1.0.2 seems to be slow to tune in to the programs and audio is choppy and stastistics show dropped audio frames. Upgrading to vlc-1.0.3 seems to make it tune in faster, but the audio is still choppy.

Changing the "Caching value in ms" to 1000 seems to have solved most of the stuttering problems (Preferences -> All -> Input/Codec -> Access modules -> DVB).

Current stable ffmpeg-0.5-r1 only shows 3 streams and refuses to encode:

Stream #0.0[0x907]: Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 50 tbr, 90k tbn, 100 tbc
Stream #0.1[0x91f](dan): Subtitle: dvbsub
Stream #0.2[0x920](dan): Subtitle: dvbsub

However upgrading ffmpeg to 0.5_p20373, results in it detecting another 2 streams:

Stream #0.0[0x7ef]: Data: 0x0006
Stream #0.1[0x907]: Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 50 tbr, 90k tbn, 100 tbc
Stream #0.2[0x911](dan): Data: 0x0011
Stream #0.3[0x91f](dan): Subtitle: dvbsub
Stream #0.4[0x920](dan): Subtitle: dvbsub

And the live ffmpeg ebuild actually detects the audio stream, but hangs when encoding:

Stream #0.0[0x7ef](dan): Subtitle: 0x0006
Stream #0.1[0x907]: Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 50 tbr, 90k tbn, 100 tbc
Stream #0.2[0x911](dan): Audio: aac, 44100 Hz, 2 channels, s16, 450 kb/s
Stream #0.3[0x91f](dan): Subtitle: dvbsub
Stream #0.4[0x920](dan): Subtitle: dvbsub

So for now I can watch DR HD on one computer, but playback on my PCH-110 is not working either as the audio codec HE-AAC seems to be unsupported too. Later on I might just install a MythTV backend and do some automatic transcoding to the troublesome devices. That is once proper HE-AAC support is in ffmpeg:-)

November 17, 2009
Patrick Lauer a.k.a. bonsaikitten (homepage, stats, bugs)
"Random crashes" with glibc 2.10 and 2.11 (November 17, 2009, 19:15 UTC)

As documented in this bug (which mirrors an upstream bug here there's a bug in glibc 2.10 and 2.11, and this one seems to be easy to hit. Multithreaded apps "randomly" crash with "Invalid free" and other confusing errors. A hackaround is to unset or empty the environment variable "MALLOC_CHECK_". For me setting MALLOC_CHECK_="" before starting some of the affected packages seems to completely hide the error, now we can only hope that the gentoo glibc gets this patch soon.

Awesome portage options (November 17, 2009, 18:47 UTC)

For the rest of this post I'll only consider portage 2.2. Most options are in portage 2.1 already, but I'm a lazy bum, so I don't compare to see what's what.

You can set PORTAGE_DEFAULT_OPS in /etc/make.conf, but if you add --ask you will have trouble running emerge from a script. --ignore-default-opts disables those defaults so you can run emerge --sync in a cronjob again.

Sets are really great, --list-sets shows you which are available. Just have a look, there are some nice ones - "security", "installed", "unavailable" ... they can help streamline some tasks. I find their names quite self-explanatory.

If you want to put something into the world file without rebuilding it use --noreplace, and if you want to remove it again use --deselect.

--nospinner disables that funny rotating spinner thingy so you can save precious bandwidth when connected remotely, and --quiet hides most of the output, which can be nice if you don't want to be hypnotized by scrolling compile output. For the OCD crowd --quiet-build might be nice as it doesn't show the compile output on console, but redirects to logfiles. --changelog is neat for seeing the log messages for that update, this often shows fixed bugs or other issues you might care about. --color with a parameter y or n toggles colorized output. And of course --alphabetical. The horror of unsorted output!

Sometimes people are confused that emerge -e world tries to update packages that emerge -uND world misses. That is usually caused by build-only dependencies. --with-bdeps=y and --complete-graph are good options to modify portage behaviour.

If you're on a fast machine and in a hurry you can try to set --jobs X with a reasonable value of X. Think about memory needs and such before setting it to infinity minus one! With --keep-going it gets really easy to not have the whole process stopped on the first failed package. This is not without issues, but it avoids the --resume --skipfirst in a loop tricks. If --jobs seems to hard to calibrate to you --load-average=LOAD may help to limit it.

For the scripters --columns might be nice, it tweaks the output to be more script friendly.

Support for binary packages has grown considerably, there's support for local (-k / -K) and remote (-g / -G ) binpkg repositories. And you can --buildpkg and --buildpkgonly to create them (they are stored in PKGDIR). There's --binpkg-respect-use to only install the packages that have useflags set the same as the current configuration - it's a very powerful mechanism if you need to support Gentoo on multiple machines and don't want to compile that much.

I hope y'all enjoyed this little lesson in RTFM, there's plenty of other options to discover. Don't be afraid of the documentation, it doesn't bite and makes your life easier :)

Eine Stunde Bildungsstreik (November 17, 2009, 11:47 UTC)

In diesen Minuten demonstrieren (mehr oder weniger) fünftausend Schüler und Studenten auf der Spandauer Straße in Berlin. Ich war auch am Roten Rathaus, doch meine Ideen von besserer Bildung (frühzeitig, durchlässig, besser ausgestattet, kostenfrei) sprachen dort nur wenige aus. “Kritik am Bildungssystem ist immer auch Kritik am Kapitalismus!” schallt es. Man verkauft T-Shirts und protestiert, die Universitäten seien “Steigbügelhalter des neoliberalen Systems”. Ich fühle mich instrumentalisiert von den Ideologen am Mikrofon.

Ich kann mich entscheiden, im “schwarzen Block” der Autonomen, im roten Block der Kommunisten, bei den Antifaschisten oder den Antikapitalisten mitzulaufen. Dann doch lieber zur S-Bahn.

Mounir Lamouri a.k.a. volkmar (homepage, stats, bugs)
Lecture about Mozilla at INSA Lyon (November 17, 2009, 10:11 UTC)

Last Friday (November 13 2009), I gave a lecture/conference titled Mozilla and its technologies in the context of the Mozilla Campus Reps program. Indeed, I am a Mozilla Campus Rep at INSA Lyon, my university.

The lecture had four parts. First of them was a classic presentation of Mozilla and Netscape history. Then, a presentation of some Mozilla projects like applications, libraries, tools and especially Mozilla Labs. The real technical part was about the Mozilla Platform (Gecko, XUL, ...). To complete, the Open Web and web standards.

Everything went well. I planned to give a 30-minute to 45-minute length lecture with 15 minutes of questions but it looks like I had a lot of things to say and I talked one hour long. Fortunately, there wasn't a lot of questions so I finished in time.
The most important is I had only good feedback which is pretty cool for a first experience !

The Mozilla campus Reps program wasn't able to send me a swag pack so I asked to Tristan Nitot (Mozilla Europe) who seemed delighted to help. Paul Rouget (Mozilla Europe too) also helped with some advices. A big thank you to both of them !

Finally, you can download my slides. You can also get the source files here. The slides have been made in latex with beamer. All this stuff is available in Creative Common Attribution 3.0 (CC-BY).
The slides aren't really verbose. They have been made only to get attention of the audience and let them follow me. I've spoke about a lot of subjects that are not even mentioned like JavaScript benchmarking, V8, FOSS work-flow... I find it more dynamic and -I hope- less boring for the audience.

It was a nice experience and I'm glad to have spread Firefox and Mozilla !

November 16, 2009
Diego E. Pettenò a.k.a. flameeyes (homepage, stats, bugs)
Configuration file ordeal (November 16, 2009, 18:46 UTC)

Following another lscube problem discussion, here comes another post of the series “why do I prefer one solution over another”, that I started thinking about after I ripped off the plugins interface from the current feng master branch (to be developed separately and brought back to the master once the interface is properly defined, and chosen and so on).

While ripping off the plugin I had to deal with the configuration file parser that we have in feng right now, which was heavily borrowed out of lighttpd. Luca’s idea has been that, since the scope of lighttpd and feng are quite similar, we could share the same configuration file syntax, and even code. Unfortunately, this ended up having a couple of problems: the first is that, as usual for Luca’s idea, they look so much forward that we only implement a small percentage of the right now: vhost, conditionals and all that stuff is something we not even barely start scratching them; the other is that the code used for the parser has changed quite a bit in lighttpd in the mean time; I think the original one was hand-tailored, then they moved to lemon-based parsing (the parser used by SQLite3) and now they are toying with Ragel to rewrite the mess that it’s now.

But in particular why is the current system a mess? Well the first problem is not really in the syntax itself, but rather n the current (lemon-based, I think) implementation: it uses a big table, which is relatively fine, but then it also references its entries with their direct array index, which means any change in the list of entries require to change all the following ones; not the nicest piece of code I had to deal with.

The second problem is also intrinsic in the way the code was written, partly by hand: there are some objects implemented for the configuration file parsing, like high-level pointer arrays and strings, which reinvent what glib already provides. These objects increase the size and complexity of our code with the only good reason that lighttpd does not use glib and thus have a need for them. Decoupling the configuration file code from these objects is non-trivial, and will diverge the code to the point we wouldn’t be able to share it with lighttpd any longer.

Now there is a certain complexity tied to the way we want the configuration file to behave: we want to have conditionals and blocks, and includes, similar to lighttpd and Apache configuration files, like most software that deals with servers and locations. The simplest configuration file formats don’t work very well for this task (for instance I don’t like the way Cherokee configuration files are written; they are designed to work with a web administration package, rather than hand-edited by an human). This kind of solution usually gets solved in two main ways: either by inventing your own syntax or using something like XML for the configuration file.

While XML makes it relatively easy to parse a configuration file (relatively because it’s just moving the issue of complexity; parsing XML is not usually faster than other configuration file syntax, it’s actually slower and much more complex; but generic XML parsers exist already that make the parsing easier for the final software), it definitely makes it obnoxious to read and edit by hand, which is why I don’t think XML is a good format for configuration files.

My favourite format for configuration file is the “good old” INI-like file format; I call it INI-like but I admit I’m not sure if Windows’s INI files were the ones using it first; on the other hand, the same format is nowadays used by so much stuff, including freedesktop’s .desktop files, and there are multiple well-tested parsers for it, including some (very limited, to be honest) support in glib itself.

Now, it’s obviously a no-brainer that the INI format is nowhere near powerful as the language used by Apache configuration files, or by lighttpd, since it bears no conditionals, and only has structure in the sense of sections, variables and values. But it’s exactly in this kind of simplicity that I think it might work well for feng nonetheless, given it works for git as well.

While the lighttpd syntax contains all kind of conditionals that allow setting particular limits based on virtual host, location, and generic headers, it’s quite likely that for feng we can reduce this to a tighter subset of conditions.

What we already have some small predisposition for is per-virtualhost settings, which are handled with an array (right now a single entry) of specific configuration structures, each of which is initialised first with the default value of the configuration and then overridden with the loaded configuration, and then support for some global non-replaceable settings. How does that fare with an INI-like configuration file? Well, to me it’s quite easy to think of it in this terms:

[global]
user = feng
group = feng
logdir = /var/log/feng
errorlog = error.log
sctp = on
listen = 0.0.0.0:554 localhost:8554

[default]
accesslog = access.log

[localhost]
accesslog =
accesslog_syslog = on

[127.0.0.1]
alias = localhost

[my.vhost.tld]
accesslog = my_access.log

[his.vhost.tld]
accesslog = /var/log/feng/another_access.log

This obviously is just a quick draft of how it could be achieved and does not mean that it should be achieved this way at all; but it’s just to say that maybe we should be looking into some alternative, even though keeping syntax-compatibility with lighttpd is a nice feature, it shouldn’t condition the extra complexity we’re currently seeing!

Patrick Lauer a.k.a. bonsaikitten (homepage, stats, bugs)
Configuring Portage (November 16, 2009, 15:29 UTC)

Few people take the time to actually read through the documentation, but if you have some time to spare "man make.conf" is a great read.
For example you can pre-set some CLI options like --ask or --verbose in EMERGE_DEFAULT_OPTS so you never have to type them again. Especially the FEATURES variable has some interesting bits:

buildpkg builds packages of everything
buildsyspkg builds only packages of the system set, which is awesome for recovery and doesn't take much space.

keepwork keeps the $WORKDIR and can be quite useful for debugging purposes (but not for general use)
noclean leaves even more there.
fail-clean is the opposite, it always wipes the build directories. Useful if you build on a small (but fast) disk or tmpfs.
installsources installs all the package sources to /usr/src/debug/, which can be used for debugging, but eats lots of space. Together with splitdebug it offers some really great debugging convenience.
test-fail-continue helps when you just want to have the tests run for logging purposes, but don't want the package to not be installed if tests fail. Most people won't need this.

split-elog and split-log features are quite interesting if you do logging.

Logging can be very nice to have, and portage has lots of configuration options for it.
PORTAGE_ELOG_SYSTEM defines how the log data is sent, be it through syslog, email or just to a file. Or completely custom?
And you can do combinations like PORTAGE_ELOG_SYSTEM="mail:warn,error syslog:* save".
PORTAGE_ELOG_CLASSES defines what you want to log - warnings, errors, qa warnings, everything ... it's your choice.

Of course there are lots of other configuration options:
PORTAGE_NICENESS can be useful when you don't want portage to interfere with anything else.
PORTAGE_IONICE_COMMAND needs ionice (or an equivalent tool) and can be used to make the disk activity of portage a bit less distracting. Both features may increase the time needed to install things, but will make portage more benign so you can still do things while it runs.

Also you can change almost all directories - PORTDIR, DISTDIR, PKGDIR and so on. This allows you to make portage behave a lot more like you want it (unless the defaults satisfy you already ...)

Diego E. Pettenò a.k.a. flameeyes (homepage, stats, bugs)
Virtualisation WTF once again. (November 16, 2009, 10:36 UTC)

To test some more RTSP clients I’ve been working to get more virtual machines available in my system; to do so I first extended the space available in my system by connecting one more half-a-terabyte hard drive (removing the DVD burner from Yamato), and then started again working on a proper init script for KVM/Qemu (as Pavel already asked me before, and provided me with an example).

Speaking about it, if somebody were to send my way an USB or FireWire DVD burner I’d be probably quite happy; while I have other three DVD burners around – iMac, MacBook Pro and Compaq laptop – having one on Yamato from time to time came out useful; not necessary, so wasting a SATA port for it was not really a good idea after all, but still useful.

I started writing a simple script before leaving for my vacation and extended it a bit more yesterday. But in line with the usual virtualisation woes the results aren’t excessively positive:

  • FreeBSD 8 pre-releases no longer seem to kernel panic when run in qemu (the last beta I tried did, the latest rc available does not); on the other hand it does seem to have problems with the default network (it works if started after boot but not at boot); it works fine with e1000;
  • NetBSD still is a desperate case: with qemu (and VDE) no network seem to work; e1000 is not even recognised, while the others end up timing out, silently or not; this is without ACPI enabled, if I do enable ACPI, no network card seems to be detected; with KVM, it freezes, no matter with or without ACPI, during boot up;
  • Pavel already suggested a method using socat and the monitor socket for qemu to shut down the VM cleanly; the shutdown request will cause the qemu or kvm instance to send the ACPI signal (if configured!) and then it would shut down cleanly… the problem is that the method requires socat, which is quite broken (even in the 2-beta branch).

Let me explain what the problem is with socat: its build system tries to identify the size of various POD types that are used by the code; to do so it uses some autoconf trickery, the -Werror switch and relies on pointer comparison to work with two POD types of the same size, even if different. Guess what? That’s no longer the case. A warning sign was already present: the code started failing some time ago when -Wall was added to the flags, so the ebuild strips it. Does that tell you something?

I looked into sanitizing the test; the proper solution would be to use run-test, rather than build-tests, for what I can see; but even if that’s possible, it’s quite intrusive and it breaks cross-compilation. So I went to look why the thing really needed to find the equivalents… and the result is that the code is definitely messy. It’s designed to work on pre-standard systems, and keep compatible with so many different operating systems that fixing the build system up is going to require quite a bit of code hacking as well.

It would be much easier if netcat supported handling of unix local sockets, but no implementation I have used seem to. My solution to this problem is to replace socat with something else; based on a scripting language, such as Perl so that’s as portable, and at the same time less prone to problems like those socat is facing now. I asked a few people to see if they can write up a replacement, hopefully this will bring us a decent replacement so we can kill that.

So if you’re interested in having a vm init script that works with Gentoo without having to deal with stuff like libvirt and so on, then you should probably find a way to coordinate all together and get a socat replacement done.

November 15, 2009
Patrick Lauer a.k.a. bonsaikitten (homepage, stats, bugs)
HOWTO Radeon (opensource) + R700 + 3D / OpenGL (November 15, 2009, 18:08 UTC)

Finally I stopped slacking for long enough to fix a few bits of my desktop, and the results are grrrrrrreat.
Now I have (OpenGL!) full effects in KDE4 as opposed to the slightly less bouncy XRender-accelerated thingies before. Performance is pretty awesome (but then the HD4650 shouldn't even notice those few effects).
What you need:

~arch install (I'm not going to care to find out what minimal versions you need)
x11 overlay
a really recent kernel
And with really recent I mean "at least 2.6.32". At the time of writing that hasn't been released, so a 2.6.32-rc6 git-sources has to substitute for me. From what I've read you might have to disable framebuffer for things to work well, but as I'm usually seeing text mode for ~30 seconds every month I don't care enough to find out. I'm lazy!
In the kernel config you need to enable DRM and especially the radeon bits. Device Drivers -> Graphics -> Direct Rendering Manager is the "most important" bit there.
The following packages were suggested in a few places, I have no idea if that is the minimal set. But you'll have to unmask:
>=x11-libs/libdrm-9999
>=media-libs/mesa-9999
>=x11-base/xorg-server-9999
>=x11-proto/fixesproto-9999
>=x11-proto/xextproto-9999
>=x11-proto/xf86vidmodeproto-9999
>=x11-proto/renderproto-9999
>=x11-proto/recordproto-9999
>=x11-proto/inputproto-9999
>=x11-proto/xineramaproto-9999
>=x11-proto/bigreqsproto-9999
>=x11-proto/xf86driproto-9999
>=x11-proto/xf86dgaproto-9999
>=x11-proto/xcmiscproto-9999
>=x11-base/xorg-drivers-9999
>=x11-libs/libXext-9999
>=x11-libs/libXi-9999
>=x11-proto/xproto-9999
>=x11-libs/libX11-9999
>=x11-libs/libxcb-9999
>=x11-proto/xcb-proto-9999
Now go forth and rebuild all your shiny new packages.
If you managed to build that and reboot your new kernel things should look pretty much as before. The only "obvious" hints I've found to test are the output of glxinfo (has changed quite a bit) and that KDE4 allows me to use OpenGL now. And maybe the wobbly windows effect was a giveaway :)

I'm positively surprised that things have progressed this far, and I'm happy to finally be able to use more of my graphics card :)

EDIT: Seems that this is not the minimal set of packages and configuration needed. Some people suggested -9999 packages of mesa + libdrm + xf86-video-ati only. If that works even better :)

Kenneth Prugh a.k.a. ken69267 (homepage, stats, bugs)
Eclipse with GTK+ 2.18 (November 15, 2009, 17:34 UTC)

Lately I noticed Eclipse having some issues such as not being able to confirm certain dialogs or press certain buttons. It made Eclipse extremely annoying to use. Before I found the relatively easy fix, I was reduced to clicking the button and the pressing enter to move past the screen, not exactly a desirable scenario to perform every 5 minutes if for example your exporting jars from Eclipse.

The fix is pretty easy, just add GDK_NATIVE_WINDOWS=1 to Eclipse’s launch script.

For example, here’s my launch script:

File: /usr/local/bin/eclipse

#!/bin/sh
cd /home/ken/eclipse && GDK_NATIVE_WINDOWS=1 exec ./eclipse $@ 

November 14, 2009
Kenneth Prugh a.k.a. ken69267 (homepage, stats, bugs)
The KDE adventure continues (November 14, 2009, 00:19 UTC)

So I’m still using KDE surprisingly, and actually liking it. Finally got most of my keybinds working so I can work efficiently. I found KDE’s ability to easily pass key presses to a specific window quite nifty, allowing me to easily map all my multimedia keys to work with XMMS.

I got around to installing kbluetooth yesterday and was absolutely shocked at the result. My bluetooth actually worked. This was extremely pleasant for me as I have been disappointed with bluetooth in Gentoo for a long time. I effortlessly was able to send a file over to my phone and it just worked after confirming on my phone’s end.

Still using Claws Mail for email for now until I find a better alternative one day. Kmail pulls in too many dependencies for my taste currently and it doesn’t seem to offer anything that would cause me to switch over from claws mail.

I have to say kwin’s “Present all windows” feature thats normally the upper left edge of the screen is extremely nifty. Reminds me a lot of OS X’s expose feature. Handy for when I have 50 terminals floating around and I don’t feel like alt-tabbing for the next 10 minutes searching for the correct terminal or whatever program I’m using.

Klipper has been causing some love/hate so far. While its history function is extremely nifty, I sometimes find myself copying something only to find I can’t paste it for whatever reason. I enabled the option to keep the selection/copy buffer synchronized and the annoyance seems to have disappeared for the most part.

Plasma has been a bit crashy on and off so far. Seems to be something to do with the notification area. I wouldn’t find it as annoying if my applications would rejoin the newly spawned panel instead of floating about on the workspace. NetworkManager, Opera, and Claws Mail being the most notorious for not rejoining the panel after it crashes. Of course, the ideal solution would be to fix the crashing all together. I haven’t figured out a reliable way to introduce the crash yet, so I’m hoping it will just go away on its own.

November 13, 2009
Looking for a padawan (November 13, 2009, 23:58 UTC)

http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml?part=1&chap=2

Title says it all. It's pretty obvious that gnome team can't currently keep up with the income of new bugs (especially a lot of unexpected 2.26 bugs) and I keep being split between my gnome duties and maintenance of various other stuff (notably freedesktop that no-one seems to care about these days). So I need one, two or more guys/gals that want to get their hands a bit dirty. If you feel up to it, just come and say hello on #gentoo-desktop, if I'm not around, probably other gnome herd members will be waiting for you :).

Doug Goldstein a.k.a. cardoe (homepage, stats, bugs)
NVIDIA legacy drivers update (November 13, 2009, 20:57 UTC)

As I previously noted, the 96.x.y and 173.x.y series had not seen any updates yet for xorg-server 1.7 compatibility, however today that has changed. They both saw updates late last night from NVIDIA and now those drivers are available in the Gentoo tree so feel free to give them a try.

Patrick Lauer a.k.a. bonsaikitten (homepage, stats, bugs)
The OOM Killer (and how to make it less annoying) (November 13, 2009, 12:20 UTC)

The linux kernel has lots of complexity in memory management. Swap allows to go beyond the size of real memory to allow applications to use "more". But still, at some point, you might exhaust all available memory.

The next application that requests memory (usually through malloc) will cause the kernel some trouble. It can either deny the request (which often causes hilarious results in the application) or free some memory somehow. (About the hilarity: Many coders assume that a malloc will always succeed. If it doesn't you'll get interesting misbehaviour like segmentation faults. Lots of fun to debug ...)

So, how does the kernel free memory? It can't just ask some other processes to surrender some. But it can terminate processes! It's a terminally stupid idea, but it's so stupid that it often works. And the handler for that is, obviously, the out-of-memory killer.
There's a very nice bit of information hidden in /proc to tell you what the oom-killer would do if it had to run now.

/proc/$pid/oom_score
contains the current value of the process with PID $pid. You could just compare them and see who is good and who is bad. And you can adjust it - a rarely used protection, but it might just help the oom-killer to act more sanely and less psychotic.
/proc/$pid/oom_adj
That's a numerical value used as a multiplier. Valid values are in the range -16 to +15, plus the special value -17, which disables oom-killing altogether for this process. The heuristic is quite complex, to quote:
The process to be killed in an out-of-memory situation is selected among all others
based on its badness score. This value equals the original memory size of the process
and is then updated according to its CPU time (utime + stime) and the
run time (uptime - start time). The longer it runs the smaller is the score.
Badness score is divided by the square root of the CPU time and then by
the double square root of the run time.
Swapped out tasks are killed first. Half of each child's memory size is added to
the parent's score if they do not share the same memory. Thus forking servers
are the prime candidates to be killed. Having only one 'hungry' child will make
parent less preferable than the child.
On some systems you might not ever want to have the oom-killer strike. It's just a hilariously bad idea to kill random processes. And you can even disable it:

The sysctl vm.overcommit_memory variable (also represented in /proc/sys/vm/overcommit_memory ) defines the behaviour. To summarize: 0 is default, where the kernel uses some heuristics and allows allocating more memory than available (which is what can trigger the nice OOM assassin) 1 always allows overcommit. The documentation is a bit sparse, but it seems to be tuned by vm.overcommit_ratio, which gives a percentage to overcommit (unless I misread that). And finally a value of 2 disables overcommitting and limits application memory to the size of (swap + ram*ratio). This means that worst case you'll disallow a request when there's still physical memory available, but you'll never have to trigger Mr.OOM-Killer.

What is best? That depends on what you do and how you want things to fail. overcommit_memory = 2 will cause memory allocation failures, but your machine will always be "alive". overcommit_memory = 0 might allow to allocate more memory, but you risk getting any process killed by oom. Sucks to have sshd killed on a server - maybe it's not the best idea to have a psychotic process assassin? But it's your choice, so do what you want to do :)

November 12, 2009
Josh Saddler a.k.a. nightmorph (homepage, stats, bugs)
November Xfce desktop (November 12, 2009, 19:23 UTC)

Decided I'd shake things up a bit this month, after keeping the same look for nearly three straight months. Thus, I present:

Grunge

icons: Area o.43
gtk+: Rele (Rezlooks engine)
xfwm4: Rezlooks-gtk (yes, it is confusingly named)
background: rassilon

It's grungy, but rather sleek. Surprisingly easy on the eyes, too. The lighter elements of the Rele gtk+ theme aren't overpoweringly white, but are just light enough to provide a decent contrast to the generally darker Area icons.

There's also an uncluttered version here.

I've been looking to assemble themes that are grungy, and themes that are warmer-yet-wintry. I like winter. I still have some hope that these 80 degree weeks will come to an end soon. We're almost to the middle of November. Surely we'll see gray sky, cool breezes, and maybe even rain here in SoCal at some point, right? Right? Well, if not, I can at least put it on my desktop.

November 11, 2009
Alex Alexander a.k.a. wired (homepage, stats, bugs)

As most of you know, KDE 3.5 is getting off the Gentoo train for various reasons mentioned elsewhere (in short: security, lack of upstream interest).

Some people are still using it though and they have been asking how they can keep it on their system, without emerge screaming each time they try to update world.

I’m writing this post to guide those people (you? :) ) on how they can achieve that.

1. Adding the kde-sunset overlay
Perhaps the most important thing you need to remember is that the ebuilds will be completely removed from the tree, so you need to add an overlay called kde-sunset to portage which contains a copy of most of them.

To add the overlay you need to have layman with git USE flag enabled:

USE="git" emerge -av layman

make sure you add the git USE flag in your package.use or make.conf :)

you can then use layman to install the overlay:

layman -f
layman -a kde-sunset

if this is your first time using layman, you’ll have to add the following line @ the end of your make.conf:

source /usr/local/portage/layman/make.conf

you can keep the overlay updated by running:

layman -s kde-sunset

2. KDE 3.5 is masked (this is necessary only while KDE 3.5 is still in tree)
Now we have the overlay, but until KDE 3.5 is completely wiped off the tree, there’s a mask to warn users about it.
Portage will scream about this mask each time you try to emerge so you need to unmask KDE 3.5 manually.

There are two (and a half) ways to do this:
a1) if your package.unmask is a folder, symlink the unmask file from kde-sunset to /etc/portage/package.unmask/

ln -s /usr/local/portage/layman/kde-sunset/Documentation/package.unmask/kde-3.5 /etc/portage/package.unmask/kde-3.5

a2) if your package.unmask is not a folder you can append the file (but you’ll have to update it manually)

cat /usr/local/portage/layman/kde-sunset/Documentation/package.unmask/kde-3.5 >> /etc/portage/package.unmask

b) if you don’t like all that, you can emerge autounmask

emerge -av autounmask

and ask it to unmask stuff for you – note that autounmask doesn’t like :slot and will only work with -version

autounmask kde-meta-3.5

3. I don’t want KDE 4 (yet)
So all is great now but portage wants to install KDE 4 when you emerge world.
This is happening because KDE 4 went stable recently and portage thinks you want to upgrade (you should btw ;) ).
To fix this one we need to tell portage that we actually want the 3.5 version of KDE and we don’t care about 4.

we need to edit /var/lib/portage/world and add a version (or a slot) to every kde 3.5 app we have in there.

* be careful with this file *

for example, lets say that you installed kde 3.5 using the kde-meta ebuild.
if you open /var/lib/portage/world you’ll find a line saying

kde-base/kde-meta

you need to add :3.5 which is the 3.5 slot, or -3.5.10 which is the version (or both, version first) at the end. if you add the version, you’ll have to prepend a “=” as well.

the line should now read:

kde-base/kde-meta:3.5

do this for each KDE 3.5 app you have in the world file. If you’re unsure of the slot/version, use eix packagename to find it out.

4. All systems go

emerge -avDuN world

^^ this should now be clean of any KDE 4 traces and mask warnings :)

If you have any issues or are interested in maintaining kde-sunset, you may visit us over @ #gentoo-kde in freenode’s IRC network or drop us an email at kde _at_ gentoo _dot_ org. We’ll do our best to help you :)

Maybe after reading this post your KDE 3 installation will last a bit longer ;)

Enjoy and see you w/ KDE 4 soon :P

Josh Saddler a.k.a. nightmorph (homepage, stats, bugs)
Tabu Audio Player (November 11, 2009, 14:50 UTC)

Even though I'm currently sick with H1N1, also known as swine flu, this morning I was feeling well enough to write an ebuild for an interesting media app I found: Tabu Audio Player. It's an interesting player -- while it still needs some translation work into English, it's simple and has an appealing UI drawn by Cairo.

It had only a single configure option, "debug," and a very short list of dependencies, so I figured it'd be a simple ebuild to write, right?

Wrong! Turns out that after a half-hours' worth of poking at configure.ac, the package's check for --disable-debug/--enable-debug was completely broken. If you explicitly passed --disable-debug, like "-debug" in IUSE, then it would enable the debug build every time. Thanks to rej and a3li on IRC for nailing this problem down; they were really helpful.

a3li also shared his solution for the same problem in one of his packages, so I used it in my ebuild to ensure that "debug" works properly as a USE variable.

Meanwhile, I sent a bug report to upstream asking for a smarter debug check. I also asked for CFLAGS="-02" to be removed from Makefile.am, that way folks are free to use their own -O levels without having to resort to using sed on the Makefile, as I had to in the ebuild.

Speaking of which: I have an ebuild for Tabu 2.1 waiting for you in my devspace, if you'd like to try it out.

November 10, 2009
Patrick Lauer a.k.a. bonsaikitten (homepage, stats, bugs)
The mistery of swappiness (November 10, 2009, 19:18 UTC)

For the longest time operating systems have been able to handle swap. In short swap extends physical memory with slow diskspace so that applications can use more memory than there is available.
On most unix systems the swap is in a dedicated partition because that has the lowest overhead. Plus you don't risk running out of diskspace when you want to swap, so things are quite predictable and nice. Linux has a very nice knob you can turn to affect the swap policy. It will not avoid swapping (in some situations you will have to), but it will affect how and when swap is used. That knob is /proc/sys/vm/swappiness.

The kernel default is a value of 60. The value can be between 0 and 100 and is effectively a percentage. It is used roughly in the following way:
If all available memory is exhausted (application memory, buffers and filesystem cache) and any memory allocation is requested the kernel needs to free a few pages of memory. It can either swap out application memory or drop some filesystem cache. The "swappiness" knob affects the probability which one is chosen.
This means that at a swappiness of 0 the kernel will try to never swap out a process, and at 100 it will try to always swap out processes and keep the filesystem cache intact. So with the default, if you use more than ca. 40% of your memory for applications and the rest is used as filesystem cache it will already start swapping a bit. The hilarious result is that you may up swapping a lot with lots of memory left - think of a machine with 64GB RAM! If you try to use 32G memory you'll be in swap hell.
That default might have been good with machines with less than 256MB RAM, but with current desktops and servers it is usually not optimal.
Now you might be tempted to tune it down to 0. Avoid swap. Swap is slow. All is good?
Not quite. At 0 your machine will try to avoid swapping until the last moment. Then it will have killed all filesystem cache (so every file operation will hit the disks) and in addition to that you start swapping like a madman. The result is usually a "swap storm" that hits very sudden. At the point where you might need some performance your machine doesn't provide it and might just be unresponsive to your input for a few minutes.
The other end (a value near 100) might make sense for a file server, but then it might be cheaper to just not run extra services on a machine that is very loaded already. I don't really see a usecase for a swappiness of 100 except maybe on machines that are very memory-limited.
On my desktop I've found a swappiness of 10-20 to be the sweet spot. This means that when 80%+ of memory is used by applications the machine will start swapping, but it's a more gradual hit and not an instant kill. And because there's still some filesystem cache the responsiveness for starting new processes (like a login shell ;) ) is still high enough to allow recovery from this pessimal system state.
Still your goal for optimal performance should be to avoid swapping. Disk access is slower than RAM by a factor of 1000 or more!
I've seen servers achieve roughly double the throughput with the right swappiness value - it can avoid an expensive hardware upgrade. Of course that's not all the tuning advice I have, so if you wish to discuss that feel free to send me a mail and maybe I can prove to you that Gentoo is the fastest penguin out there ...

Maybe I should discuss the OOM killer too - most people have seen it, but few know who it is and why he goes killing processes.

Allgemeiner Deutscher Autowahnsinn (November 10, 2009, 18:27 UTC)

Der ADAC ist schon ein lustiger Verein. Bezeichnet sich selbst als größter Fahrradfahrerclub, da als größter Verein Deutschlands eine entsprechende Menge von potenziellen Fahrradfahrern vorhanden ist. Mit derselben Begründung wäre auch eine Selbstbezeichnung als Deutschlands größte Alkoholiker- oder Prostatakrebsvereinigung denkbar. Der Schein des selbstlosen Einsatzes für die Menschheit ist ebenso ein geschicktes Marketinginstrument, denn der ADAC ist nichts anderes als ein Wirtschaftsunternehmen. Gegen Geldverdienen ist prinzipiell nichts einzuwenden, aber wenn es auf so verlogene Weise geschieht wie bei diesem Automobilclub geschieht stinkt es.

Zwei Beispiele: Zum einen die »Gelben Engel«. Verteilen so uneigennützig kleine Geschenke an im Stau steckende Menschen. Wer genug Geld bezahlt, kann seine Produkte als eben genau diese Geschenke an den Mann bringen, in Form von Produktmustern oder verdeckter Werbung. Zum anderen das eigenartige Geschäftsgebahren. Zu Beginn meiner Volljährigkeit war ich Mitglied des ADAC, bis eines Tages der Postmann eine Nachnahmesendung brachte, die ich nicht bestellt hatte. Nach der Verweigerung der Annahme frage ich beim ADAC nach, was es damit auf sich hätte. Antwort: »Das ist eine Versicherung, die wir Ihnen einfach mal anbieten wollen.« Vielleicht gibt es Menschen, die unbesehen eine unbestellte Nachnahmesendung an der Haustür bezahlen, die hätten dann eine ungewollte Versicherung. Ähnlich verfuhr der ADAC mit Atlanten. Bei Nichtgefallen soll man sich selber um die Rücksendung kümmern, andernfalls bezahlen. Für mich der Grund aus diesem Verein auszutreten.

Wer meint, ohne ADAC bei einer Panne aufgeschmissen zu sein, sollte mal einen Blick in seinen Pkw-Versicherungsvertrag werfen. Viele enthalten eine Mobilitätsgarantie, die genau diese Leistungen abdeckt, man besitzt also hier eventuell eine Doppelabdeckung. Krankenrücktransporte aus dem Ausland und ähnliche Leistungen bei der Plus-Mitgliedschaft decken andere Anbieter günstiger ab. Sei es die eigene Krankenversicherung mit einem kleinen Zusatzobulus oder separate Anbieter wie R+V bei jeder genossenschaftlichen Bank. Wer den Maltesern Geld spendet, kriegt diese Leistung sowieso obendrauf.

Wegen der stark autozentrierten und umweltpolitisch fragwürdigen Ansichten ist es sowieso ratsam, sich von diesem rückwärtsgewandten Club fernzuhalten.

Alex Alexander a.k.a. wired (homepage, stats, bugs)

Starting today, Greek Gentoo users have their own mailing list to discuss stuff and ask questions: gentoo-user-el.

For more info on how to subscribe, please visit http://www.gentoo.org/main/en/lists.xml

The list is not mentioned there yet, but you can use it normally.

[the rest of this message is in greek]

Θέλετε να συζητήσετε για το αγαπημένο σας Gentoo στα ελληνικά αλλά δεν βρίσκετε κάποια official mailing list?

Πλέον μπορείτε να χρησιμοποιείτε την νέα λίστα gentoo-user-el, που δημιουργήθηκε για να καλύψει αυτό ακριβώς το κενό.

Για να γραφτείτε, αρκεί να στείλετε ένα κενό e-mail στην διεύθυνση gentoo-user-el+subscribe _at_ lists.gentoo.org και να ακολουθήσετε τις οδηγίες.

Μπορείτε να συνομιλήσετε με άλλους χρήστες του Gentoo αλλά και με Gentoo Developers (είμαστε 6 Έλληνες) και να λύσετε κάθε πρόβλημα και απορία σας :)

Για περισσότερες πληροφορίες σχετικά με τις λίστες του Gentoo μπορείτε να επισκευτείτε την σελίδα http://www.gentoo.org/main/en/lists.xml

Η λίστα δεν αναφέρεται ακόμα σε αυτήν την σελίδα (πρέπει να ενημερωθεί από το κατάλληλο team), αλλά εσείς μπορείτε να γραφτείτε και να την χρησιμοποιήσετε κανονικά.

Επίσης μπορείτε να διαβάσετε το περιεχόμενο της λίστας πηγαίνοντας στην διεύθυνση http://archives.gentoo.org/gentoo-user-el/

Όπως βλέπετε εγώ έκανα την αρχή: http://archives.gentoo.org/gentoo-user-el/msg_4eb9364bded3280c9685356b9e0445d0.xml

Εάν είστε από αυτούς που προτιμούν πιο άμεση επικοινωνία, μπορείτε να επισκευτείτε το κανάλι #gentoo-el στο freenode irc network: http://java.freenode.net/index.php?channel=gentoo-el

Τα λέμε εκεί :)

Diego E. Pettenò a.k.a. flameeyes (homepage, stats, bugs)
Vacation time for me! (November 10, 2009, 07:47 UTC)

Just wanted everybody to note that I have a flight to catch for London today at lunch time; will be away till Sunday and will come back for all kind of work on Monday, so if you write me in the mean time I won’t be around, most likely.

Kenneth Prugh a.k.a. ken69267 (homepage, stats, bugs)
Testing the KDE4 waters (November 10, 2009, 03:21 UTC)

So after some frustrations with GNOME and various applications flat out breaking, I decided I might as well give KDE4 another chance to redeem itself. Installation was fairly easy, but I was plagued by a problem from the start. I had a dock like application of unknown origin that was starting with my new KDE session. After a lot of hunting down I discovered it wasn’t a dock at all, but actually gnome-do. I had completely forgotten that gnome-do could look like a fancy dock. After sorting that out I decided to keep the dock at the top of the screen at the smallest size which autohides itself when needed.

Next up was getting all those keybinds and shortcuts sorted out. My suspend and lock laptop keys weren’t working nor was my volume keys. This was somewhat disappointing that it wasn’t automagically working, but I managed to mostly solve my issues. Input Actions under system preferences let me do the bulk of my configuration. Volume Up and Volume Down keys were recognized by KDE, so I simply bound them to the commands amixer set Master 5%+ and amixer set Master 5%+. I was surprised to find out that my suspend key was also recognized by KDE, but I needed a way to actually make it suspend. After poking around with qdbus I discovered it was relatively simple. All what was needed was binding the key to this command: /usr/bin/qdbus --system org.freedesktop.DeviceKit.Power /org/freedesktop/DeviceKit/Power org.freedesktop.DeviceKit.Power.Suspend. Relatively easy after poking around the qdbusviewer which let me visually stumble around dbus commands.

I then proceeded to try to bind my lock screen key, but KDE complained that the key was “unsupported” or something similar. Well, it was time to finally figure out all that acpid magic. After reading the man page and a bit of googling, I banged out a relatively simple script to lock the screen for me.

/etc/acpi/events/lock:

event=ibm/hotkey HKEY 00000080 00001002

action=/etc/acpi/actions/lock.sh

/etc/acpi/actions/lock.sh:

#!/bin/sh

export DISPLAY=":0.0"

su ken -c "/usr/bin/qdbus org.kde.krunner /ScreenSaver Lock"

logger "acpi locked screen"

Probably not the best way of doing it, but it works for now so I’m relatively happy.

Didn’t need to do much for adjusting urxvt for KDE4, just added transparency to my existing config so it would fit in. Currently using claws-mail but might try out kmail later this week. I only needed to emerge x11-themes/gtk-engines-qt to make GTK not look so hideous that the default it without styling. Would be nice if I could get some kind of on screen display for when I change the brightness with my laptop keys, I’ll have to look into that a bit later.

Thats all I can remember for now, will need to explore KDE4 a bit more to see if it can replace GNOME full time.

November 09, 2009
Steve Dibb a.k.a. beandog (homepage, stats, bugs)
my hardware closet (November 09, 2009, 18:15 UTC)

I finally called and cancelled my Comcast cable TV subscription this weekend.  I've been meaning to do it forever.  I can't remember the last time I was even watching TV on a regular basis, though I think it was probably around 6 months or so.  With my media center up and running so well, I generally just watch something from there or rent it on Netflix these days.

Now, the question is, what to do with all the hardware?  I have three (yes, THREE) Tivos with unlimited subscriptions.  Two of them are the klunky one-tuner first generation of the Series2 boxes, but the third is an HD Tivo, which is very nice.  I could sell them, but considering the price I shelled out (for the HD one, at least, savvy consumerism got me the first two for real cheap ... under $50 each) I hate to part with it.  I keep thinking I'll get cable again some day, and by that year sometime in the future, I'll pat myself proudly on the back and say, "way to hang on to a piece of hardware for so long!  Now go get the compressed air."

I'm cursed with the pack rat mentality, though.  I hang onto stuff far too long in the oft chance that someday, I *might* need it.  On Saturday, I woke up a little early, and as is normally the weekend routine, I get the feeling that I must turn my entire world around by 11 a.m.  This time, it was the closet in my living room which has the distinction of dedicating 85% of its storage space to electronics that I might need sometime before the next century.  The other 15% is a mix between my puzzles, dust bunnies, air, movie posters, and movie t-shirts.  I have a red t-shirt promoting "Searching for Bobby Fischer", I kid you not... I'll even take pictures to prove it.

I swear I've been carrying this collection of cables and equipment for at least ten years or so, probably ever since I haven't been living at home.  It never really bothered me that I don't use most of the technology anymore (or ever, really), you just never know when you're going to need a floppy IDE cable.  Really!  I'm all about being prepared, but for the wrong circumstances.  I can just see the day when I'll be someone's hero for helping them be able to flash the BIOS on their 15-year old Dell desktop.  I still have the floppies to put it on, too.

So, this weekend was the closet's demise.  I grabbed a bunch of plastic bags from the kitchen (the bachelor's preferred method of storage and transportation for all things non-essential) and started filling them up with stuff.  My method of deciding what to keep and what to throw out was pretty simple: if I couldn't remember the last time I used it, it gets tossed.  Normally it could be times like these that a selective memory can cause problems down the road, but I had so much junk anyway, I don't think it'll cause a problem.  Besides, the memory problems go both ways -- when I do need a new cable or piece of hardware, I can't get mad at myself because I'll have forgotten I used to own one anyway.

All in all, I filled up something like eight to twelve bags of stuff.  I don't remember how many it was, but I do recall that when I took it to the thrift store and started unloading, I had so much stuff that it took two guys to carry it all away, and one of them kept laughing because the stream was endless.  I think most of it was cables.  There were some notable things that I'd been hanging onto for a long time, "just in case," some of which were: my old Gamecube, an 8 GB IDE harddrive, my old home-theater-in-a-box speakers (which were about as powerful and had as much wattage as two light bulbs), three PCMCIA wireless cards, a few wireless USB dongles, and a slew of PCI slot brackets.  I elected to hold onto the floppy drive -- it was a sound investment in 1990, and it's a sound investment today.

That's not really the interesting part, though.  There is still all the stuff that I decided to keep because it held some kind of value, but I don't have the energy or drive to see them through the process of being sold on the secondhand market.  Nothing makes a closet grow quite like a pack rat mentality combined with the laziness of avoiding the hassle of making spare change.  I've still got my Tivos, for instance.  There's an old (now) AMD Athlon64 desktop that is pretty nice -- top of the line of about 5 years ago.  Runs really quiet, too.  Then there's a used Gateway desktop I remember I bought on Craigslist for some reason a while ago, and I've never used.  I'm holding onto that one because it came with Windows, and I might someday want *another* Windows XP Home key, so I can just use that one.  It probably wouldn't work, anyway, but hey ... hope lingers longer than logic.

I almost dragged off my original Xbox to the thrift store, too.  It hasn't been as fun as I'd hoped it would have been, and having one console (PS2) with corded controllers is enough for me.  Plus it's a bit wheezy.  Probably just needs a new fan, or harddrive.  Dunno.  I also decided to keep all my TV tuner cards, even though I never use those either ... especially now without a cable subscription.  One of them was the Plextor external USB one that has MPEG4 hardware encoding (very nice).  I think my brother wanted that one.  Maybe it'll be a nice holiday surprise, as in, I'll be surprised if I manage to make it to the post office before Christmas 2010 to mail it off.

Oh yah, and there's an MSI Mini-ITX motherboard with an Intel Atom that I'll probably never try to revive, but I hate to donate it since I still think I could get at least $20 for it somewhere.  Then there's my new Motorola RAZR phone that I used for about a week before I switched to Verizon.  That's gotta be worth something.  I've also got two MP3 players, an iPod Nano and a Sansa something, each 4 GB ... too small for me to do anything with ... but I'll hang onto them just because.  I think I still have a portable Sony Walkman cassette player, too.

In actuality, I'd like to get rid of all of the stuff, provided I can do it through a simple way ... meaning I don't have to do any work, and non-creepy people flock to my house with cash in hand.  I doubt it'd happen, but hey, if you live near Salt Lake and are interested ... drop me a line.  That's about as proactive as I'm gonna get about it.  If you ever need your BIOS flashed, too, I could probably do that as well.

November 08, 2009
Diego E. Pettenò a.k.a. flameeyes (homepage, stats, bugs)
Can we be not ready for a technology? (November 08, 2009, 20:40 UTC)

İsmail is definitely finding me some topics to write about lately… this time it was in relation to a tweet of mine ranting on about Wave’s futility, I think I should elaborate a bit about this topic.

Regarding the Wave rant, which adds to my first impression posted a few weeks ago, I think things are starting to go downhill. From one side, more and more people started having Google Wave so you can find people to talk with, from the other, of the Waves I received, only one was actually interesting (but still nothing that makes me feel like Wave was useful), the rest falls into two categories: from one side, you get the ping tests, which I admit I also caused – because obviously the first thing you do in something like Wave is pinging somebody you feel comfortable to talk with – and on the other hand I had three different waves of people… discussing Wave itself.

And you know that there is a problem when the medium is mostly used to discuss itself.

And here is where me and İsmail diverge: for him the problem is that “we’re not ready” for the Wave technology; myself, I think that the phrase “we’re not ready” only can come out of a sci-fi book, and that there is something wrong with the technology if people don’t seem to find a reason to use it at all. But I agree with him when he says that some technologies, like Twitter, would have looked definitely silly and out of place a few years ago. I agree because we have had a perfect example that is not hypothetical at all.

You obviously all do know Apple’s Dashboard, from which even the idea of Plasma for KDE seems to have come from, and from which Microsoft seemingly borrowed heavily for the Vista and Win7 desktop. Do you think Apple was the first to think about that stuff? Think again.

It was 1997, and Microsoft released Internet Explorer 4, showing off the Active Desktop … probably one of the biggest failures in their long-running career. The underlying idea is not far at all from that of Apple’s “revolutionary” Dashboard: pieces of web pages to put on your desktop. At the same time. Microsoft released one of their first free development kits: Visual Basic 5 Control Creation Edition (VB5CCE) that allowed you to learn their VB language, and while you couldn’t compile applications to redistribute, you could compile ActiveX controls, which could in turn be used by the Active Desktop page fragments. Yes, I did use VB5CCE; it was what let me make the jump from the good old QBasic to Windows “programming”.

So, if the whole concept of Dashboard (and Plasma, and so on) makes people so happy now, why did it fail at the time? Well, to use İsmail’s words “we weren’t ready for it”; or to use mine, the infrastructure wasn’t ready. At the time, lots of users were still not connected to any network, especially outside of the US; staying connected costed, a lot, and bandwidth was limited, as were the resources of the computers. Those of us (me included) who at the time had no Internet connection at all, were feeling deprived of resources for something totally useless for them; those who had dial-up Internet connections would feel their bandwidth be eaten up by something they probably didn’t care enough about.

Who was at fault here? Us for not wanting such nonsense running on our already underpowered computers, or Microsoft for wanting to push out a technology without proper infrastructure support? Given the way Apple was acclaimed when they brought Dashboard to their computers, I’d say the latter, and they actually paid the price of pushing something out a few years too early. Timing might not be everything, but it’s definitely something.

Plugins aren't always a good choice (November 08, 2009, 16:30 UTC)

I’ve been saying this for quite a while, probably one of the most on-topic post has been written a few months ago but there are some indications about it in posts about xine and other again.

I used to be an enthusiast about plugin interfaces; with time, though, I started having more and more doubts about their actual usefulness — it’s a tract I really much like in myself, I’m fine with reconsidering my own positions over time, deciding that I was wrong; it happened before with other things, like KDE (and C++ in general).

It’s not like I’m totally against the use of plugins altogether. I only think that they are expensive in more ways than one, and that their usefulness is often overstated, or tied to other kind of artificial limitations. For instance, dividing a software’s features over multiple plugins makes it easier for the binary distributions to package them, usually: they only have to ship a package with the main body of the software, and many for the plugins (one per plugin might actually be too much so sometimes they might be grouped). This works out pretty well for both the distribution and, usually, the user: the plugins that are not installed will not bring in extra dependencies, they won’t take time to load and they won’t use memory for either code nor data. It basically allows binary distribution to have a flexibility to compare with Gentoo’s USE flags (and similar options in almost any other source-based distribution).

But as I said this comes with costs, that might or might not be worth it in general. For instance, Luca wanted to implement plugins for feng similarly to what Apache and lighttpd have. I can understand his point: let’s not load code for the stuff we don’t have to deal with, which is more or less the same reason why Apache and lighttpd have modules; in the case of feng, if you don’t care about access log, why should you be loading the access load support at all? I can give you a couple of reasons:

  • because the complexity of managing a plugin to deal with the access log (or any other similar task) is higher than just having a piece of static code that handles that;
  • because the overhead of having a plugin loaded just to do that is higher than that of having the static code built in and not enabled into configuration.

The first problem is a result of the way a plugin interface is built: the main body of the software cannot know about its plugins in too specific ways. If the interface is a very generic plugin interface, you add some “hook locations” and then it’s the plugin’s task to find how to do its magic, not the software’s. There are some exceptions to this rule: if you have a plugin interface for handling protocols, like the KIO interface (and I think gvfs has the same) you get the protocol from the URL and call the correct plugin, but even then you’re leaving it to the plugin to deal with doing its magic. You can provide a way for the plugin to tell the main body what it needs and what it can do (like which functions it implements) but even that requires the plugins to be quite autonomous. And that means also being able to take care of allocating and freeing the resources as needed.

The second problem is not only tied to the cost of calling the dynamic linker dynamically to load the plugin and its eventual dependencies (which is a non-trivial amount of work, one has to say), also by the need for having code that deals with finding the modules to load, the loading of those modules, their initialisation, keeping a list of modules to call at any given interface point, and two more points: the PIC problem and the problem of less-than-page-sized segments. This last problem is often ignored, but it’s my main reason to dislike plugins when they are not warranted for other reasons. Given a page size of 4KiB (which is the norm on Linux for what I know), if the code is smaller than that size, it’ll still require a full page (it won’t pack with the rest of the software’s code areas); but at least code is disk-backed (if it’s PIC, of course), it’s worse for what concerns variable data, or variable relocated data, since those are not disk-backed, and it’s not rare that you’d be using a whole page for something like 100 bytes of actual variables.

In the case of the access log module that Luca wrote for feng, the statistics are as such:

flame@yamato feng % size modules/.libs/mod_accesslog.so
   text	   data	    bss	    dec	    hex	filename
   4792	    704	     16	   5512	   1588	modules/.libs/mod_accesslog.so

Which results in two pages (8KiB) for bss and data segments, neither disk-backed, and two disk-backed pages for the executable code (text): 16KiB of addressable memory for a mapping that does not reach 6KiB, it’s a 10KiB overhead, which is much higher than 50%. And that’s the memory overhead alone. The whole overhead, as you might guess at this point, is usually within 12KiB (since you got three segments, and each can have at most one byte less than page size as overhead — it’s actually more complex than this but let’s assume this is true).

It really doesn’t sound like a huge overhead by itself, but you have to always judge it compared to the size of the plugin itself. In the case of feng’s access log, you got a very young plugin that lacks a lot of functionality, so one might say that with the time it’ll be worth it… so I’d like to show you the size statistics for the Apache modules on the very server my blog is hosted. Before doing so, though, I have to remind you one huge difference: feng is built with most optimisations turned off, while Apache is built optimised for size; they are both AMD64 though so the comparison is quite easy.

flame@vanguard ~ $ size /usr/lib64/apache2/modules/*.so | sort -n -k 4
   text	   data	    bss	    dec	    hex	filename
   2529	    792	     16	   3337	    d09	/usr/lib64/apache2/modules/mod_authn_default.so
   2960	    808	     16	   3784	    ec8	/usr/lib64/apache2/modules/mod_authz_user.so
   3499	    856	     16	   4371	   1113	/usr/lib64/apache2/modules/mod_authn_file.so
   3617	    912	     16	   4545	   11c1	/usr/lib64/apache2/modules/mod_env.so
   3773	    808	     24	   4605	   11fd	/usr/lib64/apache2/modules/mod_logio.so
   4035	    888	     16	   4939	   134b	/usr/lib64/apache2/modules/mod_dir.so
   4161	    752	     80	   4993	   1381	/usr/lib64/apache2/modules/mod_unique_id.so
   4136	    888	     16	   5040	   13b0	/usr/lib64/apache2/modules/mod_actions.so
   5129	    952	     24	   6105	   17d9	/usr/lib64/apache2/modules/mod_authz_host.so
   6589	   1056	     16	   7661	   1ded	/usr/lib64/apache2/modules/mod_file_cache.so
   6826	   1024	     16	   7866	   1eba	/usr/lib64/apache2/modules/mod_expires.so
   7367	   1040	     16	   8423	   20e7	/usr/lib64/apache2/modules/mod_setenvif.so
   7519	   1064	     16	   8599	   2197	/usr/lib64/apache2/modules/mod_speling.so
   8583	   1240	     16	   9839	   266f	/usr/lib64/apache2/modules/mod_alias.so
  11006	   1168	     16	  12190	   2f9e	/usr/lib64/apache2/modules/mod_filter.so
  12269	   1184	     32	  13485	   34ad	/usr/lib64/apache2/modules/mod_headers.so
  12521	   1672	     24	  14217	   3789	/usr/lib64/apache2/modules/mod_mime.so
  15935	   1312	     16	  17263	   436f	/usr/lib64/apache2/modules/mod_deflate.so
  18150	   1392	    224	  19766	   4d36	/usr/lib64/apache2/modules/mod_log_config.so
  18358	   2040	     16	  20414	   4fbe	/usr/lib64/apache2/modules/mod_mime_magic.so
  18996	   1544	     48	  20588	   506c	/usr/lib64/apache2/modules/mod_cgi.so
  20406	   1592	     32	  22030	   560e	/usr/lib64/apache2/modules/mod_mem_cache.so
  22593	   1504	    152	  24249	   5eb9	/usr/lib64/apache2/modules/mod_auth_digest.so
  26494	   1376	     16	  27886	   6cee	/usr/lib64/apache2/modules/mod_negotiation.so
  27576	   1800	     64	  29440	   7300	/usr/lib64/apache2/modules/mod_cache.so
  54299	   2096	     80	  56475	   dc9b	/usr/lib64/apache2/modules/mod_rewrite.so
 268867	  13152	     80	 282099	  44df3	/usr/lib64/apache2/modules/mod_security2.so
 288868	  11520	    280	 300668	  4967c	/usr/lib64/apache2/modules/mod_passenger.so

The list is ordered for size of the whole plugin (summed up, not counting padding); the last three positions are definitely unsurprisingly, although it surprises me the sheer size of the two that are not part of Apache itself (and I start to wonder whether they link something in statically that I missed). The fact that the rewrite module was likely the most complex plugin in Apache’s distribution never left me.

As you can see, almost all plugins have vast overhead especially for what concerns the bss segment (all of them have at least 16 bytes used, and that warrants a whole page for them: 4080 bytes wasted each); the data segment is also interesting: only the two external ones have more than a page worth of variables (which also is suspicious to me). When all the plugins are loaded (like they most likely are right now as well on my server) there are at least 100KiB of overhead; just for the sheer fact that these are plugins and thus have their own address space. Might not sound like a lot of overhead indeed, since Apache is requesting so much memory already, especially with Passenger running, but it definitely doesn’t sound like a good thing for embedded systems.

Now I have no doubt that a lot of people like the fact that Apache has all of those as plugins as they can then use the same Apache build across different configurations without risking to have in memory more code and data than it’s actually needed, but is that right? While it’s obvious that it would be impossible to drop the plugin interface from Apache (since it’s used by third-party developers, more on that later), I would be glad if it was possible to build in the modules that come with Apache (given I can already choose which ones to build or not in Gentoo). Of course I also am using Apache with two configurations, and for instance the other one does not use the authentication system for anything, and this one is not using CGI, but is the overhead caused by the rest of modules worth the hassle, given that Apache already has a way to not initialise the unused built-ins?

I named above “third party developers” but I have to say now that it wasn’t really a proper definition, since it’s not just what third parties would do, it might very well be the original developers who might want to make use of plugins to develop separate projects for some (complex) features, and have different release handling altogether. For uses like that, the cost of plugins is often justifiable; and I am definitely not against having a plugin interface in feng. My main beef is when the plugins are created for functions that are part of the basic featureset of a software.

Another unfortunately not uncommon problem with plugins is that the interface might be skewed by bad design, like the case was (and is) for xine: when trying to open a file, it has to pass through all the plugins, so it loads all of them into memory, together with the libraries they depend on, to ask each of them to test the current file; since plugins cannot really be properly unloaded (and it’s not just a xine limitation) the memory will still be used, the libraries will still be mapped into memory (and relocated, causing copy on write, and thus, more memory) and at least half the point of using plugins has gone away (the ability to only load the code that is actually going to be used). Of course you’re left with the chance that an ABI break does not kill the whole program, but just the plugin, but that’s a very little advantage, given the cost involved in plugins handling. And the way xine was designed, it was definitely impossible to have third-party plugins developed properly.

And to finish off, I said before that plugins cannot be cleanly unloaded: the problem is not only that it’s difficult to have proper cleanup functions for plugins themselves (since often the allocated resources are stored within state variables), but also because some libraries (used as dependency) have no cleanup altogether, and they rely (erroneously) on the fact that they won’t be unloaded. And even when they know they could be unloaded, the PulseAudio libraries, for instance, have to remain loaded because there is no proper way to clean up Thread-Local Storage variables (and a re-load would be quite a problem). Which drives away another point of using plugins.

I leave the rest to you.

Zhang Le a.k.a. r0bertz (homepage, stats, bugs)
Update on building mips64el cross toolchain (November 08, 2009, 08:48 UTC)

1. git clone git://www.gentoo-cn.org/var/git/loongson.git

2. Don't include loongson overlay's directory directly in your PORTDIR_OVERLAY. But in your own overlay, like /usr/local/portage, create symlinks pointing to sys-devel/ and sys-libs/glibc in loongson overlay. This is because you may not want to install packages from loongson overlay in your host machine. Also you need to make sure your own overlay is the first overlay containing binutils/gcc/glibc in your PORTDIR_OVERLAYS list. You may check the value of this list using command:

portageq envvar PORTDIR_OVERLAY
3. Then, just run crossdev -t mips64el-unknown-linux-gnu. This command installed the following components on my host machine:
  • linux-headers-2.6.27-r2 from portage.
  • binutils-2.19.1-r1 from loongson overlay.
  • gcc-4.4.2 from portage. The gcc in loongson overlay currently is just a symlink to portage gcc.
  • glibc-2.9_p2009042 from loongson overlay. However if you build the toolchain now, glibc-2.10.1 will be installed instead, I just updated it.

November 07, 2009
Steve Dibb a.k.a. beandog (homepage, stats, bugs)
packages website going offline for a while (November 07, 2009, 16:35 UTC)

I've been on a roll to clean house lately, and part of that is simplifying my hardware setup.  One thing that needs to be ripped out completely is my old server, which is getting to be a real pain to maintain.  Mostly it's just my personal stuff on there, but the ebuild packages website is also running on there right now.  Between now and Tuesday, I'm going to take it down since I'm going to be rearranging my hardware setup anyway.  I'm not going to bring the old website back online, either.  The code for the new one is almost complete, and it will use a lot less resources.  There's gonna bet lots of cool stuff on the new one: better feeds, simpler interface, new domain name and hopefully a new design as well.  Oh, and the scripts aren't dependent upon portage anymore, which is the real crutch right now.  I have to run an old version of portage (2.1.4.5) that isn't even in the tree anymore, and it's making updates painful or impossible.

The new site will also run on my dedicated Linode, where I think I've finally correctly managed the apache issues, so that means there will be less arbitrary downtime as I screw around with my box here at home.  I really hate running servers at home that other people are dependent on, because I like the freedom to change things around without affecting anyone.  Right now, the old site is so CPU intensive, that I can't move it over to the VPS.

The code for the new site is much cleaner.  The entire thing is rewritten in OOP classes to access the portage tree, which makes my job incredibly easier.  Not to mention it's a lot faster.  It'll still be a bit before I get it online, but killing it will inspire me to push it along.  I'm tired of having this thing limp around when it's just a dead albatross around my neck right now.  So, farewell.  The new one will be better. :)

Diego E. Pettenò a.k.a. flameeyes (homepage, stats, bugs)
Debating future tinderbox work (November 07, 2009, 14:46 UTC)

I’ve been not working on the tinderbox lately because my “daily job” (which is not really daily) swamped me out badly. Since this week I’m going to London to take some days off, I’ll probably get back to the tinderbox after that.

For the next ride of the tinderbox, there is at least one thing that’s definitely going to be interesting: the new X11R7.5 release means that quite a bit of packages might not build at all since they don’t have the new includes fixed. I found one or two packages with such problems while doing Yamato’s root filesystem rebuild (after glibc 2.11 update).

There is another interesting idea that I should probably toy with: the way the tinderbox works, it tests all non-masked packages; by QA standards, those should not use the network at build time. During my world rebuild this night, network went offline, and one package failed since it tried to wget a piece of source from the network. And it’s not even the first one lately.

Thanks to the fact that my tinderbox uses containers I can easily isolate it out of the network so that it cannot access the network, and then make sure that the ebuilds trying to use the network get their access refused.

The other problem to cope with is the size of the logs and the fact that I still lack an analysis script and thus opening new batches of bugs requires a huge amount of work, especially when it comes to attaching the log and getting some information out of it.

Any suggestion on how to proceed with the tinderbox will definitely be welcome.

Donnie Berkholz a.k.a. dberkholz (homepage, stats, bugs)
links for 2009-11-06 (November 07, 2009, 01:56 UTC)


  • “The Hype Cycle describes the way that new technologies and projects are perceived over time, if they do a good job of handling themselves, going from a technology trigger, inflated expectations, disillusionment, enlightenment, before arriving at “the plateau of productivity” – a state where there is no more hype and the new technology is simply a normal part of our lives.”

     

    The perception over the past few years that Gentoo is dying is in reality Gentoo’s arrival at the plateau of productivity. Hype has gone away and remaining is a distribution with a true niche that fits into the broader Linux ecosystem.

Tagged: communication, gentoo, greatness, pr

November 06, 2009
Steve Dibb a.k.a. beandog (homepage, stats, bugs)
hardware setup (November 06, 2009, 16:01 UTC)

I got woken up this morning at about 5:30 because my server's fan was so loud.  Seriously.  Actually, I think I had trouble sleeping anyway, but it was unusually noisy, and when I woke up, the first thing I thought was, "what the heck is that noise?"  The rear fan in the ATX case of my server is precariously placed, and if the elements don't align quite right, it rattles quite a bit, and that's what happened here.

This is the server that houses all my media files, so I can't really just rip it out and replace it with something else.  It has two 750 GB drives right now which make up my entire library space.

I shut the sucker down for a bit so I could pop it open and see if I could adjust the fan and blow out some of the dust in there.  While it was powered down, it was so quiet in the room, I couldn't believe it.  I forgot how much noise these things make.

Since I was already up, I decided to look into some ways to either reduce the noise pollution or find an alternative storage setup.  I've got a spare Mini-ITX system and a spare external SATA drive enclosure, so I decided to fire that up and see how good my transfer rate would be if I just used external drives with a fanless low-powered Mini-ITX.  By the time I left for work, I was in the middle of transferring a bunch of media files over to the new harddrive, so I guess I'll find out later.  But the transfer rate was at about 8 MB/s, so I think it's safe to say that it'll work out pretty nice.

I'm hoping that this setup will work in the future for my dream scenario: a quiet file server.  I figure if I can buy a few 1.5 TB harddrives, and plug them all into external SATA enclosures, then I should be good to go.

I went ahead and bought a Western Digital Green 1.5 TB harddrive this morning, too, to replace my other drives in the server.  I know the Green line of harddrives isn't the fastest of the line, but I think that, for my circumstances, it'll run just fine.  They run between 5200 and 7200 RPM.  Less speed should mean less heat, which would make me worry not as much about having it as an external drive being passively cooled.  I'm not gonna be using it as the OS, for the Mini, I'm already running that off of a 4GB USB drive, and that runs plenty fast.  The only thing it'll do is just be serving up media over the wired network.  As long as the read speed is decent, I probably won't have any complaints.

vncunused problem with Windows on Xen 3.4.1 (November 06, 2009, 15:09 UTC)

Recently I upgraded a Xen server to 3.4.1 and encountered a strange problem. I've upgraded similar servers before without any problems, but on this one the Windows XP guest complained:

# xm create /etc/xen/winxp.cfg
Using config file "/etc/xen/winxp.cfg".
Error: Domain 'winxp' does not exist.

The log files were quite sparse with information but the relevant sections of xend.log seems to be:

[2009-11-06 15:44:14 5365] WARNING (image:493) domain winxp: device model failure: pid 22777: exited with nonzero status 1; see /var/log/xen/qemu-dm-winxp.log
[2009-11-06 15:44:14 5365] WARNING (XendDomainInfo:1878) Domain has crashed: name=winxp id=20.
[2009-11-06 15:44:14 5365] ERROR (XendDomainInfo:2012) VM winxp restarting too fast (Elapsed time: 0.285470 seconds). Refusing to restart to avoid loops.

And qemu-dm-winxp.log was equally silent about details:

domid: 22
qemu: the number of cpus is 1
config qemu network with xen bridge for tap22.0 xenbr0
Watching /local/domain/0/device-model/22/logdirty/next-active
Watching /local/domain/0/device-model/22/command
qemu_map_cache_init nr_buckets = 10000 size 4194304
shared page at pfn feffd
buffered io page at pfn feffb
Guest uuid = 3ef34fd1-842d-0cbd-9782-29d8d597c36b
Time offset set 0
populating video RAM at ff000000
mapping video RAM from ff000000
Register xen platform.
Done register platform.
xs_read(/vm/3ef34fd1-842d-0cbd-9782-29d8d597c36b/log-throttling): read error
platform_fixed_ioport: changed ro/rw state of ROM memory area. now is rw state.
xs_read(/local/domain/0/device-model/22/xen_extended_power_mgmt): read error
xs_read(): vncpasswd get error. /vm/3ef34fd1-842d-0cbd-9782-29d8d597c36b/vncpasswd.
bind() failed

And only the last line seems to be the problem. Googling a bit turned up this link, which suggest to comment out vncunused = 0 and VOILA the Windows domain now boots again.

Gentoo KDE3 Deprecation Notice (November 06, 2009, 10:03 UTC)

Please turn your KDE radio on, and make sure to increase the volume to its maximum level for this important message.

After multiple setbacks we have finally managed to stabilise KDE4 on both major desktop architectures (amd64 and x86), with other teams to follow.

For this and other reasons as discussed , those of you who still use KDE3 should be seriously considering an upgrade in the near future.

The KDE3 support is being deprecated with immediate effect. This means that ebuilds are dropping KDE3 support where they were broken, or clashing with KDE4.

If you wish to still use KDE3, and you want to help others with having KDE3 around, drop a mail to kde@gentoo.org, where we can give you commit access to the special overlay which will specifically contain only KDE3 packages.
This overlay (named kde-sunset) can be easily used via layman.

Sadly upstream is not supporting KDE3 anymore and we simply lack the manpower to keep support for both (as you might have noticed in the past few months KDE3 has become more and more rusty for which we humbly apologize).

Sorry to bring you the bad news and with hope that KDE4 will suit your needs,

Tomas Chvatal
KDE Teams substituting Lead

KUDOS to Nirbheek Chauhan and David Abbott for helping to put this announcement together and Alec Warner for proofreading it.

November 05, 2009
Alex Alexander a.k.a. wired (homepage, stats, bugs)
KDE in Gentoo, an update (November 05, 2009, 15:22 UTC)

KDE 4.3.3 was released on Tuesday, with ebuilds instantly available to users in the main tree.

We also have KDE 4.3.1 in stable \o/

KDE 3.5 is on its way out of portage, with kde-sunset being the overlay that will (hopefully) be maintained by users still interested in it.

Finally, KDE 4.4 Beta 1 is due December 1st and you’ll find it in the kde-testing overlay as usual :)

November 04, 2009
Steve Dibb a.k.a. beandog (homepage, stats, bugs)
my blu-ray ripping trial run (November 04, 2009, 15:04 UTC)

Yesterday, I wanted to see if I could rip a Blu-Ray disc using my PS3.  I really want to get a BD-ROM drive, but they are so expensive still, and since I can install Linux on my PS3, I figured maybe I'd try and save myself some money and see if I could manage to get one ripped and decrypted.  It actually worked, which surprised me.  Ripping the disc was the simplest thing in the world, but the key on the movie I tried (Willy Wonka and the Chocolate Factory) was too new, and currently only AnyDVD has support for it.  I'd love to buy a copy of that, but it only runs in Windows, and it's really expensive.  Instead, I'll just have to wait for the keys to pop up eventually on the doom9 forums.

The first step, though, was getting the PS3 to run Linux.  I took the shamelessly easy way out (and I don't regret it either) and installed Xubuntu.  I won't go into details about how I got Linux on my PS3 since that's well documented.  I will say that I remember quite vividly now why I can't stand binary distros.  Bleh.

The BD filesystem is UDF.  Providing you have a recent kernel (2.6.20, I think) with UDF v2.5 support, you are good to go.  I mounted a remote share and just dumped the disc to an ISO file onto my desktop.

$ cat /media/cdrom0 > wonka.iso

That was the easy part.

The hard part was trying to get it decrypted.  I had to use Java tools (bleh) to get to the source.  There are three applications you need.  And if you hate digging through forums and using download services, then I've got direct links for yah:

For Gentoo, you'll need to install the JDK to build the aacskeys library and binary.  I just emerged dev-java/sun-jdk and it worked for me (I know absolutely nothing about Java, but my stabbing in the dark miraculously worked).  You'll also need a runtime environment to actually execute the stuff, and I emerged dev-java/sun-jre-bin and that worked fine, too on my amd64 box.

For aacskeys and Gentoo, you'll need to apply this patch that I cobbled together from what I found on the doom9 forums to get it to compile.  It just fixes the Java include directorys for the Makefile.

Now, I'm still a bit fuzzy about what each program does, and whether you need all of them or not, so I won't go into a lot of detail.  What you want to use, though, is the dumphd program.  But to use it, you'll need to copy the aacskeys library and a file from the bdvmdbg package as well into the path or same directory as the dumphd program.

Once you have that, you can just run dumphd.sh and it'll fire up a simple little GUI telling you if it has all the libraries it needs.  Then you just specify the source and destination, and aacskeys will see if it has a working key to access the disc.

I can't really give much more detail than that, since I'm so new to this.  Suffice it to say, if you read the accompanying README doc that comes with each one, you'll get along just fine.

It took me a long time last night to get just one disc ripped and transferred over my subnet to try it out, and by the time I managed to get it mounted (mount -o loop -t udf wonka.iso /mnt/udf) and access it, it was pretty late.  The keys I had didn't work for my disc, and I didn't want to try the whole procedure over to try another disc.

Anyway, good luck if you try it.  One thing that impressed me is how much simpler it was than I thought it'd be, but what a pain it was trying to figure out where things went wrong.  The doom9 forums are a good resource, but not exactly the best place to find clear, concise information for a beginner.  That part was frustrating.

Personally, I don't think it's worth the hassle right now, the way I did it.  I'll get a BD-ROM sooner or later so I don't have to transfer the content over the network and can instead just test it directly.  But, I started out to see if I could at least get a copy of the ISO and get the tools running all without Windows, and I can.  So, that's progress right there.

Yesterday I was faced with an Asterisk problem logging src CDR records as anonymous, when dialing anonymously from a Snom SIP phone. In this particular situation it was OK to use anonymous as callerid, but not in the CDR records.

Using something like Set(CDR(src)=12345678) doesn't work since most of the CDR records are read-only. Also using Set(CALLERID(num)=12345678) also doesn't give you the expected result for the src CDR record.

However if you set the ANI callerid you will get the expected result, like this: Set(CALLERID(ANI)=12345678).