Commit 21ffb3d2 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Add option to download the package tarball from the outer webserver,

to avoid NFS mountd issues during install.
parent 52b1c303
......@@ -513,6 +513,19 @@ sub doboot()
$emulabconfig{FS_PKG} = "emulab-fs-4.0";
$emulabconfig{OPS_PKG} = "emulab-ops-4.0";
$emulabconfig{BOSS_PKG} = "emulab-boss-4.0";
$emulabconfig{PACKAGE_TARBALL} = "FreeBSD-8.2-packages.tar.gz";
}
if (exists($emulabconfig{"PACKAGE_TARBALL"})) {
$emulabconfig{FS_PKG_DIR} = "$TBDIR/packages";
$emulabconfig{OPS_PKG_DIR} = $emulabconfig{FS_PKG_DIR};
$emulabconfig{BOSS_PKG_DIR} = $emulabconfig{FS_PKG_DIR};
#
# Grab the package tarball now.
#
mysystem("fetch -q -o /usr/packages.tar.gz ".
"'http://${bossname}/downloads/" .
$emulabconfig{PACKAGE_TARBALL} . "'");
}
#
......@@ -657,6 +670,12 @@ sub SetupFsNode()
GetEmulabSource("$TBDIR/src");
}
# This avoids nfs mounts interruptions
if (exists($emulabconfig{PACKAGE_TARBALL})) {
RecreateDir("$TBDIR/packages", 1);
mysystem("tar zxf /usr/packages.tar.gz -C $TBDIR/packages");
}
#
# The mirror tree is copied to temp storage, and then copied into
# place later.
......@@ -828,8 +847,10 @@ sub SetupFsNode()
# Lets mount the package dir so that we can pass off some stuff to
# the install scripts.
#
RecreateDir("/packages", 1);
mysystem("mount ${fsname}:" . $emulabconfig{FS_PKG_DIR} . " /packages");
if (! exists($emulabconfig{PACKAGE_TARBALL})) {
RecreateDir("/packages", 1);
mysystem("mount ${fsname}:" . $emulabconfig{FS_PKG_DIR} . " /packages");
}
#
# Need these for rc.conf.
......@@ -942,8 +963,13 @@ sub SetupFsNode()
#
# Create the fs node.
#
$ENV{"PKG_PATH"} = "/packages";
my $pkg = "-P $emulabconfig{FS_PKG} -p /packages";
if (exists($emulabconfig{PACKAGE_TARBALL})) {
$ENV{"PKG_PATH"} = "$TBDIR/packages";
}
else {
$ENV{"PKG_PATH"} = "/packages";
}
my $pkg = "-P $emulabconfig{FS_PKG} -p " . $ENV{"PKG_PATH"};
mysystem("cd $TBDIR/obj/testbed/install; ".
" perl fs-install $pkg -b");
......@@ -1072,6 +1098,12 @@ sub SetupOpsNode($)
GetEmulabSource("$TBDIR/src");
}
# This avoids nfs mounts interruptions
if (exists($emulabconfig{PACKAGE_TARBALL})) {
RecreateDir("$TBDIR/packages", 1);
mysystem("tar zxf /usr/packages.tar.gz -C $TBDIR/packages");
}
#
# The mirror tree is copied to temp storage, and then copied into
# place later.
......@@ -1258,8 +1290,10 @@ sub SetupOpsNode($)
# Lets mount the package dir so that we can pass off some stuff to
# the install scripts.
#
RecreateDir("/packages", 1);
mysystem("mount ${fsname}:" . $emulabconfig{OPS_PKG_DIR} . " /packages");
if (! exists($emulabconfig{PACKAGE_TARBALL})) {
RecreateDir("/packages", 1);
mysystem("mount ${fsname}:" . $emulabconfig{OPS_PKG_DIR} . " /packages");
}
#
# Need these for rc.conf.
......@@ -1378,8 +1412,13 @@ sub SetupOpsNode($)
#
# Create the ops node.
#
$ENV{"PKG_PATH"} = "/packages";
my $pkg = "-P $emulabconfig{OPS_PKG} -p /packages " .
if (exists($emulabconfig{PACKAGE_TARBALL})) {
$ENV{"PKG_PATH"} = "$TBDIR/packages";
}
else {
$ENV{"PKG_PATH"} = "/packages";
}
my $pkg = "-P $emulabconfig{OPS_PKG} -p " . $ENV{"PKG_PATH"} . " " .
($isfs ? "-F $emulabconfig{FS_PKG}" : "");
mysystem("cd $TBDIR/obj/testbed/install; ".
" perl ops-install $pkg -b -w ElabInElab ");
......@@ -1591,6 +1630,12 @@ sub SetupBossNode($)
GetEmulabSource("$TBDIR/src");
}
# This avoids nfs mounts interruptions
if (exists($emulabconfig{PACKAGE_TARBALL})) {
RecreateDir("$TBDIR/packages", 1);
mysystem("tar zxf /usr/packages.tar.gz -C $TBDIR/packages");
}
#
# Place the big content dirs on data
#
......@@ -1822,8 +1867,10 @@ sub SetupBossNode($)
# Lets mount the package dir so that we can pass off some stuff to
# the install scripts.
#
RecreateDir("/packages", 1);
mysystem("mount ${fsname}:" . $emulabconfig{BOSS_PKG_DIR} . " /packages");
if (!exists($emulabconfig{PACKAGE_TARBALL})) {
RecreateDir("/packages", 1);
mysystem("mount ${fsname}:" . $emulabconfig{BOSS_PKG_DIR} . " /packages");
}
#
# Determine if we need to run a multicast router.
......@@ -1994,8 +2041,13 @@ sub SetupBossNode($)
#
# Create the boss node. This will also install the software.
#
$ENV{"PKG_PATH"} = "/packages";
my $pkg = "-P $emulabconfig{BOSS_PKG} -p /packages";
if (exists($emulabconfig{PACKAGE_TARBALL})) {
$ENV{"PKG_PATH"} = "$TBDIR/packages";
}
else {
$ENV{"PKG_PATH"} = "/packages";
}
my $pkg = "-P $emulabconfig{BOSS_PKG} -p " . $ENV{"PKG_PATH"};
mysystem("cd $TBDIR/obj/testbed/install; ".
" perl boss-install $pkg -b -w ElabInElab");
......
Supports Markdown
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