Commit e81136ad authored by Mike Hibler's avatar Mike Hibler

Support for FreeBSD 10.x boss/ops.

The biggest changes were related to 10.0's replacing gcc with clang
and the switch to a new package system. The former required various
fixes to Makefiles that hardwired "gcc" and also missing prototypes
in source files that clang is particularly obnoxious about.

There was also accomodating the normal evolution of the ports tree.
New variables were needed in many of the Makefiles for this. Hopefully,
all the changes I made are backward compatible, but I don't actually
care that much since I hope to never, ever have to remake those older
packages! A new emulab version of the m2crypto port was needed to
reflect that m2crypto is no longer installed as an .egg file.

Casualties:

  * Emulab assign. As of this commit, assign does not build with
    clang. It will build, but immediately core dumps if built with
    a gcc port (gcc46 below). THIS NEEDS TO BE FIXED!

  * Emulab nsverify. This requires building a pure ns-2.34, which
    is old and does not compile with clang. You will need to set
    NSVERIFY=0 in your defs file. I did this in defs-elabinelab
    (iff FBSD==10) but no where else right now.

  * Bind in the base distro. Bind is no longer part of FreeBSD
    (it has been replaced with something called "unbound"). So we
    install bind99 from a port and we make the /etc/namedb symlink
    to /usr/local/etc/namedb which is where it now lives.

  * Perl 5.12. It has been totally removed from the ports tree.
    We now install 5.14, the next-most obsolete version of Perl!

  * pkg_{add,delete,info}. As mentioned, the packages tools have
    changed. For the most part "pkg <cmd>" is the same as "pkg_<cmd>"
    but not always. This required considerable violence in the
    install/phases code. But it is actually cleaner now.

  * GCC in the base distro. I added installation of the gcc46 port
    to the boss and ops meta packages, just for old-times sake
    (we might wind up needing it, if still more stuff doesn't work
    with clang).
parent 454d9991
......@@ -278,7 +278,7 @@ diff -c -r1.1.1.1 -r1.4
/*
! * wait_for_xmit(): Wait for certain period of time in busy-loop
*/
__inline__ void wait_for_xmit(struct timeval *target, struct timeval *now)
! __inline__ void wait_for_xmit(struct timeval *target, struct timeval *now)
{
while(1){
- gettimeofday(now,NULL);
......@@ -322,7 +322,7 @@ diff -c -r1.1.1.1 -r1.4
! /*
! * wait_for_xmit(): Wait for certain period of time
*/
__inline__ void wait_for_xmit(struct timeval *target, struct timeval *now)
! static __inline__ void wait_for_xmit(struct timeval *target, struct timeval *now)
{
+ gettimeofday(now,NULL);
+ if (usecpertick) {
......
#
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -36,7 +36,7 @@ include $(TESTBED_SRCDIR)/GNUmakerules
LIBTBDIR = $(TESTBED_LIBOBJDIR)/libtb
LIBEVENTDIR = $(TESTBED_LIBOBJDIR)/event
CPPC = g++
CPPC = $(CXX)
# Rules to make sure that some libraries we need from other directories get
# built first
......
This diff is collapsed.
# $FreeBSD: head/etc/group 241823 2012-10-22 01:18:41Z marcel $
# $FreeBSD: releng/10.0/etc/group 256366 2013-10-12 06:08:18Z rpaulo $
#
wheel:*:0:root,toor
daemon:*:1:
kmem:*:2:root,toor
sys:*:3:root,toor
tty:*:4:root,toor
operator:*:5:root,toor
kmem:*:2:root
sys:*:3:root
tty:*:4:root
operator:*:5:root
mail:*:6:
bin:*:7:
news:*:8:
man:*:9:
games:*:13:
ftp:*:14:
staff:*:20:root,toor
staff:*:20:
sshd:*:22:
smmsp:*:25:
mailnull:*:26:
_atf:*:27:
guest:*:31:root,toor
guest:*:31:
bind:*:53:
unbound:*:59:
proxy:*:62:
authpf:*:63:
_pflogd:*:64:
......@@ -35,3 +35,4 @@ sfs:*:171:
messagebus:*:556:
polkit:*:562:
haldaemon:*:560:
git_daemon:*:964:
# $FreeBSD: src/etc/hosts,v 1.16 2003/01/28 21:29:23 dbaker Exp $
# $FreeBSD: releng/10.0/etc/hosts 109997 2003-01-28 21:29:23Z dbaker $
#
# Host Database
#
......@@ -11,5 +11,5 @@
#
#
#::1 localhost localhost.my.domain
127.0.0.1 localhost loghost
127.0.0.1 localhost loghost
# $FreeBSD: head/etc/master.passwd 243752 2012-12-01 15:11:46Z rwatson $
# $FreeBSD: releng/10.0/etc/master.passwd 256366 2013-10-12 06:08:18Z rpaulo $
#
root:$1$0DKicYf8$PsfF3uhmTrtuaJKH/rxtQ/:0:0::0:0:Charlie &:/root:/bin/csh
toor:$1$0DKicYf8$PsfF3uhmTrtuaJKH/rxtQ/:0:0::0:0:Chaplin &:/root:/bin/csh
......@@ -13,9 +13,8 @@ man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin
sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin
smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin
mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin
# Emulab: _atf changed to 28, 27 is mike and he ain't budgin'
_atf:*:28:27::0:0:& pseudo-user:/nonexistent:/usr/sbin/nologin
bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin
unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin
proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin
_pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin
_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin
......@@ -29,3 +28,4 @@ sfs:*:171:171::0:0:SFS pseudo-user:/:/usr/sbin/nologin
messagebus:*:556:556::0:0:D-BUS Daemon User:/nonexistent:/usr/sbin/nologin
polkit:*:562:562::0:0:PolicyKit Daemon User:/nonexistent:/usr/sbin/nologin
haldaemon:*:560:560::0:0:HAL Daemon User:/nonexistent:/usr/sbin/nologin
git_daemon:*:964:964::0:0:git daemon:/nonexistent:/usr/sbin/nologin
named_enable="NO"
sendmail_enable="NO"
sshd_enable="YES"
nfs_client_enable="YES"
......
/*
* Copyright (c) 2004, 2005 University of Utah and the Flux Group.
* Copyright (c) 2004-2014 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
......@@ -23,6 +23,7 @@
#include "config.h"
#include <unistd.h>
#include <sys/param.h>
#include <math.h>
......
/*
* Copyright (c) 2004-2011 University of Utah and the Flux Group.
* Copyright (c) 2004-2014 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
......@@ -30,6 +30,7 @@
#include "config.h"
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
......
#!/usr/bin/perl -w
#
# Copyright (c) 2009 University of Utah and the Flux Group.
# Copyright (c) 2009-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -48,9 +48,6 @@ my $PWD = "/bin/pwd";
my $PW = "/usr/sbin/pw";
my $PATCH = "/usr/bin/patch";
my $SSH_KEYGEN = "/usr/bin/ssh-keygen";
my $PKG_INFO = "/usr/sbin/pkg_info";
my $PKG_ADD = "/usr/sbin/pkg_add";
my $PKG_DEL = "/usr/sbin/pkg_delete";
my $TOUCH = "/usr/bin/touch";
my $SSH_INIT = "/usr/bin/ssh -1";
my $SCP_INIT = "/usr/bin/scp -1";
......@@ -287,9 +284,7 @@ Phase "dirs", "Setting directory permissions", sub {
};
Phase "ports", "Installing ports", sub {
if (!ExecQuiet("$PKG_INFO -e $PORTNAME")) {
PhaseSkip("Package already installed");
}
DoneIfPackageInstalled($PORTNAME);
Phase "pcopy", "Copying ports into place", sub {
DoneIfExists("$PORTSMISCDIR/emulab-clrhouse");
ExecQuietFatal("$SH $SRCDIR/ports/ports-install");
......@@ -302,20 +297,16 @@ Phase "ports", "Installing ports", sub {
Phase "portfixup", "Fixing up packages", sub {
Phase "rsync", "Looking for rsync", sub {
if (!ExecQuiet("$PKG_INFO -x rsync")) {
PhaseSkip("rsync already installed");
}
DoneIfPackageInstalled("rsync");
my $pname = GetPackage("rsync", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
AddPackage($pname, $packagedir);
};
if ($FBSD_MAJOR == 6) {
# Temporary for template stuff
Phase "Simple", "Looking for Simple XML Parser", sub {
if (!ExecQuiet("$PKG_INFO -x p5-XML-Simple")) {
PhaseSkip("p5-XML-Simple already installed");
}
DoneIfPackageInstalled("p5-XML-Simple");
my $pname = GetPackage("p5-XML-Simple", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
AddPackage($pname, $packagedir);
};
}
};
......@@ -324,10 +315,11 @@ Phase "patches", "Applying patches", sub {
Phase "m2cryptopatch", "Patching m2crypto", sub {
my $patchfile = $M2CRYPTO_PATCH;
if (ExecQuiet("$PKG_INFO -I -x m2crypto | fgrep -q -s '0.17'") == 0) {
my $pkg = InstalledPackage("m2crypto", 0);
if ($pkg && $pkg =~ /0\.17/) {
$patchfile = "${patchfile}-0.17";
}
elsif (ExecQuiet("$PKG_INFO -I -x m2crypto | fgrep -q -s '0.13'") == 0) {
elsif ($pkg && $pkg =~ /0\.13/) {
$patchfile = "${patchfile}-0.13";
}
if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $patchfile")) {
......
......@@ -64,7 +64,11 @@ $BOSS_PORT = "emulab-boss-1.8";
$OPS_PORT = "emulab-ops-1.4";
$FS_PORT = "emulab-fs-1.4";
if ($FBSD_MAJOR > 4) {
if ($FBSD_MAJOR > 9 || ($FBSD_MAJOR == 9 && $FBSD_MINOR > 1)) {
if ($FBSD_MAJOR > 9) {
$BOSS_PORT = "emulab-boss-6.0";
$OPS_PORT = "emulab-ops-6.0";
$FS_PORT = "emulab-fs-6.0";
} elsif ($FBSD_MAJOR == 9 && $FBSD_MINOR > 1) {
$BOSS_PORT = "emulab-boss-5.1";
$OPS_PORT = "emulab-ops-5.1";
$FS_PORT = "emulab-fs-5.1";
......@@ -129,7 +133,10 @@ $SELFLOAD_PATCH = "$main::TOP_SRCDIR/patches/SelfLoader.patch";
#
$PYM2_PKG = "py25-m2crypto-0.19.1";
$PY_VER = "python2.5";
if ($FBSD_MAJOR > 8 || ($FBSD_MAJOR == 8 && $FBSD_MINOR > 2)) {
if ($FBSD_MAJOR > 9) {
$PYM2_PKG = "py27-m2crypto-0.21.1_1";
$PY_VER = "python2.7";
} elsif ($FBSD_MAJOR > 8 || ($FBSD_MAJOR == 8 && $FBSD_MINOR > 2)) {
$PYM2_PKG = "py27-m2crypto-0.21.1";
$PY_VER = "python2.7";
} elsif ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) {
......@@ -211,9 +218,6 @@ $PATCH = "/usr/bin/patch";
$CAT = "/bin/cat";
$NEWALIASES = "/usr/bin/newaliases";
$SH = "/bin/sh";
$PKG_ADD = "/usr/sbin/pkg_add";
$PKG_DEL = "/usr/sbin/pkg_delete";
$PKG_INFO = "/usr/sbin/pkg_info";
$PWD = "/bin/pwd";
$CP = "/bin/cp";
$MV = "/bin/mv";
......@@ -266,7 +270,6 @@ $RCLOCAL = "/etc/rc.local";
$PHP_INI = "/usr/local/etc/php.ini";
$SENDMAIL_CF = "/etc/mail/sendmail.cf";
$INETD_CONF = "/etc/inetd.conf";
$NAMED_PIDFILE = "$VARRUN/named.pid";
$ETCSSH = "/etc/ssh";
$SSH_CONFIG = "$ETCSSH/ssh_config";
$LOADER_CONF = "/boot/loader.conf";
......
#!/usr/bin/perl -w
#
# Copyright (c) 2003-2012 University of Utah and the Flux Group.
# Copyright (c) 2003-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -436,10 +436,12 @@ sub DoneIfIdentical($$) {
#
# Done if package installed.
#
sub DoneIfPackageInstalled($) {
my ($pname) = @_;
my $foo = `$PKG_INFO -x $pname 2>&1`;
if (! $?) {
sub DoneIfPackageInstalled($;$) {
my ($pname,$exact) = @_;
$exact = 0
if (!defined($exact));
if (InstalledPackage($pname, $exact)) {
PhaseSkip("already installed");
}
}
......@@ -781,7 +783,7 @@ sub FetchFileFatal($$) {
# Locate the proper version of a package to install by looking
# at the available package tarballs.
#
# Must be called "in phase" since we will PhashFail on errors.
# Must be called "in phase" since we will PhaseFail on errors.
#
sub GetPackage($$) {
my ($prefix, $packagedir) = @_;
......@@ -789,17 +791,89 @@ sub GetPackage($$) {
PhaseFail("Must provide -p (packagedir) argument!")
if (!$packagedir);
my $pname = `ls $packagedir/$prefix-*.tbz 2>/dev/null`;
my $pname = `ls $packagedir/$prefix-*.txz 2>/dev/null`;
if ($?) {
$pname = `ls $packagedir/$prefix-*.tgz 2>/dev/null`;
PhaseFail("Cannot find $prefix package in $packagedir!")
if ($?);
$pname = `ls $packagedir/$prefix-*.tbz 2>/dev/null`;
if ($?) {
$pname = `ls $packagedir/$prefix-*.tgz 2>/dev/null`;
PhaseFail("Cannot find $prefix package in $packagedir!")
if ($?);
}
}
chomp($pname);
return $pname;
}
#
# Return the name of any installed package matching the given regex or exact
# name (if $exact != 0). If there are multiple matches, we warn and return
# the first. Return undef if no match.
#
sub InstalledPackage($$) {
my ($pname, $exact) = @_;
my (@foo, $args);
if (-x "/usr/sbin/pkg_info") {
# note: use extended REs to match new pkg tool
$args = $exact ? "-I" : "-I -X";
@foo = `pkg_info $args $pname 2>/dev/null`;
} elsif (-x "/usr/sbin/pkg") {
$args = $exact ? "" : "-x";
@foo = `pkg info $args $pname 2>/dev/null`;
} else {
PhaseFail("No package tools found!?");
}
if ($? == 0 && @foo > 0) {
if (@foo > 1) {
print STDERR "WARNING: '$pname' matches multiple packages, returning first\n";
}
if ($foo[0] =~ /^(\S+)/) {
return $1;
}
}
return undef;
}
sub AddPackage($$) {
my ($pname, $packagedir) = @_;
if (-x "/usr/sbin/pkg_add") {
ExecQuietFatal("env PKG_PATH=$packagedir pkg_add $pname");
} elsif (-x "/usr/sbin/pkg") {
ExecQuietFatal("pkg add $packagedir/$pname.txz");
} else {
PhaseFail("No package tools found!?");
}
}
sub DelPackage($$$) {
my ($pname, $recursive, $fatal) = @_;
my ($cmd, $args);
$args = "-f";
if (-x "/usr/sbin/pkg_delete") {
$cmd = "pkg_delete";
$args .= " -r"
if ($recursive);
} elsif (-x "/usr/sbin/pkg") {
$cmd = "pkg delete";
$args .= " -y";
$args .= " -R"
if ($recursive);
} else {
PhaseFail("No package tools found!?");
}
$args .= "-x $pname";
if ($fatal) {
ExecQuietFatal("$cmd $args");
} else {
ExecQuiet("$cmd $args");
}
}
#
# Print out the phase stack that got us here
#
......
......@@ -31,8 +31,16 @@ sub Install($$$)
if (!$isupdate) {
# Starting at 6.0 we use the default version of bind, not the port.
my $named_control = ($FBSD_MAJOR < 6 ?
"$RCDIR/1.named.sh" : "/etc/rc.d/named");
# Starting at 10.0 we are back to a port!
my $named_control = "/etc/rc.d/named";
if ($FBSD_MAJOR < 6 && -e "$RCDIR/1.named.sh") {
$named_control = "$RCDIR/1.named.sh";
} elsif ($FBSD_MAJOR >= 10 && -e "/usr/local/etc/rc.d/named") {
$named_control = "/usr/local/etc/rc.d/named";
if (-e "/etc/rc.d/named") {
rename("/etc/rc.d/named", "/etc/rc.d/.named.NOPE");
}
}
Phase "stopping", "Stopping named", sub {
if (ExecQuiet("killall -s named")) {
......@@ -53,11 +61,15 @@ sub Install($$$)
# script.
#
if ($FBSD_MAJOR >= 6) {
unlink($NAMED_PIDFILE)
if ( -e "$NAMED_PIDFILE");
if (ExecQuiet("$named_control start") &&
! -e "$NAMED_PIDFILE") {
PhaseFail("Unable to start named: ");
my $pf1 = "$VARRUN/named.pid";
my $pf2 = "$VARRUN/named/named.pid";
unlink($pf1, $pf2);
if (ExecQuiet("$named_control start")) {
PhaseFail("Unable to start named");
}
sleep 1;
if (! -e $pf1 && ! -e $pf2) {
PhaseFail("Unable to start named");
}
} else {
ExecQuietFatal("$named_control start");
......
......@@ -25,11 +25,12 @@ sub Install($$$)
if ($FBSD_MAJOR < 7) {
Phase "m2cryptopatch", "Patching m2crypto", sub {
my $patchfile = $M2CRYPTO_PATCH;
if (ExecQuiet("$PKG_INFO -I -x m2crypto | fgrep -q -s '0.17'") == 0) {
my $pkg = InstalledPackage("m2crypto", 0);
if ($pkg && $pkg =~ /0\.17/) {
$patchfile = "${patchfile}-0.17";
}
elsif (ExecQuiet("$PKG_INFO -I -x m2crypto | fgrep -q -s '0.13'") == 0) {
elsif ($pkg && $pkg =~ /0\.13/) {
$patchfile = "${patchfile}-0.13";
}
if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $patchfile")) {
......
......@@ -15,44 +15,38 @@ sub Install($$$)
Phase "portfixup", "Fixing up packages", sub {
Phase "rsync", "Looking for rsync", sub {
if (!ExecQuiet("$PKG_INFO -x rsync")) {
PhaseSkip("rsync already installed");
}
DoneIfPackageInstalled("rsync");
my $pname = GetPackage("rsync", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
AddPackage($pname, $packagedir);
};
if ($FBSD_MAJOR >= 6) {
# Temporary for template stuff
Phase "Simple", "Looking for Simple XML Parser", sub {
if (!ExecQuiet("$PKG_INFO -x p5-XML-Simple")) {
PhaseSkip("p5-XML-Simple already installed");
}
DoneIfPackageInstalled("p5-XML-Simple");
my $pname = GetPackage("p5-XML-Simple", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
AddPackage($pname, $packagedir);
};
if ($ARCHSUPPORT) {
Phase "Subversion", "Looking for Subversion", sub {
if (!ExecQuiet("$PKG_INFO -x subversion")) {
PhaseSkip("subversion already installed");
}
DoneIfPackageInstalled("subversion");
my $pname;
if ($FBSD_MAJOR > 6) {
$pname = GetPackage("py-subversion", $packagedir);
} else {
$pname = GetPackage("subversion-python", $packagedir);
}
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
AddPackage($pname, $packagedir);
};
}
}
if ($WINSUPPORT) {
Phase "gcc30", "Looking for GCC 3.0 and installing", sub {
if ($FBSD_MAJOR > 4 ||
!ExecQuiet("$PKG_INFO -x gcc30")) {
PhaseSkip("GCC 3.0 or greater already installed");
if ($FBSD_MAJOR > 4) {
PhaseSkip("not needed");
}
DoneIfPackageInstalled("gcc30");
my $pname = GetPackage("gcc30", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
AddPackage($pname, $packagedir);
};
}
if ($FBSD_MAJOR > 6) {
......@@ -78,20 +72,20 @@ sub Install($$$)
my $pydir = "/usr/local/lib/$PY_VER/site-packages";
my $egg = `ls -d $pydir/M2Crypto-*-py*-*.egg 2>/dev/null | tail -1`;
chomp($egg);
if (! -x $EASYINSTALL) {
PhaseSkip("python easy_install missing");
}
if ($egg eq "") {
PhaseSkip("egg not found");
}
if (-d "$egg") {
PhaseSkip("egg already unpacked");
}
if (! -x $EASYINSTALL) {
PhaseSkip("python easy_install missing");
}
# XXX swig must be installed for easyinstall to exit correctly
Phase "swig", "Installing swig", sub {
DoneIfPackageInstalled("swig");
my $pname = GetPackage("swig", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
AddPackage($pname, $packagedir);
};
ExecQuietFatal("mv $egg /var/tmp/");
$egg =~ s/$pydir//;
......@@ -99,6 +93,15 @@ sub Install($$$)
ExecQuietFatal("mv /var/tmp$egg $pydir/$egg.bak");
};
}
if ($FBSD_MAJOR >= 10) {
Phase "bind-compat", "Creating /etc/namedb for backward compat", sub {
PhaseSkip("already exists")
if (-e "/etc/namedb");
PhaseSkip("bind not installed?")
if (! -d "/usr/local/etc/namedb");
ExecQuietFatal("ln -sf /usr/local/etc/namedb /etc/namedb");
};
}
};
return 0;
......
......@@ -16,103 +16,96 @@ sub Install($$$)
Phase "ports", "Installing ports", sub {
Phase "packages", "Installing packages", sub {
Phase "main", "Installing main package", sub {
if (!ExecQuiet("$PKG_INFO -e $BOSS_PORT")) {
PhaseSkip("Package already installed");
}
DoneIfPackageInstalled($BOSS_PORT, 1);
if (!$packagedir) {
PhaseSkip("No package directory provided");
}
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $BOSS_PORT");
AddPackage($BOSS_PORT, $packagedir);
};
if ($FBSD_MAJOR > 4) {
Phase "php", "Installing php${PHP_VERSION} package", sub {
if (!ExecQuiet("$PKG_INFO -e $PHP_PORT")) {
PhaseSkip("Package already installed");
}
DoneIfPackageInstalled($PHP_PORT, 1);
if (!$packagedir) {
PhaseSkip("No package directory provided");
}
# XXX ugh, make sure an older version is not installed
if ($PHP_VERSION > 4) {
ExecQuiet("$PKG_DEL -f -x php4-");
DelPackage("php4-", 0, 0);
}
ExecQuietFatal("$ENV PKG_PATH=$packagedir ".
" $PKG_ADD $PHP_PORT");
AddPackage($PHP_PORT, $packagedir);
};
# XXX temporary: only needed til emulab-boss package updated
Phase "tftpd", "Updating tftpd installation", sub {
my $pname = `$PKG_INFO -E 'emulab-tftp-hpa-*' 2>/dev/null`;
chomp($pname);
if ($pname eq $TFTPD_PKG) {
PhaseSkip("tftpd already up to date");
my $pname = InstalledPackage("emulab-tftp-hpa-", 0);
if ($pname) {
if ($pname eq $TFTPD_PKG) {
PhaseSkip("tftpd already up to date");
}
DelPackage($pname, 0, 1);
}
if (!$packagedir) {
PhaseSkip("No package directory provided");
}
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_DEL -f $pname")
if ($pname);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $TFTPD_PKG");
AddPackage($TFTPD_PKG, $packagedir);
};
# XXX Also temporary
Phase "pubsub", "Installing pubsub package", sub {
my $pspkg = $ELVIN_COMPAT ? "pubsub-elvincompat" : "pubsub";
if (!ExecQuiet("$PKG_INFO -x $pspkg")) {
PhaseSkip("$pspkg already installed");
}
DoneIfPackageInstalled($pspkg, 0);
my $pname = GetPackage($pspkg, $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
AddPackage($pname, $packagedir);
};
# XXX Ditto
if ($FBSD_MAJOR > 6 || ($FBSD_MAJOR == 6 && $FBSD_MINOR > 2)) {
if ($FBSD_MAJOR < 8) {
Phase "p5-DBD-mysql50", "Installing old Perl Mysql package", sub {
my $pname = `$PKG_INFO -E 'p5-DBD-mysql50-*' 2>/dev/null`;
chomp($pname);
if ($pname eq $P5DBD_PKG) {
PhaseSkip("p5-DBD-mysql50 already up to date");
my $pname = InstalledPackage("p5-DBD-mysql50-", 0);
if ($pname) {
if ($pname eq $P5DBD_PKG) {
PhaseSkip("p5-DBD-mysql50 already up to date");
}
DelPackage($pname, 0, 1);
}
if (!$packagedir) {
PhaseSkip("No package directory provided");
}
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_DEL -f $pname")
if ($pname);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $P5DBD_PKG");
AddPackage($P5DBD_PKG, $packagedir);
};
}
if ($FBSD_MAJOR > 6) {
Phase "py-m2crypto", "Installing python m2crypto package", sub {
my $pname = `$PKG_INFO -E 'py*-m2crypto-*' 2>/dev/null`;
chomp($pname);
if ($pname eq $PYM2_PKG) {
PhaseSkip("py-m2crypto already up to date");
my $pname = InstalledPackage("py[0-9]+-m2crypto-", 0);
if ($pname) {
if ($pname eq $PYM2_PKG) {
PhaseSkip("py-m2crypto already up to date");
}
DelPackage($pname, 0, 1);
}
if (!$packagedir) {
PhaseSkip("No package directory provided");
}
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_DEL -f $pname")
if ($pname);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $PYM2_PKG");
AddPackage($PYM2_PKG, $packagedir);
};
#
# XXX Remove conflicting bind package,
# XXX Remove conflicting bind package.
#
Phase "bind9", "Removing conflicting bind package", sub {
PhaseSkip("bind9 already deleted")
if (ExecQuiet("$PKG_INFO -x bind9") &&
!-e "/usr/local/sbin/rndc");
ExecQuietFatal("$PKG_DEL -r -f -x bind9");
};
if ($FBSD_MAJOR < 10) {
Phase "bind9", "Removing conflicting bind package", sub {
my $pname = InstalledPackage("bind9", 0);
if (!$pname) {
PhaseSkip("bind9 not installed");
}
DelPackage("bind9", 1, 1);
};
}
}
if ($NEEDMROUTED &&
$FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) {
Phase "mrouted", "Installing mrouted", sub {
if (!ExecQuiet("$PKG_INFO -x mrouted")) {
PhaseSkip("mrouted already installed");
}
DoneIfPackageInstalled("mrouted", 0);
my $pname = GetPackage("mrouted", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
AddPackage($pname, $packagedir);
};
}
}
......@@ -121,21 +114,17 @@ sub Install($$$)
# XXX Also temporary
Phase "pubsub", "Installing pubsub package", sub {
my $pspkg = $ELVIN_COMPAT ? "pubsub-elvincompat" : "pubsub";
if (!ExecQuiet("$PKG_INFO -x $pspkg")) {
PhaseSkip("$pspkg already installed");
}
DoneIfPackageInstalled($pspkg, 0);
my $pname = GetPackage($pspkg, $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
AddPackage($pname, $packagedir);
}
}
if ($PGENISUPPORT) {
Phase "protogeni", "Installing protogeni packages", sub {
if ($FBSD_MAJOR > 6 || ($FBSD_MAJOR == 6 && $FBSD_MINOR > 2)) {
if (!ExecQuiet("$PKG_INFO -x emulab-protogeni")) {
PhaseSkip("Protogeni package already installed");
}
DoneIfPackageInstalled("emulab-protogeni", 0);
my $pname = GetPackage("emulab-protogeni", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
AddPackage($pname, $packagedir);
} else {
PhaseSkip("OS install too old for Protogeni");
}
......@@ -144,13 +133,11 @@ sub Install($$$)
};
if (ISFS($server)) {
Phase "fs-packages", "Installing FS packages", sub {
if (!ExecQuiet("$PKG_INFO -e $FS_PORT")) {
PhaseSkip("FS ports already installed");
}
DoneIfPackageInstalled($FS_PORT, 1);
if (!$packagedir) {
PhaseSkip("No package directory provided");
}
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $FS_PORT");
AddPackage($FS_PORT, $packagedir);
};
}
PhaseSkip("Package directory provided; not installing from sources")
......@@ -175,9 +162,7 @@ sub Install($$$)
}
if (ISFS($server)) {
Phase "fs-pinstall", "Installing FS ports (may take a while)", sub {
if (!ExecQuiet("$PKG_INFO -e $FS_PORT")) {
PhaseSkip("Ports already installed");
}
DoneIfPackageInstalled($FS_PORT, 1);
chdir "$PORTSMISCDIR/emulab-fs" or
PhaseFail "Unable to change to $PORTSMISCDIR/emulab-fs: $!";
ExecQuietFatal("make -DBATCH install");
......
......@@ -57,16 +57,26 @@ sub Install($$$)
}
}
# Starting at FreeBSD 6 we use the default version of bind, not the port.
#
# Starting at FreeBSD 6 we use the default version of bind,
# not the port. Er, back to a port as of FreeBSD 10.
#
if ($FBSD_MAJOR < 6) {
push(@strings, qq|named_enable="NO"|);
}
else {
elsif ($FBSD_MAJOR < 10) {
push(@strings, (qq|named_enable="YES"|,
qq|named_chrootdir=""|,
qq|named_flags=""|,
qq|named_uid="root"|,