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:
parent
31cff24c27
commit
99d7a6d3fa
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user