Commit 0950ac4f authored by Mike Hibler's avatar Mike Hibler

Hack to deal with loading multiple images where one is already on disk.

We force the reload of all images even if the boot image is already on
disk. Otherwise we violate assumptions in libosload about it being
responsible for setting def_boot_osid.

The right fix is to get rid of those assumptions, but no time right now...
parent 464a175a
......@@ -407,7 +407,7 @@ sub SetOS($$)
if (! $osinfo) {
die_noretry("$node has no bootpath and no def_boot_osid set!");
}
$self->SetOSAux($node, $osinfo, 0);
$self->SetOSAux($node, $osinfo, 0, $loadlist);
#
# Now look for additional loads.
......@@ -422,7 +422,7 @@ sub SetOS($$)
die_noretry("Could not map $osname to its object!")
if (!defined($osinfo));
$self->SetOSAux($node, $osinfo, 1);
$self->SetOSAux($node, $osinfo, 1, 1);
}
}
}
......@@ -436,9 +436,9 @@ sub SetOS($$)
#
# Helper for above.
#
sub SetOSAux($$$$)
sub SetOSAux($$$$$)
{
my ($self, $node, $osinfo, $auxload) = @_;
my ($self, $node, $osinfo, $auxload, $multiple) = @_;
my $node_id = $node->node_id();
my $experiment = $self->experiment();
my $pid = $experiment->pid();
......@@ -471,10 +471,19 @@ sub SetOSAux($$$$)
die_noretry("Error determining if $osinfo is loaded on $node\n");
}
if ($isloaded) {
#
# XXX the primary (boot) OSID is already loaded, but we are loading
# multiple images. In this case we reload the primary OS anyway so that
# the logic in osload continues to work (it assumes that it is responsible
# for setting the def_boot_osid based on the last image specified).
#
if (!$auxload && $multiple) {
$self->SetupReload($node, $osinfo, $auxload);
}
#
# OSID is loaded, but might need to be cleaned.
#
if ($self->dolastload() &&
elsif ($self->dolastload() &&
defined($node->last_reservation()) &&
$node->last_reservation() ne $pid) {
$self->SetupReload($node, $osinfo, $auxload);
......
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