Debian packaging with git - Part 1

May 29, 2008

Recently, I’ve been taking a look at tools to version control and maintain my Debian packages in git.

Git, like mercurial, is a distributed SCM used to maintain the Linux kernel since version 2.6.12. Branching in git is very cheap, and merging is trivial and follows a decentralized model where developers can push and pull code with each other in true distributed fashion.

Of the Debian tools I’ve tried, the main contenders are:

  • gitpkg
  • git-buildpackage

gitpkg, is extremely simple to use, and quick to get you off the ground. If you already have an entire revision history of .dsc, .diff.gz files, maintained in the good old fashioned way, gitpkg provides the git-debimport utility that lets you import everything into a git repository in one go. It does this intelligently by applying consecutive revisions and tagging the different versions along the way.

Here are the steps that I took to import my ncc package history into git:

$ mkdir /git/repo
$ cd /git/repo
$ git-debimport ../../debian/ncc/ncc

It will then pick up all the files beginning with ncc in the ../../debian/ncc directory.

To see the revision history:

$ cd ncc
$ gitk

The .orig.tar.gz files will be extracted to a branch called upstream and tagged (v2.5), it will then be merged to master and the .diff.gz files applied sequentially and tagged at each step (v2.5-1). A list of tags like the following will be created:

v2.5
v2.5-1
v2.5-2
v2.6
v2.6-1
v2.6-2

To create the source package for a particular revision:

gitpkg v2.6-1 v2.6

Where the first argument is the tag with the Debian changes, and the second argument is the tag for upstream code.

$ ls -F ../deb-packages/ncc/
ncc-2.6/ ncc_2.6-1.diff.gz ncc_2.6-1.dsc ncc_2.6.orig.tar.gz
$ cd ../deb-packages/ncc/ncc-2.6
$ debuild

These steps didn’t work for me the first time as git silently dropped an empty directory that caused the build to fail. The workaround was to create a .gitignore file in the empty directory. This is probably something that gitpkg could be configured to handle.

To upgrade to a new upstream version:

$ git checkout upstream
$ rm -rf *
$ tar zxvf /path/to/new/upstream.tar.gz
$ git add .
$ git commit -m
$ git tag v2.7

# Merge the Debian changes
$ git checkout master
$ git branch debian
$ git checkout debian
$ git merge upstream

# Fix conflicts / make Debian specific changes / test

$ git add .
$ git commit -a
$ git checkout master
$ git merge debian
$ git tag v2.7-1

# Generate Debian package artifacts
$ gitpkg v2.7-1 v2.7

# Build Debian package
$ cd ../deb-packages/ncc/ncc-2.7
$ debuild

A couple of caveats - gitpkg generates the orig.tar.gz by tarring up the upstream branch. As far as I know, gitpkg does not yet have pristine-tar support yet and that’s a must-have if you don’t want to re-package the upstream sources. I also noticed that git-debimport had trouble with absolute paths, for which I submitted a patch - so I don’t have a whole lot of confidence in the tool yet, but it’s getting there.


FireFox + GPG

May 8, 2008

FireGPG is a neat little FireFox plugin that acts as a front-end for GPG and provides seamless integration with Gmail. Once installed and Gmail support is enabled (which is, by default), a series of signing/encryption related buttons will appear at the top of the Compose Mail page.

It also lets you easily encrypt or sign any selected text area on a web page.

It’s a very intuitive and effective plugin. I just wish I had stumbled upon this sooner.


On OpenSolaris

April 26, 2008

In a recent article, Ted T’so makes some interesting points on Sun’s motives behind OpenSolaris, and how it fares today in the FOSS ecosystem as a result.

“Fundamentally, Open Solaris has been released under a Open Source license, but it is not an Open Source development community.”

It’s quite sad that this is the case simply considering the enormous potential that OpenSolaris had back in 2005, and the opportunities for cross pollination with Linux had the licenses been compatible. Given some of killer features of the operating system, it’s quite a shame that it has not been able to rally the developer community that it deserves.

At this point, I think the only hope for OpenSolaris is GPLv3 and a truly open development process. Then for once, Linus’ kernel will have a strong contender and a raised bar on licensing grounds.

Nexenta (a project unaffiliated with Sun), and essentially a Debian distribution with an OpenSolaris kernel, has been a strong attempt at attracting developers. Debian is by far is the most developer friendly GNU/Linux distribution out there, with a mature and proven development model, and to build an OpenSolaris distribution with user land tools of Debian makes the most sense.

I’ve been a Solaris user since version 6, which I attempted to run (quite foolishly) on a 333MHz Pentium. The user experience was anything but smooth, but still ended up gaining a lot of respect for the platform. Only time can say whether the tide changes for OpenSolaris or whether it ends up relegating to the Minix boat.

Updated: 03 May - Corrections on Nexenta


Linux on Palm TX

March 3, 2008

Here are the steps to get Linux running on a Palm TX. For the approach described, you’ll need an SD card, an SD card reader and a Palm TX that you can hopefully live without. Remember, backup the handheld using a tool such as JPilot. It’s really
quite simple and you’ll thank yourself later.

For the impatient, here’s the list of steps to get you up and running:

- Mount the SD card on your Linux desktop

- Extract tx-bootbundle-20060813.tar.gz to a temporary location

- Copy linux.boot.cfg to the SD card

- Copy garux.prc to Palm/Launcher on the SD card

- Download the root image with your choice of environment

GPE - GTK+ widget toolkit/X Windows
Opie - a fork of Qtopia developed by Trolltech

The links for the root images above are for version 0.8.4-RC3 of the Familiar distribution and are somewhat dated.

- Copy the root image(s) to the SD card

- Create 32M swap file in SD card

dd if=/dev/zero of=swap.fs bs=1k count=32k
mkswap swap.fs

- Edit linux.boot.cfg and uncomment the line with the root image that you wish to boot

- Uncomment the following line

SWAP_DEV=/media/mmc1/swap.fs

- Unmount SD card, giving it ample time to flush its buffers

- Pop the card in the Palm TX

- Tap on “Garux” and you’re ready to boot Linux

Garux is a loadlin-style bootloader that unloads the Palm OS from memory and boots Linux. PalmOS will still be present in ROM so a reset of the handheld will boot the device back into PalmOS. Because of the way PalmOS works, the Linux kernel is broken up into 64k chunks and rejoined at runtime. The kernel is embedded in Garux, and so a Garux image cannot be used to boot a kernel other than the version it was compiled for. Cocoboot is a newer bootloader that can be used to boot any supported kernel. To setup Cocoboot, simply follow the additional steps:

- Copy zImage to the root of the SD card from the tx-bootbundle

- Copy cocoboot-0.4 to Palm/Launcher of the SD card

- Start the cocoboot application from the handheld and follow the steps

Next week, Linux powered toaster.


Marmot ‘08

February 26, 2008

So, there’s a thread on the Debian mailing lists on a mascot for the project. Someone jokingly suggested a Marmot.

Marmots typically live in burrows, and hibernate there through the winter. Most marmots are highly social, and use loud whistles to communicate with one another, especially when alarmed.

Now if that’s not a reason why Marmot should be the Debian mascot, I’d be very disappointed.

And just look at this froody Marmot. I say he’s the complete embodiment of all that is free and open. Now that’s one happy and content Marmot.

And here’s yet another blissfully content Marmot, chilling out. I don’t care what you think, these dudes are cool. This post deserves a whole new category. And I’m going to call it…

wait for it…

Marmot!

My vote’s for Marmot.


FD 100

October 16, 2007

You see, it was way back in the summer of ‘45 when I was a mere little laddie, stomping around in my school boy shorts that I was introduced to LOGO. It pretty much did it for me. If it wasn’t for LOGO, I’d probably have grown up to be a normal, well-balanced kid. But alas, that was not to be.

Happy birthday, LOGO, and many more!


Drama

August 14, 2007

In an unsurprising turn, SCO stocks plummet as a judge rules that Novell owns the UNIX copyrights, and not SCO as McBride would have you believe. Not that I really care about SCO stocks, I really don’t, it’s just nice to see people finally catching on to the SCO bluff. Redmond played it beautifully, or thought they did by financing the smear campaign that was SCO AND striking a deal with Novell to distribute Linux “coupons”, but will they find themselves outwitted by GPLv3 when/if Novell starts shipping GPLv3 code as part of the coupon deal? Now that is going to be very interesting to watch.


GPLv3 Launch

July 1, 2007

GPLv3 was launched on Friday (29) after close to eighteen months of public involvement in it’s drafting process. This has been an important milestone in the free software world as an upgrade to the GPL to address some of the more modern concerns have been a long time coming. I think Bruce Perens sums this up well when he said:

“When the GPLv2 and GPLv1 were written, we got music from phonograph records,” he says. “The most complicated input device people had in their homes was a touch-tone telephone. The only thing that was even close to digital rights management were these dongles you’d hang on the back of your computer that would authorize you to run software — digital rights management didn’t even really exist.”

You can read the rest of the Wired article — here.

I was at the Free Software Foundation with a couple of my mates and you can find some of the photographs, here. RMS made the announcement in a room rigged with audio equipment, so everyone was really quiet. In a room where the dropping of a pin could be heard, the shutter release of my DSLR came like claps of thunder. So I resorted to just watch the whole thing rather than draw the wrath of the assembled mob of free software types.

GPLv3 has finally taken flight. It’ll be a lot of work to re-license all the GNU tools under GPLv3 but the process has already begun. It’ll be very interesting to see what happens.

Update (14 July): The announcement from RMS.


Lists

June 21, 2007

I was under the impression that my thinkpad R50 had an IR port, but for the life of me I can’t seem to find it. I’ve been scouring every inch of my R50 all morning and came up with zilch. What’s strange is that IR was detected at some point in the past when I turned on my PDA but I wasn’t paying attention then and I haven’t been able to get it working since. And yes, I’ve recently purchased a PDA. A battered, old Sony Clie, cos it’s about time I got a little organized. And so far it has been working out well. I just wish I had gotten one sooner, but somehow the image of PDA wielding yuppies made the prospect undesirable a long time ago.

I deliberately went for the Sony Clie for several reasons:

1) It’s cheap.

2) I like the fact that it’s Sony.

3) Palm OS.

4) I don’t need most of the new-fangled features. All I need to do is manage lists and track events / meetings. Oh and rudimentary memo capabilities.

The SJ30 meets all the criteria. Although graffiti is pretty cool and easy to use, I prefer the pull up keyboard. I’m old fashioned that way.

Over the past few days, I’ve been using it exclusively, and daily TODO lists on paper is just a distant memory of more painful times. I still lug my battered notebook (the dead tree variety) to meetings to maintain my old fashioned, conservative, techno-Luddite image and synchronize notes to my PDA in the privacy of my cubicle.

Oh and I’ve installed Chess and Go so I can play while pretending to be planning my day.


Mahavilachchiya

April 19, 2007

A little while back, I had the opportunity to visit Mahavilachchiya [blog] and help out with some of the great work that Horizon Lanka Foundation is doing. It was very inspiring to see how much HLF and Wanni has managed to do with so little over the years and now it’s very easy for anyone to contribute. I hope HLF gets the funds it needs to continue its work with the help of readers like you.