Introduction

Warning

Before we get started I should point out that most of the larch scripts must be run as root in order to do their work, and that much of this work consists of deleting and overwriting files and even complete directories. If just one of these is wrong it might make quite a mess of your system. That is quite normal for an installer, but you will be using it on a system that is already configured and this is somewhat risky - if you set up your configuration wrong (or if you or I made some other mistake ...), you might find you have destroyed some important data and/or your system doesn't work any more. But that's life - Share and Enjoy!

Below is the general introductory blurb, but for those who want to jump straight in and try it out I would suggest the following pages as possible starting points:

What is a live system?

larch is a collection of scripts designed around the creation and use of custom live media (USB-stick/CD/DVD) of Arch Linux. A live operating system is one which can reside on a removable medium and boot on (ideally) any computer (of compatible architecture) into which it is inserted. This can be useful in quite a variety of situations, for example for testing purposes, for rescue purposes on machines whose installed operating system is broken, or as an installation medium (many linux distributions use live systems as installers). But there are also situations where a permanently installed live system can offer advantages over a normal installation, perhaps because of the compression or because a live system is quite robust - it is in essence read-only (though there are ways of supporting data persistence), and can be quite insensitive to hardware changes.

The main features of the larch system are listed on the Features page, among the most significant might be the use of 'profiles' to define the characteristics of the system to be built, the ability to install the live system to various media and simple support of data persistence. In addition it tries to remain as close to standard Arch Linux as possible, using (by default) the standard kernel, the same initscripts, mkinitcpio for building the initramfs, etc.

Build system requirements

larch has been designed to work without extensive demands on the build system. Although it has been developed under Arch Linux, larch should run on other GNU/Linux systems. By means of a sort of bootstrapping, the required software has been kept to a minimum - many of the build functions are carried out on the newly installed Arch system using chroot. For example, you do not need support for squashfs or aufs on the build system. But basic utilities which are normally available on any GNU/Linux system, such as bash, file, find, blkid, mkisofs - and of course chroot - are assumed to be present (on Arch that is packages 'bash', 'e2fsprogs', 'util-linux-ng', 'coreutils', 'findutils', 'file', 'cdrkit').

The larch scripts are written mainly in python, but snippets of bash crop up here and there. In addition to python you must also have the pexpect module available (in Arch the 'python-pexpect' package). The (optional) GUI requires pyqt. I'm not sure what the oldest supported versions are, development was done using python-2.6 and pyqt-4.7. I think python-2.5 should be alright, and I have heard that pyqt-4.4 probably doesn't work.

Command line vs. GUI

The basic functionality of larch is provided by command-line scripts, but a graphical user interface is available, to make it easier to see what options are available and to avoid the need to remember and not mistype obscure command line parameters. In addition to providing a front-end to the main scripts the GUI also provides help with organising the configuration files.

Overview

One design aim was easy customisation, so that even relatively inexperienced users could build personalised live systems on USB-stick or CD/DVD, containing whatever packages they wanted and with their own personal configurations. The resulting medium should also be usable for installation purposes, so that one has a customised Arch Linux installation/rescue medium. As the content can be chosen freely, a comfortable working environment is possible - in contrast to the rather Spartan standard Arch installation CD. However, note that it is also possible, using the officially supported archiso, to produce a customised Arch Linux installation/rescue medium (see the corresponding Arch wiki page). The approach taken by the two projects is somewhat different so do have a look at both. Note that at the latest since version 7, larch makes no pretence of a 'KISS' approach. The code is, I'm afraid, rather complicated. The resulting live system should, however, be very close to a normal non-live Arch Linux system (as far as the squashfs + aufs basis allows).

larch offers a flexible approach to building your live media. You can use 'profiles' to determine what gets installed, and how it is configured. The advantage of this method is that all your specifications are kept together in a folder which can be used to rebuild the same or a similar system at a later date. Alternatively you can do a normal Arch Linux installation (if there is such a thing!) and then make a live medium from this (e.g. by running larch on it from a live medium).

The use of squashfs in the resulting system means that the space occupied will be significantly less than in the 'raw' state, normally about a third of the original. As a result of this decision, it is not possible to write directly to the system - which would seem to be quite a drawback, though in some situations it can even be an advantage. The use of aufs (a 'unification' file-system, originally based on unionfs) allows the resulting system to use a writeable 'overlay', so that the system behaves in most respects like a normal installation. Of course if the boot medium is not writeable (e.g. a CD) it may be difficult to provide a persistent writeable layer (full persistence, which would include kernel updates, is completely impossible in such a situation). In that case, or in general if it is desired that there is no persistence (e.g. for 'kiosk' type situations), tmpfs (a memory-based file-system) can be used for the writeable layer.

If the larch system is used in the same way as a normal Arch installation, including package updates, the space saving effect of the squashfs archive can be lost (updates cannot modify the base archive, so they occupy additional space). At some point it would then be desirable to rebuild the system. This should be fairly straightforward, but it is not really the envisioned use of larch media.

Hardware detection is provided by the same udev approach as is used in a standard Arch Linux system.

The larch project comprises several components. The scripts for building a larch live medium are in the larch package, which need not itself be installed in the live system, though it may be useful (and is indeed installed by default). Scripts and data for the live environment are provided in the larch-live package, which must be installed in the live system. There is also an optional installer (larchin) which can install the live system to hard disk, providing a convenient way to install a ready-configured Arch Linux system.

As with Arch Linux in general larch is not really designed for beginners - you should know your way around a GNU/Linux system (preferably Arch!), and be aware of the dangers of running such programs, such as corrupting your whole system. In any case, I hope that the documentation will be clear enough to help anyone who wants to exploit larch to the full (feedback is welcome!).

Space Requirements: You need quite a lot of space to create a live Arch Linux system. Bear in mind that a complete Arch Linux system is installed, then, additionally, a compressed ('squashed') version is made, and then perhaps even a CD image (iso). Building for a USB-stick requires slightly less space, as the iso-image is not built. If building a live version of an existing Arch Linux system, much less space is required as no new system must be installed.

Installation of the larch build system

The recommended way of installing larch is by means of the setup script, see here for details. This installs all the necessary packages to a working directory, and it should also work on non-Arch linux systems.

The larch package may, however, be installed in the normal Arch Linux way using pacman. This method will only work on an Arch system, of course. The larch repository is at berlios.

The larch command line scripts need to be started as root, and each has a usage message (run with the '-h' option). The gui should be started as a normal user (it uses su, or can be configured to use sudo instead, to get administrator rights when needed).

Profiles

A larch 'profile' is a directory containing the information needed to build a particular 'flavour' of Arch Linux as a live system - which packages to install, and how it should be set up. For details see Profiles.

The stages of the build process

The starting point is an Arch Linux installation. This can be an already existing one from which you want to make a live version, or - the recommended approach - you can use the 'Installation' stage of the larch system (using the archin.py script) to prepare this. archin downloads all the desired packages (if they are not already in the host's package cache) and installs them to a directory on the host. See this page for details.

Once we have the Arch Linux installation this can be processed to build the basis components for the live medium. The installation is compressed into a squashfs archive, and an overlay directory containing the necessary modifications to the base system is built - a sort of 'patch' directory for the basic installation. The latter contains a few necessary adjustments for running as a live system and also the customisations specified in the profile. The other important component is the initramfs, which also needs to be adapted to boot the live system. This processing is performed by the larchify.py script, see this page for details.

When the 'larchification' has been completed, the components can be packed together onto a boot medium together with a bootloader. The live_iso.py script creates an iso file, which can then be written to a CD or DVD, the live_part.py script sets up a bootable partition on a disk(-like) device, such as a USB stick. See this page for details.