automated installations (4)

Now that I know that the bug is in partman-auto, I need to either fix it or work around it.
In any case, I will need to replace the udeb.

I found a way to unpack the udeb by looking at the sourcecode of udpkg.
An udeb is an "ar" package with 3 files (or at least, partman-auto_41.udeb is):

(deepstar/tachyon) ~/projects/kulnet-server-setup/cd/pool/main/p/partman-auto$ ar -t partman-auto_41_all.udeb
(deepstar/tachyon) ~/projects/kulnet-server-setup/cd/pool/main/p/partman-auto$

Each of these files can be extracted like so:

(deepstar/tachyon) /tmp/udebtest$ udeb=~/projects/kulnet-server-setup/cd/pool/main/p/partman-auto/partman-auto_41_all.udeb; for i in `ar -t $udeb`; do ar -p $udeb $i > $i; done
(deepstar/tachyon) /tmp/udebtest$ ls -l
total 40
-rw-r--r-- 1 deepstar deepstar 28404 2006-02-15 17:28 control.tar.gz
-rw-r--r-- 1 deepstar deepstar 7428 2006-02-15 17:28 data.tar.gz
-rw-r--r-- 1 deepstar deepstar 4 2006-02-15 17:28 debian-binary
(deepstar/tachyon) /tmp/udebtest$

After altering the package, you can recreate the package with

(deepstar/tachyon) /tmp/udebtest$ ar -t $udeb
(deepstar/tachyon) /tmp/udebtest$ ls -la
(deepstar/tachyon) /tmp/udebtest$ ar -cr partman-auto_41_all.udeb debian-binary control.tar.gz data.tar.gz
(deepstar/tachyon) /tmp/udebtest$

The order doesn't seem to matter (from what I see in the sourcecode), but why take the chance.
After the udeb is packed again, copy it to the CD and don't forget to change the Packages and Packages.gz files.
Normally this is done with dpkg-scanpackages, but since these are udebs, it will probably not work.
Being lazy, I do a find on the old md5sum and replace it with the new one.

I'll write a script for this as I will need to recreate the package a lot :)