fix for bug 4150: modify xCAT-genesis-scripts.spec, xCAT-genesis-base.spec and xcatconfig to not run mknb twice during xcat installation/update

This commit is contained in:
ligc 2014-07-27 22:43:38 -04:00
parent 109e086253
commit fc6536eb30
3 changed files with 26 additions and 11 deletions

View File

@ -53,7 +53,10 @@ cd -
if [ "$1" == "2" ]; then #only on upgrade, as on install it's probably not going to work...
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
. /etc/profile.d/xcat.sh
mknb %{tarch}
#mknb %{tarch}
echo "If you are installing/updating xCAT-genesis-base separately, not as part of installing/updating all of xCAT, run 'mknb <arch> manually'"
mkdir -p /etc/xcat
touch /etc/xcat/genesis-base-updated
fi
fi

View File

@ -67,6 +67,7 @@ cd -
# should run mknb. Tried to use rpm triggers, but in several cases the trigger would
# get run multiple times.
#echo "touching /etc/xcat/genesis-scripts-updated"
echo "If you are installing/updating xCAT-genesis-base separately, not as part of installing/updating all of xCAT, run 'mknb <arch> manually'"
mkdir -p /etc/xcat
touch /etc/xcat/genesis-scripts-updated

View File

@ -31,7 +31,6 @@ use Socket;
#-----------------------------------------------------------------------------
# Main
$::progname = "xcatconfig";
my $args = join ' ', @ARGV;
$::command = "$0 $args";
@ -1869,22 +1868,34 @@ sub setupLinuxexports
#-----------------------------------------------------------------------------
sub mknb
{
# The xCAT-genesis-scripts.spec file touches /etc/xcat/genesis-scripts-updated so we know to run
# mknb here.
if ($::arch eq "x86_64" && (-f '/etc/xcat/genesis-scripts-updated') ) {
unlink '/etc/xcat/genesis-scripts-updated';
my $cmd = "$::XCATROOT/sbin/mknb $::arch";
xCAT::MsgUtils->message('I', "Running '$cmd', triggered by the installation/update of xCAT-genesis-scripts-x86_64 ...");
# The xCAT-genesis-scripts.spec file touches /etc/xcat/genesis-scripts-updated or
# the xCAT-genesis-base.spec file touches /etc/xcat/genesis-base-updated,
# so we know to run mknb here.
my $cmd;
if ($::arch eq "x86_64" && (-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-x86_64 ...");
}
if ($::arch eq "x86_64" && (-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-x86_64 ...");
}
#my $outref = xCAT::Utils->runcmd("$cmd", 0);
system($cmd);
if ($? != 0) {
my $rc = $? >> 8;
xCAT::MsgUtils->message('E', "The 'mknb $::arch' command returned error code: $rc.");
my $rc = $? >> 8;
xCAT::MsgUtils->message('E', "The 'mknb $::arch' command returned error code: $rc.");
}
else {
xCAT::MsgUtils->message('I', "The 'mknb $::arch' command completed successfully.");
}
}
}
#-----------------------------------------------------------------------------