ltsp-build-client

From LTSPedia
Jump to: navigation, search

Contents

Usage

The default behavior of ltsp-build-client can be configured with commandline options or using the ltsp-build-client.conf configuration file.

commandline option config option description notes
arch ARCH set the target architecture
base BASE set the default base install directory preferably, set this config in ltsp-server.conf
chroot CHROOT set the name of the chroot if not set, the value for arch becomes the name
config - load a user specific configuration file
debug DEBUG enable debug support
exclude EXCLUDE exclude packages from the initial chroot
purge-chroot PURGE_CHROOT purge existing LTSP chroot if present think twice to set in config file

The possible full usage is different for each distribution, refer to your distro's installation page for those details. Also, the following command shows all distro specific options:

user@server $ltsp-build-client --extra-help

Developer-24x24.png Plugins

The command is able to perform a distro specific client installation by making use of plugins. When starting, plugins are called by the "load_plugins" function. Common plugins are located in /usr/share/ltsp/plugins/ltsp-build-client/common, while vendor-specific plugins are defined in /usr/share/ltsp/plugins/ltsp-build-client/$DISTRO. If a distro plugin has the same filename as a common plugin, it will override the common plugin. The plugin code is used in different phases. A plugin typically only uses some of the available phases.

  1. commandline
  2. configure
  3. before-install
  4. install
  5. after-install
  6. finalization

Commandline

Any commandline options for ltsp-build-client are defined here. The commandline argument itself can be specified as well as the value type (string or boolean). Also a description and an "advanced" flag for display in the regular help section or the advanced help section. The syntax is as follows:

add_option "<name>" "`eval_gettext "<description>"`" "<help section (advanced or regular)>" "<value type (false for string, true for boolean)>"

Configure

Any commandline or config file options can be processed here. The commandline options will be available as $option_<argname>_value, where any dashes in the option name will be converted to underscores. The config file variables are available as is.

Install

In this phase the initial chroot is built. This will obviously vary greatly for each distro.

Finalization

In the finalization phase, you may want to install additional packages that needed custom configurations to other software before installing, such as a kernel (which may require certain initramfs tweaks). you may also want to copy the kernel images into a location accessible by tftp at this phase, or seed the chroot's /etc/ssh/ssh_known_hosts file with your server's public ssh keys.

Example

/usr/share/ltsp/plugins/ltsp-build-client/Gentoo/020-rootpath
 case "$MODE" in
    commandline)
        add_option "purge-chroot" "`eval_gettext "purge existing LTSP chroot if present"`" "advanced" "false"
        ;;
    configure)
        if [ "true" = "$option_purge_chroot_value" ]; then
            PURGE_CHROOT="true"
        fi
        ;;
    before-install)
        export ROOT=$BASE/$CHROOT
        if [ -d $ROOT ] ; then
            if [ "true" = "$PURGE_CHROOT" ]; then
                # wipe it out, so we can try again
                rm --force --recursive --one-file-system "$ROOT"
            else
                echo "NOTE: Root directory $ROOT already exists, this will lead to problems, please remove it before trying again. Exiting."
                exit 0
            fi
        fi 
        mkdir -p "$ROOT"
        ;;
 esac
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox