# # # use strict; use libinstall; use installvars; my $UTAHURL = "http://www.emulab.net/downloads"; my $DESCRIPTORS = "$TOP_SRCDIR/install/descriptors-v3.xml"; my @STDIMAGES = ("FBSD82-STD", "FEDORA10-STD"); my @MBRS = ("emulab-mbr.dd", "emulab-mbr2.dd"); my $STDIMAGESURL = "$UTAHURL/images-STD"; sub Install($$$) { my ($server, $isupdate, $impotent) = @_; # Replace if this script does an update for ip/domain. return 0 if ($isupdate); Phase "IDs", "Setting up Images and OSs", sub { # # Load up the initial descriptors. # Load up the images from boss. # Phase "descriptors", "Loading the Image and OS IDS", sub { ExecQuietFatal("cd $TOP_OBJDIR/install; ". " $SUDO -u $PROTOUSER $WAP ". " perl load-descriptors -a $DESCRIPTORS"); }; foreach my $imagename (@STDIMAGES) { my $localfile = "$PREFIX/images/${imagename}.ndz"; my $url = "$STDIMAGESURL/${imagename}.ndz"; Phase "$imagename", "Fetching $imagename. Patience!", sub { DoneIfExists($localfile); FetchFileFatal($url, $localfile); }; } foreach my $mbr (@MBRS) { my $localfile = "$PREFIX/images/$mbr"; my $url = "$UTAHURL/$mbr"; Phase "$mbr", "Fetching $mbr.", sub { DoneIfExists($localfile); FetchFileFatal($url, $localfile); }; } # # The sitevar is how the reload daemon knows what to reload nodes # with, by default. Now a comma separated list. # my $idlist = join(",", @STDIMAGES); Phase "sitevar", "Setting sitevar $DEFAULTIMAGESITEVAR", sub { ExecQuietFatal("$PREFIX/sbin/setsitevar ". "'$DEFAULTIMAGESITEVAR' '$idlist'"); }; PhaseSucceed("done") }; return 0; } # Local Variables: # mode:perl # End: