.\" Man page generated from reStructuredText. . .TH "VMDEBOOTSTRAP" "8" "March 31, 2019" "1.11 " "vmdebootstrap" .SH NAME vmdebootstrap \- install basic Debian system into virtual disk image . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH PURPOSE .sp vmdebootstrap is a helper to install basic Debian system into virtual disk image. It wraps \fBdebootstrap\fP\&. You need to run \fBvmdebootstrap\fP as root. If the \fB\-\-verbose\fP option is not used, no output will be sent to the command line. If the \fB\-\-log\fP option is not used, no output will be sent to any log files either. .sp To use the image, you probably want to create a virtual machine using your preferred virtualization technology, such as \fBkvm\fP or \fBqemu\fP\&. Configure the virtual machine to use the image you\(aqve created. Then start the virtual machine and log into it via its console to configure it. The image has an empty root password and will not have networking configured by default. Set the root password before you configure networking. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ sudo vmdebootstrap \-\-image=FILE \-\-size=SIZE [\-\-mirror=URL] [\-\-distribution=NAME] .ft P .fi .UNINDENT .UNINDENT .SS Options .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .TP .BI \-\-output\fB= FILE write output to FILE, instead of standard output .TP .B \-\-verbose report what is going on .TP .B \-\-no\-verbose opposite of \-\-verbose .TP .BI \-\-image\fB= FILE put created disk image in FILE .TP .BI \-\-size\fB= SIZE create a disk image of size SIZE (1000000000) in bytes. Suffixes k,K,M,G,T are supported, see qemu\-img(1) for more detail. .TP .BI \-\-tarball\fB= FILE tar up the disk\(aqs contents in FILE .TP .BI \-\-mirror\fB= URL use MIRROR as package source (\fI\%http://httpredir.debian.org/debian/\fP) .TP .BI \-\-arch\fB= ARCH architecture to use (amd64) \-\-\- if using an architecture which the host system cannot execute, ensure the \fB\-\-foreign\fP option is also used. .TP .BI \-\-distribution\fB= NAME release to use (defaults to stable). The release needs to be a valid Debian or Ubuntu release name or codename. .TP .BI \-\-debootstrapopts\fB= OPTS Supply options and arguments to \fBdebootstrap\fP, separated by spaces. e.g. \fB\-\-debootstrapopts="variant=buildd no\-check\-gpg components=main,contrib"\fP\&. See \fBdebootstrap (1)\fP for more information. This option replaces the \fB\-\-variant\fP support in previous versions. .TP .BI \-\-debootstrap\-scripts\fB= DIR set the directory containing debootstrap scripts. .TP .BI \-\-package\fB= PACKAGE install PACKAGE onto system .TP .BI \-\-custom\-package\fB= DEB install package in DEB file onto system (not from mirror) \- all dependencies must be available in the specified distribution. .TP .B \-\-no\-kernel do not install a linux package .TP .BI \-\-kernel\-package\fB= PACKAGE If \fB\-\-no\-kernel\fP is not used and the auto\-selection of the \fBlinux\-image\-586\fP or \fBlinux\-image\-armmp\fP or \fBlinux\-image\-$ARCH\fP package is not suitable, the kernel PACKAGE name can be specified explicitly. .TP .B \-\-enable\-dhcp enable DHCP on eth0 .TP .BI \-\-root\-password\fB= PASSWORD set root password .TP .B \-\-lock\-root\-password lock root account so they cannot login? .TP .BI \-\-customize\fB= SCRIPT run SCRIPT after setting up system. If the script does not exist in the current working directory, \fB/usr/share/vmdebootstrap/examples/\fP will be checked as a fallback. The script needs to be executable and is passed the root directory of the debootstrap and the image name as the only arguments. Use chroot if you need to execute binaries within the chroot created by debootstrap. .TP .BI \-\-hostname\fB= HOSTNAME set name to HOSTNAME (debian) .TP .BI \-\-user\fB= USERSTRING create USER with PASSWORD. The USERSTRING needs to be of the format: USER/PASSSWORD. .TP .BI \-\-owner\fB= OWNER change the owner of the final image from root to the specified user. .TP .B \-\-serial\-console configure image to use a serial console (Wheezy only) .TP .B \-\-serial\-console\-command (Wheezy only.) Set the command to manage the serial console which will be appended to \fB/etc/inittab\fP\&. Default is \fB/sbin/getty \e\-L ttyS0 115200 vt100\fP, resulting in a line: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C "S0:23:respawn:/sbin/getty \e\-L ttyS0 115200 vt100" .ft P .fi .UNINDENT .UNINDENT .TP .B \-\-sudo install sudo, and if user is created, add them to sudo group .TP .BI \-\-bootsize\fB= BOOTSIZE If specified, create a /boot partition of the given size within the image. Debootstrapping will fail if this is too small for the selected kernel package and upgrading such a kernel package is likely to need two or three times the space of the installed kernel. .TP .BI \-\-boottype\fB= FSTYPE Filesystem to use for the /boot partition. (default ext2) .TP .BI \-\-bootflag\fB= FLAG Flag to set on the first partition. (default none) .TP .BI \-\-bootoffset\fB= SIZE Space to leave at start of the image for bootloader .TP .BI \-\-roottype\fB= FSTYPE Filesystem to use for the / (root) partition. (default ext4) .TP .BI \-\-part\-type\fB= PART\-TYPE Partition type to use for this image. (default msdos) .TP .BI \-\-swap\fB= SWAPSIZE If specified, create a swap partition of the given size within the image. Debootstrapping will fail if this results in a root partition which is too small for the selected packages. The minimum swap space is 256MB as the default memory allocation of QEMU is 128MB. A default 1GB image is not likely to have enough space for a swap partition as well. .TP .BI \-\-foreign\fB= PATH Path to the binfmt_handler to enable foreign support in debootstrap. e.g. \fB/usr/bin/qemu\-arm\-static\fP Note: foreign debootstraps may take a significant amount of time to complete and debootstrap will retry five times if packages fail to install by default. .TP .B \-\-use\-uefi Setup image for UEFI boot .TP .B \-\-no\-use\-uefi opposite of \-\-use\-uefi .TP .BI \-\-esp\-size\fB= SIZE Size of EFI System Partition \- requires use\-uefi .TP .B \-\-extlinux install extlinux (deprecated: default will change in a future release to use grub) .TP .B \-\-no\-extlinux Skip installation of extlinux. Needs grub, a customize script or alternative bootloader to make the image bootable. extlinux is deprecated and this will become the default in a future release. .TP .B \-\-mbr Run install\-mbr (default if extlinux used) .TP .B \-\-no\-mbr opposite of \-\-mbr .TP .BI \-\-squash\fB= DIRECTORY Run mksquashfs against the rootfs using xz compression \-\-\- requires \fBsquashfs\-tools\fP to be installed. The squashfs and other files needed to use the squashfs to make a bootable system will be put into the specified directory. The directory will contain a \fBfilesystem.squashfs\fP as well as the top level contents of the \fBboot/\fP directory. (If using UEFI, the \fBboot/efi\fP directory as well.) By default, \fBmksquashfs\fP is allowed to use all processors which may result in high load. squashfs can also have issues with large root filesystems. These errors can result in truncated files. This is a known bug in squashfs. \fBvmdebootstrap\fP will fail if the squashed filesystem is less than 1MB. .TP .B \-\-configure\-apt Use the specified mirror and distribution to create a suitable apt source inside the VM. Can be useful if debootstrap fails to create it automatically. .TP .B \-\-apt\-mirror Use the specified mirror inside the image instead of the mirror used to build the image. This is useful if you have a local mirror to make building the image quicker but the image needs to run even if that mirror is not available. Requires \fB\-\-configure\-apt\fP .TP .B \-\-grub Disable extlinux installation and configure grub2 instead. grub2 will be added to the list of packages to install. update\-grub will be called once the debootstrap is complete and grub\-install will be called in the image. .TP .B \-\-no\-acpid Disable installation of acpid if not required, otherwise acpid will be installed if \fB\-\-foreign\fP is not used. .TP .B \-\-sparse Skip optimizing image for compression and keep a sparse image. .TP .B \-\-no\-sparse opposite of \-\-sparse .TP .B \-\-pkglist Output a list of package names installed inside the image. Useful if you need to track the relevant source packages used inside the image for licence compliance. .TP .B \-\-dry\-run Do not build, just test that the options are valid. .TP .B \-\-no\-update\-initramfs Skip the call to \fBupdate\-initramfs\fP for reasons of speed or practicality. .TP .B \-\-convert\-qcow2 Convert the final raw image to qcow2 format. .TP .B \-\-systemd\-networkd Use Predictable Network Interface Names .TP .B \-\-no\-systemd\-networkd Do not use Predictable Network Interface Names using systemd\-networkd. .UNINDENT .UNINDENT .UNINDENT .SH CONFIGURATION FILES AND SETTINGS .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .TP .B \-\-dump\-config write out the entire current configuration .TP .B \-\-no\-default\-configs clear list of configuration files to read .TP .BI \-\-config\fB= FILE add FILE to config files .UNINDENT .UNINDENT .UNINDENT .SH LOGGING .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .TP .BI \-\-log\fB= FILE write log entries to FILE (default is to not write log files at all); use "syslog" to log to system log, or "none" to disable logging. .TP .BI \-\-log\-level\fB= LEVEL log at LEVEL, one of debug, info, warning, error, critical, fatal (default: debug). .TP .BI \-\-log\-max\fB= SIZE rotate logs larger than SIZE, zero for never (default: 0) .TP .BI \-\-log\-keep\fB= N keep last N logs (10) .TP .BI \-\-log\-mode\fB= MODE set permissions of new log files to MODE (octal; default 0600) .UNINDENT .UNINDENT .UNINDENT .SH PERFORMANCE .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .TP .BI \-\-dump\-memory\-profile\fB= METHOD make memory profiling dumps using METHOD, which is one of: none, simple, meliae, or heapy (default: simple) .TP .BI \-\-memory\-dump\-interval\fB= SECONDS make memory profiling dumps at least SECONDS apart .UNINDENT .UNINDENT .UNINDENT .SH NETWORKING .SS Wheezy support .sp The \fB\-\-enable\-networking\fP option uses the \fB/etc/network/interfaces.d/\fP source directory, with the default settings for \fBlo\fP and \fBeth0\fP being added to \fB/etc/network/interfaces.d/setup\fP\&. Other networking configuration can be specified using a customisation script. Localhost settings would be: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C auto lo iface lo inet loopback .ft P .fi .UNINDENT .UNINDENT .sp If \fB\-\-enable\-dhcp\fP is specified, these settings are also included into \fB/etc/network/interfaces.d/setup\fP: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C auto eth0 iface eth0 inet dhcp .ft P .fi .UNINDENT .UNINDENT .sp In addition, wheezy images do not boot if the roottype is specified as the default of \fBext4\fP, so \fBvmdebootstrap\fP will fail if a \fB\-\-roottype\fP is not specified or is specified as \fBext4\fP\&. .SS Jessie and later .sp In addition, \fBsystemd\fP in jessie or later introduces \fI\%PredictableNetworkInterfaceNames\fP which are enabled using the \fBsystemd\-networkd\fP service. If this option is disabled, traditional interface names (like \fBeth0\fP) will be used and the predictable names masked using \fBudev\fP\&. Implementing the mask requires updating the initramfs, so the \fB\-\-update\-initramfs\fP option must not be disabled. .sp If DHCP is also enabled, the following configuration is used: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C /etc/systemd/network/99\-dhcp.network .ft P .fi .UNINDENT .UNINDENT .sp \fBsystemd\fP will use the first available match, so this can be overridden by putting another file into place using the customisation scripts, using a lower sorting filename. .SS Stretch and later .sp There is no need to use the \fB\-\-enable\-dhcp\fP option when using \fBsystemd\fP for networking with stretch or sid. \fBsystemd\-resolved\fP is enabled instead if \fBsystemd\-networkd\fP is specified. (\fB\-\-enable\-dhcp\fP would simply add an unused entry to \fB/etc/network/interfaces\fP for \fBeth0\fP\&.) .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C [Match] Name=en* [Network] DHCP=yes .ft P .fi .UNINDENT .UNINDENT .SH BOOTLOADERS .sp Unless the \fB\-\-no\-extlinux\fP or \fB\-\-grub\fP options are specified, the image will use \fBextlinux\fP as a boot loader. \fBbootsize\fP is not recommended when using \fBextlinux\fP \-\-\- use \fBgrub\fP instead. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Unlike grub, extlinux support requires the installation of packages outside the image which are used to install the extlinux bootloader inside the image. extlinux support also involves the use of \fBsync\fP which can cause issues on systems with multiple filesystems mounted, particularly over a network or when building multiple images simultaneously. Therefore, \fBextlinux\fP is \fBdeprecated\fP in vmdebootstrap. The default will change in a future release and \fBextlinux\fP support may be dropped once Stretch is released. .UNINDENT .UNINDENT .SS extlinux support issues with ext4 .sp VMs using ext4 may not boot when using extlinux \- unless the build is performed on Jessie. Builds using ext2 and ext3 work normally. .sp \fBIMPORTANT:\fP .INDENT 0.0 .INDENT 3.5 This problem depends on the \fBexternal\fP distribution, \fBnot\fP the distribution you are trying to build. When building on Jessie, \fBextlinux\fP succeeds but when building on Stretch or Sid, \fBextlinux\fP fails to make a bootable system if the filesystem of that system is \fBext4\fP\&. ext2 and ext3 work. .UNINDENT .UNINDENT .sp Version 1.6 of vmdebootstrap adds a warning but allows the build to proceed (to allow for the bug to be fixed). Sadly, downgrading the version of extlinux to the version in Jessie does not fix the problem when building on stretch or sid. Hence, vmdebootstrap can only output a warning. .sp \fBSEE ALSO:\fP .INDENT 0.0 .INDENT 3.5 \fI\%http://bugs.debian.org/cgi\-bin/bugreport.cgi?bug=833057\fP .UNINDENT .UNINDENT .SS Versions of grub2 in wheezy .sp Grub2 in wheezy can fail to install in the VM, at which point \fBvmdebootstrap\fP will fall back to \fBextlinux\fP\&. It may still be possible to complete the installation of \fBgrub2\fP after booting the VM as the problem may be related to the need to use loopback devices during the \fBgrub\-install\fP operation. Details of the error will appear in the vmdebootstrap log file, if enabled with the \fB\-\-log\fP option. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 \fBgrub\-legacy\fP is not supported. .UNINDENT .UNINDENT .sp \fBvmdebootstrap\fP also supports \fBEFI\fP\&. See \fI\%UEFI\fP\&. .sp Use \fB\-\-use\-uefi\fP to use \fBgrub\-efi\fP instead of \fBgrub\-pc\fP\&. If the default 5MB is not enough space, use the \fB\-\-esp\-size\fP option to specify a different size for the EFI partition. Registered firmware is not supported as it would need to be done after boot. If the system you are creating is for more than just a VM or live image, you will likely need a larger ESP, up to 500MB. .SS UEFI .sp UEFI support requires Grub and \fBvmdebootstrap\fP contains a configuration table of the UEFI components required for supported architectures. .sp There are issues with running UEFI with QEMU on some architectures and a customisation script is available for amd64: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # vmdebootstrap \-\-verbose \-\-image jessie\-uefi.img \-\-grub \-\-use\-uefi \e \-\-customize ./examples/qemu\-efi\-bochs\-drm.sh .ft P .fi .UNINDENT .UNINDENT .sp \fBvmdebootstrap\fP supports UEFI for images and for squashfs but the necessary behaviour is different. With an image, an ESP vfat partition is created. With squashfs, the EFI files will be copied into an \fBefi/\fP directory in the squashfs output directory instead. .sp There is EFI firmware available to use with QEMU when testing images built using the UEFI support, but this software is in Debian non\-free due to patent concerns. If you choose to install \fBovmf\fP to test UEFI builds, a secondary change is also needed to symlink the provided \fBOVMF.fd\fP to the file required by QEMU: \fBbios\-256k.bin\fP and then tell QEMU about the location of this file with the \-L option: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ qemu\-system\-x86_64 \-L /usr/share/ovmf/ \-machine accel=kvm \e \-m 4096 \-smp 2 \-drive format=raw,file=test.img .ft P .fi .UNINDENT .UNINDENT .sp To test the image, also consider using the \fBqemu\-wrapper.sh\fP: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ /usr/share/vmdebootstrap/qemu\-wrapper.sh jessie\-uefi.img amd64 /usr/share/ovmf/ .ft P .fi .UNINDENT .UNINDENT .SS UBoot .sp UBoot needs manual configuration via the customisation hook scripts, typically support requires adding \fBu\-boot\fP using \fB\-\-package\fP and then copying or manipulating the relevant \fBu\-boot\fP files in the customisation script. Examples are included for beaglebone\-black. .sp Some \fBu\-boot\fP examples recommend the use of the \fBlba\fP flag on the boot partition, so use the \-\-bootflag option where relevant. .SH INSTALLATION IMAGES AND VIRTUAL MACHINES .sp :file:\fBvmdebootstrap\fP is aimed principally at creating virtual machines, not installers or prebuilt installation images. It is possible to create prebuilt installation images for some devices but this depends on the specific device. (A \(aqprebuilt installation image\(aq is a single image file which can be written to physical media in a single operation and which allows the device to boot directly into a fully installed system \-\-\- in a similar way to how a virtual machine would behave.) .sp \fBvmdebootstrap\fP assumes that all operations take place on a local image file or directory, not a physical block device / removable media. .sp \fBvmdebootstrap\fP is intended to be used with tools like \fBqemu\fP on the command line to launch a new virtual machine. Not all devices have virtualisation support in hardware. .sp This has implications for \fBu\-boot\fP support in some cases. If the device can support reading the bootloader from a known partition, like the beaglebone\-black, then \fBvmdebootstrap\fP can provide space for the bootloader and the image will work as a prebuilt installation image. If the device expects that the bootloader exists at a specific offset and therefore requires that the bootloader is written as an image not as a binary which can be copied into an existing partition, \fBvmdebootstrap\fP is unable to include that bootloader image into the virtual machine image. .sp The beagleboneblack.sh script in the examples/ directory provides a worked example to create a prebuilt installation image. However, the beagleboneblack itself does not support virtualisation in hardware, so is unable to launch a virtual machine. Other devices, like the Cubietruck or Wandboard need \fBu\-boot\fP at a predefined offset but can launch a virtual machine using \fBqemu\fP, so the cubietruck and wandboard6q scripts in the examples/ directory relate to building images for virtual machines once the device is already installed and booted into a suitable kernel. .sp It is possible to wrap \fBvmdebootstrap\fP in such a way as to prepare a physical block device with a bootloader image and then deploy the bootstrap on top. However, this does require physical media to be inserted and removed each time the wrapper is executed. To do this, use the \fB\-\-tarball\fP option instead of the \fB\-\-image\fP option. Then setup the physical media and bootloader image manually, as required for the device, redefine the partitions to make space for the rootfs, create a filesystem on the physical media and unpack the \fBvmdebootstrap\fP tarball onto that filesystem. Once you have working media, an image can be created using dd to read back from the media to an image file, allowing other media to be written with a single image file. .SH EXAMPLE .sp To create an image for the stable release of Debian: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C sudo vmdebootstrap \-\-image test.img \-\-size 1G \e \-\-log test.log \-\-log\-level debug \-\-verbose \e \-\-mirror http://mirror.lan/debian/ .ft P .fi .UNINDENT .UNINDENT .sp To run the test image, make sure it is writeable. Use the \fB\-\-owner\fP option to set mode 0644 for the specified user or use chmod manually: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C sudo chmod a+w ./test.img .ft P .fi .UNINDENT .UNINDENT .sp If \fB\-\-log\fP is also used, consider using \fB\-\-log\-mode\fP as well so that the logfile is readable by the owner. By default, the log file permissions are 0o600. The logfile itself will be owned by \fBroot\fP\&. .sp Execute using qemu, e.g. on amd64 using qemu\-system\-x86_64: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C qemu\-system\-x86_64 \-drive format=raw,file=./test.img .ft P .fi .UNINDENT .UNINDENT .sp (This loads the image in a new window.) Note the use of \fB\-drive file=,format=raw\fP which is needed for newer versions of QEMU. .sp There is a \fBbin/qemu\-wrapper.sh \fP script for simple calls where the \fB\-\-owner\fP option is used, e.g.: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ /usr/share/vmdebootstrap/qemu\-wrapper.sh jessie.img amd64 .ft P .fi .UNINDENT .UNINDENT .sp There is EFI firmware available to use with QEMU when testing images built using the UEFI support, but this software is in Debian non\-free due to patent concerns. If you choose to install \fBovmf\fP to test UEFI builds, a secondary change is also needed to symlink the provided \fBOVMF.fd\fP to the file required by QEMU: \fBbios\-256k.bin\fP and then tell QEMU about the location of this file with the \-L option: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ qemu\-system\-x86_64 \-L /usr/share/ovmf/ \-machine accel=kvm \e \-m 4096 \-smp 2 \-drive format=raw,file=test.img .ft P .fi .UNINDENT .UNINDENT .sp To use the \fB\-nographic\fP option, ensure that the \fB\-\-serial\-console\fP option is supplied to \fBvmdebootstrap\fP and use \fB\-monitor none\fP when booting the image with QEMU. .sp For further examples, including u\-boot support for beaglebone\-black, see \fB/usr/share/vmdebootstrap/examples\fP .SH NOTES .sp If you get problems with the bootstrap process, run a similar bootstrap call directly and chroot into the directory to investigate the failure. The actual debootstrap call is part of the vmdebootstrap logfile. The debootstrap logfile, if any, will be copied into your current working directory on error. .sp \fBdebootstrap\fP will download all the apt archive files into the apt cache and does not remove them before starting the configuration of the packages. This can mean that debootstrap can fail due to a lack of space on the device if the VM size is small. vmdebootstrap cleans up the apt cache once debootstrap has finished but this doesn\(aqt help if the package unpack or configuration steps use up all of the space in the meantime. Avoid this problem by specifying a larger size for the image. .sp \fBCAUTION:\fP .INDENT 0.0 .INDENT 3.5 if you are also using a separate /boot partition in your options to \fBvmdebootstrap\fP it may well be the boot partition which needs to be enlarged rather than the entire image. .UNINDENT .UNINDENT .sp It is advisable to change the mirror in the example scripts to a mirror closer to your location, particularly if you need to do repeated builds. Use the \-\-apt\-mirror option to specify the apt mirror to be used inside the image, after boot. .sp There are two types of examples for ARM devices available with \fBvmdebootstrap\fP: prebuilt installation images (like the beaglebone\-black) and virtual machine images (cubietruck and wandboard). ARM devices which do not support hypervisor mode and which also rely on the bootloader being at a specific offset instead of using a normal partition will \fBnot\fP be supportable by vmdebootstrap. Similarly, devices which support hypervisor will only be supported using virtual machine images, unless the bootloader can be executed from a normal partition. .sp If the host device has a limited amount of RAM or simply to use a different TMP directory when preparing the filesystems, set the \fBTMPDIR\fP or \fBTEMP\fP or \fBTMP\fP environment variables, in line with the underlying support in the python tempfile module. .SH DEVELOPING .SS Testing vmdebootstrap from git .sp \fBvmdebootstrap\fP uses \fByarn\fP for the test suite, available in the \fI\%cmdtest\fP package. YARN is a scenario testing tool. Scenarios are written in mostly human readable language, however, they are not free form text. For more information on YARN see \fI\%the homepage\fP: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ sudo apt \-y install cmdtest .ft P .fi .UNINDENT .UNINDENT .sp All commits must pass at least the fast tests. All merges into master need to pass a full test. All additions of new functionality must add fast and build tests \-\-\- fast tests for any new options and build tests which exercise the new functionality. Build tests can add checks for particular support on the machine running the test and skip if not found or add new environment settings to selectively run some build tests instead of all. .sp If no arguments are given, the full test suite will be executed: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ yarns/run\-tests .ft P .fi .UNINDENT .UNINDENT .sp \fBWARNING:\fP .INDENT 0.0 .INDENT 3.5 Do not run the full test suite if your connection to a Debian mirror is limited or metered. Each build requires a minimum of 2GB free space in tmpfs. A full test takes at least 10 minutes. .UNINDENT .UNINDENT .sp When limiting the run to specific tests, each \fB\-\-env\fP option needs to be specified separately: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ sudo yarns/run\-tests \-\-env TESTS=build \-\-env MIRROR=http://mirror/debian .ft P .fi .UNINDENT .UNINDENT .sp To run a single test, use the \fB\-\-run\fP option to specify the name of the scenario (option can be repeated). .SS pre\-commit .sp All vmdebootstrap developers need to run the fast tests as a pre\-commit hook \-\-\- any patches which fail this test will be rejected: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ ln \-s ../../pre\-commit.sh .git/hooks/pre\-commit .ft P .fi .UNINDENT .UNINDENT .sp The pre\-commit hook just runs the fast tests which do not require \fBsudo\fP\&. .SS Fast tests .sp The fast checks validate the handling of incompatible option arguments: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ yarns/run\-tests \-\-env TESTS=fast .ft P .fi .UNINDENT .UNINDENT .sp Fast tests typically take a few seconds to run. .SS Build tests .sp The slow / build tests build multiple images and use \fBsudo\fP \-\-\- a local mirror is strongly recommended. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ sudo yarns/run\-tests \-\-env TESTS=build \-\-env MIRROR=http://mirror/debian .ft P .fi .UNINDENT .UNINDENT .sp If \fBMIRROR\fP is not specified, a default mirror of \fBhttp://httpredir.debian.org/debian/\fP will be used. .SS LAVA tests .sp There is an example \fBlava\-submit.py\fP script which can be edited to automatically submit QEMU tests to a specified LAVA instance. The images themselves will use local \fBfile://\fP URLs and therefore the \fBlava\-dispatcher\fP needs to be installed locally. Configuring LAVA for these tests is a separate topic \-\-\- please ask on the \fI\%vmdebootstrap mailing list\fP\&. .SH AUTHOR Neil Williams .SH COPYRIGHT 2019, Neil Williams .\" Generated by docutils manpage writer. .