2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-22 03:32:04 +00:00

Verify nbk kernel file is present before defaulting to use it

This commit is contained in:
Mark Gurevich 2020-09-10 14:23:33 -04:00
parent c6a8adeacd
commit 6f4c59fece
2 changed files with 11 additions and 3 deletions

View File

@ -103,5 +103,7 @@ The following table illustrates the cluster being used in this example:
chdef -t site clustersite installloc=
rsync -auv --exclude 'autoinst' /install r1n01:/
rsync -auv --exclude 'autoinst' /install r2n01:/
rsync -auv --exclude 'autoinst' /tftpboot r1n01:/
rsync -auv --exclude 'autoinst' /tftpboot r2n01:/
rsync -auv /tftpboot r1n01:/
rsync -auv /tftpboot r2n01:/
.. note:: If ``/install`` and ``/tftpboot`` directories local to each Service Node are used and ``mknb`` command is executed to generate a diskless network boot image with custom changes, it will not be automatically copied to the Service Node. Make sure to run the above ``rsync`` commands after executing the ``mknb``. Verify ``/tftpboot/xcat`` directory on Service node contains ``genesis.kernel.<arch>`` and ``genesis.fs.<arch>.gz`` files.

View File

@ -711,10 +711,16 @@ sub setdestiny {
$bphash->{$_}->[0]->{initrd} = "xcat/genesis.fs.$arch.$othersuffix";
$bphash->{$_}->[0]->{kcmdline} = $kcmdline . "xcatd=$master:$xcatdport destiny=$state";
}
} else { #'legacy' environment
} else { # genesis.kernel file is not there, assume 'legacy' environment
if (-r "$tftpdir/xcat/nbk.$arch") {
$bphash->{$_}->[0]->{kernel} = "xcat/nbk.$arch";
$bphash->{$_}->[0]->{initrd} = "xcat/nkfs.$arch.gz";
$bphash->{$_}->[0]->{kcmdline} = $kcmdline . "xcatd=$master:$xcatdport";
$callback->({ warning => ["No genesis.kernel.$arch file found. Defaulting to legacy nbk.$arch"]});
} else { # can not find genesis.kernel or nbk file
$callback->({ error => ["Could not find genesis.kernel.$arch or legacy nbk.$arch files"], errorcode => [1] });
exit(1);
}
}
}