pbuilder - Personal builder

Problem

An easy system to build a chroot on Debian GNU/Linux systems, and building programs inside the chroot was required. Usually developers compile the programs on their own highly-customized systems, and there sometimes are cases of the programs being linked to absurd libraries. To check and prevent this case, a system which builds a system only including the necessary tools for the compilation was required.

Existing software

In reality, there were similar programs like sbuild. However, these programs are actually focused on compilation functions, and they are effective when they are ran on build daemons but not much of an entertainment to run these programs manually. This tool focuses on being a chroot environment configuration tool, and to complement tools like sbuild.

Results

As a result, a program which was implemented with a shell script was created. Using this program one can easily compile a program inside a chroot. There would have been other features, but they were ignored for the time being. It was rather good.

However, to be able to build chroot, it needs a lot of things. It is a very good stress test for debootstrap, and Debian installer. It seems to be nice that this program has helped rising the awareness about Debian base system and its state. It is by the existence of this program that sid has been kept in an installable state for almost every day (at time of writing, December 2002).

Currently many features are being added, due to many requests for such expantion. The system was not very scalable at first, and thus it should be better to think up of a expandable way without expanding the main code. There is a scriptable system for expandability. This is for executing arbitrary specified command, but by utilizing it, many requests could be met.

This project has proved to be useful in that it could build many of the Debian packages with this simplistic view of the world. However, there are quite a few packages which cannot be rebuilt from source, and the individual source packages need to be fixed now. The next move will be to fix those packages to be buildable. There are known unbuildable packages, and their build failure logs are available from here.

Download

It is available on the Debian sites, as pbuilder package. However, use of the latest version is required to bootstrap unstable/testing distributions.

A manual is available on-line, as it is distributed in the source tarball.

Usage

pbuilder create creates a chroot image, and it is saved in the .tar.gz format. By specifying --debbuildopts "-B" it is possible to hand over the option to dpkg-buildpackage. If architecture dependent parts need to be compiled from source inside the chroot, this is the way to go.

If you specify the .dsc file like pbuilder build package.dsc it will build the program inside the chroot.

pdebuild command is a convenience script, which builds the current Debian source directory (the source tree which has the debian/ directory) inside the chroot.

Extention via user-mode-linux

pbuilder requires root privileges for running, therefore the application is always confronted with security concerns. It is possible to run user-mode-linux as a normal user privilege, and run pbuilder inside it. pbuilder-uml is the application that provides this functionality.

See the log for updating the image inside to find out what it looks like using UML.

This version is now somewhat fully functional, and on 10 Jan 2003, a build daemon using UML was started.

Future

Currently cross-compilation is not really supported. In the long term plan, it would be one of the goals. The current work is in trying to make the whole system recompile from source.

This system is very simple, and this can be applied for other architectures than i386-linux, as long as debootstrap supports that architecture. It should even be possible to use this system on non-Debian systems. Log processing systems, and automatic compilation systems are the TODO items.

Related works

devscripts-el contains some useful utilities for pbuilder in emacs.


Junichi Uekawa

$Id: pbuilder.html.en,v 1.28 2004/05/31 17:06:10 dancer Exp $