Configuring farbot

Introduction

The farbot configuration file is composed of five different section types:

  • Releases Configuration
  • Partitions Configuration
  • PackageSets Configuration
  • Installations Configuration

The configuration uses an Apache-style syntax.

Releases Configuration

The Releases section defines at least one Release within a farbot configuration file.

Releases Configuration Options

BuildRoot
Used as the working directory for release builds. A per release directory is added by farbot at build time.
InstallRoot
Installation clients will load installation data from this directory. This directory will end up being NFS and TFTP exported.
NFSHost
The IP address/FQDN of the machine that will be acting as an NFS server for the installation files.
Release Configuration Options
<Release Name>
The Release section must be named. ex: <Release 6.0>
CVSRoot
The FreeBSD CVS repository mirror. This option may be omitted if BinaryRelease and UsePortsnap are both true. ex: /home/ncvs
CVSTag
The CVS tag for this release. This option is only needed if BinaryRelease is not set to true. ex: RELENG_6_0
BinaryRelease
Use binaries from a FreeBSD CD ISO rather than building the release from source. Default is false.
ISO
Path to FreeBSD release CD ISO file to extract from if BinaryRelease is true. ex: /export/freebsd/6.2-RELEASE-i386-disc1.iso
UsePortsnap
If true, use portsnap rather than cvs for extracting an up-to-date ports tree into the chroot used for building packages. The server running farbot must be running FreeBSD 5.5 or later to use this option, as earlier versions do not include portsnap in the base system. Default value is false.
LocalData
Custom files to be made available at install time via the NFS mout in the path /dist/local.
InstallCDs
Whether to create ISO install images from the release built by farbot. Defaults to false, and is ignored if BinaryRelease is true.
PackageBuildOptions

An optional list of options to pass to every package build for this release. BuildOptions for a given package override this global setting.. ex:

<PackageBuildOptions>
    WITHOUT_X11  true
</PackageBuildOptions>
Dists
Space delimited list of distribution sets to install. At least base and kernels must be included. If this is left undefined the following dists will be installed: base, kernels, doc, games, manpages, catpages, proflibs, dict, info, and src. It may be a good idea to add lib32 if you are building an amd64 release. Do not add ports to this list. The ports tree will be fetched for package building separately from the release building process using either cvs or portsnap .
SourceDists
List of source sub-distribution sets to install if src is included in Dists. By default this will be sbase, scontrib, scrypto, sgnu, setc, sgames, sinclude, skrb5, slib, slibexec, srelease, sbin, ssecure, ssbin, sshare, ssys, subin, susbin, stools, and srescue. These are all the sources available in FreeBSD 6.x. If this release is FreeBSD 7 or higher you may wish to define this list and add scddl and/or scompat.
KernelDists
List of kernels to install. By default this will be GENERIC and SMP if this is left undefined.

Partitions Configuration

The Partitions section defines at least one PartitionMap with at least one Partition within a farbot configuration file.

PartitionMap Configuration Options

<PartitionMap Name>
The PartitionMap section must be named. ex: <PartitionMap Standard>
Partition Configuration Options
Mount
Mount point for this partition. ex: /usr
Size
The size of this partition. ex: 512MB
Type
Type of filesystem. ex: ufs
SoftUpdates
Whether to enable soft updates on this filesystem.

PackageSets Configuration

The PackageSets section defines at least one PackageSets within a farbot configuration file.

PackageSets Configuration Options

DistfilesCache
Optional directory for persistent storage of port distfiles between builds. Setting this option will obviate the need to re-download the same distfiles for each builds and for different releases, and provide a place to store distfiles which cannot be automatically fetched by the ports system.

PackageSet Configuration Options

<PackageSet Name>
The PackageSet section must be named. ex: <PackageSet Base>
Package Configuration Options
Port
The category and name of this port. ex: security/sudo
Package
Optional: The package name of this port, if it differs from the port name. ex: mysql50-server
BuildOptions

An optional list of options to pass to the package build. ex:

<BuildOptions>
    WITH_COLLATION  latin1_general_ci
    WITH_OPTION  true
</BuildOptions>

Installations Configuration

The Installations section defines at least one Installation within a farbot configuration file.

Installation Configuration Options

<Installation Name>
The Installation section must be named. ex: <Installation Database>
Description
A human-readable description for this installation, used in the installation-selection boot menu generated by farbot.
Release
A Release name defined in the Releases section above. There may only be one release per installation.
PackageSet
A list of PackageSet names as defined in the PackageSets section.
NetworkDevice
The network device to mount the the NFS root from. ex: em0
Disk Section Options
<Disk Name>
A disk name that matches the corresponding system disk for the following PartitionMap. ex: ad0
PartitionMap
A PartitionMap name as defined in the Partitions section above. Only list one PartitionMap per disk.
PostInstall Section Options
Command
A command to be run from /dist/local after the installation boots for the first time. See LocalData above.

Example Configuration File

An example configuration follows. The same configuration file is included with the distribution as farbot.conf.

#
# Releases
#
<Releases>
    # Release Build Working Directory
    BuildRoot   /export/freebsd/build

    # Install/NFS Directory
    # Clients will load installation data from this directory
    InstallRoot /export/freebsd/netinstall

    # NFS/TFTP Server Host/IP
    # The host exporting the installation data.
    # Should probably be the local machine
    NFSHost     jumpstart.example.org

    # This is an example release which is built from CVS.
    <Release 6-STABLE>
        # FreeBSD CVS Repository Mirror
        CVSRoot     /home/ncvs
        # Release Tag
        CVSTag      RELENG_6

        # LocalData will be copied into the release
        # distribution. These files will be available at
        # install time via the NFS mount, in the path /dist/local
        LocalData   /export/freebsd/postinst

        # Enable creation of ISO install images
        # Requires cdrtools 
        InstallCDs  True

        # Global package build options to be applied to every package
        # built in this release. Local BuildOptions will override this
        <PackageBuildOptions>
            WITHOUT_X11 yes 
        </PackageBuildOptions>
        
        # Distribution sets to install. The following dists will be installed
        # by default for this release if Dists is left undefined: base,
        # kernels, doc, games, manpages, catpages, proflibs, dict, info, and
        # src. It may be a good idea to add lib32 if you are building an amd64
        # release. At least base and kernels must be included.
        Dists base kernels src
        
        # Source sub-distribution sets to install. The following are included
        # by default if SourceDists is left undefined: sbase, scontrib,
        # scrypto, sgnu, setc, sgames, sinclude, skrb5, slib, slibexec,
        # srelease, sbin, ssecure, ssbin, sshare, ssys, subin, susbin, stools,
        # and srescue. Note that these will only be installed if src is
        # included in Dists. If installing FreeBSD 7 or higher, you may wish
        # to add scddl and scompat to SourceDists.
        SourceDists ssys
        
        # Kernel sub-distribution sets to install. Includes GENERIC and SMP 
        # kernels by default if KernelDists is left undefined. 
        KernelDists GENERIC SMP
    </Release>

    # You may also use an already built release from a CD image. 
    <Release 6.3-RELEASE>
        # Extract the release from an install CD image rather than build it.
        BinaryRelease   True

        # Path to the ISO file to install from.
        ISO             /export/freebsd/6.3-RELEASE-i386-disc1.iso
        
        # Use portsnap(8) rather than cvs(1) to install an up-to-date 
        # ports tree that packages will be built from. Requires that 
        # this release be FreeBSD 5.5 or later--portsnap is not in the 
        # base system on earlier releases.
        UsePortsnap     True
    </Release>
</Releases>

#
# Partition Maps
#
<Partitions>
    <PartitionMap Standard>
        <Partition 1>
            Mount       /
            Size        512MB
            Type        ufs
            SoftUpdates no
        </Partition>

        <Partition 2>
            Size        4GB
            Type        swap
        </Partition>

        <Partition 3>
            Mount       /var
            Size        10GB
            Type        ufs
        </Partition>

        <Partition 4>
            Mount       /tmp
            Size        1GB
            Type        ufs
        </Partition>

        <Partition 5>
            # All remaining space
            Mount       /usr
            Size        0GB
            Type        ufs
        </Partition>
    </PartitionMap>
</Partitions>

#
# Package Sets
#
<PackageSets>
    # Optional directory for persistent storage of port 
    # distfiles between builds. These distfiles are also
    # shared by all releases.
    DistfilesCache  /export/freebsd/distfiles
    
    <PackageSet Base>
        <Package>
            Port    security/sudo 
        </Package>
    </PackageSet>
    <PackageSet Database>
        <Package>
            Port    databases/mysql50-server
            # If your build options modify the name
            # of the resulting package, use the Package
            # option to define the correct name.
            #Package    mysql50-server
            <BuildOptions>
                WITH_COLLATION  latin1_general_ci
            </BuildOptions>
        </Package>
    </PackageSet>
</PackageSets>


#
# Installation Types
#
<Installations>
    <Installation Standard>
        # Human-readable Description.
        # Used in the installation-selection boot menu
        Description Standard Installation
        Release         6.2-RELEASE
        PackageSet      Base
        PackageSet      Database
        NetworkDevice   em0
        <Disk ad0>
            PartitionMap    Standard
        </Disk>
        <PostInstall>
            Command /dist/local/postinst/local.sh database
            Command /dist/local/postinst/cleanup.sh everything
        </PostInstall>
    </Installation>
</Installations>