Whirliwig’s Weblog

Just another WordPress.com weblog

We’re all Heels

leave a comment »

Google’d for ‘hibernate linux post sleep’, because I want to run scripts on wake-up to kick the MM10 back up to longrun ‘performance’ (always defaults to ‘economy’). Near the top of the results was this article on TechRebublic written this month (March 2008) by Jack Wallen.

Jack states he has ten years’ experience with ‘Linux’ (BTW, see a comment to my previous post to decode what I mean by ‘Linux’ — Jack uses some convenient shortcuts too).

Too many people are waving their Achilles Heels at Linux, and I’m just as guilty.

If I say something a little unthinking, and a little inflammatory, will y’all please take it as a provocative viewpoint of the n00b, and feel free to educate me. I just believe that if I try to be precisely correct in my postings, I’ll never write anything; I’ll never annoy anyone and I’ll never learn anything.

I really like Linux (OK, to be precise, the Debian Distro. Gnome Desktop on Linux 2.6.24 patched with Suspend2, with most packages taken from Lenny). It just seems the processes surrounding it[s development could cause more pain than necessary.

Written by whirliwig

March 28, 2008 at 6:53 pm

Posted in Life

Linux and Sado-Masochism

with 4 comments

I’ve been dabbling with Linux now for a couple of months.

When I started, I was sure that I wouldn’t be doing anything new compared to others who ‘went before’ — I would just be covering ground worn bare by the sneaker tracks of other, more experienced geeks. My task was to avoid the traps, and the dead-ends, marked by the forum posts that trail off into nothing, or with a plaintive ‘Haven’t heard anything for two months now. Please help!’ posting.

As everyone knows the Geek’s last cry is a terrible sound to hear — somewhere between the call of a dying elephant and that of a distressed hamster. Shiver.

I discovered quickly that Linux is on two tracks:

  1. The academic-driven track, where new concepts and technologies are developed and implemented, often in C/C++ with a low-level non-gui interface
  2. Those who believe that, with a bit of effort, and if everyone just ‘pulls together’, Linux will become the desktop-environment-to-end-all-desktop-environments

Lurking in the sidelines are the big companies who wait for something worth cherry-picking to turn up, and then they cherry-pick the products of the first of the Linux types, add their own spin, and make lots of money. Cough, cough Asus-tishoo..

The second Linux type is full of missionary zeal, and often youthful energy. They respond almost immediately to people posting questions on the forums they own.

In between all of the honest, wonderfully generous hard-graft, there is also time to have the Linux version of the sneering conviction that no-one else can do anything half as ‘cool’ as we can attitude that infects open source.

That is the problem.

They want to make their component the best it can be, and will soon become irritated by the lack of facilities that dependent other components offer up to their component. So what do they do? They ask for patches in the other components to give them the functionality they require.

That is why most forum postings end in: “You should be using Patch xyz of <dependent component>”, and the forum poster replies “That fixed it! Thanks!” If you are like me, you feel sudden elation, followed by a brooding depression: now I’ll have to patch, recompile, and try again. And then, I’ll find the patched component doesn’t quite work with <other component>, and so on.

From having this occur repeatedly to me, I began to believe that I was simply ‘on the bleeding edge’ of Linux, and suddenly I began to become infected by the same revolutionary zeal of the component writers. I thought “Maybe I can make a difference! Maybe, if I pull all of the right levers, twiddle all of the correct knobs I can create the most perfect installation of Linux ever!”

And so began the ‘tail chasing’ of someone who believed he was only ever an hour away from Linux Nirvana.

  1. Install latest ‘testing’ version of NetworkManager (say)
  2. Install latest ‘testing’ version of WPA Supplicant (say)
  3. It kinda works, but not automatically when I wake the laptop up from sleep.
  4. Install cutting edge version of NetworkManager, compile from code if necessary
  5. Try again. Now all of my network APs look like gibberish.
  6. Forum search
  7. Install cutting edge version of WPA Supplicant
  8. My networks are fixed!
  9. Buy new network card
  10. My networks are broken!
  11. Install patches for NetworkManager
  12. Grow several grey hairs
  13. etc.

In fact, it really is best to get off the bleeding edge, or you’ll get hurt. Not to realise this is to indulge in masochistic fantasy.

I also believe that the very enthusiasm which makes Linux so dynamic is also its weakness.

I want to develop the theory here that the GUI component writers are closet sadists, releasing patches to dependent components in an uncontrolled way, thereby potentially breaking everything, and requiring the masochistic masses to follow the path of pain.

In other words, I want to propose the theory of Sado-Masochistic Software Development which will always stay one-step behind capitalist companies paying non-masochistic employees to develop to a vision…because if it ever led the world, it wouldn’t have anything to beat itself up about, and then it would be as bad as ‘The Man’. In the end, being a leader is too scary.

Most people will look at what I have written in the previous paragraph, and snort, laugh, or just get angry. Or ignore it.

I am suggesting no less than a massive collusion between developers to believe in ‘them and us’ so that they can always define themselves as ‘us’: the Honest Geek Syndrome.

The very ‘freedom’ that allows anyone to release a component which claims to work well with the rest of the environment, and which is ‘a lot better than the old <component>’ is what creates the world of pain we inhabit; one in which the dependencies between patch-levels can grow exponentially.

The only answer is more control, and a reigning in of creative impulses without responsibility.

Yes, our betters have said it for years: without discipline, we’ll never amount to much.

Written by whirliwig

March 28, 2008 at 3:06 pm

Posted in Life, Linux

Building NetworkManager — patch

leave a comment »

 While trying to build the latest NetworkManager, I came across the ‘tp:type’ namespace issue mentioned elsewhere. That is, on attempting to build the XML DBUS stuff, one may receive an error about ‘illegal use of tp:type’. This is because a later version of dbus has support for namespaces in the schemas, and I don’t have that patched dbus, or the energy to find it.SO, I found a posting referring to this issue, and how to fix it. I can’t find that posting anymore. Before I lost it, I copied it verbatim to this posting. If the original author wants to contact me and tell me to credit them, I’ll be happy to. For now… In NetworManager top-level directory, create cleanup.sh, chmod u+x cleanup.sh.cleanup.sh 

#!/bin/sh

 

mkdir introspection-dirty
mv introspection/nm-*.xml introspection-dirty
for i in introspection-dirty/*.xml
do
xmlfile=`basename $i`
{
xsltproc spec-to-introspect.xsl introspection-dirty/$xmlfile \
| perl -pe '$hash = chr(35); s{xmlns:tp="http://telepathy\.freedesktop\.org/wiki/DbusSpec${hash}extensions-v0"} {}g'

  

} >  introspection/$xmlfile
done

 Also write the following file in the Top-Level directoryspec-to-introspect.xsl<!– Remove Telepathy extensions from a D-Bus interface, trying to leave onlyDTD-compliant introspection XML. The output still needs to be subjected to thefollowing sed filter:sed -e ’s@xmlns:tp=”http://telepathy\.freedesktop\.org/wiki/DbusSpec.extensions-v0″@@g’ The master copy of this stylesheet is in the Telepathy spec repository -please make any changes there. Copyright (C) 2006, 2007 Collabora Limited This library is free software; you can redistribute it and/ormodify it under the terms of the GNU Lesser General PublicLicense as published by the Free Software Foundation; eitherversion 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNULesser General Public License for more details. You should have received a copy of the GNU Lesser General PublicLicense along with this library; if not, write to the Free SoftwareFoundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA–> <xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”xmlns:tp=”http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0″exclude-result-prefixes=”tp”>        <xsl:output method=”xml” indent=”yes” encoding=”UTF-8″omit-xml-declaration=”no”doctype-system=”http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd”doctype-public=”-//freedesktop//DTD D-BUS Object Introspection 1.0//EN” />  

Written by whirliwig

March 25, 2008 at 7:07 pm

Posted in Life

Sound on MM10

leave a comment »

From lenny at least, just run ‘alsaconf’ from a root prompt.

erm…that’s it.

Written by whirliwig

March 25, 2008 at 11:45 am

Posted in Life

Installing RPMs in Debian

leave a comment »

http://www.debianadmin.com/install-rpm-files-in-debian-and-ubuntu.html

Of course, why not have aptitude do this conversion on the fly?

All link arms and sing…

Written by whirliwig

March 25, 2008 at 11:09 am

Posted in Life

Talking to Macs from Linux

leave a comment »

Connect to a Mac from MM10…

http://sourceforge.net/project/showfiles.php?group_id=179882

FUSE based AppleTalk

Written by whirliwig

March 25, 2008 at 11:03 am

Posted in Life

Bluetooth Dingle Dangle Dongle

leave a comment »

Just got latest available thumbnail sized USB EDR Bluetooth 2.0 dongle. Plugged into MM10. Nada. hcitool -scan. Nada ‘device not found’. Bah.

lsusb

Nada.

Hang on. It’s started flashing! Hoorah! a flashing dongle!

lsusb again…

diddlysharp:/home/ant# lsusb

Bus 003 Device 001: ID 0000:0000

Bus 002 Device 001: ID 0000:0000

Bus 001 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

Bus 001 Device 001: ID 0000:0000

diddlysharp:/home/ant# hcitool scan

Scanning …

00:xx:xx:xx:xx:xx K800i

Tadaaaa!!! It’s there! just running lsusb did it. Has my hotplug gone cold? What is hotplug?

I assume it handles someone unexpectedly plugging their dongle into an available socket, and other such ‘hot’ plugging events.

Written by whirliwig

March 20, 2008 at 1:17 pm

Posted in Life

Longrun on MM10

leave a comment »

Installed ‘longrun’ package to control Centrino power saving,


longrun -p

cack’d out with ‘cannot read blah blah’. A bit of Googling said sometimes (whether using udev or not), the correct query nodes are not created automatically.

This needs to be done on each boot.

An answer is to add the following to your /etc/rc.local:


# Create nodes for querying CPU performance (longrun)
for i in 0 1 2 3; do
	mkdir -p /dev/cpu/$i
	mknod -m 444 /dev/cpu/$i/msr c 202 $i
	mknod -m 444 /dev/cpu/$i/cpuid c 203 $i
done

# Default to highest performance
longrun -f performance

Note, the final line. I found out that by default, my MM10 was running in ‘economy’. Now I have a massive battery attached, I think I can afford a little careless power.

Excuse me, I have a man with an axe from the Green Party at the door. I’ll be back in a mo…

Written by whirliwig

March 17, 2008 at 9:06 am

Posted in Linux

Great Suspend / Hibernate Overview

leave a comment »

Written by whirliwig

March 16, 2008 at 8:21 pm

Posted in Linux

MM10 Debian Power Management Continued

leave a comment »

After getting suspend2 and hibernate working from the command line, the way to integrate these sleep/hibernate methods into gnome-power-manager world is to change the underlying HAL query scripts that gnome-power-manager uses.HAL abstracts hardware details from upper layers. That means:

  1. It allows querying of a ‘virtual hardware’ machine so that upper-layers don’t need to worry so much about adapting to each and every hardware variation
  2. it provides ‘actions’ on the ‘virtual hardware’ via scripts in /usr/lib/hal/scripts

gnome-power-manager uses these HAL scripts to poke your machine into doing the right thing.HAL is SOOOOOO concerned with abstraction, that it also seems designed to abstract away the fact we’re using linux…so it has sub-directories in /usr/lib/hal/scripts for each OS.Here, we’re interested in /usr/lib/hal/scripts/linux.And, we’re particularly interested in the HAL actions for power management:hal-system-power-hibernate-linuxhal-system-power-suspend-linuxetc…For whatever reason, my default scripts only support actually doing the power management (in a concrete sense) via pm-tools…an alternative to hibernate. So, I added a few bits to support hibernate as well.Note, the scripts as they are are mostly about setting up params to pass to pm-tools to handle ‘quirks’ of hardware. Hibernate handles quirks itself, so we don’t need to use all of the quirk code here. Just call hibernate-ram or hibernate-disk or whatever…E.g., hal-system-power-suspend-linux will end up with a section as so:

...  # We support hibernate-ram and pm-utils
if [ -x "/usr/local/sbin/hibernate-ram" ] ; then
# All Quirk handling delegated to hibernate script
/usr/local/sbin/hibernate-ram
RET=$?
elif [ -x "/usr/sbin/pm-suspend" ] ; then
/usr/sbin/pm-suspend $QUIRKS
RET=$?
else
# TODO: add support
unsupported
fi ... 

 

Written by whirliwig

March 16, 2008 at 7:28 pm

Posted in Linux