Command-Line Interface

Basically the same actions as can be performed from the gui are available via the command-line. The larch program must be started with '-c' as the first option, the commands will be taken from the rest of the command line. There are a couple of options, selected by appending letters directly to the '-c': 'x' will cause the program to skip interactive prompts (just ploughing on through your system without asking if that's ok), 'l' will suppress logging to the console (a log file will always be written to the working directory). Note that the configuration files will be looked for in ~/.config/larch, so start it as the user which has (or should have) these files. You will be prompted for the root password if necessary. [If you need to run without such prompts, you must start the program as root and ensure that the environment variable '$HOME' is set appropriately. If you then issue commands which write to the configuration area, you will probably find that the ownerships are wrong, so be warned.]

The actual commands follow. It is possible to pass a sequence of commands, where each command is a single argument to the 'larch' program - which means that commands must be enclosed in quotes (unless they consist of single words). Each command has a long form and a short form, some need an argument, some not. Some just give information, others change the stored configuration, still others perform the actual operations which are needed to produce a live system. A simple, probably rather useful example would be the 'show_project_info' command, which outputs the main stored configuration information. Using the short form it could be entered thus:

larch -c i?

The complete list of commands

Command Alias Arguments Description
show_project_info i? Output the main stored configuration information
show_projects P? List the configured projects
show_profiles p? List the configured profiles
show_example_profiles e? List the example profiles supplied with larch
show_partitions d? List the partitions to which the live system might be installed
install i Run the installation step
larchify l "[s][r]" Prepare the live system (squash the system, prepare the overlay, initramfs, etc.)
create_iso ci Build an iso image for burning to CD/DVD
write_partition cp device "[n][l]" Write the larch system to a partition
create_bootiso cb Make a boot iso image for computers that can't boot from USB devices
set_project P: name Select one of the already configured projects
new_project P+ name Start a new project
del_project P- name Remove a project
set_profile p: name Select one of the already configured profiles
rename_profile p! name Rename the current profile
new_profile p+ path [name] Copy a profile from the given path, optionally renaming it
del_profile p- name Remove a profile
set_ipath ip: path Set the installation path
set_platform arch: i686(/x86_64) Set the platform (only relevant on x86_64 host)
set_buildmirror m: URL Set the URL of a custom repository to be used for installation
use_build_mirror um: y/n Use the custom repository set by "set_buildmirror"
use_project_mirrorlist upm: y/n If not using a custom installation repository use the project's custom mirrorlist file for installation
set_pacman_cache cache: path Set the (host) path to the package cache
set_bootloader bl: grub/syslinux/isolinux/none Select the bootloader to use in the live system
set_medium_detection md: search/uuid/label/device Set how to detect the live partition (for iso this is always "search")
set_label lab: name Set the label of the live partition
set_isoa isoa: name Set the application label of the iso
set_isop isop: name Set the publisher info of the iso
pacman_s ps: package names Install/update packages by name (pacman -S)
pacman_r pr: package names Remove packages (pacman -Rs)
pacman_u pu: file-paths Add/update packages from package files
pacman_sy psy Synchronize pacman database

Arguments

Arguments listed in square brackets are optional. When single letters are listed as optional arguments and more than one of these is specified they may not be separated by spaces (e.g. to specify option "s" and option "r" I must pass "sr" as the argument). A slash ("/") indicates a choice.

larchify:
                [ s: don't generate sshkeys ]
                [ r: use old system.sqf ]
    Example: larch -c 'larchify sr'

write_partition:
                device (e.g. /dev/sdb1)
                [ n: don't format the partition ]
                [ l: with larchboot file even if not using 'search' \
                        discovery method ]
    Example: larch -c 'cp /dev/sdb1 l'

set_project:
                name
    Example: larch -c 'P: project1'

del_project:
                name
    Example: larch -c 'P- MyOldProject'

set_buildmirror:
                URL
    Example: larch -c 'm: file:///home/myrepos/*platform*/*repo*'

set_bootloader:
                grub/syslinux/isolinux/none
    Example: larch -c 'bl: grub'

pacman_s:
                package names
    Example: larch -c 'ps: gimp abiword'

pacman_u:
                file-paths
    Example: larch -c 'pu: pkgs/dlarch-theme-gdm-1.2-2-any.pkg.tar.gz \
                                pkgs/xkmap-3.0-5-any.pkg.tar.gz'

A more complicated command might perform an installation, prepare the live system and write it to a USB partition, all without prompting the user. I assume that the configuration work has already been done:

larch -cx i l 'cp /dev/sdb1'