Commit 3a96cf99 authored by Kevin Atkinson's avatar Kevin Atkinson

Misc tb-set-tarfiles client side fixes.

This includes create a large local filesystem (using mkextrafs) if the
target directory starts with "/local".

These changes where suppose to go in with my initial commit, but I
forgot to push from my test node to my devel tree before rebasing and
hanse they didn't make it in.
parent 23a030f8
......@@ -38,6 +38,7 @@ my $TARDBFILE = "/var/db/testbed.tarfiles";
# library and initialize itself.
#
use libsetup;
use liblocsetup;
use libtmcc;
use librc;
......@@ -95,6 +96,7 @@ sub doboot()
{
my @blobs;
my $errors = 0;
my $need_mkextrafs = 1;
if (-e "/var/emulab/boot/rc.blobs-ran") {
print STDOUT "Blobs installation already ran on this node.\n";
......@@ -113,13 +115,18 @@ sub doboot()
foreach my $blob (@blobs) {
eval {
($mcastaddr, $portnum, undef, $basename, $dest) =
$blob =~ m|^URL=frisbee.mcast://(.+):(.+)/(.+/)?(.+) ACTION=unpack:(\S+)|
$blob =~ m|^URL=frisbee.mcast://(.+?):(.+?)/(.+/)?(.+) ACTION=unpack:(\S+)|
or die "Bad Blobs line\n";
# FIXME: Make sure $basename doesn't exist...
my $local_path = "/var/tmp/$basename";
my $frisbee_cmd = "$FRISBEE -p $portnum -m $mcastaddr $local_path";
if ($dest =~ /^\/local/ && $need_mkextrafs) {
os_mountextrafs("/local");
$need_mkextrafs = 0;
}
print STDOUT "Fetching blob $basename to $local_path and unpacking to $dest\n";
#print STDOUT "$frisbee_cmd\n";
......@@ -128,13 +135,15 @@ sub doboot()
die "Frisbee failed\n";
}
my $unpack_cmd = "$TARINSTALL $dest $local_path";
my $unpack_cmd = "$TARINSTALL -f $dest $local_path";
#print STDOUT "$unpack_cmd\n";
if (system($unpack_cmd)) {
if ($? >> 8 == 255) {
die "Tarinstall failed\n";
}
}
system("rm $local_path");
};
if ($@) {
my $err = $@;
......
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