Search Results: "spa"

28 June 2007

Biella Coleman: Minimizing Lingusitic Drift for the Sake of Political Clarity and Integrity

I am finally catching up with the remarkably thick goulash of email and blogs entries that comes from traveling for well over a month and today I read one in particular When is Open Source not Open Source? that captivated my interest for it compellingly addresses the dangers that follow from diluting, or one might say hijacking, the term open source. When people learn that I study “free software” one of the most common questions I get asked is: why did I chose free software over open source? The answer is quite simple: given that the bread and butter of my research covers ethics, freedom, and liberalism, free software is the obvious path to follow, yet I also feel like a lot of my work is still relevant to the open source camp because of the affinities between the two. I have long maintained that the ideological gulf between open source and free software is not so great nor impassable, but more modest. As most know, both share a certain strong commitment to access and in a strict technical sense they refer to the same set of licenses. Philosophically there is agreement that openness and, especially, non-discrimination are essential for the quality of software and often by close extension, the vibrancy of community responsible for the software. Of course, when pontificating the ramifications and implications of openness, they do part company and enter into different territories. Free software tends to flag rights and freedoms, while open source meanders into a discussion of markets, business, and competition and in this regard they do craft different visions of the social world and human behavior, etc. But the case that Karl Fogel writes about, where OSI is strongly opposing the use of the term open source for licenses that don’t adhere to the definition demonstrates where the two positions join. As Michael Tiemann from the OSI succinctly put it:
The FSF may have got the orthodoxy wrong, and the OSI may have got the interpretation wrong, but we both agree that prohibition of commercial use without special permission is antithetical to both positions.
There is a unmistakable kernel of agreement and it is great to see the OSI taking such a strong stance in this regard. Now, David Richard’s response, who seeks, I think, to essentially dilute the term open source, is as (or perhaps even more) fascinating for in a nut shell, and using a lot of florid religious imagery, it accuses the OSI of being too rigid! In his own words:
I believe the OSI has a wonderful opportunity to continue being relevant and helping to lead the movement forward. If, however, y’all choose to define your denomination of this religion in a way that we don’t fit in, that’s fine. No hard feelings. It’s your choice. You’ll ultimately be excluding a large congregation and we for one will continue trying to build a church made up of others like ourselves.
In response, I would say that the goal of F/OSS is not to be inclusive of anyone who wants to release bits of source code, but to create the conditions under which software, as it has been defined by the community, can be created. Join the church if you would like to make free/open source software as defined and you can go elsewhere (i.e., create a different term) if you are creating something different, even if it is only slightly different. Integrity matters. And again inclusiveness, if it comes at the expense of the main goal, is not a boon but a danger to F/OSS. The OSI will remain relevant by halting the dilution of the term OSI, not by expanding the definition so that it is left with no substance. And in contradistinction to what David Richard maintains, however, there is a great degree of flexibility within this domain but it does not lie in the strict definition of F/OSS but in the realm of interpretation. You are also free, as Mako and I have argued elsewhere to interpret the significance of F/OSS in multiple ways. And I think this is where the political strength of free software lies. There is interplay between a well-defined goal (in this case for creating free software) and a more flexible realm of interpreting the significance of these technical practice. And we wold lose and I might add, a lot if we became flexible about the strict definition of F/OSS and inflexible about its political significance. I get irked with folks like David Richards who would like to bend open source rules to meet their (often commercial) interests and I find it pretty na ve when folks say the political significance of F/OSS is just x (or worse should be x) for in reality its political significance lies in the fact that it has spawned multiple types of political and economic projects. And there is something almost playfully ironic, (or at least it makes me smile) in this fact. Though there is strict definition contained withing F/OSS, this strictness has, at least to some extent, encouraged by an extreme and very healthy form of political proliferation and promiscuity. More than anyone else I know, Mako has most passionately and thoughtfully argued for the importance of what I would call political clarity and integrity. That is, the importance of having a well articulated definition for social movements, for they act, as he says a rallying point to realize a social movement. Urging the Creative Commons to learn from F/OSS and dare to simultaneously narrow and more clearly define their goals, he states it quite nicely in the following terms:
Free software advocates have been able to use the free software definition as the rallying point for a powerful social movement. Free software, like the concept of freedom in any freedom movement, is something that one can demand, something that one can protest for, and something that one can work toward. Working toward these goals, free and open source software movements have created the GNU/Linux operating system and billions of lines of freely available computer code.
In essence, a definition that people can abide by, respect, and perhaps eventually cherish is the condition of possibility to make working political code. And given how hard it is to make social change happen (at least in comparison to build computer code), we should learn from what F/OSS has to offer. And at the same time there is another lesson embedded in F/OSS. The Free Software Definition is well defined; but it must be emphasized, narrowly so. It does not try to do everything and have everyone pledge allegiance to an inordinately complex set of commitments. Clarity, narrowness, and well-defined goals –> these three attributes have powered it far and wide and I hope it remains so. Now, since the term open source is not trademarked, we are left with the problem of how to challenge the current hijacking of the term. For the solution, I will leave you with Karl Fogel, who I think proposes a good solution:
Note that the OSI s objection is not to the Zimbra license per se. The objection is just to Zimbra s calling that license open source . They can use any license they want, but they shouldn t call it open source unless it actually is. Freedom is freedom, and no amount of spin will change that. So what should we do about this? The term open source isn t trademarked. Years ago, the OSI tried to register it, but it was apparently too generic. …But there is public opinion. What Danese and Michael are proposing doing is organizing a lot of open source developers (and I mean open source according to the traditional definition, the one the OSI and I and most other open source developers I know adhere to) to stand up and, basically, say All of us agree on what the definition of open source is, and we reject as non-open source any license that does not comply with the letter and spirit of the Open Source Definition.

Antti-Juhani Kaijanaho: The Dying Philosophers Problem

Reading a masters thesis draft that mentions the dining philosophers problem – a parable about the difficulties of process synchronization very well known in computer science – it occurred to me that it must not be a very good idea to eat just spaghetti (or just rice). I asked a nutritionist about it, and here is her answer. Even if they manage to avoid deadlock or livelock, dying of malnutrition is not going to be their first problem, go read the full story! [Typos and thinkos corrected after initial publication]

MJ Ray: Tour de France on ITV and others

Despite their TV trailers and it being only 10 days away, there's still nothing on the itv sport site about the Tour de France coverage, but I can see the early stage details on tvtv now. The bulk of the coverage is on itv4 with some highlights repeated around midnight on itv1 and itv4. Unusually, the first stage is also on itv1, so terrestial analogue viewers can see what the fuss is really about, instead of the ceremonial final stage. Eurosport International is being good and covering everything live and in highlights, as ever. (Eurosport Analogue is free-to-air in English and German; Eurosport Digital is FTA in German.) The British Eurosport schedule seems something between the International and itv schedules described below. Strangely, it seems that the weekend afternoon live coverage is also on itv4, which doesn't usually start transmission until 18:00. I guess itv play or citv may be closing down early to make space. In detail: Presentation of the teams - Friday 6 July, live on itv4 from 18:30 (preceded by Liege-Bastogne-Liege highlights at 18:00), repeated on itv1 00:00, on itv4 00:30. Eurosport show it recorded 10:45-11:15 Saturday morning. Prologue - Saturday 7 July, live on itv4 14:45-19:00, live on Eurosport 15:00-18:30, highlights on itv4 00:30 Stage 1 - Sunday 8 July, live on itv4 from 10:30-16:10, live on itv1 10:50-11:50 and 15:15-16:00, live on Eurosport 10:00-16:00, highlights on itv4 19:00, repeated on itv4 00:30 As far as I can see so far, weekday stages look likely to be live on Eurosport from 13:00-16:30 (covering the start live at whatever time and maybe with highlights between that and the main live coverage) with highlights on itv4 19:00, repeated on itv4 after 23:30, highlights on Eurosport after 21:00. I expect most weekends to be a similar coverage pattern to the Prologue and the final stage to be covered like Stage 1, similar to last year's final stage. Also, France 2/3, ARD/ZDF (listings) and maybe RTBFSat will cover the race live too. Any other free-to-air satellite coverage?

27 June 2007

Jacobo Tarrío Barreiro: All Mexico All

For several days now, I have been seeing messages like this in my logcheck output:
Jun 27 19:24:07 maestro postfix/smtpd[14339]: warning: malformed domain name in resource data of MX record for neolookups.com: *.mx.*
Obviously, the MX entry for the domain neolookups.com (and all its subdomains, apparently) is 0 *.mx.* . It turns out that you cannot search for *.mx.* on Google, so I ask you, dear Lazyweb, is this one of the latest tricks spammers use to try and thwart antispam countermeasures?

Rob Taylor: the taste of sweet crack

I’ve been gradually pushing on in my free time on gobject-introspection, so I can make the dbus-glib bindings decent. A couple of months ago back I started hacking up a code scanner to generate the introspection xml,using code from gtk-doc, but using perl regexps to parse C just made me feel dirty… Johan Dahlin pointed me at Sparse, a front-end parser for c developed by some of the kernel guys. The only problem is that it doesn’t have language bindings (or even, seemingly, a stable abi). So I’ve just submitted a patch to sparse that adds an executable ‘c2xml‘. c2xml will dump the parse tree of the input file as a simple xml structure, suitable for manipulation by some python or suchlike. That could then be used to, say, generate c api descriptions, documentation and language bindings or make code navigation or refactoring tools. I like it!

David Welton: Ruby and Rails in Innsbruck, Austria

I like coding, but I also like to meet up, share ideas, and exchange information with other programmers from time to time. So I "spammed" a few people I found via google, and met up with Sudara and Samo yesterday for a beer and chit chat about Rails, Austria and life in general. It was fun, so we went ahead and created an Innsbruck Ruby and Rails google group, and are thinking about doing a "real" meeting at some point in the future. Samo had a nice presentation in German introducing Rails that I bet people would find interesting. Should be fun! I enjoyed getting out of the house and talking with some interesting people.

Martin F. Krafft: Removing background from images

Every now and then, I want to remove the background from an image and replace it with transparency. Instead of painful pixel work with the select tool, the following Gimp recipe does the job quite well, provided the background is a single colour:
  1. Choose Layer->Transparency->Colour to Alpha and select the background colour in the dialog box. Then click OK.
  2. Use the magic wand tool (Z) to select the contiguous region around your object. Make sure to use a sufficiently high threshold such that the selection line coincides with the image's silhouette.
  3. Press Ctrl-I to invert the selection.
  4. Choose Select->Shrink and shrink the selection by a pixel or two.
  5. Create a new, transparent layer. The selection should still be active.
  6. Make the background colour you previously converted to transparent your foreground colour and choose Edit->Fill with FD Colour from the menu.
  7. Switch the two layers such that the current one moves behind the one containing your image.
The method isn't perfect, but it certainly saves me a lot of time. For instance, my new hackergotchi a tribute to Scotland and the local team of DebConf7 only took me a few minutes to get ready. Suggestions still welcome. NP: Barclay James Harvest: Everyone Is Everybody Else

Bastian Venthur: What does it take to break rng?

Actually just a small change in the html code of our BTS. The problem was easy to fix and the new version is already uploaded, but this shows again how fragile the connection between BTS’ html output and rng is. I’ve heard other tools where affected too — just one reason more to switch to SOAP as soon as possible. An unfortunate side effect of today’s upload: In the last weeks I tried very hard to finally get rng into testing by not uploading as often as I wanted to. The problem aren’t RC bugs, but archs like SPARC or ARM which seem to have problems keeping up with the build queue. Being of priority extra doesn’t help very much, since packages with higher priorities (like: all other packages but rng) always jump the queue. Unfortunately my request to fix the override disparity I filed two weeks ago wasn’t processed yet and the only one who could fix this is currently on vacation. In fact others could fix this too, but it looks like they’re on vacation too. I guess I’ll just exclude both archs in one of the next uploads until things run smoother again. But not everything is dark: with the current upload, a Dutch, a Frech, a Norwegian and a Polish pony found a new home. Update: Looks like the override disparity has been fixed. Whoever fixed this, thank you! Rng should be available on all our archs by tomorrow and in testing in 10 days!

Joey Hess: ditto Keith

Like everyone else with an Intel graphics chipset and some X bug at DebConf, I was happy to have Keith there to debug it. But I'd go one step futher, and recommend anyone who doesn't have an Intel graphics chipset and some X bug, to go find one of each (and Keith). It's worth the price of admission just to experience his debugging process. If your experience is anything like mine, you'll have a lot of fun. You'll learn about some graphics-related thing, such as PCI configuration space and the LCD brightness register. And you might learn some new things about debugging. How twenty years of experience do come in handy at diagnosing what kind of crash happened, at a glance. That it's possible to still have fun working on something after those twenty years of experience. How to keep the bug submitter involved by letting them follow your thoughts as the problem is debugged, and letting them handle some of the skut-work. How to teach them what they need to do to handle the skut-work, without talking down, or wasting any time. How important it can be to have things like good hardware documentation. And probably lots more that I missed.

26 June 2007

Martin F. Krafft: 60 efficient minutes of Intel

I arrived at DebConf7 with my X40, which would randomly freeze on any video-related event. I even reinstalled everything without copying /etc from the old installation onto a fresh harddisk without success. I tried various kernels, including Ubuntu kernels which rendered my system unbootable. I swore, I kicked and screamed, I contemplated throwing it out of several windows at once and buying a non-IBM replacement, I think I even had bad dreams about it. I did not cry just yet though. I was unable to work on it, neither locally nor via external monitor. In fact, my solution for the first week was to occupy one of the spare desktop machines, link up the original laptop harddisk by way of a great PATA/SATA to USB converter, which Hanspeter gave me for Christmas, boot off the encrypted filesystems, bring up X, and finally ssh into the laptop, where I did the actual work. Trust me, it was ugly. But at least I was able to make progress on netconf. I called Lenovo and they agreed to send a technician out to the venue. Yay for on-site support. That was Friday though, so I'd have to wait until Monday, which was of course when my talk on netconf was to take place. Suddenly, or not so suddenly, but it happened in real-time: in walks Keith Packard, developer of the Intel graphics chips driver for X, and I swear he had "bring me broken X40s!!!!!!" written on his forehead and BIOS latency timeout values as pupils like a popular comic character's eyes may be made off a dollar sign when excited. Ask Matthew Garrett if you don't believe me. So I approached him and handed over the X40 and had him even more excited when I mentioned i855 and it was all downhill from there. I left him with password for root and the encrypted filesystem (he's a Debian developer after all, so he has root on all my machines anyway ) and wandered off for some organisational stuff. It feels great to be at DebConf without your laptop to come back to. So great even that in a moment of genius I decided to do my laundry, and off I went, back to the hostel. Get stuff from hostel B, convince staff from hostel A that I am in fact allowed to wash there as hostel B has no laundry facilities, buy tokens and detergent, dump stuff, find couch and sleep gosh was I tired, but not anymore, when my phone rings to announce the end of the washing cycle. Retrieve, return to hostel B, hang stuff all over the room (we all know each other and these are clean clothes), return to hostel A to say thank you (I actually did), fetch lunch at Subway, arrive at venue, return to desk to find laptop but no Keith. Look confused. Look around to find Keith smiling at me and that the patch to my problem had already made it to the upstream repository. Sit, relax, think, breathe, wow. 60 damn efficient minutes. Let my next machine have Intel chips, please? (call Lenovo, "suspend" the call. Lucky for them, or imagine the ripples of the on-site technician suggesting to try to reproduce the problem with Windows). PS: Unfortunately, the problems aren't all gone. There still seem to be some DPMS-related crashes, and suspending to RAM from X leaves a black display on resume (some might say it's good that this is happening to me too), but I am definitely a lot more peaceful now. Thanks, Keith. NP: Threshold: Critical Mass

Ross Burton: GTK+ Is My Bitch

Thanks to some pointers from Kris, I've got some subtle new bling in Tasks. The core of the code is KotoCellRendererPixbuf, a GtkCellRendererPixbuf subclass which implements the activate virtual method, so that it is clickable. However because the other renderer in the column is not activatable (a text renderer), clicking on the row activates the pixbuf renderer. A quick bit of logic in the activate virtual function to look at where was clicked solves this, and now Tasks shows clickable icons when a task has a URL set. Tasks I particularly like how space for the icon isn't allocated in every row, so if there is no icon the text extends all the way across the view. NP: The Herd, The Herd

Matthias Urlichs: Be prepared!

>> Thank you for your message to the Adaptec Customer Service department.
>> Your case # is 000000000005432. (NB: not the real number.)

*ROTFL*  Exactly how many customer requests do they expect to handle?

If the answer is "about 100/day", which sounds somewhat high to me given the above number, then space will last roughly three times as long as the time until this nice planet will die a fiery death in its expanding sun's outer heliosphere.

Maybe somebody was afraid of the Year-100-Billion problem

Antti-Juhani Kaijanaho: Tux Games is a spammer

I received some time ago (don’t remember exactly when, I’ve since deleted that mail) a mail from Tux Games informing me that a mail that I (supposedly) had sent them is being held pending my confirmation that the message is not spam. Now, I have never ever before heard of Tux Games, so it seems likely that the message being held indeed is spam – and was not, in fact, sent by me. Email source forgery is trivial if you know how the system works, and spammers routinely forge email sender information. Tux Games is itself engaging in spamming by sending unsolicited confirmation mails to people. I replied to the mail saying so, and asking them to stop doing this. The message bounced. Today, I received another message from Tux Games. The original message is still in the queue, and has not been read by a human. I am asked to confirm it is not spam. It is tempting to do so.

Evan Prodromou: 6 Messidor CCXV

We had a great weekend this last weekend here in Montreal. Yesterday, June 24, was Saint-Jean-Baptiste Day here in Quebec -- the national holiday of this cool and fun nation. St. Jean Baptiste is important to me in a lot of ways. Of course, it's cool that it's the national holiday of our adopted new home. But John the Baptist, the patron saint of Quebec, is also our family's name saint. ''Prodromos'' means "forerunner" in Greek, and it's one of the titles of St. John. Most of all, it's the day that Maj and I moved to Montreal. We came in on St. Jean Baptiste Day, 2003, and we've been here ever since. We drove my beautiful 1972 Citro n DS from San Francisco, where my niece Elena had just been born, all the way out here. We arrives on June 24th and wandered around the McGill Ghetto looking for our sight-unseen sublet. It's hard to believe it's only been 4 years -- it seems like so much longer. We had a good day yesterday. The three of us went to Piknic in the afternoon and hung out with our friends Jeremy and Lina and their two great kids Clea and Sylvie. We had a lot of hummus and pasta salad and bread and cheese and generally had a great time. Meg and Catherine came and hung out for a while, and also our friend Kristen, who's 7 months pregnant and has a 10-month-old. Good luck on that one. Most of all a pretty day enjoying the outdoors in our new home town, as well as fun dancing to house under a big Calder statue. How great is that? tags:

72 hours from Flickr I forgot to mention that we had a really nice time on Friday evening going to the 24 Hours of Flickr party at the SAT. Heather Champ, community leader at Flickr and welcomer to partiers, put it well: "We have three requirements for Flickr parties: the food must be good, the drinks must be copious, and the schwag must be ample." And that's exactly what happened. All the usual Montreal suspects were out in force: YULblog types, Web entrepreneurs, Web pranksters. It was great seeing m-c and c-c, who wore their awesome Flickr Socks -- although they each had a matching pair. I also talked to Allen Morris, which was really fun. He's a developer living now in Saranac Lake, one of the towns in the Adirondacks I find strangely compelling. We exchanged GPG key signatures and talked a lot about the Bay Area (California), where we both once lived. Probably my best talk was with Heather Champ and Derek Powazek. We talked about their joys of creation of JPG Magazine, the despair of leaving it, and looking forward to the future. We also chatted a lot about print on demand technologies, which we're evaluating for Wikitravel. Heather took the photo of my friend Ben Cerveny at Burning Man that's become his avatar icon on about every social software platform I know of. It must be good to capture someone in the way they want to think of themselves. I took my own self-concept picture by putting the camera on the dashboard of my Citroen. Heh. All in all a good party. One thing I was interested to find out was that there's a Yahoo! Quebec, which launched last month and I guess just slipped by me. Sadly, if you click on the "English" button, it takes you to... Yahoo! Canada. Hey, Yahoo! There are actually a lot of anglophones here! Just in case you were wondering. tags:

Montreal Web Development Book Club Montreal Web scene stalwart Heri Rakotomalala -- the man with the magic name, originally from Madagascar, along with Montevideo and Marfa, one of the M-places on my travel wishlist -- recently started a Montreal Web Development Book Club. It's a meeting for people interested in the practical side of the Web to talk about the books they read and let that drift into talk about the work we do and ideas we have. I think the book club is an awesome idea. Book clubs are a great grass-roots intellectual meetup that we don't often celebrate in the post-flash mob BarCamp-ized world. The great thing about a book club, for Web people, is that it filters out the bullshitters and dilettantes. If you're going to a book club, you're going to have to know what you're talking about, and you're going to have to care about the subject. The book gives focus that keeps the conversation from drifting to tangential topics. Flakes and hangers-on just don't have the stamina for it. Also, we met at La ka, so it was nice to have some beers in a good place on a hot night. Why not? We managed to talk about a lot of good books, too. Jean-Fran ois <something> (I didn't get his last name) talked about In Search of Stupidity, a look at the last 25 years of marketing and business blunders in the high-tech realm. Our industry is subject to a lot of decisions that seem absolutely self-defeating in hindsight, and the book goes in-depth on 15 case studies -- like Wordstar, Ashton-Tate and Borland. It sounds like a great cautionary tale for Web 2.0 startup mavens. Heri talked about the book Information Architecture for the World Wide Web -- the infamous "Polar Bear Book". It sounds like a really good book for doing initial planning for a Web site, but I'm really interested in tools for profiling an IA effort. We get about 2 million unique visitors a month at Wikitravel, for example, which is a huge amount of usability data I could be mining. But I don't really have the tools for it, so I don't do it much. I'd love to know, for example, about people who land on a Wikitravel page from a search engine and then leave. What were they looking for? Why couldn't they find it? Also, users who browse through our pages clicking on links, then resort to a full-text search. What did they think they were clicking on, and what were they looking for instead? Did they find it? How can we put that in front of them in the first place? Most of all, I want to know how and why people start editing Wikitravel pages, and why they stop. Of people who click the "edit" button, only 1 in 17 click "save". (That is one bit of clickpath analysis I've done.) Why? I've often been tempted to put a survey up when someone navigates away from our edit page. "Why didn't you save? Tell us so we can fix it for other people." I talked about the book I just finished reading a few weeks ago, Everything is Miscellaneous. It's the latest book by Dave Weinberger about how we impose order on information to make it easy to understand and retrieve. It's an awesome book -- really fun -- especially for someone married to a knowledge management expert. I don't think I gave a good enough description of the book to ignite the club's interest, but I hope they check it out, because it's really readable and good. At the end of the meeting Heri took a poll and decided that we'll continue doing the book club on the last Monday of the month. I've already picked out my book for next month: RESTful Web Services. I've heard good things about this book (admittedly mostly from the co-author Leonard Richardson) and I want to give it a look-see. So book-club fodder it is. ''Update: Heri has his own book club report here.'' tags:

25 June 2007

Miriam Ruiz: Classifying games for children

Parents and educators should be aware about what kind of games their children play. In the current state, this means that the parents must be gamers themselves to know about that, because there’s no way of knowing whether a game includes sex, violence, sexism, etc. until you play it. The idea is to provide a way of classifying games so that parents can know in advance whether the game involves certain culture-dependent controversial stuff, and being able to use that when considering what games they want their children to play, or what games they want to play themselves. Not that I’m the proper one to make the classification myself, but it should be done by teachers and educators, who I think are the best suited for this kind of task. In any case I’m willing to lead and coordinate the project, with the support of just some Spanish teachers for the moment. I hope that in the future teachers of other cultures will like to get involved too and the system can evolve to a multicultural one. The result should be as culturally independent as possible, but that would only be possible if members of different cultures help. There’s no way to provide a totally objective classification of moral stuff, so instead of trying to make the classification as aseptic as possible, it might make more sense to make it the other way round: trying to have all the different possible points of view, even when some of them might not even fit my own beliefs. Links:

Christine Spang: New Hackergotchi?

I feel like this picture would make a decent new hackgotchi (with up-to-date hair!). I wonder if I could bribe someone with better GIMP-fu to make this happen. <twiddle>

24 June 2007

Christine Spang: DebConf7

Going: Best. Choice. Ever. (Ironically?,) I spent way less time on my computer than I do when I’m at home.

Kai Hendry: Back from Debconf7

Kai and Fabio
Kai Hendry at Debconf7

Mike Hommey: Playing more with LVM, LUKS and the device mapper

Following my previous entry about playing around with LVM, LUKS and the device mapper, I documented myself about internals involved in pvmove, which is more of a challenge, considering there is no such documentation. I could find no useful documentation for either the device mapper or LVM. A bit of good old UTSL later, I could elaborate how to do what I wanted, and realized it was even possible to do in shell script. So here you are : a shell script to transform an LVM physical volume to a LVM over LUKS physical volume,. I’ll detail in between how it works. As the previous script, use at your own risk, it comes with no warranty.
Note you theorically can still access the filesystems underneath without problems. It’s an in-place and live conversion. Also note this is more a proof of concept than a proper, risk-less and well-written solution.

set -e
dev=$1
luks=$(mktemp)
cryptdev=$(basename $dev)_crypt
pvsize=$(pvs -o pe_start,pv_size --units s --noheadings --nosuffix "$dev" awk ' print $1 + $2 ')
devsize=$(blockdev --getsz "$dev")
mchunk=8
The script takes the physical volume device to convert as an argument. Note there is no check for the validity of its value.

dd of="$luks" seek=$devsize count=0 bs=512 2> /dev/null
luksdev=$(losetup -f)
losetup "$luksdev" "$luks"
trap "losetup -d \"$luksdev\"; rm -f \"$luks\"" EXIT
Next, we create a sparse luks file the same size as the device (in case luksFormat would use the size somehow, but I believe it doesn’t), and a loopback device on this file. The trap is here to avoid leaving the loopback device and the file when an error occurs later (though during the conversion itself, it will be pointless).

cryptsetup luksFormat -q "$luksdev"
cryptsetup luksOpen "$luksdev" $ cryptdev _real
read start length crypt format key IVoff cdev offset <<EOF
$(dmsetup table $ cryptdev _real)
EOF
We create a LUKS device, so that we can get the encryption key ($key), and the size of the LUKS header ($offset). Note you need to add –showkey to the dmsetup table command on sid.

if [ $(expr $devsize - $pvsize) -lt $offset ]; then
  echo Not enough free space after LVM physical volume
  cryptsetup luksClose $ cryptdev _real
  exit
fi
Check we have enough space after the LVM physical volume to offset everything by the size of the LUKS header. If not, you can still try again after you reduce the size of the LVM physical volume by an extent.

if [ $(expr $devsize % $offset % $mchunk) -gt 0 ]; then
  echo Last
  cryptsetup luksClose $ cryptdev _real
  exit
fi
This is another check to avoid surprises at the end, when dealing with the last chunk. As the script is written for the moment, it doesn’t support cases where this last chunk is not a multiple of $mchunk. So we need to abort in these.

read major minor <<EOF
$(stat -t "$dev" awk ' print $10,$11 ')
EOF
maps=$(dmsetup deps awk -F: "/\($major, $minor\)/ print \$1 ")
dmsetup create $cryptdev <<EOF
0 $length linear $dev 0
EOF
dmsetup reload $ cryptdev _real <<EOF
$start $length crypt $format $key $IVoff $dev $offset
EOF
dmsetup resume $ cryptdev _real
for map in $ maps ; do
  dmsetup table "$map" sed s,$major:$minor,/dev/mapper/$cryptdev, dmsetup reload "$map"
  dmsetup resume "$map"
done
Here, we create the dev_crypt device mapper that is our fake LUKS device, which starts as a simple linear mapper and will end as a complete crypt mapper. This fake LUKS device is inserted as an intermediate mapper between the LVM device mapper and the real device. So, the LVM device mapper will have this fake LUKS device as backend, and, at the beginning, the fake LUKS device maps linearly to the real device. Note we look for all device mappers using the real device as backend before creating the fake LUKS device to avoid finding the fake LUKS device in the list. Also note dmsetup reload only loads a new table in the INACTIVE slot, and dmsetup resume makes this inactive table LIVE.

cursor=$length
chunk=$offset
while [ $cursor -gt 0 ]; do
  cursor=$(expr $cursor - $chunk)
  if [ $cursor -lt 0 ]; then
    chunk=$(expr $chunk + $cursor)
    cursor=0
  fi
  (
  [ $cursor -ne 0 ] && echo 0 $cursor linear $dev 0
  echo $cursor $chunk mirror core 1 $mchunk 2 $dev $cursor /dev/mapper/$ cryptdev _real $cursor
  [ $cursor -lt $(expr $length - $chunk) ] && echo $(expr $cursor + $chunk) $(expr $length - $cursor - $chunk) crypt $format $key $(expr $IVoff + $cursor + $chunk) $dev $(expr $offset + $cursor + $chunk)
  ) dmsetup reload "$cryptdev"
  dmsetup resume "$cryptdev"
  chunks=$(expr $chunk / $mchunk)
  while ! dmsetup status "$cryptdev" grep "$chunks/$chunks"; do
    true
  done
done
This is where the main work is done : moving the data around. We actually just let the device mapper deal with the data duplication, $offset blocks by $offset blocks ($offset being the LUKS header size), using a mirror target for the chunk being moved. So our disk looks like the following:

We use the extra dev_crypt_real device (the previously remapped LUKS device) as the encryption backend for the mirror.
I haven’t figured a better way to wait for the end of the mirroring than to do a loop checking with dmsetup status, dmsetup wait doesn’t seem to be very helpful here.
Anyways, this is the part of the script where you don’t want a crash to occur. Because if it does, all you can do is start on a rescue system, and try to find where the encrypted part of the disk start to setup a device mapper by hand.
And you’d better have the luks temporary file in a directory that is neither in RAM (think tmpfs) nor in the LVM you are converting (/tmp in a default etch install is, for instance ; note the script works nevertheless fine in this case). Also note the trap will remove the luks temporary file if the script exits…

dmsetup reload "$cryptdev" <<EOF
$start $length crypt $format $key $IVoff $dev $offset
EOF
dmsetup resume "$cryptdev"
dmsetup remove "$ cryptdev _real"
dd if="$luks" of=$dev count=$offset bs=512 2> /dev/null
Final steps of the conversion : our dev_crypt device becomes a full LUKS volume, so we can remove dev_crypt_real and add the LUKS headers at the top of the device we converted. At this moment, the LUKS volume is setup just as if it had been setup by cryptsetup. For LVM to recognize the change properly, you need to run pvscan. Once you ran it, you can do whatever you want with LVM. Now, you may want to add the following to your /etc/crypttab file:

$cryptdev $dev none luks
i.e. hda5_crypt /dev/hda5 none luks if the device was /dev/hda5. And if the LVM volume you converted contains your root filesystem, you should run (for Debian systems):

update-initramfs -u
I tested this successfully under qemu and will give it a shot on my laptop some time soon. Now, because I had a hard time not finding much about the mirror target of the device mapper, here is what I could gather about it. The target syntax is as follows:

<logical_start_sector> <num_sectors> mirror [ core disk ] <num_params> <param> ... <num_mirrors> [ <destination > <start_sector> ] ...
logical_start_sector, num_sectors, destination and start_sector have the same meaning as in other targets.
core and disk are two different log types (to track differences between mirrors), respectively in memory and on disk.
num_params and params depend on the log type: num_mirrors is the number of mirrors and for each mirror, we have a pair destination and start_sector. [ Update: after a quick look at the device mapper source code in Linus’s git tree, updated the mirror target description ]

Daniel Burrows: Jealousy

I've been suffering for a while from mild jealousy of the people who have a spare week of vacation time to make it to Edinburgh for DebConf. (is there a support group for this? :) ) But now I read that some people apparently have so much time off that they travelled to Edinburgh a full week ahead of time, just because, y'know, they could. Darn Europeans.

But then, I only have to work for another year and a half before I qualify for another whole week of vacation time, raising the total to three weeks off per year. Maybe I can make DebConf 2009, assuming that President Hillary doesn't invade Luxembourg or something...

Next.

Previous.