Install FreeBSD.
Create a user to own the portbuild
repository, such as portbuild
. It should have the
'*'
password.
Similarly, create a user to own the administration functions
and manage the svn
repositories, such as srcbuild
. It should have the
'*'
password.
Add the following to /boot/loader.conf
:
You should run the cluster on UTC. If you have not set the clock to UTC:
#
cp -p /usr/share/zoneinfo/Etc/UTC /etc/localtimeCreate the appropriate
/etc/rc.conf
.
Required entries:
${hostname}
"
sshd_enable="YES"
zfs_enable="YES"Recommended entries:
If you are using ganglia, add:
If you will be using a squid cache on the server, rather than the clients:
Create /etc/resolv.conf
, if
necessary.
Create the appropriate files in
/etc/ssh/
.
Add the following to /etc/sysctl.conf
:
Make sure the following change is made to
/etc/ttys
:
You should be able to install from the most recent release using only the default kernel configuration.
The following ports (or their latest successors) are required:
Expect those to bring in, among others:
If you are using ganglia, add:
If you will be using a squid cache on the server, rather than the clients:
The following ports (or their latest successors) are strongly suggested:
The use of sudo on the master, which was formerly required, is no longer recommended.
The following ports (or their latest successors) are handy:
The following steps need to be done as euid root.
Here is a quick example:
portbuild/tools/example_install
Here is a detailed explanation of the example:
Export the value of PORTBUILD_USER
:
#
export PORTBUILD_USER=portbuild
Export the value of SRCBUILD_USER
:
#
export SRCBUILD_USER=srcbuild
Pick a zfs volume name and export
it. We have used a
so far to date.
#
export ZFS_VOLUME=a
Pick a mountpoint and export it. We have used
/
so far to date.a
#
export ZFS_MOUNTPOINT=/a
Create the zfs volume and mount it.
#
zpool create ${ZFS_VOLUME} mirror da1 da2 mirror da3 da4 mirror da5 da6 mirror da7 da8The kickstart script defines zfs
permission sets
, so that the
srcbuild
user and
portbuild
user may administer
subdirectories of this
volume without having to have root privileges.
Select an svn repository and export it. See the FreeBSD Handbook for the currently supported list.
#
export VCS_REPOSITORY=svn://svn0.us-east.FreeBSD.org
Obtain a copy of the kickstart script into a temporary directory. (You will not need to keep this directory later.)
#
mkdir -p /home/portbuild
/tmp
#
svn checkout ${VCS_REPOSITORY}/base/projects/portbuild/admin/tools /home/portbuild
/tmp
Run the kickstart script:
#
sh /home/portbuild
/tmp
/mkportbuildThis will accomplish all the following steps:
Create the portbuild
directory
Create and mount a new zfs filesystem on it
Set up the directory
Set up the initial repository:
Set up the zfs
permission sets
.
Split ownerships of subdirectories such that
PORTBUILD_USER
owns, and
only owns, files that are used to manage builds and
interact with slaves. The more trustable user
SRCBUILD_USER
now owns
everything else.
Configure the server by making the following changes to
/
:a
/portbuild/admin/conf/admin.conf
Set SUPPORTED_ARCHS
to the
list of architectures you wish to build packages for.
For each source branch you will be building for, set
SRC_BRANCHES
and
SRC_BRANCH_
as detailed in Section 14.1, “Steps necessary before qmanager is started”.
You should not need to change
branch
_SUBDIRSRC_BRANCHES_PATTERN
.
Set ZFS_VOLUME
and
ZFS_MOUNTPOINT
to whatever you
chose above.
Set VCS_REPOSITORY
to whatever
you chose above.
Set MASTER_URL
to the http
URL of your server. This will be stamped into the
package build logs and the indices thereof.
Most of the other default values should be fine.
Configure how build slaves will talk to your server
by making the following changes to
/
:a
/portbuild/conf/client.conf
Set CLIENT_NFS_MASTER
to wherever
your build slaves will PXE boot from. (Possibly, the
hostname of your server.)
Set CLIENT_BACKUP_FTP_SITE
to a backup site for FTP fetches; again, possibly
the hostname of your server.
Set CLIENT_UPLOAD_HOST
to
where completed packages will be uploaded.
Most of the other default values should be fine.
Most of the default values in
/
should be fine. This file holds definitions used by
both the server and all its clients.a
/portbuild/conf/common.conf
Configure the server by making the following changes to
/
:a
/portbuild/conf/server.conf
Set UPLOAD_DIRECTORY
,
UPLOAD_TARGET
, and
UPLOAD_USER
as appropriate
for your site.
Most of the other default values should be fine.
For each architecture, follow the steps in Section 17.1, “Steps necessary before qmanager is started”.
As root
, copy the following files from
/a/portbuild/admin/etc/rc.d/
to
/usr/local/etc/rc.d/
:
As root, start each one of them. You may find it handy to start each under screen for debugging purposes.
Initialize the qmanager database's acl list:
This should now be automatically done for you by
the first build
command.
#
python /a
/portbuild/qmanager/qclient add_acl name=deny_all uidlist= gidlist= sense=0As the srcbuild
user,
run the following commands manually to create the
src
and ports
repositories, respectively:
%
/a
/portbuild/admin/scripts/updatesnap.ports
%
/a
/portbuild/admin/scripts/updatesnapThese will be periodically run from the
srcbuild
crontab
, which you will
install below.
Configure
/usr/local/etc/apache22/httpd.conf
as appropriate for your site.
Copy /a/portbuild/admin/conf/apache.conf
to the appropriate Includes/
subdirectory, e.g.,
/usr/local/etc/apache22/Includes/portbuild.conf
.
Configure it as appropriate for your site.
Install /a/portbuild/admin/crontabs/portbuild
as
the portbuild
crontab via
crontab -u portbuild -e
. If you do
not support all the archs listed there, make sure to comment out
the appropriate dologs entries.
Install /a/portbuild/admin/crontabs/srcbuild
as
the srcbuild
crontab via
crontab -u srcbuild -e
.
If your build slaves will be pxebooted, make sure to
enable the tftp entries in
/etc/inetd.conf
.
Configure mail by doing the following:
newaliases
.
For each architecture, follow the steps in Section 17.2, “Steps necessary after qmanager is started”.
You will probably find it handy to append
the following to the PATH
definition for
the portbuild
user:
a
/portbuild/scripts:/a
/portbuild/toolsYou will also probably find it handy to append
the following to the PATH
definition for
the srcbuild
user:
a
/portbuild/admin/scripts:/a
/portbuild/admin/toolsYou should now be ready to build packages.
This, and other documents, can be downloaded from http://ftp.FreeBSD.org/pub/FreeBSD/doc/
For questions about FreeBSD, read the
documentation before
contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.