ftp dependency removal initial code drop

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10987 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2011-11-10 14:26:08 +00:00
parent 720d253866
commit 112f5aeebd
7 changed files with 34 additions and 23 deletions

View File

@ -2462,10 +2462,10 @@ sub updateOS {
# Get install directory
my $installDIR = xCAT::Utils->getInstallDir();
# Get FTP server
my $ftp = xCAT::Utils->my_ip_facing($node);
if ( !$ftp ) {
push @{$rsp->{data}}, "$node: (Error) Missing FTP server";
# Get HTTP server
my $http = xCAT::Utils->my_ip_facing($node);
if ( !$htp ) {
push @{$rsp->{data}}, "$node: (Error) Missing HTTP server";
xCAT::MsgUtils->message("I", $rsp, $callback);
return;
}
@ -2516,8 +2516,8 @@ sub updateOS {
my $path;
my $out;
if ( "$installOS$version" =~ m/sles10/i ) {
# SUSE repository path - ftp://10.1.100.1/sles10.3/s390x/1/
$path = "ftp://$ftp/$os/$arch/1/";
# SUSE repository path - http://10.1.100.1/install/sles10.3/s390x/1/
$path = "http://$http$installDIR/$os/$arch/1/";
if (!(-e "$installDIR/$os/$arch/1/")) {
push @{$rsp->{data}}, "$node: (Error) Missing install directory $installDIR/$os/$arch/1/";
xCAT::MsgUtils->message("I", $rsp, $callback);
@ -2546,8 +2546,8 @@ sub updateOS {
}
elsif ( "$installOS$version" =~ m/sles11/i ) {
# SUSE repository path - ftp://10.1.100.1/sles10.3/s390x/1/
$path = "ftp://$ftp/$os/$arch/1/";
# SUSE repository path - http://10.1.100.1/install/sles10.3/s390x/1/
$path = "http://$http$installDIR/$os/$arch/1/";
if (!(-e "$installDIR/$os/$arch/1/")) {
push @{$rsp->{data}}, "$node: (Error) Missing install directory $installDIR/$os/$arch/1/";
xCAT::MsgUtils->message("I", $rsp, $callback);
@ -2571,8 +2571,8 @@ sub updateOS {
}
elsif ( "$installOS$version" =~ m/rh/i ) {
# Red Hat repository path - ftp://10.0.0.1/rhel5.4/s390x/Server/
$path = "ftp://$ftp/$os/$arch/Server/";
# Red Hat repository path - http://10.0.0.1/install/rhel5.4/s390x/Server/
$path = "http://$http$installDIR/$os/$arch/Server/";
if (!(-e "$installDIR/$os/$arch/Server/")) {
push @{$rsp->{data}}, "$node: (Error) Missing install directory $installDIR/$os/$arch/Server/";
xCAT::MsgUtils->message("I", $rsp, $callback);

View File

@ -39,6 +39,10 @@ hostname $HOSTNAME
export MASTER_IP="#XCATVAR:XCATMASTER#"
export MASTER_IPS="#XCATVAR:XCATMASTER#"
export MASTER="#XCATVAR:XCATMASTER#"
export INSTALLDIR=#TABLE:site:key=installdir:value#
if [ -z "$INSTALLDIR" ]; then
INSTALLDIR="/install"
fi
cd /tmp
RAND=$(perl -e 'print int(rand(50)). "\n"')
sleep $RAND
@ -47,8 +51,8 @@ do
GOTIT=0
for i in $MASTER_IPS
do
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 0 -T 60 ftp://$i/postscripts
#wget --wait=10 --random-wait --waitretry=10 --retry-connrefused -t 0 -T 60 http://$i/install/autoinst/xcatpost.tar.gz
#wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 0 -T 60 ftp://$i/postscripts
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -nH --cut-dirs=2 --reject "index.html*" --no-parent -t 0 -T 60 http://$i$INSTALLDIR/postscripts/ -P /xcatpost
if [ "$?" = "0" ]
then
if [ ! -x /usr/bin/openssl ]; then #Stop if no openssl to help the next bit
@ -97,6 +101,7 @@ do
RAND=$(perl -e 'print int(rand(5)). "\n"')
sleep $RAND
done
echo "INSTALLDIR=$INSTALLDIR" >> /opt/xcat/xcatinfo
cd /xcatpost
#gunzip xcatpost.tar.gz
#tar -xvf xcatpost.tar

View File

@ -82,7 +82,8 @@ do
for i in $MASTER_IPS
do
#mount -r $i:/install/postscripts /xcatpost
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 0 -T 60 ftp://$i/postscripts
#wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 0 -T 60 ftp://$i/postscripts
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -nH --cut-dirs=2 --reject "index.html*" --no-parent -t 0 -T 60 http://$i$INSTALLDIR/postscripts/ -P /xcatpost
if [ "$?" = "0" ]
then
if [ ! -x /usr/bin/openssl ]; then #Stop if no openssl to help the next bit

View File

@ -64,7 +64,8 @@ do
for i in $MASTER_IPS
do
#mount -r $i:/install/postscripts /xcatpost
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 0 -T 60 ftp://$i/postscripts
#wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 0 -T 60 ftp://$i/postscripts
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -nH --cut-dirs=2 --reject "index.html*" --no-parent -t 0 -T 60 http://$i$INSTALLDIR/postscripts/ -P /xcatpost
if [ "$?" = "0" ]
then
if [ -x /usr/bin/openssl ]; then

View File

@ -71,7 +71,7 @@ if [ $? -eq 0 ]; then
fi
if [ -z "$OSPKGDIR" ]; then
OSPKGDIR="$NFSSERVER/$OSVER/$ARCH"
OSPKGDIR="$NFSSERVER$INSTALLDIR/$OSVER/$ARCH"
if ( pmatch "$OSVER" "sles*" ); then
OSPKGDIR="$OSPKGDIR/1"
elif ( pmatch "$OSVER" "rhel*" ); then
@ -162,7 +162,7 @@ if ( pmatch "$OSVER" "sles10*" ); then
#add new repo
if [ $mounted -eq 0 ]; then
path="ftp://$OSPKGDIR"
path="http://$OSPKGDIR"
else
path="dir://$OSPKGDIR"
fi
@ -263,7 +263,7 @@ elif ( pmatch "$OSVER" "sles11*" ); then
fi
if [ $mounted -eq 0 ]; then
path="ftp://$OSPKGDIR"
path="http://$OSPKGDIR"
else
path="file://$OSPKGDIR"
fi
@ -404,7 +404,7 @@ else
echo "[$OSVER]" > $REPOFILE
echo "name=$OSVER" >> $REPOFILE
if [ $mounted -eq 0 ]; then
echo "baseurl=ftp://$OSPKGDIR" >> $REPOFILE
echo "baseurl=http://$OSPKGDIR" >> $REPOFILE
else
echo "baseurl=file://$OSPKGDIR" >> $REPOFILE
fi

View File

@ -229,7 +229,7 @@ if [ $? -eq 0 ]; then
fi
if [ -z "$OTHERPKGDIR" ]; then
OTHERPKGDIR="$NFSSERVER/post/otherpkgs/$OSVER/$ARCH"
OTHERPKGDIR="$NFSSERVER$INSTALLDIR/post/otherpkgs/$OSVER/$ARCH"
fi
if [ $mounted -eq 0 ]; then
@ -392,7 +392,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
echo "[xcat-otherpkgs$index]" > $REPOFILE
echo "name=xcat-otherpkgs$index" >> $REPOFILE
if [ $mounted -eq 0 ]; then
echo "baseurl=ftp://$whole_path" >> $REPOFILE
echo "baseurl=http://$whole_path" >> $REPOFILE
else
echo "baseurl=file://$whole_path" >> $REPOFILE
fi
@ -402,7 +402,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
REPOFILE="$repo_base/xCAT-otherpkgs$index.list"
if [ $mounted -eq 0 ]; then
type=ftp
type=http
else
type=file
fi
@ -579,7 +579,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
for x in `echo "$plain_pkgs" | tr " " "\n"`
do
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 0 -T 60 ftp://$OTHERPKGDIR/$x 2> /tmp/wget.log
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -nH --cut-dirs=2 -t 0 -T 60 --reject "index.html*" --no-parent http://$OTHERPKGDIR/$x 2> /tmp/wget.log
done
mv $dir_no_ftproot/* /xcatpost/$dir_no_ftproot;

View File

@ -31,11 +31,15 @@ download_postscripts()
return 1;
fi
INSTALLDIR=`grep 'INSTALLDIR' /opt/xcat/xcatinfo |cut -d= -f2`
if [ -z "$INSTALLDIR" ]; then
INSTALLDIR="/install"
fi
max_retries=5
retry=0
rc=1
while [ 0 -eq 0 ]; do
wget -l inf -nH -N -r --waitretry=10 --random-wait -T 60 ftp://$server/postscripts -P /xcatpost --cut-dirs=1 2> /tmp/wget.log
wget -l inf -nH -N -r --waitretry=10 --random-wait -T 60 -nH --cut-dirs=2 --reject "index.html*" --no-parent http://$server$INSTALLDIR/postscripts/ -P /xcatpost 2> /tmp/wget.log
rc=$?
if [ $rc -eq 0 ]; then