SBUILD-QEMU(1) | Debian sbuild | SBUILD-QEMU(1) |
sbuild-qemu - sbuild using QEMU images
sbuild-qemu [-h] [--image=IMAGE] [--arch=ARCH] [-d=DIST] [--ram-size=MiB] [--cpus=CPUs] [--overlay-dir=OVERLAY_DIR] [--noexec] [--autopkgtest-debug]
Build Debian packages with sbuild using QEMU images, by using sbuild's --chroot-mode=autopkgtest.
All options other than the ones described below are passed on through to sbuild, with the exception of --dist (it is both consumed here, and passed on). The image will be started in snapshot mode, so the image is never changed. Multiple processes can use the same image concurrently.
Using a fast temporary image overlay is key to faster build times. An overlay created on a tmpfs would be ideal, and can speed up I/O by an order of magnitude, compared to a slow HDD. If /tmp or $TMPDIR are mountpoints for a tmpfs, then all should be fine by default.
However, tmpfs filesystems are backed by memory and swap on the host, so a build needing substantial disk space in the VM may fail. If this happens, the --overlay-dir option should be used to point to a host directory with more available disk space. Note that the base image itself must have been created with a suitable size, see the --size option to sbuild-qemu-create(1).
Due to the nature of sbuild's --chroot-mode=autopkgtest, not all sbuild options are supported yet. In particular, getting an interactive shell, for example using --build-failed-command is NOT possible. However, there are other ways to access the build environment (see below).
sbuild's --chroot-mode=autopkgtest uses autopkgtest-virt-qemu under the hood, so you will find an SSH shell on port 10022 (or the first free port after that) if, and only if, the openssh-server package is installed in the VM.
As a further consequence of this chroot mode, what is stated in autopkgtest-virt-qemu(1) generally also holds here.
$ sbuild-qemu -d unstable -s --arch-all FOO.dsc
This will build the package FOO.dsc using unstable as the Distribution in the generated .changes file.
Because the --image option was not specified, an image with the name unstable-autopkgtest-amd64.img will be looked for first in the current directory, and then in $IMAGEDIR.
The -s and --arch-all aren't known to sbuild-qemu, and are therefore will be passed on through to sbuild for it to use.
$IMAGEDIR defaults to ~/.cache/sbuild.
Copyright © 2020-2022 Christian Kastner <ckk@debian.org>
04 January 2023 | Version 0.85.0 |