In which we describe the processes used to bootstrap an Ubuntu archive, given the existance of a Debian binary archive for the architecture (whether in Debian's archive nor not.)

Bootstrapping an architecture from scratch is beyond the scope of this document.

The high level view

In order to make sure that things are built with the correct shared libraries, etc, it is necessary to build things twice: (yes, this doesn't really address static libraries completely, but those are evil and should break.)

  • stage 1 uses a Debian chroot and is finished when there are enough packages to debootstrap stage 2 and avoid build-depends loops in main.
  • stage 2 uses the binaries created in stage 1 to produce the actual archive binaries.

There are several goals for the port, which can partially be worked in parallel after stage 1 is complete. These are:

  • stage 2 (obviously)
  • debian-installer
  • kernel

Initial setup

  1. Install the needed packages, by adding the following line to /etc/apt/sources.list and installing sbuild and quinn-diff:
  2. you probably will need to modify sbuild to accept additional distribution names.
  3. debootstrap a buildd chroot from Debian:
    • debootstrap --variant=buildd --include=fakeroot,build-essential sid chroot-stage1 mirror-site

  4. create chroot-stage1/etc/apt/sources.list to point to mirror-site for debs, and ubuntu for sources:

  5. use quinn-diff to create a build-list:


We need to iterate a few times to make any real progress (there are hoary-version-specific build-depends in the hoary source tree...) the simplest way to do this is:

echo file:$(pwd)/files / > chroot-stage1/etc/apt/sources.list   # this must be first
echo deb mirror-site sid main >> chroot-stage1/etc/apt/sources.list
echo deb-src hoary main >> chroot-stage1/etc/apt/sources.list
mkdir -p chroot-stage1/$(pwd)/files
ln -s chroot-stage1/$(pwd)/files .
mv *deb files

Then, in files/, generate a Packages, Packages.gz, and Release file. As I work on the hppa port, I'll populate an arch repository with the scripts I'm using, meanwhile they're left as an exercise for the reader.

Once you update the archive, you'll need to apt-get update; apt-get clean in the chroot.

Alternatively, you can set up katie, mini-dinstall, or whatever to manage a more-real repository. Again, that is beyond the scope of this document.

stage 2

Once you have enough there to debootstrap stage 2, switch over to that. Simply create chroot-stage2 as we did for chroot-stage1 above, changing all references to Debian into references to the stage1 archive and references to sid into references to hoary. If you can't debootstrap and can't build anything else that you need in order to do so using stage1, then you'll be iterating:

  • copy the missing .debs from Debian into your stage1 archive (EVIL, take 2 penalty cards)

  • remember that you committed EVIL, and therefore must do a stage 3...

debian installer

Yeah. You'll probably want that. See the debian-installer changelog for what all files were touched for sparc/ia64, and do accordingly.


Ubuntu uses a unified kernel source tree. What this means is that you'll need to migrate (and fix) linux-kernel-di-* as well as kernel-patch-* for your architecture.


Once you have all of that happy, then it's time to validate your work. Install your system and then build a chroot and rebuild everything, using only your stage2 archive

ArchitectureBootstrapping (last edited 2008-08-06 16:35:09 by localhost)