handles otherpkgs and syncfiles being put into xcatdefault on postscritps table

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3900 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
linggao 2009-07-29 21:25:59 +00:00
parent 4ea33650c2
commit 04c3f3d5fe
5 changed files with 41 additions and 30 deletions

View File

@ -229,7 +229,7 @@ sub makescript {
push @scriptd, "NODESETSTATE=".$nodesetstate."\n";
push @scriptd, "export NODESETSTATE\n";
# set the UPDATENODE flag in the script, the default it 0, that means not in the updatenode process
# set the UPDATENODE flag in the script, the default it 0, that means not in the updatenode process, xcatdsklspost and xcataixpost will set it to 1 in updatenode case
push @scriptd, "UPDATENODE=0\n";
push @scriptd, "export UPDATENODE\n";
@ -300,14 +300,16 @@ sub makescript {
push @scriptd, "OTHERPKGS=$pkgtext\n";
push @scriptd, "export OTHERPKGS\n";
if (-r "/install/post/otherpkgs/$os/$arch/repodata/repomd.xml") {
push @scriptd, "OTHERPKGS_HASREPO=1\n";
push @scriptd, "export OTHERPKGS_HASREPO\n";
}
}
}
}
# check if there are sync files to be handled
my $syncfile = xCAT::SvrUtils->getsynclistfile(undef, $os, $arch, $profile, $nodesetstate);
if (! defined ($syncfile)) {
push @scriptd, "NOSYNCFILES=1\n";
push @scriptd, "export NOSYNCFILES\n";
}
###Please do not remove or modify this line of code!!! xcatdsklspost depends on it
push @scriptd, "# postscripts-start-here\n";

View File

@ -22,6 +22,16 @@
#=cut
#-------------------------------------------------------------------------------
# do nothing for diskless deployment case because it is done in the image already
if [[ $UPDATENODE -ne 1 ]]; then
if [ $NODESETSTATE = "netboot" -o \
$NODESETSTATE = "diskless" -o \
$NODESETSTATE = "dataless" ]
then
exit 0
fi
fi
#echo "OTHERPKGS=$OTHERPKGS"
if [[ -z "$OTHERPKGS" ]]; then
echo "$0: no extra rpms to install"

View File

@ -7,14 +7,25 @@
#
#####################################################
# do nothing when UPDATENODE=1
if [ $UPDATENODE = 1 -o \
$NODESETSTATE = "netboot" -o \
$NODESETSTATE = "diskless" ]
# do nothing when UPDATENODE=1 because it is done from the top down
if [[ $UPDATENODE -eq 1 ]]; then
exit 0
fi
#do nothing id there is no sync file template for the node
if [[ $NOSYNCFILES -eq 1 ]]; then
exit 0
fi
# do nothing for diskless deployment case because it is done in the image already
if [ $NODESETSTATE = "netboot" -o \
$NODESETSTATE = "diskless" -o \
$NODESETSTATE = "dataless" ]
then
exit 0
fi
logger -t xCAT "Performing syncfiles postscript"
osname=`uname`

View File

@ -7,7 +7,8 @@
# This script is run from the /etc/inittab file on both
# diskless and diskfull AIX nodes
#
# It is also run by the updatenode cmd
# It is also run by the updatenode cmd ( -c 1)
# moncfg command (-c 3)
#
#####################################################
@ -192,14 +193,6 @@ if (-f $scriptname)
`echo "$POSTS" | tr "," "\n" >> $scriptname`;
}
# when called by the updatenode command,
# if the first parameter equals 1, remove the otherpkgs postscript,
# since the otherpkgs only run for Linux software maintenance
if (@ARGV > 0 && $ARGV[0] == 1) {
my $TMP=`sed "/otherpkgs/ d" $scriptname`;
`echo "$TMP" > $scriptname`;
}
$nodesetstat=`grep "NODESETSTATE=" $scriptname|awk -F \= '{print \$2}'`;
chomp($nodesetstat);
$ENV{PATH}="/xcatpost:$ENV{PATH}";

View File

@ -3,6 +3,11 @@
#####################################################
#
# Generic xCAT post script for diskless nodes
# This script is called in the following different palces:
# updatenode -P ... --> xcatdsklspost 1 ...
# updatenode -S --> xcatdsklspost 2 otherpkgs
# moncfg rmcmon --> xcatdsklspost 3 configrmcnodes
# node deployment --> xcatdsklspost
#
#####################################################
if [ ! `uname` == Linux ]; then
@ -71,8 +76,8 @@ while [ -z "$MYCONT" ]; do
# echo "MYCONT=$MYCONT"
done
# when called by the updatenode command,
#modify the UPDATENODE flag to 1
# when called by the updatenode command
#modify the UPDATENODE flag to 1
if [ $# -gt 0 ]; then
TMP=`sed -e 's/UPDATENODE=0/UPDATENODE=1/g' /tmp/mypostscript`;
echo "$TMP" > /tmp/mypostscript;
@ -96,16 +101,6 @@ fi
#MYCONT=`cat /tmp/mypostscript`
#echo "$MYCONT"
# when called by the updatenode command,
# if the first parameter equals 1, remove the otherpkgs postscript,
# since the otherpkgs only run for software maintenance: xcatdsklspost 2 otherpkgs
if [ $# -gt 0 ]; then
if [ $1 -eq 1 ]; then
TMP=`sed "/otherpkgs/ d" /tmp/mypostscript`
echo "$TMP" > /tmp/mypostscript
fi
fi
if [ $# -eq 0 ]; then
#notify the server that we are done with netbooting
CNS=`grep NODESTATUS= /tmp/mypostscript |awk -F = '{print $2}'`