Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Martinfx/17f4af315a87e5b15455e61e250ebc54 to your computer and use it in GitHub Desktop.
Save Martinfx/17f4af315a87e5b15455e61e250ebc54 to your computer and use it in GitHub Desktop.
Notes on using poudriere to build FreeBSD packages

Installing poudriere for bulk port building

References

Create a config file

#/usr/local/etc/poudriere.conf
ZPOOL=zroot
FREEBSD_HOST=http://ftp.de.freebsd.org
RESOLV_CONF=/etc/resolv.conf
BASEFS=/usr/local/poudriere
USE_PORTLINT=no
USE_TMPFS=yes
DISTFILES_CACHE=/usr/ports/distfiles
SVN_HOST=svn0.eu.FreeBSD.org
PKG_REPO_SIGNING_KEY=/usr/local/etc/ssl/keys/pkg.key
WRKDIR_ARCHIVE_FORMAT=txz
URL_BASE=http://pkg.skunkwerks.at/poudriere
BUILDER_HOSTNAME=pkg.skunkwerks.at

Get the bits

After installing the package, we'll create a copy of the ports tree using git. You can use the same approach to pull in your own ports, or other peoples', and graft them together.

# sudo from here
pkg install -y poudriere
poudriere ports -c -p git -m git -v

Create the build slaves

We want a RELEASE or STABLE one for normal servers, and a CURRENT one for systems that are living on the bleeding edge of hardware, such as my laptop. The latter creation will take a while, as it builds the image from source.

poudriere jail -c -j 10_1_amd64 -v 10.1-RELEASE -a amd64
poudriere jail -c -j current_amd64 -v head -a amd64 -m svn

Provide a basic configuration that applies to all build jails. By using a custom name, instead of make.conf, it can be made to apply to a specific jailed build slave.

echo "WITH_PKG=yes" > /usr/local/etc/poudriere.d/make.conf

Create a package specification

Poudriere uses free-form text fields to specify packages to be built:

# /usr/local/etc/poudriere.d/core.packages
editors/vim-lite
rsync
subversion
tmux

Customise a package

Just as the FreeBSD ports tree allows custom parameters, so does poudriere. The ports tree will store these changes in /var/db/ports/, and you can simply copy these into poudriere if you like. Alternatively, you can customise the config using either:

# customise all packages listed in core
poudriere options -j 10_1_amd64 -f /usr/local/etc/poudriere.d/core.packages
# customise a single package
poudriere options -j 10_1_amd64 editors/vim

Build All The Things

poudriere bulk -f /usr/local/etc/poudriere.d/core.pkg -j 10_1_amd64
poudriere bulk -f /usr/local/etc/poudriere.d/core.pkg -j current

Keeping Things Up to Date

Upgrade the ports

Optionally, pass a parameter specifying a particular port, otherwise the default ports will be updated.

poudriere ports -u

Upgrade the jails

As during installation, upgrading a non-RELEASE jail will require rebuilding from source, and thus take a while.

poudriere jail -u -j 10_1_amd64
poudriere jail -u -j current_amd64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment