debian.org porterboxes
The Debian project runs machines with unusual architectures that can be used for porting and validating fixes.
- Start a terminal multiplexer in case you want to run a long running compile job:
$ tmux
# or
$ screen
Using sbuild+unshare
You may use sbuild (in unshare mode) to build a package, but also to get a "chroot"-environment to work on your package.
To start an sbuild session for a distribution
<distro>and the package<pkg>, run the following. sbuild, for<pkg>takes the name of a .dsc file, or if you pass a package name it will try to download it from the archive.The Build-Depends will be installed automatically and dpkg-buildpackage will be started.
$ sbuild --chroot-mode=unshare --dist=<distro> --anything-failed-commands=%SBUILD_SHELL <pkg>
# optionally add --arch=<arch> for a different architecture (for example armel on armhf).
Alternatively pass --starting-build-commands=%SBUILD_SHELL to get a shell
before dpkg-buildpackage, or pass any other hooks (see man sbuild).
Note that the chroot is cleaned when the shell is closed.
- Inside the sbuild shell:
Once you have the sbuild session open, you may want to install and run
screen, disable network access, and probably retry building the package.
$ apt install screen # to get multiple shells.
$ unshare --net
$ su - sbuild
$ cd /build/reproducible-path/<pkg>_<version>/
$ dpkg-buildpackage -b
- You can also edit files from the outside in
/tmp/tmp.sbuild.*. You can find the tmp path in the build log as:I: Unpacking tarball from STDIN to /tmp/tmp.sbuild.XXXXXX. Then in a new shell/login:
$ unshare --map-root-user --map-auto
$ cd /tmp/tmp.sbuild.*
- In the case of backports (or experimental), you can use:
$ sbuild --extra-repository='deb http://deb.debian.org/debian experimental main'
- Getting a shell without a package. You may use the
hello-traditionalpackage as a stand-in - it is a very small package. You canexit 1the last shell so the package is not built.
$ sbuild --chroot-mode=unshare --dist=<distro> --starting-build-commands=%SBUILD_SHELL hello-traditional
- You should be done by now. If you find any issue, please report to debian-admin@lists.debian.org.
Using schroot
- List available chroots:
$ schroot -l
- Begin a persistent schroot session on Debian unstable (or in the case of backports replace sid with, for example, jessie-backports):
# Pick your own session name:
$ echo -n "Session ID: " && read sessionid && schroot -b -c sid -n $sessionid
# or use a random one:
$ sessionid=$(schroot -b -c sid)
- Update and upgrade Debian unstable chroot:
$ dd-schroot-cmd -c $sessionid apt-get update
$ dd-schroot-cmd -c $sessionid apt-get dist-upgrade
[..]
Do it for real [Y/n]:
[..]
- Install your build dependencies:
$ dd-schroot-cmd -c $sessionid apt-get build-dep hello
[..]
Do it for real [Y/n]:
[..]
- In the case of backports (or experimental), you can install a given package. You could use, for example:
$ dd-schroot-cmd -c $sessionid apt-get install debhelper/jessie-backports
[..]
- Change root to Debian unstable chroot:
$ schroot -r -c $sessionid
- Download your source:
(sid_arch-dchroot)user@porterbox:~$ apt-get source hello
- You should be able to reproduce your issue, hack on the package, fix the bug. Once you are done with your work, please, finish your schroot session:
(sid_arch-dchroot)user@porterbox:~$ exit
$ schroot -e -c $sessionid
$ exit
- List your currently open sessions:
$ schroot-list-sessions
- List all currently open sessions:
$ schroot --list --all-sessions
- You should be done by now. If you find any issue, please report to debian-admin@lists.debian.org.
