Commit 5ffb5664 authored by Russ Fish's avatar Russ Fish

Update setup{,-ops}.txt for FreeBSD-6.1 .

The packagedir is now passed to {ops,boss}-install with a -p argument instead of
as a PKG_PATH envar.  If the old way is done, PKG_PATH is ignored and packages are
all built from sources.  This failed in many ways (due to sync problems between the
6.1 packages and ports tarballs?)  In any case, to prevent others falling down the
same rabbit-hole, building from sources is now off by default, requiring a -s
argument to be given to do it.  Libinstall now shows PhaseSkip reasons, to make
it more clear what's going on.

Also tweak dhcpd_makeconf to handle a null DHCPD_DYNRANGE in the defs file,
to prevent a bogus dhcpd response from an inner emulab, half set-up for testing.
parent e00405bd
...@@ -158,7 +158,11 @@ while (my %row = $query_result->fetchhash()) { ...@@ -158,7 +158,11 @@ while (my %row = $query_result->fetchhash()) {
open(IF,"<$template") or open(IF,"<$template") or
fatal("Unable to open $template for reading"); fatal("Unable to open $template for reading");
while (<IF>) { while (<IF>) {
if (/^(\s*)\%\%nodetype=(\w+)/) { if (/^(\s*)range\s*;/) {
# Comment out a null DHCPD_DYNRANGE line.
my $spaces = $1;
print $OUT "${spaces}#range ... ...;\n";
} elsif (/^(\s*)\%\%nodetype=(\w+)/) {
my $spaces = $1; my $spaces = $1;
my $nodetype = $2; my $nodetype = $2;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
##### #####
##### Setting up the Utah Network Testbed software ##### Setting up the Utah Network Testbed software
##### Most recently tested on FreeBSD 4.11. ##### Most recently tested on FreeBSD 6.1 .
##### #####
##### Step 1 - OS installation and setup ##### Step 1 - OS installation and setup
...@@ -97,37 +97,36 @@ collection that are known to work with our software, and to save you hours ...@@ -97,37 +97,36 @@ collection that are known to work with our software, and to save you hours
of compile time, we provide pre-built binary packages of the ports required of compile time, we provide pre-built binary packages of the ports required
by Emulab. by Emulab.
(Do not let the names of the following tar files bother you, e.g.
"FreeBSD-4.10" or the apparent 20041102 date stamp. These are indeed
the correct files to use with FreeBSD 4.11 and with the current (May 2005)
Emulab distribution.)
Download the packages tarball from: Download the packages tarball from:
http://www.emulab.net/downloads/FreeBSD-4.10-20041102.tar.gz http://www.emulab.net/downloads/FreeBSD-6.1-20060921.tar.gz
(You can use the FreeBSD 'fetch' command to download the file.) (You can use the FreeBSD 'fetch' command to download the file.)
Now, untar this someplace (you need about 70MB of space, so don't use /tmp). Now, untar this someplace (you need about 140MB of space, so don't use /tmp).
Let's say you untarred it into /usr/tmp. You would then run: Let's say you untarred it into /usr/tmp. You would then run:
env PKG_PATH=/usr/tmp/FreeBSD-4.10-20041102 pkg_add emulab-ops-1.4 env PKG_PATH=/usr/tmp/FreeBSD-6.1-20060921 pkg_add emulab-ops-2.0
Of course, if you untarred it somewhere else, put in the correct path. Of course, if you untarred it somewhere else, put in the correct path.
Now you need to download a ports tree that corresponds to the above We provide all of the binary packages necessary to build ops/fs/boss in our
packages. We have run into many, many problems with versions of the packages tarball, making setup of an Emulab-in-Emulab very quick. You may
want to install more packages built from ports tree makefiles with downloaded
sources, but if not there is no need to install a /usr/ports tree.
We have run into many, many problems with clashes between versions of the
FreeBSD ports. So, rather than using the /usr/ports tree that comes on the FreeBSD ports. So, rather than using the /usr/ports tree that comes on the
FreeBSD installation media, we use one that we've tested against. You can FreeBSD installation media, we use one that we've tested against. You can
grab our 'approved' copy of the ports tree from: grab our 'approved' copy of the ports tree from:
http://www.emulab.net/downloads/ports-20041102.tar.gz http://www.emulab.net/downloads/ports-20060921.tar.gz
The tarball is about 40 meg; it unpacks to 175 meg.
Untar it, move it into place as /usr/ports (rename the old directory to Untar it, move it into place as /usr/ports (rename the old directory to
ports.old, or just remove it), and install whatever ports you want to make ports.old, or just remove it), and install whatever ports you want to make
ops feel like 'home' (like emacs, jove, or whatever). NOTE: You must ops feel like 'home' (like emacs, jove, or whatever)
download and copy the ports tree into place, even if you do not intend to
install any packages yourself.
##### Step 3 - Unpacking and running configure ##### Step 3 - Unpacking and running configure
...@@ -159,7 +158,7 @@ an 'install' subdirectory, with a script called 'ops-install'. Just run this ...@@ -159,7 +158,7 @@ an 'install' subdirectory, with a script called 'ops-install'. Just run this
script as root (note the same package directory argument as above). script as root (note the same package directory argument as above).
cd install cd install
env PKG_PATH=/usr/tmp/FreeBSD-4.10-20041102 perl ops-install perl ops-install -p /usr/tmp/packages
It will take care of installing any additional ports, and doing various It will take care of installing any additional ports, and doing various
other configuration of FreeBSD required to make it into an ops node. The other configuration of FreeBSD required to make it into an ops node. The
......
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2001-2005 University of Utah and the Flux Group. # Copyright (c) 2001-2006 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -144,9 +144,9 @@ and make sure the home directories for them are removed as well! ...@@ -144,9 +144,9 @@ and make sure the home directories for them are removed as well!
Again, almost the same as on ops. Download the same tarball, and follow Again, almost the same as on ops. Download the same tarball, and follow
the same pkg_add procedure, except this time, you're going to install the same pkg_add procedure, except this time, you're going to install
the emulab-boss-1.8 package instead of emulab-ops: the emulab-boss package instead of emulab-ops:
env PKG_PATH=/usr/tmp/FreeBSD-4.10-20041102 pkg_add emulab-boss-1.8 env PKG_PATH=/usr/tmp/FreeBSD-6.1-20060921 pkg_add emulab-boss-2.0
Also grab a copy of our approved ports tree and install it, the same as Also grab a copy of our approved ports tree and install it, the same as
described in setup-ops.txt. described in setup-ops.txt.
...@@ -184,13 +184,16 @@ boss-install in the object tree, instead of ops-install. Just run this ...@@ -184,13 +184,16 @@ boss-install in the object tree, instead of ops-install. Just run this
script as root (note the same package directory argument as above). script as root (note the same package directory argument as above).
cd install cd install
env PKG_PATH=/usr/tmp/FreeBSD-4.10-20041102 perl boss-install perl boss-install -p /usr/tmp/packages
Like the ops-install script, boss-install sets up passwordless sudo for Like the ops-install script, boss-install sets up passwordless sudo for
anyone in the wheel group. anyone in the wheel group.
##### Step 7 - Installing from source. ##### Step 7 - Installing from source.
This step is now done as part of boss-install. You can check it or fix up
problems by doing the makes yourself, as follows:
In your object directory, do a 'gmake && gmake boss-install'. Then, as root, do In your object directory, do a 'gmake && gmake boss-install'. Then, as root, do
a 'gmake post-install'. The post-install target needs to run as root, so that a 'gmake post-install'. The post-install target needs to run as root, so that
it can make certain scripts setuid, etc. it can make certain scripts setuid, etc.
...@@ -311,8 +314,9 @@ Utah for some. ...@@ -311,8 +314,9 @@ Utah for some.
locate database - It can be useful to update the 'locate' database to help you locate database - It can be useful to update the 'locate' database to help you
find files as you're learning the system. This normally happens nightly, but find files as you're learning the system. This normally happens nightly, but
you can force it to happen now by running 'locate.updatedb' as root. This will you can force it to happen now by running '/usr/libexec/locate.updatedb' as
take several minutes. You can then find foo.conf by running 'locate foo.conf'. root. This will take several minutes. You can then find foo.conf by running
'locate foo.conf'.
##### Step 11 - Reboot boss ##### Step 11 - Reboot boss
......
...@@ -246,16 +246,18 @@ use Getopt::Std; ...@@ -246,16 +246,18 @@ use Getopt::Std;
# Handle command-line options # Handle command-line options
# #
sub usage { sub usage {
print "Usage: boss-install [-p packagedir] [-P portname]\n"; print "Usage: boss-install [-b] [-p packagedir] [-s] [-P portname]\n";
print " Required: -p (for binary packages) or -s (for source makes.)\n";
exit(1); exit(1);
} }
my $packagedir = ""; my $packagedir = "";
my $batchmode = 0; my $batchmode = 0;
my $domakes = 0;
my $password; my $password;
my %opts; my %opts;
if (! getopts("P:p:bw:", \%opts)) { if (! getopts("P:p:bsw:", \%opts)) {
usage(); usage();
} }
if (defined($opts{p})) { if (defined($opts{p})) {
...@@ -264,13 +266,24 @@ if (defined($opts{p})) { ...@@ -264,13 +266,24 @@ if (defined($opts{p})) {
if (defined($opts{b})) { if (defined($opts{b})) {
$batchmode = 1; $batchmode = 1;
} }
if (defined($opts{s})) {
$domakes = 1;
}
if (defined($opts{w})) { if (defined($opts{w})) {
$password = $opts{w}; $password = $opts{w};
} }
if (defined($opts{P})) { if (defined($opts{P})) {
$BOSS_PORT = $opts{P}; $BOSS_PORT = $opts{P};
} }
# Don't just charge into making ports from source by default.
if ($packagedir eq "" and $domakes eq 0) {
print "At least one of -p and -s must be given.\n";
usage();
}
if ($packagedir ne "" and $domakes eq 1) {
print "Only one of -p and -s can be given.\n";
usage();
}
if (@ARGV) { if (@ARGV) {
usage(); usage();
} }
...@@ -296,26 +309,26 @@ if ($UID != 0) { ...@@ -296,26 +309,26 @@ if ($UID != 0) {
Phase "usersgroups", "Creating users and groups", sub { Phase "usersgroups", "Creating users and groups", sub {
Phase "tbadmin", "Creating tbadmin group", sub { Phase "tbadmin", "Creating tbadmin group", sub {
if (getgrnam("tbadmin")) { if (getgrnam("tbadmin")) {
PhaseSkip("tbadmin group already exists"); PhaseSkip("Group already exists");
} }
ExecQuietFatal("$PW groupadd tbadmin -g 101"); ExecQuietFatal("$PW groupadd tbadmin -g 101");
}; };
Phase "root", "Creating root group", sub { Phase "root", "Creating root group", sub {
if (getgrnam("root")) { if (getgrnam("root")) {
PhaseSkip("root group already exists"); PhaseSkip("Group already exists");
} }
ExecQuietFatal("$PW groupadd root -g 103"); ExecQuietFatal("$PW groupadd root -g 103");
}; };
# Added next two cause the mysql package does not do this (port does). # Added next two cause the mysql package does not do this (port does).
Phase "mysqlgroup", "Creating mysql group", sub { Phase "mysqlgroup", "Creating mysql group", sub {
if (getgrnam("mysql")) { if (getgrnam("mysql")) {
PhaseSkip("mysql group already exists"); PhaseSkip("Group already exists");
} }
ExecQuietFatal("$PW groupadd mysql -g 88"); ExecQuietFatal("$PW groupadd mysql -g 88");
}; };
Phase "mysqluser", "Creating mysql user", sub { Phase "mysqluser", "Creating mysql user", sub {
if (getpwnam("mysql")) { if (getpwnam("mysql")) {
PhaseSkip("mysql user already exists"); PhaseSkip("User already exists");
} }
ExecQuietFatal("$PW useradd mysql -g 88 -g 88 -h - ". ExecQuietFatal("$PW useradd mysql -g 88 -g 88 -h - ".
"-d $MYSQLDBDIR -s /sbin/nologin -c 'MySQL Daemon'"); "-d $MYSQLDBDIR -s /sbin/nologin -c 'MySQL Daemon'");
...@@ -344,8 +357,8 @@ Phase "dirs", "Setting directory permissions", sub { ...@@ -344,8 +357,8 @@ Phase "dirs", "Setting directory permissions", sub {
Phase "tftp", "Setting up directories for tftp", sub { Phase "tftp", "Setting up directories for tftp", sub {
Phase "tftpoff", "Disabling BSD tftpd", sub { Phase "tftpoff", "Disabling BSD tftpd", sub {
PhaseSkip("no inetd.conf!?") unless (-e $INETD_CONF); PhaseSkip("No inetd.conf!?") unless (-e $INETD_CONF);
PhaseSkip("already disabled") unless `grep '^tftp' $INETD_CONF`; PhaseSkip("Already disabled") unless `grep '^tftp' $INETD_CONF`;
ExecQuietFatal("sed -i .orig -e '/^tftp/s/^/#/' $INETD_CONF"); ExecQuietFatal("sed -i .orig -e '/^tftp/s/^/#/' $INETD_CONF");
HUPDaemon("inetd"); HUPDaemon("inetd");
}; };
...@@ -391,7 +404,7 @@ Phase "ports", "Installing ports", sub { ...@@ -391,7 +404,7 @@ Phase "ports", "Installing ports", sub {
}; };
} }
}; };
PhaseSkip("Package directory provided; not installing from source") PhaseSkip("Package directory provided; not installing from sources")
if ($packagedir); if ($packagedir);
Phase "pcopy", "Copying ports into place", sub { Phase "pcopy", "Copying ports into place", sub {
...@@ -403,7 +416,7 @@ Phase "ports", "Installing ports", sub { ...@@ -403,7 +416,7 @@ Phase "ports", "Installing ports", sub {
# it - hopefully it'll get fixed someday, and we remove this # it - hopefully it'll get fixed someday, and we remove this
Phase "php4patch", "Patching php4 port", sub { Phase "php4patch", "Patching php4 port", sub {
if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $PHP4_PATCH")) { if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $PHP4_PATCH")) {
PhaseSkip("$PHP4_PATCH already applied"); PhaseSkip("Patch already applied");
} }
ExecQuietFatal("$PATCH -f -l -p0 -i $PHP4_PATCH"); ExecQuietFatal("$PATCH -f -l -p0 -i $PHP4_PATCH");
}; };
...@@ -458,7 +471,7 @@ Phase "patches", "Applying patches", sub { ...@@ -458,7 +471,7 @@ Phase "patches", "Applying patches", sub {
if ($FBSD_VERSION == 4) { if ($FBSD_VERSION == 4) {
Phase "g++patch", "Patching g++'s STL", sub { Phase "g++patch", "Patching g++'s STL", sub {
if (!ExecQuiet("$PATCH -C -f -R -p0 -i $STL_PATCH")) { if (!ExecQuiet("$PATCH -C -f -R -p0 -i $STL_PATCH")) {
PhaseSkip("$STL_PATCH already applied"); PhaseSkip("Patch already applied");
} }
ExecQuietFatal("$PATCH -f -p0 -i $STL_PATCH"); ExecQuietFatal("$PATCH -f -p0 -i $STL_PATCH");
}; };
...@@ -470,13 +483,13 @@ Phase "patches", "Applying patches", sub { ...@@ -470,13 +483,13 @@ Phase "patches", "Applying patches", sub {
$patchfile = "${patchfile}-0.13"; $patchfile = "${patchfile}-0.13";
} }
if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $patchfile")) { if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $patchfile")) {
PhaseSkip("$patchfile already applied"); PhaseSkip("Patch already applied");
} }
ExecQuietFatal("$PATCH -f -l -p0 -i $patchfile"); ExecQuietFatal("$PATCH -f -l -p0 -i $patchfile");
}; };
Phase "Mysql.pm.patch", "Patching Mysql.pm", sub { Phase "Mysql.pm.patch", "Patching Mysql.pm", sub {
my $patchfile = $MYSQL_PM_PATCH; my $patchfile = $MYSQL_PM_PATCH;
my $patchfile = `realpath $patchfile`; $patchfile = `realpath $patchfile`;
chomp $patchfile; chomp $patchfile;
my $dir; my $dir;
...@@ -491,7 +504,7 @@ Phase "patches", "Applying patches", sub { ...@@ -491,7 +504,7 @@ Phase "patches", "Applying patches", sub {
} }
if (!ExecQuiet("$PATCH -d $dir -C -f -l -R -i $patchfile")) { if (!ExecQuiet("$PATCH -d $dir -C -f -l -R -i $patchfile")) {
PhaseSkip("$patchfile already applied"); PhaseSkip("Patch already applied");
} }
ExecQuietFatal("$PATCH -d $dir -f -l -i $patchfile"); ExecQuietFatal("$PATCH -d $dir -f -l -i $patchfile");
}; };
......
...@@ -104,7 +104,7 @@ sub Phase($$$) { ...@@ -104,7 +104,7 @@ sub Phase($$$) {
# #
SWITCH: for ($@) { SWITCH: for ($@) {
(/^skip$/) && do { (/^skip$/) && do {
print "[ Skipped ]\n"; print "[ Skipped ($libinstall::reason) ]\n";
$$parentSkipped++; $$parentSkipped++;
$libinstall::phaseResults{$name} = $_; $libinstall::phaseResults{$name} = $_;
last SWITCH; last SWITCH;
...@@ -224,7 +224,7 @@ sub DoneIfExists($) { ...@@ -224,7 +224,7 @@ sub DoneIfExists($) {
my ($filename) = @_; my ($filename) = @_;
if (!$filename) { PhaseFail("Bad filename passed to DoneIfExists"); } if (!$filename) { PhaseFail("Bad filename passed to DoneIfExists"); }
if (-e $filename) { if (-e $filename) {
PhaseSkip("File $filename already exists"); PhaseSkip("File already exists");
} }
} }
...@@ -235,7 +235,7 @@ sub DoneIfDoesntExist($) { ...@@ -235,7 +235,7 @@ sub DoneIfDoesntExist($) {
my ($filename) = @_; my ($filename) = @_;
if (!$filename) { PhaseFail("Bad filename passed to DoneIfExists"); } if (!$filename) { PhaseFail("Bad filename passed to DoneIfExists"); }
if (!-e $filename) { if (!-e $filename) {
PhaseSkip("File $filename does not exist"); PhaseSkip("File does not exist");
} }
} }
...@@ -249,7 +249,7 @@ sub DoneIfEdited($) { ...@@ -249,7 +249,7 @@ sub DoneIfEdited($) {
open(FH,$filename) or return; open(FH,$filename) or return;
if (grep /$MAGIC_STRING/, <FH>) { if (grep /$MAGIC_STRING/, <FH>) {
close(FH); close(FH);
PhaseSkip("File $filename has already been edited\n"); PhaseSkip("File has already been edited");
} }
close(FH); close(FH);
} }
...@@ -291,7 +291,7 @@ sub DoneIfMounted($) ...@@ -291,7 +291,7 @@ sub DoneIfMounted($)
if ($opt eq "nfs") { if ($opt eq "nfs") {
if ($dir eq $2) { if ($dir eq $2) {
close(MOUNT); close(MOUNT);
PhaseSkip("NFS dir $dir already mounted"); PhaseSkip("NFS dir already mounted");
} }
} }
} }
......
...@@ -79,7 +79,9 @@ use Getopt::Std; ...@@ -79,7 +79,9 @@ use Getopt::Std;
# Handle command-line options # Handle command-line options
# #
sub usage { sub usage {
print "Usage: ops-install [-b] [-p packagedir] [-P portname]\n"; print "Usage: ops-install [-b] [-p packagedir] [-s] " .
"[-P ops-portname] [-F fs-portname]\n";
print " Required: -p (for binary packages) or -s (for source makes.)\n";
exit(1); exit(1);
} }
...@@ -102,9 +104,10 @@ my $PHP4_PORT = "php4-extensions-1.0"; ...@@ -102,9 +104,10 @@ my $PHP4_PORT = "php4-extensions-1.0";
my $packagedir = ""; my $packagedir = "";
my $batchmode = 0; my $batchmode = 0;
my $domakes = 0;
my $password; my $password;
my %opts; my %opts;
if (! getopts("P:p:bw:F:", \%opts)) { if (! getopts("P:p:bsw:F:", \%opts)) {
usage(); usage();
} }
if (defined($opts{p})) { if (defined($opts{p})) {
...@@ -113,6 +116,9 @@ if (defined($opts{p})) { ...@@ -113,6 +116,9 @@ if (defined($opts{p})) {
if (defined($opts{b})) { if (defined($opts{b})) {
$batchmode = 1; $batchmode = 1;
} }
if (defined($opts{s})) {
$domakes = 1;
}
if (defined($opts{P})) { if (defined($opts{P})) {
$OPS_PORT = $opts{P}; $OPS_PORT = $opts{P};
} }
...@@ -122,6 +128,15 @@ if (defined($opts{F})) { ...@@ -122,6 +128,15 @@ if (defined($opts{F})) {
if (defined($opts{w})) { if (defined($opts{w})) {
$password = $opts{w}; $password = $opts{w};
} }
# Don't just charge into making ports from source by default.
if ($packagedir eq "" and $domakes eq 0) {
print "At least one of -p and -s must be given.\n";
usage();
}
if ($packagedir ne "" and $domakes eq 1) {
print "Only one of -p and -s can be given.\n";
usage();
}
if (@ARGV) { if (@ARGV) {
usage(); usage();
} }
...@@ -381,7 +396,7 @@ Phase "ports", "Installing ports", sub { ...@@ -381,7 +396,7 @@ Phase "ports", "Installing ports", sub {
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname"); ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
}; };
} }
PhaseSkip("Package directory provided; not installing from source") PhaseSkip("Package directory provided; not installing from sources")
if ($packagedir); if ($packagedir);
Phase "pcopy", "Copying ports into place", sub { Phase "pcopy", "Copying ports into place", sub {
...@@ -474,7 +489,7 @@ Phase "patches", "Applying patches", sub { ...@@ -474,7 +489,7 @@ Phase "patches", "Applying patches", sub {
$patchfile = "${patchfile}-0.13"; $patchfile = "${patchfile}-0.13";
} }
if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $patchfile")) { if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $patchfile")) {
PhaseSkip("$patchfile already applied"); PhaseSkip("Patch already applied");
} }
ExecQuietFatal("$PATCH -f -l -p0 -i $patchfile"); ExecQuietFatal("$PATCH -f -l -p0 -i $patchfile");
}; };
...@@ -483,7 +498,7 @@ Phase "patches", "Applying patches", sub { ...@@ -483,7 +498,7 @@ Phase "patches", "Applying patches", sub {
my $patchfile = $MAILMAN_PATCH; my $patchfile = $MAILMAN_PATCH;
if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $patchfile")) { if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $patchfile")) {
PhaseSkip("$patchfile already applied"); PhaseSkip("Patch already applied");
} }
ExecQuietFatal("$PATCH -f -l -p0 -i $patchfile"); ExecQuietFatal("$PATCH -f -l -p0 -i $patchfile");
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment