Scott James Remnant Considered Harmful

I refer, of course, to the appearance of Bug#313400 in the archive and making unstable bootstrapping break in subtle ways on the very day I make my first debootstrap upload in a year and a half. Bastard.

I noticed the bug when converting the sid script to have the nifty detailed progress support Colin Watson implemented for Ubuntu. The relevant implementation detail is that various fds get munged around, and then held open by daemons like inetd and cron that get started by /usr/sbin/start-stop-daemon when they should’ve been skipped by the dummy /sbin/start-stop-daemon that debootstrap cunningly puts in place, which causes the pipe to stay open, and debootstrap to hang just before it finishes.

Ignoring that problem, the other hacking seemed to go fairly well.

Having debootstrap report progress while the install’s happening made me feel like putting all the confusing dpkg output somewhere else, so there’s now a debootstrap.log file in the /debootstrap directory in the root of the target, that gets moved to /var/log/bootstrap.log when (if…) the installation completes. That’ll probably make things awkward for installer types who might want to keep the verbose output showing up live on a tty, so something might have to be tweaked around there to have that come back. We’ll see.

The override munging I did yesterday seemed to work out, with Priority: required and Priority: important matching the packages that are meant to be part of the base system fairly well – at least on i386. So the sid script now also doesn’t have any hardcoded information about what’s in base, it pulls it from the Packages file instead. By the time it appears in the archive, there’ll also be Build-Essential: yes tags to help it work out which packages to install in the buildd variant. Unfortunately these are likely pretty wrong at the moment, but should improve soon enough. And won’t require a debootstrap upload in order to improve in future either! Awesome! (Also awesome: closing bugs that have been open for over four years!)

What else? Ah yes. I wrote a version of pkgdetails in perl (well, shell and perl), so that I could make the package just a simple matter of scripting. In theory that should let you just grab the deb and run debootstrap on Red Hat or Solaris or maybe even Windows. In practice, we’ll see — but hey, it gives me an excuse to close the bugs anyway. Unfortunately the perl version is noticeably slower than the C version, and unfortunately one of the particularly slow bits that parsed the entire Packages file was getting called once for each package and being almost as painful as reading this sentence. So the invoking code in download_release also got rewritten, and now, not only is the Packages file only parsed once while all the debs are being downloaded and validated, but the code’s in roughly the right form to make it plausible to implement support for pulling from multiple sources.

Finally, there’s the Release.gpg signature checking that Colin implemented for Ubuntu. Just install gpgv, point debootstrap at a trusted keyring with the --keyring argument, and you’re done. Sweet.

That’s about it, really. Most of the other things on the TODO list are probably right to be left for a little while yet, and there’s definitely a few bugs that’ll need to be worked out in the stuff already implemented. The CodeWiki seemed somewhat useful for organising development stuff — it’s nice to be able to see some progress, and have something that looks vaguely professional, while at the same time requiring no actual effort.

So, that’s 0.3.1. Surely something’s broken this time.

Leave a Reply