Profiles

This feature of the larch build system allows bundling all the configuration information for a particular live CD 'design' into a single directory. That includes the list of packages to be installed, locale information and the particular tweaks and additions needed to customize the CD, in particular a subdirectory containing the 'overlay' files - those files which have been changed from their initial fresh state after installation and those which have simply been added.

A profile is a directory, the name of the profile is the directory's name. The simplest feature is perhaps the 'rootoverlay' subdirectory: everything in this directory is copied directly to the live system's overlay, so that the a file 'a/b/c' within this directory will appear at '/a/b/c' in the live system, regardless of whether this file previously existed. Note however that all ownerships are changed to 'root:root'.

If you would like to have a look at a profile, look in the 'profiles' directory in the distribution. Each of its subdirectories is a profile. If you want to make your own profile, it is probably easiest to start with one of the examples. The larch gui allows you to copy one of these into your working directory, and rename it.

The main files within a profile are described below:

  • addedpacks - a simple list of packages (just package name as supplied to 'pacman -S', e.g. 'syslinux', not the file name), one per line, comment lines start with '#'. This is the primary place for configuring which packages are installed. Also package groups may occur here (e.g. 'xorg'), and if these are preceded by a '*' their constituent packages will be filtered by the veto list in vetopacks.
  • vetopacks - This file is optional. It provides a list of packages (one package per line) to be ignored when installing from package groups (e.g. 'base' or 'xorg'). Note that only packages which are not required by others can actually be prevented from being installed, and that only packages in 'base' and in those groups in addedpacks which are preceded by a '*' will be omitted from the installation list.
  • bootlines - This file contains bootloader independent boot lines, so that the same file can be used for grub and isolinux/syslinux. The gui provides a button to edit this file. To get an idea of what should be in here look at the default version (in the 'larch' package, 'cd-root' directory), or just click on the button.
  • rootoverlay (directory) - The files in this directory are effectively copied on top of the original system - as an overlay. They (potentially) form the bulk of the customization for the live system. This directory is optional, but editing any of the files mentioned below via the gui will create it automatically.
  • rootoverlay/etc/rc.conf - As a major point of configuration in an Arch system this is important enough to get a button in the larch gui to edit it.
  • rootoverlay/etc/locale.gen - For convenience, the larch gui provides a button to edit this file, which determines which glibc locales are supported in the live system.
  • rootoverlay/etc/mkinitcpio.conf.larch0 - Again for convenience, the larch gui provides a button to edit this file, which allows you to tweak the initramfs. This is a special version of '/etc/mkinitcpio.conf' which is used to generate the initramfs for the larch live system. The default version is supplied as '/etc/mkinitcpio.conf.larch0' in the 'larch-live' package. Whatever else you change, don't change the larch hooks.
  • rootoverlay/etc/inittab.larch - If this file is present it will cause the original /etc/inittab to be saved with a '.larchsave' suffix, and this new version will be used for the live 'inittab'. This allows a special version of this file to be used just for the live system, an installer can replace it by the original during the installation process.
  • cd-root (directory) - This directory contains files that will be (more or less) directly copied to the larch medium, partly dependent on the chosen bootloader.
  • cd-root/isolinux0 (directory) - The contents of this directory will be copied to the isolinux (syslinux) directory of the medium if the isolinux (syslinux) bootloader is chosen. If this directory doesn't exist, the default version from the 'larch' package, 'cd-root' directory, will be taken.
  • cd-root/isolinux (directory) - The contents of this directory will be copied to the isolinux (syslinux) directory of the medium if the isolinux (syslinux) bootloader is chosen. It can be used to overwrite or add to the files in the previously copied 'isolinux0' directory.
  • cd-root/grub0 (directory) - The contents of this directory will be copied to the boot directory of the medium if the grub bootloader is chosen. If this directory doesn't exist, the default version from the 'larch' package, 'cd-root' directory, will be taken.
  • cd-root/grub (directory) - The contents of this directory will be copied to the boot directory of the medium if the grub bootloader is chosen. It can be used to overwrite or add to the files in the previously copied 'grub0' directory.
  • cd-root/boot0 (directory) - The contents of this directory will be copied to the isolinux/syslinux/boot directory of the medium after the bootloader specific stuff is copied. If this directory doesn't exist, the default version from the 'larch' package, 'cd-root' directory, will be taken.
  • cd-root/boot (directory) - The contents of this directory will be copied to the isolinux/syslinux/boot directory of the medium after the bootloader specific stuff is copied. It can be used to overwrite or add to the files in the previously copied 'grub0'/'isolinux0'/'boot' directory.
  • cd-root/larch/copy (directory) - The contents of this directory will appear in '/larch/copy' on the medium and during booting the larch live system will copy the contents of this directory to the tmpfs base directory ('/.livesys').
  • cd-root/larch/extra (directory) - The contents of this directory will appear in '/larch/extra' on the medium but are otherwise unconnected with any larch functionality.

Further files which may be found within a profile are described below:

  • users - It is possible to add user accounts to the system during building. See below.
  • skel_* (directory) - Customized '/etc/skel' substitutes for use at build time only. See below.
  • vetodirs - Do not use this unless you really know what you are doing. Each directory listed in this file (one entry per line, comment lines start with '#') will be excluded from the live system. The directories are relative to the installation root.
  • build-tweak - Do not use this unless you really know what you are doing. It is a program (script) - so it must be executable - to customize the construction of the overlay (to a certain extent). It gets two arguments on the command line: the path to the installation being larchified, and the (full) path to the directory in which the overlay is being constructed. It is called just before 'mods.sqf' is squashed, but also before users are added.

Adding user accounts

The construction details should be provided in the 'users' file in the profile directory. It is an 'ini'-style configuration file, the sections being the user names. Here is an example:

[DEFAULT]
pw =
expert =
skel =
maingroup =
uid =
xgroups = video,audio,optical,storage,scanner,power,camera

[u1]
uid = 999
skel =

[u2]
pw = p1
expert =
skel =
maingroup =
uid =
xgroups = video,audio,optical,storage
The 'DEFAULT' section is not necessary, but is generated automatically by the gui user-table editor. Only entries which differ from the default values need be present.

The default primary group is defined by settings in '/etc/login.defs' and '/etc/default/useradd' ('USERGROUPS_ENAB yes' in 'etc/login.defs' causes this to be a group with the same name as the user). You can override this by adding an 'expert' option, or by placing modified versions of these files in the profile's 'rootoverlay' directory.

The additional groups should be comma-separated and without spaces.

If no 'skel'-file is specified, the default ('/etc/skel') is used, including anything in the overlay. To use a custom 'skel'-file, place the directory in the profile, giving it a name starting with 'skel_', and place the rest of the name (the part after '_') in the configuration line.

A password can be set for the new user by entering this (plain text - I'm guessing this is alright in this situation ...). An empty password field will allow passwordless logins (at least on the console).

By default the UID number will be chosen automatically, but a specific number may be entered here. In Arch Linux the UIDs normally start at 1000.

Users are added by means of 'useradd', so anything placed in the 'expert' field should be a valid option to that command. If a user-name already exists in the system to be larchified, it will be ignored (it does not count as an error).