live Arch Linux builder
Preparing the larch live medium
The building blocks for the preparation of a live medium are produced by the 'larchification' process: the squashfs archive, 'system.sqf', the 'boot' directory, containing the kernel and initramfs, and the modifications overlay, 'mods.sqf'.
This stage adds the bootloader files and user-defined customisations which are directly copied to the medium rather than being included in the overlay (essentially the stuff from the 'cd-root' directory in the profile. See the cd-root section in the profiles documentation for details on how to customise this data. On writeable media it is also possible to specify that the medium be used as a writeable overlay branch in the aufs root ('/') file-system. Finally the system is written to the medium, if it is a partition (USB-stick, etc.), or - in the case of a CD/DVD - an iso file is created.
The structure of the live system is such that it is fairly easy to transfer a larch system from one medium to another, including the preservation of changes that have been made using the data persistence facility, and including the possibility of transferring a non-writeable system to a writeable medium and then enabling data persistence. Support files for these operations are saved in the '/boot/support' directory of the medium - these are mostly binary executables which may not be available (in the correct version) on the machine used to perform the operations. The libraries they need are also included, and the applications must be run as
path/to/support/support application-name arguments
The applications supported in this way are mksquashfs, unsquashfs, extlinux and syslinux. Also the binaries 'mbr.bin' and 'isolinux.bin' from the syslinux package are made available here. The copying process can, however, be delegated to the 'larch-medium' script, the source medium being specified using the '-S' option (run 'larch-medium -h' for all options).
Data Persistence: The Writeable Overlay
The medium (partition) containing the larch system can be used as a writeable overlay branch for the live system (assuming the partition actually is writeable), causing changes made while running the system to be preserved from one boot to the next, basically the same as in a 'normal' linux system. The advantage this has over just installing a normal linux system on the partition is that the bulk of the underlying system is highly compressed, allowing smaller devices to be used than would otherwise be possible. It is also relatively straightforward to transfer such a system to and from non-writeable media, such as CD/DVD.
If the medium is not writeable (or if the 'nw' boot parameter is passed) then a writeable layer is created in tmpfs, a memory based file-system, allowing the system to act 'normally' (i.e. the file-system appears writeable) while running. However any changes will be lost on shutdown. There are situations (e.g. 'kiosk'-systems) where this behaviour can even be an advantage.
Command-line Scripts
The command line script for building a larch live is larch-medium. Run 'larch-medium -h' to get a usage message.
When the live system is installed to a partition (e.g. USB-stick) it is possible to choose how the boot partition will be recognized. The options available are via UUID, partition label, partition path (e.g. '/dev/sdb1'), or by searching for a partition containing the file 'larch/larchboot'. See also 'Boot parameters'.
The 'bootlines' file allows the boot options to be specified in an easily parseable, bootloader independent way. The default version is supplied in the 'larch' package (in the 'cd-root/boot0' directory), but this will be overridden by a version supplied in the profile. The unprocessed version is also retained in the 'boot' directory of the created medium, for later reference.
It is possible to repeat the installation onto various media, changing the configuration, without needing to rerun the 'larchification' stage. The constituent larch files remain unchanged.
Building a boot CD for a USB-stick
Older computers may not be able to boot from USB devices, so the possibility of generating a small boot iso is provided. This can be burned to CD and can be used to boot your larch system on a USB-stick. On the command line this is managed by passing the '-b' option to the larch-medium script. As this function uses the system on the USB-stick, this needs to be plugged in (not mounted!) and selected in the 'Partition' entry.
As the kernel and initramfs are now taken from the CD rather than from the USB device, an update of the kernel on the actual larch medium would require the creation of a new boot-CD.