From a35f34830c3b240717b5a0d8438a0287aa5d018c Mon Sep 17 00:00:00 2001 From: yangsbj Date: Tue, 19 Mar 2019 05:09:24 -0400 Subject: [PATCH 01/12] fix issue otherpkgdir won't work with localdir and http repo #6118 --- xCAT/postscripts/otherpkgs | 80 ++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 46 deletions(-) diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index abb4b3219..4138e52d8 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -619,6 +619,35 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do repo_base="/etc/apt/sources.list.d" fi + + urlrepoindex=0 + #add repo for url repos in otherpkgdir + if [ -n "OTHERPKGDIR_INTERNET" ];then + OIFS=$IFS + IFS=',' + OTHERPKGDIRLIST_INTERNET=($OTHERPKGDIR_INTERNET) + + + for url in ${OTHERPKGDIRLIST_INTERNET[@]} + do + if [ $hasyum -eq 1 ] || [ $haszypper -eq 1 ] ; then + REPOFILE="$repo_base/xCAT-otherpkgs$urlrepoindex.repo" + echo "[xcat-otherpkgs$urlrepoindex]" > $REPOFILE + echo "name=xcat-otherpkgs$urlrepoindex" >> $REPOFILE + echo "baseurl=$url" >> $REPOFILE + echo "enabled=1" >> $REPOFILE + echo "gpgcheck=0" >> $REPOFILE + + elif [ $hasapt -eq 1 ] ; then + REPOFILE="$repo_base/xCAT-otherpkgs${urlrepoindex}.list" + echo "deb "$url >> $REPOFILE + fi + urlrepoindex=$[urlrepoindex+1] + done + + IFS=$OIFS + fi + array_empty repo_path repo_pkgs="" repo_pkgs_preremove="" @@ -700,10 +729,11 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do #try to add the path to the repo if [ $try_repo -eq 1 ]; then index=$(array_get_size repo_path) + localrepoindex=$[urlrepoindex+index] if [ $hasyum -eq 1 ] || [ $haszypper -eq 1 ] ; then - REPOFILE="$repo_base/xCAT-otherpkgs$index.repo" - echo "[xcat-otherpkgs$index]" > $REPOFILE - echo "name=xcat-otherpkgs$index" >> $REPOFILE + REPOFILE="$repo_base/xCAT-otherpkgs$localrepoindex.repo" + echo "[xcat-otherpkgs$localrepoindex]" > $REPOFILE + echo "name=xcat-otherpkgs$localrepoindex" >> $REPOFILE if [ $mounted -eq 0 ]; then echo "baseurl=http://$whole_path" >> $REPOFILE else @@ -722,7 +752,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do fi fi elif [ $hasapt -eq 1 ] ; then - REPOFILE="$repo_base/xCAT-otherpkgs$index.list" + REPOFILE="$repo_base/xCAT-otherpkgs$localrepoindex.list" if [ -n "$OTHERPKGDIR" ];then if [ $mounted -eq 0 ]; then type=http @@ -731,16 +761,6 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do fi echo "deb $type://$whole_path ./" > $REPOFILE fi - if [ -n "$OTHERPKGDIR_INTERNET" ] && [ $index -eq 0 ] ;then - OLDIFS=$IFS - IFS=$',' - urlarray=($OTHERPKGDIR_INTERNET) - for url in ${urlarray[@]} - do - echo "deb "$url >> $REPOFILE - done - IFS=$OLDIFS - fi fi fi if [ $hasyum -eq 1 ]; then @@ -798,38 +818,6 @@ EOF` fi done - #add repo for url repos in otherpkgdir - if [ -n "OTHERPKGDIR_INTERNET" ];then - OIFS=$IFS - IFS=',' - OTHERPKGDIRLIST_INTERNET=($OTHERPKGDIR_INTERNET) - - index=$(array_get_size repo_path) - for url in ${OTHERPKGDIRLIST_INTERNET[@]} - do - if [ $hasyum -eq 1 ] || [ $haszypper -eq 1 ] ; then - REPOFILE="$repo_base/xCAT-otherpkgs$index.repo" - echo "[xcat-otherpkgs$index]" > $REPOFILE - echo "name=xcat-otherpkgs$index" >> $REPOFILE - echo "baseurl=$url" >> $REPOFILE - echo "enabled=1" >> $REPOFILE - echo "gpgcheck=0" >> $REPOFILE - index=$[index+1] - fi - done - - IFS=$OIFS - if [ $hasyum -eq 1 ]; then - yum clean all - fi - if [ $haszypper -eq 1 ]; then - result=`zypper --non-interactive refresh 2>&1` - if [ $VERBOSE ]; then - echo "otherpkgs: zypper --non-interactive refresh" - echo " $result" - fi - fi - fi if [ "$repoonly" -eq 1 ]; then echo "otherpkgs: "repoonly set, so ignore pkg installation ..."" From d32833e9f1c8781fc1b3b833fbb20e79e88d6f1a Mon Sep 17 00:00:00 2001 From: yangsbj Date: Wed, 20 Mar 2019 03:30:16 -0400 Subject: [PATCH 02/12] add skip_if_unavailable option into repo conf to avoid yum operation abort due to broken repo --- xCAT/postscripts/otherpkgs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index 4138e52d8..1161d1836 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -637,6 +637,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do echo "baseurl=$url" >> $REPOFILE echo "enabled=1" >> $REPOFILE echo "gpgcheck=0" >> $REPOFILE + echo "skip_if_unavailable=True" >> $REPOFILE elif [ $hasapt -eq 1 ] ; then REPOFILE="$repo_base/xCAT-otherpkgs${urlrepoindex}.list" @@ -741,6 +742,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do fi echo "enabled=1" >> $REPOFILE echo "gpgcheck=0" >> $REPOFILE + echo "skip_if_unavailable=True" >> $REPOFILE if [ $hasyum -eq 1 ]; then yum clean all fi From 4435960f4a26a87ded6c52732219ddb00d0d6e4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=E1=B4=8F=C9=B4=C9=A2=20Jie?= Date: Wed, 20 Mar 2019 18:06:15 +0800 Subject: [PATCH 03/12] Fix python error, TypeError: cannot use a string pattern on a bytes-like object (#6137) --- xCAT-server/share/xcat/install/scripts/pre.rhels8 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/pre.rhels8 b/xCAT-server/share/xcat/install/scripts/pre.rhels8 index b95582e51..4563e2632 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/pre.rhels8 @@ -77,7 +77,7 @@ try: received = newSocket.recv(200) if not received: break - command = re.split('\s+',received) + command = re.split(b'\s+',received) if(command[0] == b"stat"): ilog = "" line = "" @@ -113,10 +113,10 @@ try: newSocket.send(line.encode()) break #UNCOMMENTOENABLEDEBUGPORT# if(command[0] == b"sh"): #DEBUG purposes only, wide open root priv command here. -#UNCOMMENTOENABLEDEBUGPORT# newcommand = "" +#UNCOMMENTOENABLEDEBUGPORT# newcommand = b"" #UNCOMMENTOENABLEDEBUGPORT# for i in command[1:]: -#UNCOMMENTOENABLEDEBUGPORT# newcommand = newcommand + i + " " -#UNCOMMENTOENABLEDEBUGPORT# output = os.popen(newcommand).read() +#UNCOMMENTOENABLEDEBUGPORT# newcommand = newcommand + i + b" " +#UNCOMMENTOENABLEDEBUGPORT# output = os.popen(newcommand.decode('utf-8')).read() #UNCOMMENTOENABLEDEBUGPORT# newSocket.send(output.encode()) #UNCOMMENTOENABLEDEBUGPORT# break if(command[0] == b"screendump"): From 5452d36b502bebd8c55b6de64c1aad72e17e30df Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 21 Mar 2019 01:28:59 -0400 Subject: [PATCH 04/12] delete space before nmcli connection name --- xCAT/postscripts/configeth | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index a71b7b293..fb34d2b1e 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -133,7 +133,7 @@ function configipv4(){ fi str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}" if [ $networkmanager_active -eq 1 ]; then - con_name=$(nmcli dev show ${str_if_name}|grep CONNECTION|awk -F: '{print $2}'|sed 's/^[ \t]*$//g') + con_name=$(nmcli -g CONNECTIONS dev show ${str_if_name}|awk -F"|" '{print $NF}'|sed 's/^[ \t]*//g') if [ "$con_name" == "--" ] ; then nmcli con add type ethernet con-name ${str_if_name} ifname ${str_if_name} ipv4.method manual ipv4.addresses ${str_v4ip}/${str_prefix} else @@ -624,7 +624,7 @@ elif [ "$1" = "-s" ];then str_inst_prefix=$(v4mask2prefix ${str_inst_mask}) str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_inst_nic}" if [ $networkmanager_active -eq 1 ]; then - con_name=$(nmcli dev show ${str_if_name}|grep CONNECTION|awk -F: '{print $2}'|sed 's/^[ \t]*$//g') + con_name=$(nmcli -g CONNECTIONS dev show ${str_if_name}|awk -F"|" '{print $NF}'|sed 's/^[ \t]*//g') if [ "$con_name" == "--" ] ; then nmcli con add type ethernet con-name ${str_inst_nic} ifname ${str_inst_nic} ipv4.method manual ipv4.addresses ${str_inst_ip}/${str_inst_prefix} else From d4715d27452e29bb3f4de240aa43409f7c3dbdce Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 21 Mar 2019 16:02:03 +0800 Subject: [PATCH 05/12] Fix #UNCOMMENTOENABLEDEBUGPORT# replacement --- xCAT-server/lib/perl/xCAT/Template.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 801581446..0da104fa0 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -394,7 +394,7 @@ sub subvars { $inc =~ s/#COLONHTTPPORT#/$httpportsuffix/eg; if (($::XCATSITEVALS{xcatdebugmode} eq "1") or ($::XCATSITEVALS{xcatdebugmode} eq "2")) { - $inc =~ s/#UNCOMMENTOENABLEDEBUGPORT#/ /g; + $inc =~ s/#UNCOMMENTOENABLEDEBUGPORT#//g; } if ($::XCATSITEVALS{xcatdebugmode} eq "2") { From 58441c848961ecd745325254d9e280e87c599ad6 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 21 Mar 2019 16:03:12 +0800 Subject: [PATCH 06/12] Make variable output byte instead of string --- xCAT-server/share/xcat/install/scripts/pre.rhels8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/pre.rhels8 b/xCAT-server/share/xcat/install/scripts/pre.rhels8 index 4563e2632..66abd34db 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/pre.rhels8 @@ -116,8 +116,8 @@ try: #UNCOMMENTOENABLEDEBUGPORT# newcommand = b"" #UNCOMMENTOENABLEDEBUGPORT# for i in command[1:]: #UNCOMMENTOENABLEDEBUGPORT# newcommand = newcommand + i + b" " -#UNCOMMENTOENABLEDEBUGPORT# output = os.popen(newcommand.decode('utf-8')).read() -#UNCOMMENTOENABLEDEBUGPORT# newSocket.send(output.encode()) +#UNCOMMENTOENABLEDEBUGPORT# output = os.popen(newcommand.decode('utf-8')).read().encode() +#UNCOMMENTOENABLEDEBUGPORT# newSocket.send(output) #UNCOMMENTOENABLEDEBUGPORT# break if(command[0] == b"screendump"): newcommand = "cat /dev/vcs" From 92170ed11336738cbf16f946666cc7388a333097 Mon Sep 17 00:00:00 2001 From: Weihua Hu Date: Thu, 21 Mar 2019 16:26:24 +0800 Subject: [PATCH 07/12] add linux_diskless_kdump to weekly bundles (#6148) --- xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle | 1 + xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle | 1 + xCAT-test/autotest/bundle/rhels_x86_weekly.bundle | 1 + xCAT-test/autotest/bundle/sles_ppc_weekly.bundle | 1 + xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle | 1 + xCAT-test/autotest/bundle/sles_x86_weekly.bundle | 1 + xCAT-test/autotest/bundle/ubuntu_ppcle_weekly.bundle | 1 + xCAT-test/autotest/bundle/ubuntu_x86_weekly.bundle | 1 + 8 files changed, 8 insertions(+) diff --git a/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle index f523dfe2f..f3face903 100644 --- a/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle @@ -69,3 +69,4 @@ rpower_reset runcmdinstaller_command redhat_migration1 redhat_migration2 +linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle index 52df8ce98..f4f1f4460 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle @@ -72,3 +72,4 @@ rpower_reset runcmdinstaller_command redhat_migration1 redhat_migration2 +linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle index a06f89c06..670d00f7b 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle @@ -72,3 +72,4 @@ rpower_reset runcmdinstaller_command redhat_migration1 redhat_migration2 +linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/sles_ppc_weekly.bundle b/xCAT-test/autotest/bundle/sles_ppc_weekly.bundle index 898f66a67..1bc819e65 100644 --- a/xCAT-test/autotest/bundle/sles_ppc_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_ppc_weekly.bundle @@ -12,3 +12,4 @@ reg_linux_diskless_installation_flat reg_linux_statelite_installation_flat sles_migration1 sles_migration2 +linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle index 08534fe14..0c9bbdee1 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle @@ -19,3 +19,4 @@ reg_linux_diskless_installation_flat reg_linux_statelite_installation_flat sles_migration1 sles_migration2 +linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle index f6928afe4..7cfc1e238 100644 --- a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle @@ -19,3 +19,4 @@ reg_linux_diskless_installation_flat reg_linux_statelite_installation_flat sles_migration1 sles_migration2 +linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_weekly.bundle index f45b09f29..38085b775 100644 --- a/xCAT-test/autotest/bundle/ubuntu_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_weekly.bundle @@ -14,3 +14,4 @@ packimage_m_tar_c_xz packimage_o_p_a_m rmimage_diskless ubuntu_migration2_p8le +linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/ubuntu_x86_weekly.bundle b/xCAT-test/autotest/bundle/ubuntu_x86_weekly.bundle index c25018857..65a2d68aa 100644 --- a/xCAT-test/autotest/bundle/ubuntu_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_x86_weekly.bundle @@ -14,3 +14,4 @@ packimage_m_tar_c_xz packimage_o_p_a_m rmimage_diskless ubuntu_migration2_vm +linux_diskless_kdump From 00bf5d432c75133e0e6d03578289a6e44477aefd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=E1=B4=8F=C9=B4=C9=A2=20Jie?= Date: Thu, 21 Mar 2019 16:27:13 +0800 Subject: [PATCH 08/12] Partly revert "Revise openssl settings for RHEL 8 (#5967)" (#6144) * Put "openssl s_client" command line argument "-no_ssl2" back. This reverts commit ec56baf36f251b4eed1527dcc0b06ac1e125e006. --- xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk | 5 +++++ xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite | 2 +- .../xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat | 2 +- xCAT/postscripts/getcredentials.awk | 3 +++ xCAT/postscripts/getpostscript.awk | 3 +++ xCAT/postscripts/startsyncfiles | 2 +- xCAT/postscripts/startsyncfiles.awk | 5 ++++- 7 files changed, 18 insertions(+), 4 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk index 204310660..7676e73ce 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk @@ -69,11 +69,16 @@ xCATCmd () { ARCH=`uname -m` if [ x$ARCH = x"ppc64" -a x$OS = x"rh" ]; then /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 \ + $(/usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -help 2>&1 | + grep -m 1 -o -- -no_ssl2) \ -connect ${1} -rand /bin/bash 2>/dev/null \ <<<"${2}" else LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 \ ${MNTDIR}/usr/bin/openssl s_client -quiet -no_ssl3 \ + $(LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 \ + ${MNTDIR}/usr/bin/openssl s_client -help 2>&1 | + grep -m 1 -o -- -no_ssl2) \ -connect ${1} -rand /bin/bash 2>/dev/null \ <<<"${2}" fi diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite index cef1ac789..fa6549464 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite @@ -128,7 +128,7 @@ GetSyncInfo () { xCATCmd () { # $1 is the xCAT server # $2 is the command - LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 ${MNTDIR}/usr/bin/openssl s_client -quiet -no_ssl3 -connect ${1} -rand /bin/bash 2>/dev/null <<<"${2}" + LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 ${MNTDIR}/usr/bin/openssl s_client -quiet -no_ssl3 $(LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 ${MNTDIR}/usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} -rand /bin/bash 2>/dev/null <<<"${2}" } diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat index 6f37f6465..8aa5dac22 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat @@ -128,7 +128,7 @@ GetSyncInfo () { xCATCmd () { # $1 is the xCAT server # $2 is the command - echo "\n${2}\n" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 -connect ${1} -rand /bin/nice 2>/dev/null + echo "\n${2}\n" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 $(/usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} -rand /bin/nice 2>/dev/null } diff --git a/xCAT/postscripts/getcredentials.awk b/xCAT/postscripts/getcredentials.awk index 5873b253b..67300becf 100755 --- a/xCAT/postscripts/getcredentials.awk +++ b/xCAT/postscripts/getcredentials.awk @@ -2,6 +2,9 @@ BEGIN { if ((ENVIRON["USEOPENSSLFORXCAT"]) || (ENVIRON["AIX"])) { server = "openssl s_client -quiet -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { + server = "openssl s_client -quiet -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + } } else { server = "/inet/tcp/0/127.0.0.1/400" } diff --git a/xCAT/postscripts/getpostscript.awk b/xCAT/postscripts/getpostscript.awk index d0d49dd88..985b34dcb 100755 --- a/xCAT/postscripts/getpostscript.awk +++ b/xCAT/postscripts/getpostscript.awk @@ -2,6 +2,9 @@ BEGIN { if (ENVIRON["USEOPENSSLFORXCAT"]) { server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { + server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + } } else { server = "/inet/tcp/0/127.0.0.1/400" } diff --git a/xCAT/postscripts/startsyncfiles b/xCAT/postscripts/startsyncfiles index 9f9b79d15..9a15261a1 100755 --- a/xCAT/postscripts/startsyncfiles +++ b/xCAT/postscripts/startsyncfiles @@ -42,7 +42,7 @@ while read LINE;do RET=${RET%<*} [ "$RET" != "0" ] && RETCODE=1 fi -done < <(openssl s_client -no_ssl3 -connect $MASTER_IP:$XCATDPORT -ign_eof -quiet <<<$REQUEST) +done < <(openssl s_client -no_ssl3 $(openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect $MASTER_IP:$XCATDPORT -ign_eof -quiet <<<$REQUEST) rm -rf $RESPFILE exit $RETCODE diff --git a/xCAT/postscripts/startsyncfiles.awk b/xCAT/postscripts/startsyncfiles.awk index 4855cee0f..c9af5345b 100755 --- a/xCAT/postscripts/startsyncfiles.awk +++ b/xCAT/postscripts/startsyncfiles.awk @@ -1,7 +1,10 @@ #!/usr/bin/awk -f BEGIN { if (ENVIRON["USEOPENSSLFORXCAT"]) { - server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " 2> /dev/null" + server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { + server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + } } else { server = "/inet/tcp/0/127.0.0.1/400" } From 0ff9bc0be53210d9b27665045d98c27618d698fd Mon Sep 17 00:00:00 2001 From: bxuxa Date: Thu, 21 Mar 2019 16:46:20 +0800 Subject: [PATCH 09/12] Ignore the disable when not installed, not using package checking as we use a fake package there --- xCAT-server/lib/perl/xCAT/Goconserver.pm | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/Goconserver.pm b/xCAT-server/lib/perl/xCAT/Goconserver.pm index ce095116f..a6eea15d5 100644 --- a/xCAT-server/lib/perl/xCAT/Goconserver.pm +++ b/xCAT-server/lib/perl/xCAT/Goconserver.pm @@ -503,11 +503,13 @@ sub is_goconserver_running { sub switch_goconserver { my $callback = shift; # ignore SN as it is handled by AAsn - if ((-x "/usr/bin/systemctl" || -x "-x /bin/systemctl") && !$isSN) { + if ((-x "/usr/bin/systemctl" || -x "/bin/systemctl") && !$isSN) { my $cmd = "systemctl disable conserver"; - xCAT::Utils->runcmd($cmd, -1); - if ($::RUNCMD_RC != 0) { - xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback); + if (-x "/usr/sbin/conserver") { + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback); + } } $cmd = "systemctl enable goconserver"; xCAT::Utils->runcmd($cmd, -1); @@ -537,9 +539,11 @@ sub switch_conserver { # ignore SN as it is handled by AAsn if ((-x "/usr/bin/systemctl" || -x "-x /bin/systemctl") && !$isSN) { my $cmd = "systemctl disable goconserver"; - xCAT::Utils->runcmd($cmd, -1); - if ($::RUNCMD_RC != 0) { - xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback); + if (-x "/usr/bin/goconserver") { + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback); + } } $cmd = "systemctl enable conserver"; xCAT::Utils->runcmd($cmd, -1); From e35b3ce6840499a9db8a686b36f7371e99a30325 Mon Sep 17 00:00:00 2001 From: xuweibj Date: Thu, 21 Mar 2019 03:56:55 -0400 Subject: [PATCH 10/12] spec file not be used for xCAT-openbmc-py3 build --- xCAT-openbmc-py/xCAT-openbmc-py3.build | 68 ++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 xCAT-openbmc-py/xCAT-openbmc-py3.build diff --git a/xCAT-openbmc-py/xCAT-openbmc-py3.build b/xCAT-openbmc-py/xCAT-openbmc-py3.build new file mode 100644 index 000000000..1235030e3 --- /dev/null +++ b/xCAT-openbmc-py/xCAT-openbmc-py3.build @@ -0,0 +1,68 @@ +%undefine __brp_mangle_shebangs +Summary: xCAT openbmc python3 +Name: xCAT-openbmc-py3 +#Version: %{?version:%{version}}%{!?version:%(cat Version)} +Version: 2.14.6 +Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Epoch: 1 +License: EPL +Group: Applications/System +Source: xCAT-openbmc-py-%{version}.tar.gz +Packager: IBM Corp. +Vendor: IBM Corp. +Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} +Prefix: /opt/xcat +BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root + +%ifnos linux +AutoReqProv: no +%endif + +BuildArch: noarch +Requires: xCAT-server +Requires: python3-gevent >= 1.2.2-2 +Requires: python3-greenlet >= 0.4.13-2 +Requires: python3-paramiko >= 2.0.0 +Requires: python3-docopt python3-requests python3-scp + +%description +xCAT-openbmc-py3 provides openbmc related functions python3 based. + +%prep +%setup -q -n xCAT-openbmc-py +%build + +%install +rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/common +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/openbmc +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/redfish +install -m755 lib/python/agent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent +install -m644 lib/python/agent/xcatagent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent +install -m644 lib/python/agent/common/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/common +install -m644 lib/python/agent/hwctl/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl +install -m644 lib/python/agent/hwctl/openbmc/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/openbmc/ +install -m644 lib/python/agent/hwctl/redfish/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/redfish/ + +%ifnos linux +rm -rf $RPM_BUILD_ROOT/%{prefix}/lib/python/agent +%endif + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%{prefix} + +%changelog + +%pre + +%post + +%preun + From 26fb874a84449dadad2bad67acc2d489c8601d8e Mon Sep 17 00:00:00 2001 From: bxuxa Date: Thu, 21 Mar 2019 17:09:29 +0800 Subject: [PATCH 11/12] Fix a code error --- xCAT-server/lib/perl/xCAT/Goconserver.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/perl/xCAT/Goconserver.pm b/xCAT-server/lib/perl/xCAT/Goconserver.pm index a6eea15d5..0873872b7 100644 --- a/xCAT-server/lib/perl/xCAT/Goconserver.pm +++ b/xCAT-server/lib/perl/xCAT/Goconserver.pm @@ -537,7 +537,7 @@ sub switch_goconserver { sub switch_conserver { my $callback = shift; # ignore SN as it is handled by AAsn - if ((-x "/usr/bin/systemctl" || -x "-x /bin/systemctl") && !$isSN) { + if ((-x "/usr/bin/systemctl" || -x "/bin/systemctl") && !$isSN) { my $cmd = "systemctl disable goconserver"; if (-x "/usr/bin/goconserver") { xCAT::Utils->runcmd($cmd, -1); From 978c7964146e94524330c49e81de63dc1b438bac Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 21 Mar 2019 17:59:03 +0800 Subject: [PATCH 12/12] Make postscript enabledkump work on RHEL 8 --- xCAT/postscripts/enablekdump | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xCAT/postscripts/enablekdump b/xCAT/postscripts/enablekdump index 295447b77..3a61bcfc0 100755 --- a/xCAT/postscripts/enablekdump +++ b/xCAT/postscripts/enablekdump @@ -101,7 +101,7 @@ if [ ! -z "$DUMP" ]; then MOUNTPATH="" if (pmatch $OSVER "*6\.*"); then MOUNTPATH="/tmp" - elif (pmatch $OSVER "*7\.*"); then + elif (pmatch $OSVER "*[78]\.*"); then MOUNTPATH="/mnt" else MOUNTPATH="/var/tmp" @@ -215,7 +215,7 @@ EOF mv ${oldremount}.bak $oldremount fi else - if (pmatch $OSVER "rhel7*") || (pmatch $OSVER "rhels7*");then + if (pmatch $OSVER "rhel[78]*") || (pmatch $OSVER "rhels[78]*");then nfsvers=$(/usr/sbin/rpcinfo -p $KDIP|grep -w nfs|awk /tcp/'{print $2}'|sort) nfsver=0 if [ -n "$nfsvers" ]; then @@ -246,8 +246,10 @@ EOF echo "nfs $KDIP:$KDPATH" > /etc/kdump.conf echo "default shell" >> /etc/kdump.conf - #strip "xcat" out of the initramfs for kdump - echo "dracut_args --omit \"xcat\"" >> /etc/kdump.conf + if (pmatch $OSVER "rhel7*") || (pmatch $OSVER "rhels7*");then + #strip "xcat" out of the initramfs for kdump + echo "dracut_args --omit \"xcat\"" >> /etc/kdump.conf + fi #strip the unnecessary kernel options from /proc/cmdline #the modified "cmdline" will be used as the kernel options #for kdump initramfs; otherwise, the "service kdump restart" will fail