-
Notifications
You must be signed in to change notification settings - Fork 33
Test your poudriere build with pot
Install and initialize pot (currently you need to clone the git repo, because of a needed features still missing in the 0.3.1 tag)
# install pot
pkg install pot
# edit the configuration file setting up proper values for POT_ZFS_ROOT and POT_FS_ROOT
vi /usr/local/etc/pot/pot.conf
# initialize pot
pot init
# create a 11.1 base
pot create-base -r 11.1
# create a fscomp for distfiles
pot create-fscomp -f distfilesInstall and initialize poudriere (https://github.com/freebsd/poudriere/wiki for more):
pkg install poudriere
# configure poudriere to use the zpool of you choice
echo "ZPOOL=zroot" >> /usr/local/etc/poudriere.conf
# configure poudriere to use the distfiles fscomp
echo "DISFILES_CACHE=/opt/pot/fscomp/distfiles
poudriere jails -c -v 11.1-RELEASE -j 111x64
# here you should use the portstree of your choice (git, svn, or whatever)
poudriere ports -c -p upstreamBuild a package of your choice
poudriere -j 111x64 -p upstream devel/gdbCreate a testing pot called gdb-test
pot create -p gdb-test -b 11.1
pot add-fscomp -p gdb-test -f zroot/poudriere/data/packages -m /mnt -e
pot run gdb-testNow you have just to configure your local repository (more info in pkg.conf(5)) with a file like this:
FreeBSD: { enabled: no }
local: {
url: "file:///mnt/111x64-upstream",
enabled: yes
}
The pot gdb-test is now configured to use the local repository generated by poudriere
All steps performed after the pot creation can be automated using a proper flavour.
To create a flavor called port-test, two files are needed:
-
port-testthat contains pot sub-commands (in this case on one sub-command)
add-fscomp -f zroot/poudriere/data/packages -m /mnt -e
-
port-test.shthat is a shell script that contextualize the container
#!/bin/sh
mkdir -p /usr/local/etc/pkg/repos
echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
cat > /usr/local/etc/pkg/repos/local.conf <<EOF
local: {
url: "file:///mnt/111x64-upstream",
enabled: yes
}
EOF
ASSUME_ALWAYS_YES=yes pkg bootstrapBoth files have to be placed in /usr/local/etc/pot/flavours. Moreover, the shell scripts has to be executable:
chmod a+x /usr/local/etc/pot/flavours/port-test.shNow, you can create the pre-configured pot container using the command:
pot create -p gdb-test -b 11.1 -f port-test
pot run port-test