.\" (C) Copyright 2015 Etienne Dublé , .\" .TH DEBOOTSTICK 8 "August 24, 2015" .\" Please adjust this date whenever revising the manpage. .SH NAME debootstick \- Generate a bootable image from a Debian-based chroot environment .SH SYNOPSIS .B debootstick .RI [ options ] .I SOURCE DEST .SH DESCRIPTION .B debootstick generates a bootable image (at \fIDEST\fP) from a Debian-based chroot environment (at \fISOURCE\fP). .PP \fISOURCE\fP must be a directory containing a standard Debian-based chroot environment (such as one generated with \fBdebootstrap\fP(8)). The output image generated at \fIDEST\fP should then be copied to a USB stick or disk. .PP The embedded system is: .br - ready to be used (no installation step) .br - viable in the long-term, fully upgradable (kernel, bootloader included) .br - compatible with BIOS and UEFI systems .B debootstick can also generate installer media. See option \fB\-\-system\-type\fP below. .SH OPTIONS .B debootstick follows the usual GNU command line syntax, with long options starting with two dashes (`\-'). A summary of options is included below. .TP .B \-h, \-\-help Show summary of options. .TP .B \-v, \-\-version Show version of program. .TP .B \-\-help\-os\-support Describe which chroot environments are supported. .TP .B \-\-system\-type [live|installer] Specify which kind of system is targeted. The default is \fBlive\fP. When booting a system where \fBinstaller\fP was selected, the system will try to migrate to a larger device on first startup. If \fBlive\fP was selected, or if no such option was specified, no migration will occur. See section \fBINSTALLER MEDIA\fP below. .TP .B \-\-kernel\-package PACKAGE_NAME Specify the kernel that should be installed. Without this option, \fBdebootstick\fP will install a common one (depending on the embedded distribution). .TP .B \-\-config\-hostname HOSTNAME Specify the hostname the embedded system will have. .TP .B \-\-config\-kernel\-bootargs BOOTARGS Specify boot arguments to be added to the kernel. (You may specify several arguments, e.g. \fB\-\-config\-kernel\-bootargs \(dqconsole=ttyS0 acpi=off\(dq\fP.) .TP .B \-\-config\-root\-password\-ask Prompt for the root password of the embedded system and set it accordingly. .TP .B \-\-config\-root\-password\-none Remove the root password of the embedded system (root login will not prompt any password). .TP .B \-\-config\-root\-password\-first\-boot Ask for the root password when the system will be booted for the first time. .TP .B \-\-config\-grub\-on\-serial\-line Update grub configuration to show boot menu on serial line. .SH EXAMPLES The most common workflow is the following. .PP .B 1- Generate a chroot environment: .br \fBdebootstrap\fP \-\-variant=minbase jessie /tmp/jessie_tree .PP .B 2- (Optionally) customize it: .br \fBchroot\fP /tmp/jessie_tree; [...]; exit .PP .B 3- Generate the bootable image: .br \fBdebootstick\fP \-\-config\-root\-password\-ask /tmp/jessie_tree /tmp/img.dd .br Enter root password: .br Enter root password again: .br OK .br [...] .br .PP .B 4- Test it with kvm. .br \fBcp\fP /tmp/img.dd /tmp/img.dd\-test # let's work on a copy, our test is destructive .br \fBtruncate\fP \-s 2G /tmp/img.dd\-test # simulate a copy on a 2G-large USB stick .br \fBkvm\fP \-hda /tmp/img.dd\-test # the test itself (BIOS mode) .PP .B 5- Copy the boot image to a USB stick or disk. .br \fBdd\fP bs=10M if=\fB/tmp/img.dd\fP of=/dev/your\-device .PP The USB device may now be booted on any BIOS or UEFI system. .SH CPU ARCHITECTURES \fBdebootstick\fP expects a chroot environment built for amd64 or i386 systems. Of course, the resulting image will reflect this initial architecture, and thus it should be booted on a compatible system. .br \fBdebootstick\fP also needs that the host system is able to execute binaries in the chroot environment. For example, trying to run it with an amd64 chroot environment on an i386 host will fail. .br \fBdebootstick\fP will check this kind of things on startup. .SH INSTALLER MEDIA When first booting a system built with the \fB\-\-system\-type installer\fP option, it will look for a larger disk and move to that disk. This operation does not require a reboot. Once done, the system will just continue its bootup procedure (and the initial device can be removed). .br \fBCAUTION:\fP Any data on the target disk will be lost. .br Also note that the system is moved, not copied. Thus the initial device cannot be used anymore after the migration, unless you copy an image again, of course. .SH NOTES It is also possible to test the UEFI boot with \fBkvm\fP, if you have the \fBovmf\fP package installed, by adding \fB\-bios /path/to/OVMF.fd\fP to the \fBkvm\fP command line. .PP Many Live distributions propose a highly compressed system based on a squashfs image. They handle writes using an overlay based on a filesystem union. While this allows the system to remain compact in the first times, this also has disavantages: .br - Some important files remain read-only and cannot be upgraded (that is the case of the linux kernel and the bootloader) which quickly leads to security issues or upgrade problems. .br - Storing modified files in an overlay and never releasing the room needed for the original versions in the squashfs image is counter-productive in the long term. .br One of the objectives behind \fBdebootstick\fP was to provide a viable long-term live system, therefore this kind of setup has been discarded. .SH AUTHOR Etienne Duble (etienne.duble@imag.fr) .SH SEE ALSO .BR debootstrap (8), .BR kvm (1).