From e8ab9d78eaf19c94f46b4ca26ea54cf6feaff07c Mon Sep 17 00:00:00 2001 From: dancer Date: Wed, 11 May 2005 11:56:07 +0000 Subject: update after brasil hack 2005. --- Documentation/pbuilder-doc.xml | 405 ++++++++++++++++++++++++++--------------- 1 file changed, 261 insertions(+), 144 deletions(-) (limited to 'Documentation') diff --git a/Documentation/pbuilder-doc.xml b/Documentation/pbuilder-doc.xml index a488583..e59e3bc 100644 --- a/Documentation/pbuilder-doc.xml +++ b/Documentation/pbuilder-doc.xml @@ -4,7 +4,7 @@ and the latest version is found in CVS repository. --> - 2005-02-13 + 2005-05-02 pbuilder User's Manual pbuilder-doc Usage and operations @@ -17,17 +17,15 @@ - - Introducing pbuilder Aims of pbuilder - pbuilder stands for + pbuilder stands for Personal Builder, and it is an automatic Debian Package Building system for personal environments. - pbuilder aims to be an + pbuilder aims to be an easy-to-setup system for auto-building Debian packages inside a clean-room environment, so that it is possible to verify that @@ -46,25 +44,25 @@ installed. - The primary aim of pbuilder is different from other + The primary aim of pbuilder is different from other auto-building systems in Debian in that its aim is not - to try to build as many packages as possible. + to try to build as many packages as possible. It does not try to guess what a package needs, and in most cases it tries the worst choice of all if there is a choice to be made. - In this way, pbuilder tries to ensure - that packages - tested against pbuilder will build properly in + In this way, pbuilder tries to ensure + that packages + tested against pbuilder will build properly in most Debian installations, hopefully resulting in a good overall Debian source-buildability. - The goal of making Debian buildable from source is + The goal of making Debian buildable from source is somewhat accomplished, and has seen good progress. - It is known that Debian 3.0 is not quite - buildable from source, but the next version should + It is known that Debian 3.0 has problems when building from source. + But the version after, Debian 3.1 should be better, and the version after. @@ -76,16 +74,16 @@ pbuilder create will create a base chroot image. - The distribution code-name needs to be specified with + The distribution code-name needs to be specified with the command-line option. Usually, "sid" is used, and the default is now sid. - debootstrap is used to create - the bare minimum Debian installation, - and then build-essential packages are installed on top - of the minimum installation using apt-get + debootstrap is used to create + the bare minimum Debian installation, + and then build-essential packages are installed on top + of the minimum installation using apt-get inside the chroot. @@ -112,11 +110,11 @@ pbuilder update will update the chroot image. It will extract the chroot, invoke apt-get update - and apt-get dist-upgrade inside the + and apt-get dist-upgrade inside the chroot, and then recreate the base tarball. - It is possible to switch the distribution which the chroot + It is possible to switch the distribution which the chroot tarball is targeted at at this point. Specify to change the distribution to sid. @@ -135,24 +133,24 @@ To build a package inside the chroot, invoke pbuilder build . - pbuilder will extract + pbuilder will extract the chroot image to a temporary working directory, and satisfy the build-dependencies inside the chroot, and build the package. - The built packages will be moved to a - directory specified with + The built packages will be moved to a + directory specified with the command-line option. - The option can be + The option can be used to specify which chroot image to use. pbuilder will extract a fresh chroot image created with pbuilder build and updated with pbuilder update, - and populate the chroot with build-dependencies by parsing + and populate the chroot with build-dependencies by parsing debian/control and invoking apt-get. @@ -163,11 +161,11 @@ Facilitating Debian Developers' typing, pdebuild - pdebuild is a little wrapper + pdebuild is a little wrapper script that does the most frequent of all tasks. - A Debian Developer may try to do debuild, and + A Debian Developer may try to do debuild, and build a package, inside a Debian source directory. - pdebuild will allow similar + pdebuild will allow similar control, and allow package to be built inside the chroot, to check that the current source tree will build happily inside the chroot. @@ -184,7 +182,7 @@ See the pdebuild.1 manual page for more details. - There is a slightly different mode of operation available + There is a slightly different mode of operation available in pdebuild since version 0.97. pdebuild usually runs debian/rules clean outside of the chroot; however, it is possible to change the behavior to run it @@ -193,7 +191,7 @@ - It will try to bind mount the working directory inside chroot, + It will try to bind mount the working directory inside chroot, and run dpkg-buildpackage inside. It has the following characteristics, and thus cannot be made default. @@ -223,50 +221,50 @@ Configuration Files It is possible to specify all settings by command-line - options. However, for typing convenience, it is possible to + options. However, for typing convenience, it is possible to use a configuration file. - /etc/pbuilderrc and + /etc/pbuilderrc and ${HOME}/.pbuilderrc are read in when pbuilder is invoked. - The possible options are documented in + The possible options are documented in the pbuilderrc.5 manual page. It is useful to use --configfile option to load up a pre-set - configuration file when switching between configuration files for + configuration file when switching between configuration files for different distributions. Building packages as non-root inside the chroot - pbuilder requires full root privilege - when it is satisfying the build-dependencies, but most packages do not + pbuilder requires full root privilege + when it is satisfying the build-dependencies, but most packages do not need root privilege, or fail to build when they are root. - pbuilder can create a user which is only used + pbuilder can create a user which is only used inside pbuilder and use that user id when building, and use the fakeroot command when root privilege is required. BUILDUSERID configuration option should be set to a value for a user id that - does not already exist on the system, so that it is more difficult for - packages that are being built with + does not already exist on the system, so that it is more difficult for + packages that are being built with pbuilder to affect the environment outside the chroot. - When BUILDUSERNAME configuration option is also set, + When BUILDUSERNAME configuration option is also set, pbuilder will use the specified user name and fakeroot for building packages, instead of running as root inside chroot. - Even when using the fakerooting method, pbuilder will run with + Even when using the fakerooting method, pbuilder will run with root privilege when it is required. For example, when installing packages to the chroot, pbuilder will run under root privilege. - To be able to invoke pbuilder without being + To be able to invoke pbuilder without being root, you need to use user-mode-linux, as explained in . @@ -274,13 +272,13 @@ Using pbuilder for back-porting - pbuilder can be used for back-porting software from - the latest Debian distribution to + pbuilder can be used for back-porting software from + the latest Debian distribution to the older stable distribution, by using a chroot that contains an image of the older distribution, and building packages inside the chroot. There are several points to consider, and due to the following reasons, - automatic back-porting is usually not possible, and + automatic back-porting is usually not possible, and manual interaction is required: @@ -305,21 +303,21 @@ pbuilder can be automated, because its operations are non-interactive. - It is possible to run pbuilder through multiple packages + It is possible to run pbuilder through multiple packages non-interactively. Several such scripts are known to exist. Junichi Uekawa has been running such a script since 2001, - and has been filing bugs on packages that fail the + and has been filing bugs on packages that fail the test of pbuilder. There were several problems with auto-building: - Build-Dependencies need to install non-interactively, but - some packages are so broken that they cannot install + Build-Dependencies need to install non-interactively, but + some packages are so broken that they cannot install without interaction (like postgresql). - When a library package breaks, or gcc/gcj/g++ breaks, + When a library package breaks, or gcc/gcj/g++ breaks, or even bison, a large number of build failures are reported. (gcj-3.0 which had no "javac", bison which got more strict, etc.) @@ -334,12 +332,12 @@ - A script that was used by Junichi Uekawa is now included in + A script that was used by Junichi Uekawa is now included in the pbuilder distribution, as pbuildd.sh. It is available in /usr/share/doc/pbuilder/examples/pbuildd/ and its configuration is in /etc/pbuilder/pbuildd-config.sh. - It should be easy enough to set up for people who are used to - pbuilder. It has been running for quite a while, and it should be + It should be easy enough to set up for people who are used to + pbuilder. It has been running for quite a while, and it should be possible to set the application up on your system also. However, it is a new introduction, and please file bugs to the Debian BTS if you know of possible problems, @@ -357,7 +355,7 @@ which are not aimed for your architecture. - Because you are running random build scripts, it is better to use + Because you are running random build scripts, it is better to use the fakeroot option of pbuilder, to avoid running the build under root privilege. @@ -368,7 +366,7 @@ - Some packages require a lot of disk space, + Some packages require a lot of disk space, around 2GB seems to be sufficient for the largest packages for the time being. If you find otherwise, please inform the maintainer of this documentation. @@ -383,7 +381,7 @@ I would like some information on how people are doing it, - I would appreciate any feedback or information on + I would appreciate any feedback or information on how you are doing, or any examples. @@ -393,12 +391,12 @@ pbuilder can be used for automated testing of packages. It has the feature of allowing hooks to be placed, and these hooks can try to install packages inside - the chroot, or run them, or whatever else that + the chroot, or run them, or whatever else that can be done. Some known tests and ideas: - Automatic install-remove-upgrade-remove-install-purge-upgrade-purge testsuite (distributed as an example, B91dpkg-i), + Automatic install-remove-upgrade-remove-install-purge-upgrade-purge testsuite (distributed as an example, B91dpkg-i), or just check that everything installs somewhat (execute_installtest.sh). @@ -409,22 +407,23 @@ Automatic debian-test of the package? The debian-test package has been removed from Debian. - Someone please reintroduce it. + A pbuilder implementation can be found as + debian/pbuilder-test directory, implemented through B92pkg-test script. Using pbuilder for testing builds with alternate compilers - Most packages are compiled with gcc + Most packages are compiled with gcc or g++ and using the default compiler version, which was gcc 2.95 for Debian GNU/Linux 3.0 (i386). However, Debian 3.0 was distributed with other compilers, under package names - such as gcc-3.2 for gcc compiler + such as gcc-3.2 for gcc compiler version 3.2. It was therefore possible to try compiling packages against different compiler versions. - pentium-builder provides an infrastructure for + pentium-builder provides an infrastructure for using a different compiler for building packages than the default gcc, by providing a wrapper script called gcc which calls the real gcc. To use pentium-builder in pbuilder, it is possible to set up the @@ -436,14 +435,13 @@ export DEBIAN_BUILDGCCVER=3.2 - It will instruct pbuilder to install the pentium-builder package + It will instruct pbuilder to install the pentium-builder package and also the GCC 3.2 compiler packages inside the chroot, - and set the environment variables required for + and set the environment variables required for pentium-builder to function. - Using User-mode-linux with pbuilder @@ -493,8 +491,8 @@ export DEBIAN_BUILDGCCVER=3.2 (It's in a separate package, user-mode-linux-doc.) - user-mode-linux requires - the user to be in the uml-net group in order to configure the network + user-mode-linux requires + the user to be in the uml-net group in order to configure the network unless you are using slirp. @@ -517,14 +515,14 @@ export DEBIAN_BUILDGCCVER=3.2 - TUN/TAP only: + TUN/TAP only: add the user to the uml-net group to allow access to the network adduser dancer uml-net - TUN/TAP only: + TUN/TAP only: Check that the kernel supports the TUN/TAP interface, or recompile the kernel if necessary. @@ -532,7 +530,7 @@ adduser dancer uml-net Set up /etc/rootstrap/rootstrap.conf. For example, - if the current host is 192.168.1.2, changing following + if the current host is 192.168.1.2, changing following entries to something like this seems to work. transport=tuntap @@ -544,11 +542,11 @@ uml=192.168.1.199 netmask=255.255.255.0 Some experimentation with configuration and running - rootstrap ~/test.uml to actually + rootstrap ~/test.uml to actually test it would be handy. - Using slirp requires less configuration. + Using slirp requires less configuration. The default configuration comes with a working example. @@ -603,9 +601,9 @@ PBUILDER_UML_IMAGE="/home/dancer/uml-image" - + pbuilder-user-mode-linux does not support all options of pbuilder - properly yet. This is a problem, and will be addressed as + properly yet. This is a problem, and will be addressed as specific areas are discovered. @@ -625,7 +623,7 @@ PBUILDER_UML_IMAGE="/home/dancer/uml-image" Parallel running of pbuilder-user-mode-linux - To run pbuilder-uml in parallel on a system, there are a few things + To run pbuilder-uml in parallel on a system, there are a few things to bear in mind. @@ -637,14 +635,14 @@ PBUILDER_UML_IMAGE="/home/dancer/uml-image" If you are not using slirp, UML processes which are running in parallel need to have different IP addresses. - Just trying to run the pbuilder-uml + Just trying to run the pbuilder-uml several times will result in failure to access the network. But something like the following will work: for IP in 102 103 104 105; do xterm -e pbuilder-user-mode-linux build --uml-ip 192.168.0.$IP \ 20030107/whizzytex_1.1.1-1.dsc & -done +done When using slirp, this problem does not exist. @@ -654,7 +652,7 @@ done Using pbuilder-uml as a wrapper script to start up a virtual machine - It is possible to use pbuilder-uml for other uses than just building Debian + It is possible to use pbuilder-uml for other uses than just building Debian packages. pbuilder-user-mode-linux login will let a user use a shell inside the user-mode-linux @@ -667,12 +665,12 @@ done so that it is possible to access inside the UML through ssh. - Note that it is not possible to use a script from - /tmp due to the way pbuilder-uml mounts + Note that it is not possible to use a script from + /tmp due to the way pbuilder-uml mounts a tmpfs at /tmp. - The following example script may be useful in starting a sshd + The following example script may be useful in starting a sshd inside uml. @@ -704,9 +702,9 @@ read It often happens that pbuilder cannot create the latest chroot. Try upgrading pbuilder and debootstrap. - It is currently only possible to create software that handles the - past. Future prediction is a feature which may be added later after - we have become comfortable with the past. + It is currently only possible to create software that handles the + past. Future prediction is a feature which may be added later after + we have become comfortable with the past. There are people who occasionally backport debootstrap to stable @@ -721,10 +719,10 @@ read Directories that cannot be bind-mounted - Because of the way pbuilder works, there are several directories + Because of the way pbuilder works, there are several directories which cannot be bind-mounted when running pbuilder. The directories include /tmp, - /var/cache/pbuilder, + /var/cache/pbuilder, and system directories such as /etc and /usr. The recommendation is to use directories under the user's home directory @@ -759,7 +757,7 @@ $ sudo pbuilder update --hookdir ~/loginhooks/E10shell Setting BUILDRESULTUID for sudo sessions - It is possible to set BUILDRESULTUID=$SUDO_UID in pbuilderrc + It is possible to set BUILDRESULTUID=$SUDO_UID in pbuilderrc to set the proper BUILDRESULTUID when using sudo. @@ -771,21 +769,21 @@ $ sudo pbuilder update --hookdir ~/loginhooks/E10shell such as dpkg-source failing. There are two options, you may install a hook to create that - directory, or set + directory, or set export TMPDIR=/tmp in pbuilderrc. Take your pick. - An example script is provided as + An example script is provided as examples/D10tmp with pbuilder. Creating a shortcut for running pbuilder with a specific distribution - When working with multiple chroots, it would be nice to work with + When working with multiple chroots, it would be nice to work with scripts that reduce the amount of typing. - An example script + An example script pbuilder-distribution.sh is provided as an example. Invoking the script as pbuilder-woody will invoke pbuilder with a woody chroot. @@ -794,16 +792,16 @@ $ sudo pbuilder update --hookdir ~/loginhooks/E10shell Using special apt sources lists - If you have some very specialized requirements on your - apt setup inside pbuilder, - it is possible to specify that through + If you have some very specialized requirements on your + apt setup inside pbuilder, + it is possible to specify that through the option. Try something like: - To use the local filesystem instead of http, it is necessary to do + To use the local filesystem instead of http, it is necessary to do bind-mounting. is a command-line option useful for such cases. @@ -846,24 +844,24 @@ $ sudo pbuilder update --hookdir ~/loginhooks/E10shell Using /var/cache/apt/archives for the package cache For the help of low-bandwidth systems, - it is possible to use /var/cache/apt/archives as the + it is possible to use /var/cache/apt/archives as the package cache. Just specify it instead of the default /var/cache/pbuilder/aptcache. - It is however not possible to do so currently with the user-mode-linux + It is however not possible to do so currently with the user-mode-linux version of pbuilder, because /var/cache/apt/archives is usually only writable by root. - Use of dedicated tools such as apt-proxy is recommended, since caching of packages + Use of dedicated tools such as apt-proxy is recommended, since caching of packages would benefit the system outside the scope of pbuilder. pbuilder backported to stable Debian releases - It is known that Brian May does a backport of + It is known that Brian May does a backport of pbuilder, available at: deb http://www.microcomaustralia.com.au/debian/ woody main @@ -887,11 +885,11 @@ $ sudo pbuilder update --hookdir ~/loginhooks/E10shell Cannot Build-conflict against an essential package - pbuilder does not currently allow Build-Conflicts against + pbuilder does not currently allow Build-Conflicts against essential packages. - It should be obvious that essential packages should not be - removed from a working Debian system, and a source - package should not try to force removal of such packages + It should be obvious that essential packages should not be + removed from a working Debian system, and a source + package should not try to force removal of such packages on people building the package. @@ -899,7 +897,7 @@ $ sudo pbuilder update --hookdir ~/loginhooks/E10shell Avoiding the "ln: Invalid cross-device link" message By default, pbuilder uses hard links to manage the pbuilder package cache. - It is not possible to make hard links across different devices; + It is not possible to make hard links across different devices; and thus this error will occur, depending on your set up. If this happens, set APTCACHEHARDLINK=no in your pbuilderrc file. @@ -910,11 +908,11 @@ $ sudo pbuilder update --hookdir ~/loginhooks/E10shell It is possible to use fakechroot instead of being root to run pbuilder; however, several things make this impractical. - fakechroot overrides library loads and tries to + fakechroot overrides library loads and tries to override default libc functions when providing the functionality of virtual chroot. - However, some binaries do no use libc to function, or override the overriding - provided by fakechroot. + However, some binaries do no use libc to function, or override the overriding + provided by fakechroot. One example is ldd. Inside fakechroot, ldd @@ -932,7 +930,7 @@ $ sudo pbuilder update --hookdir ~/loginhooks/E10shell Using debconf inside pbuilder sessions - To use debconf inside pbuilder, setting DEBIAN_FRONTEND to + To use debconf inside pbuilder, setting DEBIAN_FRONTEND to readline in pbuilderrc should work. Setting it to dialog should also work, but make sure whiptail or dialog is installed inside the chroot. @@ -941,7 +939,7 @@ $ sudo pbuilder update --hookdir ~/loginhooks/E10shell nodev mount options hinder pbuilder activity - If you see messages such as this when building a chroot, you are mounting the filesystem with + If you see messages such as this when building a chroot, you are mounting the filesystem with the nodev option. @@ -950,7 +948,7 @@ $ sudo pbuilder update --hookdir ~/loginhooks/E10shell You will also have problems if you mount the filesystem with the noexec option, or nosuid. - Make sure you do not have these flags set when mounting the filesystem for + Make sure you do not have these flags set when mounting the filesystem for /var/cache/pbuilder or $BUILDPLACE. @@ -960,20 +958,20 @@ $ sudo pbuilder update --hookdir ~/loginhooks/E10shell pbuilder is slow - pbuilder is often slow. The slowest part of pbuilder is extracting the tar.gz every time + pbuilder is often slow. The slowest part of pbuilder is extracting the tar.gz every time pbuilder is invoked. That can be avoided by using pbuilder-user-mode-linux. - pbuilder-user-mode-linux uses + pbuilder-user-mode-linux uses COW filesystem, and thus does not need to clean up and recreate the root filesystem. - pbuilder-user-mode-linux is slower in executing the actual build system, due to the + pbuilder-user-mode-linux is slower in executing the actual build system, due to the usual user-mode-linux overhead for system calls. It is more friendly to the hard drive. Creating a chroot reminder - You may want a sign that you are inside a chroot, when + You may want a sign that you are inside a chroot, when working with chroot. Check out the examples/F90chrootmemo hook script. @@ -984,8 +982,8 @@ $ sudo pbuilder update --hookdir ~/loginhooks/E10shell