2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 17:46:38 +00:00

Merge pull request #304 from penguhyang/mknb_twice

correct mknb will run twice during install xcat
This commit is contained in:
Xiaopeng Wang 2015-10-23 18:54:09 +08:00
commit 4d03e69648

View File

@ -1856,21 +1856,20 @@ sub mknb
$::arch = "ppc64";
}
if ((($::arch eq "x86_64") ||($::arch =~ /ppc/)) && (-f '/etc/xcat/genesis-scripts-updated') ) {
unlink '/etc/xcat/genesis-scripts-updated';
# Do not print messages or run command twice
if (-f '/etc/xcat/genesis-base-updated') {
unlink '/etc/xcat/genesis-base-updated';
}
$cmd = "$::XCATROOT/sbin/mknb $::arch";
xCAT::MsgUtils->message('I', "Running '$cmd', triggered by the installation/update of xCAT-genesis-scripts-$::arch ...");
unlink '/etc/xcat/genesis-scripts-updated';
# Do not print messages or run command twice
if (-f '/etc/xcat/genesis-base-updated') {
unlink '/etc/xcat/genesis-base-updated';
}
$cmd = "$::XCATROOT/sbin/mknb $::arch";
xCAT::MsgUtils->message('I', "Running '$cmd', triggered by the installation/update of xCAT-genesis-scripts-$::arch ...");
}
if ((($::arch eq "x86_64") ||($::arch =~ /ppc/)) && (-f '/etc/xcat/genesis-base-updated')) {
unlink '/etc/xcat/genesis-base-updated';
$cmd = "$::XCATROOT/sbin/mknb $::arch";
xCAT::MsgUtils->message('I', "Running '$cmd', triggered by the installation/update of xCAT-genesis-base-$::arch ...");
}
my $outref = xCAT::Utils->runcmd("$cmd", 0);
# my $outref = xCAT::Utils->runcmd("$cmd", 0);
if ($cmd) {
system($cmd);
if ($? != 0) {
@ -1878,7 +1877,7 @@ sub mknb
xCAT::MsgUtils->message('E', "The 'mknb $::arch' command returned error code: $rc.");
}
else {
xCAT::MsgUtils->message('I', "The 'mknb $::arch' command completed successfully.");
xCAT::MsgUtils->message('I', "The 'mknb $::arch' command completed successfully.");
}
}
}