From 5d90a4212c6c6198522cd48db53d4c3e4bfc845e Mon Sep 17 00:00:00 2001 From: yangsbj Date: Sun, 4 Nov 2018 21:54:30 -0500 Subject: [PATCH] change HTTPPORT in /proc/cmdline to XCATHTTPPORT to avoid potential confilic --- xCAT-server/lib/xcat/plugins/anaconda.pm | 2 +- xCAT-server/lib/xcat/plugins/debian.pm | 2 +- xCAT-server/lib/xcat/plugins/sles.pm | 2 +- xCAT/postscripts/xcatdsklspost | 15 +++++++++++++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 84e6f7167..4fea40716 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -653,7 +653,7 @@ sub mknetboot $kcmdline .= "XCAT=$xcatmasterip:$xcatdport "; - $kcmdline .= "HTTPPORT=$httpport "; + $kcmdline .= "XCATHTTPPORT=$httpport "; if ($rootfstype ne "ramdisk") { diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index 17838589e..70c2e6ddb 100644 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -1336,7 +1336,7 @@ sub mknetboot } - $kcmdline .=" HTTPPORT=$httpport "; + $kcmdline .=" XCATHTTPPORT=$httpport "; # add support for subVars in the value of "statemnt" my $statemnt = ""; diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index d867e344f..79487429e 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -515,7 +515,7 @@ sub mknetboot "imgurl=$httpmethod://$imgsrv:$httpport/$rootimgdir/$compressedrootimg "; } $kcmdline .= "XCAT=$xcatmaster:$xcatdport quiet "; - $kcmdline .= " HTTPPORT=$httpport "; + $kcmdline .= " XCATHTTPPORT=$httpport "; #if site.nodestatus="n", append "nonodestatus" to kcmdline #to inform the statelite/stateless node not to update the nodestatus during provision diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index cfdbf3d68..1cfd3a89c 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -376,13 +376,24 @@ if [ "$MODE" = "4" ]; then # for statelite mode echo "XCATSERVER=$XCATSERVER" >> /opt/xcat/xcatinfo fi break + elif [ "$KEY" = "XCATHTTPPORT" ]; then + HTTPPORT=`echo $i | awk -F= '{print $2}'` + grep 'HTTPPORT' /opt/xcat/xcatinfo > /dev/null 2>&1 + if [ $? -eq 0 ]; then + sed -i "s/HTTPPORT=.*/HTTPPORT=$HTTPPORT/" /opt/xcat/xcatinfo + else + echo "HTTPPORT=$HTTPPORT" >> /opt/xcat/xcatinfo + fi + break + fi done if [ -f /opt/xcat/xcatinfo ]; then SIP=`grep 'XCATSERVER' /opt/xcat/xcatinfo |cut -d= -f2` + HTTPPORT=`grep 'HTTPPORT' /opt/xcat/xcatinfo |cut -d= -f2` if [ -n "$SIP" ]; then - download_postscripts $SIP + download_postscripts $SIP:${HTTPPORT} if [ $? -eq 0 ]; then downloaded=1 fi @@ -469,7 +480,7 @@ else # for common mode MODE=1,2,3,5 (updatenode,moncfg,node deployment) TMP=`echo $i | awk -F= '{print $2}'` SIP=`echo $TMP | cut -d: -f1` - elif [ "$KEY" = "HTTPPORT" ];then + elif [ "$KEY" = "XCATHTTPPORT" ];then HTTPPORT=$(echo $i | awk -F= '{print $1}') [ -z "$HTTPPORT" ] && HTTPPORT="80" fi