Turning a simple chroot into a binpkg repository

OK, since Alex asked me last Sunday what exactly needs to be done to turn a simple chroot (or even a bloody box) into a binpkg producing environment, here’s a little howto …

First, lets start from a freshly unpacked stage3.

With that single change you’re basically nearly finished with setting up the whole thing, the remaining things are just

  1. Making sure the binary packages get to a web-enabled (either ftp or http) box, from where you’re going to fetch the binary packages to their target
  2. Make sure you use binary packages on the target systems by default

But first, we’re gonna need to emerge something within that freshly created build chroot.

Since we now emerged some things we do have quite a few binary packages, which we are going to need on the target systems in order to avoid individual compile time.

Now, we just need to figure out a way to get the packages to a remote repository. That’s where bashrc, rsync and ssh come into play.

Take a looksie at my bashrc (or at solar’s if you can find it), especially at syncpkg. That’s the actual function doing all the work for us. It’s basically guessing what profile you’re using atm (by reading the info’s on /etc/make.profile (x86, amd64)), and the uploading it to the remote location given by REPO_HOST, REPO_BASE and REPO_TYPE (either via environment or by /etc/make.conf).

Sure the emerge takes a bit longer (since emerge forks an rsync process via ssh that syncs the just merged binary to our remote repository), but that way you have a nice repository, from which you can install one or 1.000 boxes.