2008-09-08 18:54:30 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
2008-09-09 21:08:48 +00:00
|
|
|
#=head1 otherpkgs
|
2008-09-08 18:54:30 +00:00
|
|
|
#=head2 It gets the extra rpms and install/update them.
|
2008-09-09 21:08:48 +00:00
|
|
|
# The environment variable OTHERPKGS contains the rpms to be installed/updated.
|
2008-09-08 18:54:30 +00:00
|
|
|
# On MN, You need to:
|
2008-09-09 21:08:48 +00:00
|
|
|
# 1. put rpms under /install/post/otherpkgs/os/arch directory where 'os' and 'arch'
|
2008-09-08 18:54:30 +00:00
|
|
|
# can be found in the nodetype table.
|
|
|
|
# 2. put the name of the packages to /opt/xcat/share/xcat/netboot(install)/platform
|
|
|
|
# directory. The file name is one of the following:
|
2008-09-09 21:08:48 +00:00
|
|
|
# profile.os.arch.otherpkgs.pkglist
|
|
|
|
# profile.os.otherpkgs.pkglist
|
|
|
|
# profile.arch.otherpkgs.pkglist
|
|
|
|
# profile.otherpkgs.pkglist
|
2008-09-08 18:54:30 +00:00
|
|
|
# The install/deployment process will pick up the rpms and install them on the nodes.
|
|
|
|
# However, if the nodes have already installed and up and running, you can run the following
|
|
|
|
# command to have the extra rpms installed:
|
2008-09-09 21:08:48 +00:00
|
|
|
# updatenode noderange otherpkgs
|
2008-09-08 18:54:30 +00:00
|
|
|
#
|
|
|
|
#=cut
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
2008-09-09 21:08:48 +00:00
|
|
|
#echo "OTHERPKGS=$OTHERPKGS"
|
|
|
|
if [[ -z "$OTHERPKGS" ]]; then
|
2008-09-08 18:54:30 +00:00
|
|
|
echo "$0: no extra rpms to install"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
SIP=`grep -h dhcp-server-identifier /var/lib/dhclient/dhclient-*.leases|tail -n 1|awk '{print $3}'|sed -e 's/;//'`
|
|
|
|
if [ -z "$SIP" ]; then
|
|
|
|
SIP=`grep -h DHCPSID /var/lib/dhcpcd/*.info|awk -F= '{print $2}'|tail -n 1`
|
|
|
|
fi
|
2008-09-09 21:08:48 +00:00
|
|
|
mkdir -p /xcatpost/post/otherpkgs;
|
2008-09-08 18:54:30 +00:00
|
|
|
mkdir -p /tmp/postage/
|
2008-09-09 21:08:48 +00:00
|
|
|
rm -f -R /xcatpost/post/otherpkgs/*
|
2008-09-08 18:54:30 +00:00
|
|
|
rm -f -R /tmp/postage/*
|
|
|
|
cd /tmp/postage
|
|
|
|
|
2008-09-09 21:08:48 +00:00
|
|
|
for x in `echo "$OTHERPKGS" | tr "," "\n"`
|
2008-09-08 18:54:30 +00:00
|
|
|
do
|
2008-09-09 21:08:48 +00:00
|
|
|
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 0 -T 60 ftp://$SIP/post/otherpkgs/$OSVER/$ARCH/$x-* 2> /tmp/wget.log
|
2008-09-08 18:54:30 +00:00
|
|
|
done
|
|
|
|
|
2008-09-09 21:08:48 +00:00
|
|
|
mv $SIP/post/otherpkgs/* /xcatpost/post/otherpkgs;
|
2008-09-08 18:54:30 +00:00
|
|
|
rm -rf $SIP
|
|
|
|
|
2008-09-09 21:08:48 +00:00
|
|
|
cd /xcatpost/post/otherpkgs/$OSVER/$ARCH
|
2008-09-08 18:54:30 +00:00
|
|
|
rpm -Uvh *
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|