From 320eea1c75c03152a80bbe4aed7939327eb946c4 Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 4 Dec 2012 20:40:11 +0000 Subject: [PATCH] new logic to get xcataixpost to the node git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14549 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/xcataixpost | 9 +++++++- xCAT/postscripts/xcatdsklspost | 40 +++++++++++++++++++++++----------- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/xCAT/postscripts/xcataixpost b/xCAT/postscripts/xcataixpost index cc3f2d114..03975d8ea 100755 --- a/xCAT/postscripts/xcataixpost +++ b/xCAT/postscripts/xcataixpost @@ -57,9 +57,16 @@ unless ($useSocketSSL) { # Process the command line... # # the -c means redo the copy of scripts from the server +my $idir; +my $nfsv4; Getopt::Long::Configure("no_pass_through"); $Getopt::Long::ignorecase = 0; -if (!GetOptions('copy|c' => \$::opt_c, 'm=s' => \$::opt_m, 'M=s' => \$::opt_M, 'tftp=s'=> \$::opt_tftpdir)) +if (!GetOptions('copy|c' => \$::opt_c, + 'm=s' => \$::opt_m, + 'M=s' => \$::opt_M, + 'tftp=s'=> \$::opt_tftpdir, + 'installdir=s'=> \$idir, + 'nfsv4=s'=> \$nfsv4)) { # Gather options exit 1; } diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index d5d3622b5..c4039e65b 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -122,19 +122,6 @@ pmatch () return 1 # non-zero return code means string not matched by pattern } -# check if on AIX node -if [ ! `uname` = Linux ]; then - # if we don't have xcataixpost on the node, get it - #if [ ! -f /xcatpost/xcataixpost ]; then - # if [ ! -d /xcatpost ]; then - # mkdir -p /xcatpost; - # fi - #fi - logger -t xCAT -p local4.err "Running xcataixpost $*"; - MYDIR=`dirname $0` - exec $MYDIR/xcataixpost $* - exit -fi # parse the arguments ARGNUM=$#; if [ -z $1 ]; then @@ -162,11 +149,38 @@ else TFTPDIR=$6 fi fi + if [ $ARGNUM -gt 5 ]; then + if [ $7 = "--installdir" ]; then + INSTALLDIR=$8 + fi + fi + if [ $ARGNUM -gt 6 ]; then + if [ $9 = "--nfsv4" ]; then + NFSV4=$10 + fi + fi ;; 3|4|6) MODE=$1;; esac fi +# If on AIX node +if [ ! `uname` = Linux ]; then + #Get a new copy of xcataixpost on the node + mkdir -p /xcatpost; + mkdir -p /xcatmnt; + if [ "$NFSV4" = "yes" ]; then + mount -o vers=4 $P_SIP:$INSTALLDIR/postscripts /xcatmnt + else + mount $P_SIP:$INSTALLDIR/postscripts /xcatmnt + fi + cp /xcatmnt/xcataixpost /xcatpost + umount /xcatmnt + rmdir /xcatmnt + logger -t xCAT -p local4.err "Running xcataixpost $*"; + exec /xcatpost/xcataixpost $* + exit +fi #SLI=$(awk 'BEGIN{srand(); printf("%d\n",rand()*10)}') #sleep $SLI