package-building.txt 4.86 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
######################################################################
##### Everything You Never Wanted To Know About Building Packages
#####                But Didn't Care Enough to Ask
##### Robert Ricci <ricci@cs.utah.edu>
######################################################################

#####
##### What?
#####

Building binary packges for the emulab-ops and emulab-boss ports.

#####
##### Why?
#####

Well, when you're building and ops or boss node (particularly a boss node),
it really sucks to have to wait for a year to compile all 73 million ports
that boss depends on. This is particularly bad when you're trying to set up
a test installation of Emulab. This document will show you how to build
packages so that you only have to wait this out once.

#####
##### Who?
#####

Well, you, apparently. Don't know how you got stuck with this job. Sorry.

#####
##### Where?
#####

At Utah, we stash the binary packages in the /share/freebsd/packages directory.
For example, the ports built from the 4.10-Release ports tree are in:
/share/freebsd/packages/FreeBSD-4.10-Release/
... and the ones I made on a 4.10 box, with a snapshot of the ports tree from
Sep. 17 2004 are in:
/share/freebsd/packages/FreeBSD-4.10-20040917/

#####
##### How?
#####

Note, this process is going to install a whole bunch of software, so you
probably want to do it on a testbed node, not on boss or on your desktop or
something like that.

First, you're gonna need a copy of the ports tree. There are lots of ways you
can get this - at Utah, you can find a copy in /share/freebsd/<version>/ports .
Or you can grab a copy from:
ftp://ftp.freebsd.org/pub/FreeBSD/ports/ports/ports.tar.gz

Optionally, you'll probably want to update the ports tree to the latest
version - you don't want to be stuck in the past, right? Put the following
magic in /etc/make.conf:
SUP_UPDATE=yes
PORTSSUPFILE=/usr/share/examples/cvsup/ports-supfile
SUPHOST=cvsup3.freebsd.org # xyz.lcs.mit.edu

Now, run 'pkg_add -r cvsup-without-gui', which should install the binary
package of cvsup from the FreeBSD FTP server. If you a masochist, you can
compile it yourself from /usr/ports/net/cvsup-without-gui, but be warned, this
will compile all of the Modula-3 lanauge, which takes an eternity, and is
fairly usless since cvsup appears to be the only program in all of history ever
written in Modula-3.

Okay, now cd to /usr/ports and run 'make update'. Welcome to the bleeding edge!

Next, you'll need a copy of the emulab ports. Just copy (recursively), the
contents of install/ports in the Emulab source tree into /usr/ports/misc .

Now, you have to install all of these ports. Just run a 'make install' in the
/usr/port/misc/emulab-boss and /usr/ports/misc/emulab-ops directories. Now, we
play the waiting game. This will take a while.

76 77 78 79 80 81 82 83 84 85 86
At this point, is a good idea to check for ports with bad packing lists - this
happens every once in a while. Run 'pkg_info -g -a', and look for "doesn't
exist" - if you find any of these, you'll have to determine whether the port
is broken, whether you should touch the file, or what else needs to be fixed.
Generally, files that fail their MD5 checksums are okay - this just means that
two ports installed the same file. So far, I haven't seen this happen with any
files that actually mattered.

After building the ports, you'll want to do a 'make clean' and remove everything
in /usr/ports/distfiles to make sure you have enough room for all the packages.

87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
Now, to build the packages. Pretty easy, actually. Just run:
mkdir /usr/ports/packages
Then:
cd /usr/ports/misc/emulab-boss && make deinstall package-recursive
cd /usr/ports/misc/emulab-ops && make deinstall package-recursive

At this point, though, you may run into some problems with broken ports.  For
example, the Apache port at the time of writing has a broken packing list,
which causes the package to fail. I had to run:
mv /usr/local/etc/rc.d/apache.sh /usr/local/etc/rc.d/apache.sh.sample

... before it would work.

Also, we depend on cvsup on boss. Remember how I told you above that you want
to avoid building Modula-3? Well, guess what, you have to build it anyway. This
is because the cvsup port depends on it. Bummer. So, you'll also have to do a:
cd /usr/ports/lang/ezm3 && make install

If you run into any other problems, consult, in this order:
(1) 'man 7 ports'
(2) http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/
108
(3) testbed-ops@flux.utah.edu
109 110 111 112 113 114 115 116 117 118 119 120

Now, just copy the contents of /usr/ports/packages/All/ into the directory you
picked above!

Oh, and to install the packages on some other node, you won't need a ports tree
on it. You just need /share mounted, and run:
env PKG_PATH=/share/freebsd/packages/<some-dir>/ pkg_add emulab-boss-1.5
env PKG_PATH=/share/freebsd/packages/<some-dir>/ pkg_add emulab-ops-1.4

(note, check emulab-boss/Makefile and emulab-ops/Makefile to get the version
numbers if they've changed from 1.4 and 1.5, and I've forgotten to update this
document)