PermanentPbuilderChroot
Generating a permanent pbuilder chroot
This is a draft step-by-step instruction about how to create a permanent pbuilder chroot. Consider the result a dirty environment to do some quick builds in: in the end you will need to test build in a clean chroot.
This is a first draft. Please do send me your feedback. My contact info is on https://launchpad.net/~mouz.
If you have not done so already, create a normal pbuilder chroot:
$ sudo pbuilder create
Create a script that generates an error:
$ mkdir -p /path/to/hooks/disabled/ $ cat > /path/to/hooks/disabled/error #!/bin/sh echo echo ERROR IS DELIBERATE. exit 127 ^D $ cd /path/to/hooks/ $ chmod +x ./disabled/error $ ln -s ./disabled/error E00error
Make sure there are no other scripts in /path/to/hooks/. Then use the script as a pbuilder hook:
$ sudo pbuilder update \ --hookdir /path/to/hooks/ \ --debug
For more information about hooks and --debug: see the pbuilder(1) manual page.
You will land in a shell within the chroot. Exit it:
... # ^D
Pbuilder won't clean up the unpacked environment (which is what you want). Make a note of its location, ex. /var/cache/pbuilder/build/54321/. Remove the symbolic link to the hook:
$ rm /path/to/hooks/E00error
You can build in this environment using the --no-targz option:
$ sudo pbuilder build \
--no-targz \
--buildplace /var/cache/pbuilder/build/54321 \
<foo-1.2-3ubuntu4>.dsc