check for AIX in otherpkgs

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11944 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2012-03-22 13:51:08 +00:00
parent 93fc27b4f2
commit 0014099d9c

View File

@ -2,7 +2,7 @@
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
#-------------------------------------------------------------------------------
#=head1 otherpkgs
#=head1 otherpkgs - only runs on Linux
#=head2 It gets the extra rpms and install/update them.
# The environment variable OTHERPKGS contains the rpms to be installed/updated.
# On MN, You need to:
@ -194,8 +194,15 @@ apt_get_update_if_repos_changed()
##
## End the means to update apt's view of Ubuntu repo's if necessary.
##
# Main - start of other pkgs
#do nothing for diskless deployment case because it is done in the image already
# do nothing for diskless deployment case because it is done in the image already
if [ "$(uname -s)" = "AIX" ]; then
logger -p local4.info -t xcat "otherpkgs not support on AIX, exiting "
exit 0
else
logger -p local4.info -t xcat "Running otherpkgs "
fi
if [ -z "$UPDATENODE" ] || [ $UPDATENODE -ne 1 ]; then
if [ "$NODESETSTATE" = "netboot" -o \
"$NODESETSTATE" = "statelite" -o \
@ -244,9 +251,9 @@ else
fi
echo NFSSERVER=$NFSSERVER
logger -t xcat "NFSSERVER=$NFSSERVER"
logger -p local4.info -t xcat "NFSSERVER=$NFSSERVER"
echo OTHERPKGDIR=$OTHERPKGDIR
logger -t xcat "OTHERPKGDIR=$OTHERPKGDIR"
logger -p local4.info -t xcat "OTHERPKGDIR=$OTHERPKGDIR"
#if [ -x "/sbin/dhcpcd" ]; then
# dhcpcd -n $PRIMARYNIC
@ -466,26 +473,26 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
if [ $hasyum -eq 1 ]; then
echo "yum -y upgrade"
result=`yum -y upgrade 2>&1`
logger -t xcat "$result"
logger -p local4.info -t xcat "$result"
if [ $? -ne 0 ]; then
logger -t xcat "otherpkgs: $result"
logger -p local4.info -t xcat "otherpkgs: $result"
fi
echo "$result"
elif [ $haszypper -eq 1 ]; then
echo "zypper --non-interactive update --auto-agree-with-license"
result=`zypper --non-interactive update --auto-agree-with-license 2>&1`
logger -t xcat "$result"
logger -p local4.info -t xcat "$result"
if [ $? -ne 0 ]; then
logger -t xcat "otherpkgs: $result"
logger -p local4.info -t xcat "otherpkgs: $result"
fi
echo "$result"
elif [ $hasapt -eq 1 ]; then
apt_get_update_if_repos_changed $REPOFILE
echo "apt-get -y upgrade"
result=`apt-get -y upgrade 2>&1`
logger -t xcat "$result"
logger -p local4.info -t xcat "$result"
if [ $? -ne 0 ]; then
logger -t xcat "otherpkgs: $result"
logger -p local4.info -t xcat "otherpkgs: $result"
fi
echo "$result"
fi
@ -499,26 +506,26 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
if [ $hasyum -eq 1 ]; then
echo "$envlist yum -y remove $repo_pkgs_preremove"
result=`eval $envlist yum -y remove $repo_pkgs_preremove 2>&1`
logger -t xcat "$result"
logger -p local4.info -t xcat "$result"
if [ $? -ne 0 ]; then
logger -t xcat "otherpkgs: $result"
logger -p local4.info -t xcat "otherpkgs: $result"
fi
echo "$result"
elif [ $haszypper -eq 1 ]; then
echo "$envlist zypper remove -y $repo_pkgs_preremove"
result=`eval $envlist zypper remove -y $repo_pkgs_preremove 2>&1`
logger -t xcat "$result"
logger -p local4.info -t xcat "$result"
if [ $? -ne 0 ]; then
logger -t xcat "otherpkgs: $result"
logger -p local4.info -t xcat "otherpkgs: $result"
fi
echo "$result"
elif [ $hasapt -eq 1 ]; then
apt_get_update_if_repos_changed $REPOFILE
echo "apt-get -y remove $repo_pkgs_preremove"
result=`apt-get -y remove $repo_pkgs_preremove 2>&1`
logger -t xcat "$result"
logger -p local4.info -t xcat "$result"
if [ $? -ne 0 ]; then
logger -t xcat "otherpkgs: $result"
logger -p local4.info -t xcat "otherpkgs: $result"
fi
echo "$result"
fi
@ -527,9 +534,9 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
if [ "$plain_pkgs_preremove" != "" ]; then
echo "$envlist $sremovecommand $plain_pkgs_preremove"
result=`eval $envlist $sremovecommand $plain_pkgs_preremove 2>&1`
logger -t xcat "$result"
logger -p local4.info -t xcat "$result"
if [ $? -ne 0 ]; then
logger -t xcat "otherpkgs $result"
logger -p local4.info -t xcat "otherpkgs $result"
fi
echo "$result"
fi
@ -540,17 +547,17 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
if [ $hasyum -eq 1 ]; then
echo "$envlist yum -y install $repo_pkgs"
result=`eval $envlist yum -y install $repo_pkgs 2>&1`
logger -t xcat "$result"
logger -p local4.info -t xcat "$result"
if [ $? -ne 0 ]; then
logger -t xcat "otherpkgs: $result"
logger -p local4.info -t xcat "otherpkgs: $result"
fi
echo "$result"
elif [ $haszypper -eq 1 ]; then
echo "$envlist zypper install -y $repo_pkgs"
result=`eval $envlist zypper install -y $repo_pkgs 2>&1`
logger -t xcat "$result"
logger -p local4.info -t xcat "$result"
if [ $? -ne 0 ]; then
logger -t xcat "otherpkgs: $result"
logger -p local4.info -t xcat "otherpkgs: $result"
fi
echo "$result"
#remove the repos
@ -563,9 +570,9 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
apt_get_update_if_repos_changed $REPOFILE
echo "$envlist apt-get -q -y --force-yes install $repo_pkgs"
result=`eval $envlist apt-get -q -y --force-yes install $repo_pkgs 2>&1`
logger -t xcat "$result"
logger -p local4.info -t xcat "$result"
if [ $? -ne 0 ]; then
logger -t xcat "otherpkgs: $result"
logger -p local4.info -t xcat "otherpkgs: $result"
fi
echo "$result"
fi
@ -593,9 +600,9 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
echo "$envlist $supdatecommand $plain_pkgs"
result=`eval $envlist $supdatecommand $plain_pkgs 2>&1`
logger -t xcat "$result"
logger -p local4.info -t xcat "$result"
if [ $? -ne 0 ]; then
logger -t xcat "otherpkgs $result"
logger -p local4.info -t xcat "otherpkgs $result"
fi
echo "$result"
@ -612,26 +619,26 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
if [ $hasyum -eq 1 ]; then
echo "$envlist yum -y remove $repo_pkgs_postremove"
result=`eval $envlist yum -y remove $repo_pkgs_postremove 2>&1`
logger -t xcat "$result"
logger -p local4.info -t xcat "$result"
if [ $? -ne 0 ]; then
logger -t xcat "otherpkgs: $result"
logger -p local4.info -t xcat "otherpkgs: $result"
fi
echo "$result"
elif [ $haszypper -eq 1 ]; then
echo "$envlist zypper remove -y $repo_pkgs_postremove"
result=`eval $envlist zypper remove -y $repo_pkgs_postremove 2>&1`
logger -t xcat "$result"
logger -p local4.info -t xcat "$result"
if [ $? -ne 0 ]; then
logger -t xcat "otherpkgs: $result"
logger -p local4.info -t xcat "otherpkgs: $result"
fi
echo "$result"
elif [ $hasapt -eq 1 ]; then
apt_get_update_if_repos_changed $REPOFILE
echo "$envlist apt-get -y remove $repo_pkgs_postremove"
result=`eval $envlist apt-get -y remove $repo_pkgs_postremove 2>&1`
logger -t xcat "$result"
logger -p local4.info -t xcat "$result"
if [ $? -ne 0 ]; then
logger -t xcat "otherpkgs: $result"
logger -p local4.info -t xcat "otherpkgs: $result"
fi
echo "$result"
fi
@ -640,9 +647,9 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
if [ "$plain_pkgs_postremove" != "" ]; then
echo "$envlist $sremovecommand $plain_pkgs_postremove"
result=`eval $envlist $sremovecommand $plain_pkgs_postremove 2>&1`
logger -t xcat "$result"
logger -p local4.info -t xcat "$result"
if [ $? -ne 0 ]; then
logger -t xcat "otherpkgs $result"
logger -p local4.info -t xcat "otherpkgs $result"
fi
echo "$result"
fi