From ac85d1027df4c3c28b1374b71888e22ef8acaa3c Mon Sep 17 00:00:00 2001 From: litingt Date: Fri, 4 Jan 2019 02:26:37 -0500 Subject: [PATCH 001/276] update case lsvmkvmhost to check the correct output --- xCAT-test/autotest/testcase/lsvm/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/lsvm/cases0 b/xCAT-test/autotest/testcase/lsvm/cases0 index b29b2fc7b..b36520c84 100644 --- a/xCAT-test/autotest/testcase/lsvm/cases0 +++ b/xCAT-test/autotest/testcase/lsvm/cases0 @@ -96,7 +96,7 @@ start:lsvm_kvmhost description:lsvm could give out the kvm host information. This case should be run on a mn which has kvm host defined.In this case, $$CN should be a kvm host. label:others,hctrl_kvm cmd:lsvm $$CN -check:output=~$$CN +check:output=~$$CN:\s*$$CN\w. end start:lsvm_mixed_vm_defined_and_not From e5f517048ba6ff6375bcc94cf2a97e7c85345bf4 Mon Sep 17 00:00:00 2001 From: litingt Date: Tue, 15 Jan 2019 03:34:11 -0500 Subject: [PATCH 002/276] update according to comments --- xCAT-test/autotest/testcase/lsvm/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/lsvm/cases0 b/xCAT-test/autotest/testcase/lsvm/cases0 index b36520c84..f4dbb48a5 100644 --- a/xCAT-test/autotest/testcase/lsvm/cases0 +++ b/xCAT-test/autotest/testcase/lsvm/cases0 @@ -96,7 +96,7 @@ start:lsvm_kvmhost description:lsvm could give out the kvm host information. This case should be run on a mn which has kvm host defined.In this case, $$CN should be a kvm host. label:others,hctrl_kvm cmd:lsvm $$CN -check:output=~$$CN:\s*$$CN\w. +check:output=~$$CN:\s*\b\w+\b(\r\n|\n|\r) end start:lsvm_mixed_vm_defined_and_not From e0e75022520b8aba96bd7a433ebf14fd46e29c1a Mon Sep 17 00:00:00 2001 From: huweihua Date: Wed, 13 Mar 2019 02:38:33 -0400 Subject: [PATCH 003/276] add more debug information for dynamic group test cases --- xCAT-test/autotest/testcase/chdef/cases0 | 9 +++++++++ xCAT-test/autotest/testcase/mkdef/cases0 | 8 ++++++++ xCAT-test/autotest/testcase/rmdef/cases0 | 6 ++++++ 3 files changed, 23 insertions(+) diff --git a/xCAT-test/autotest/testcase/chdef/cases0 b/xCAT-test/autotest/testcase/chdef/cases0 index dc3c0ab03..dc84f1e40 100644 --- a/xCAT-test/autotest/testcase/chdef/cases0 +++ b/xCAT-test/autotest/testcase/chdef/cases0 @@ -153,12 +153,17 @@ end start:chdef_dynamic_group description:chdef with dynamic node group label:mn_only,ci_test,db +cmd:tabdump nodegroup +cmd:tabdump nodelist cmd:mkdef -t node -o testnode1-testnode2 mgt=hmc cons=hmc groups=all,systemp check:rc==0 +cmd:tabdump nodelist|grep testnode cmd:mkdef -t node -o testnode3-testnode4 mgt=hmc cons=ipmi groups=all,systemx check:rc==0 +cmd:tabdump nodelist|grep testnode cmd:mkdef -t group -o dyngrp -d -w cons==hmc check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -s dyngrp check:rc==0 check:output=~testnode1 @@ -167,6 +172,7 @@ check:output!~testnode3 check:output!~testnode4 cmd:chdef -t group -o dyngrp -d -w mgt==hmc check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -s dyngrp check:rc==0 check:output=~testnode1 @@ -175,6 +181,7 @@ check:output=~testnode3 check:output=~testnode4 cmd:chdef -t group -o dyngrp -d -p -w cons==hmc -w groups=~systemp check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -s dyngrp check:rc==0 check:output=~testnode1 @@ -186,6 +193,7 @@ check:rc==0 check:output=~wherevals=mgt==hmc::cons==hmc::groups=~systemp cmd:chdef -t group -o dyngrp -d -m -w cons==hmc -w groups=~systemp check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -s dyngrp check:output=~testnode1 check:output=~testnode2 @@ -193,6 +201,7 @@ check:output=~testnode3 check:output=~testnode4 cmd:rmdef -t group -o dyngrp check:rc==0 +cmd:tabdump nodegroup cmd:rmdef -t node -o testnode1-testnode4 check:rc==0 end diff --git a/xCAT-test/autotest/testcase/mkdef/cases0 b/xCAT-test/autotest/testcase/mkdef/cases0 index b360587d6..a9adc70cf 100644 --- a/xCAT-test/autotest/testcase/mkdef/cases0 +++ b/xCAT-test/autotest/testcase/mkdef/cases0 @@ -95,12 +95,17 @@ end start:mkdef_dynamic_group description:mkdef with dynamic node group label:mn_only,ci_test,db +cmd:tabdump nodegroup +cmd:tabdump nodelist cmd:mkdef -t node -o testnode1-testnode2 mgt=hmc cons=hmc groups=all,systemp check:rc==0 +cmd:tabdump nodelist|grep testnode cmd:mkdef -t node -o testnode3-testnode4 mgt=ipmi cons=ipmi groups=all,systemx check:rc==0 +cmd:tabdump nodelist|grep testnode cmd:mkdef -t group -o dyngrp1 -d -w mgt==hmc check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -s dyngrp1 check:rc==0 check:output=~testnode1 @@ -109,6 +114,7 @@ check:output!~testnode3 check:output!~testnode4 cmd:mkdef -t group -o dyngrp2 -d -w mgt==hmc -w cons==hmc check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -s dyngrp2 check:rc==0 check:output=~testnode1 @@ -117,6 +123,7 @@ check:output!~testnode3 check:output!~testnode4 cmd:mkdef -t group -o dyngrp3 -d -w mgt==hmc -w cons==ipmi check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -s dyngrp3 check:rc!=0 check:output!~testnode1 @@ -125,6 +132,7 @@ check:output!~testnode3 check:output!~testnode4 cmd:rmdef -t group -o dyngrp1,dyngrp2,dyngrp3 check:rc==0 +cmd:tabdump nodegroup cmd:rmdef -t node -o testnode1-testnode4 check:rc==0 end diff --git a/xCAT-test/autotest/testcase/rmdef/cases0 b/xCAT-test/autotest/testcase/rmdef/cases0 index e5bea9ce4..c4e746e4d 100644 --- a/xCAT-test/autotest/testcase/rmdef/cases0 +++ b/xCAT-test/autotest/testcase/rmdef/cases0 @@ -90,21 +90,27 @@ description:rmdef to remove dynamic node group label:mn_only,ci_test,db cmd:lsdef testnode1;if [ $? -eq 0 ]; then lsdef -l testnode1 -z >/tmp/testnode1.standa ; rmdef testnode1;fi cmd:lsdef testnode2;if [ $? -eq 0 ]; then lsdef -l testnode2 -z >/tmp/testnode2.standa ; rmdef testnode2;fi +cmd:tabdump nodegroup +cmd:tabdump nodelist cmd:mkdef -t node -o testnode1-testnode2 mgt=hmc cons=hmc groups=all,systemp check:rc==0 +cmd:tabdump nodelist|grep testnode cmd:mkdef -t group -o dyngrp -d -w mgt==hmc -w cons==hmc -w groups==all,systemp check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -s dyngrp check:rc==0 check:output=~testnode1 check:output=~testnode2 cmd:rmdef -t node -o dyngrp check:rc=0 +cmd:tabdump nodegroup cmd:lsdef -t node testnode1,testnode2 check:output=~Could not find an object named 'testnode1' of type 'node'. check:output=~Could not find an object named 'testnode2' of type 'node'. cmd:rmdef -t group -o dyngrp check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -t group -o dyngrp check:output=~Could not find an object named 'dyngrp' of type 'group'. cmd:if [ -e /tmp/testnode1.standa ]; then cat /tmp/testnode1.standa | mkdef -z; rm -rf /tmp/testnode1.standa; fi From 530b6c94d118f4f5361a619417d0e5d4dd88056d Mon Sep 17 00:00:00 2001 From: Weihua Hu Date: Fri, 29 Mar 2019 15:57:55 +0800 Subject: [PATCH 004/276] update version from 2.14.6 to 2.15 --- Version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Version b/Version index d7b0d017e..e3d069645 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.14.6 +2.15 From 690fd069f57a86df4bb86130972eaefabeef2417 Mon Sep 17 00:00:00 2001 From: litingt Date: Mon, 1 Apr 2019 02:04:25 -0400 Subject: [PATCH 005/276] update case rspconfig_dump_download and rspconfig_dump_no_option --- xCAT-test/autotest/testcase/rspconfig/cases1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xCAT-test/autotest/testcase/rspconfig/cases1 b/xCAT-test/autotest/testcase/rspconfig/cases1 index deff88bb1..9224d8873 100644 --- a/xCAT-test/autotest/testcase/rspconfig/cases1 +++ b/xCAT-test/autotest/testcase/rspconfig/cases1 @@ -111,9 +111,9 @@ check:output =~$$CN:\s*\[\d+\]\s* success cmd:sleep 300 cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;rspconfig $$CN dump -d $dumpnumber |tee /tmp/dumpdown check:rc == 0 -cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;grep "Downloaded dump $dumpnumber to /var/log/xcat/dump/" /tmp/dumpdown +cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;grep "Downloading dump $dumpnumber to /var/log/xcat/dump/" /tmp/dumpdown check:rc == 0 -cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`rspconfig $$CN dump -l |grep "\[$dumpnumber\] Generated" |cut -d : -f 6`;ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize +cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`rspconfig $$CN dump -l |grep "\[$dumpnumber\] Generated" |cut -d : -f 6`;if lsdef service > /dev/null 2>&1; then xdsh $$SN ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize;else ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize;fi check:rc == 0 cmd:rspconfig $$CN dump -g |tee /tmp/dumpgenerate check:rc == 0 @@ -121,9 +121,9 @@ check:output =~$$CN:\s*\[\d+\]\s* success cmd:sleep 300 cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;rspconfig $$CN dump --download $dumpnumber |tee /tmp/dumpdown check:rc == 0 -cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;grep "Downloaded dump $dumpnumber to /var/log/xcat/dump/" /tmp/dumpdown +cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;grep "Downloading dump $dumpnumber to /var/log/xcat/dump/" /tmp/dumpdown check:rc == 0 -cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`rspconfig $$CN dump -l |grep "\[$dumpnumber\] Generated" |cut -d : -f 6`;ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize +cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`rspconfig $$CN dump -l |grep "\[$dumpnumber\] Generated" |cut -d : -f 6`;if lsdef service > /dev/null 2>&1; then xdsh $$SN ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize;else ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize;fi check:rc == 0 cmd:rspconfig $$CN dump -d all check:rc == 0 @@ -145,7 +145,7 @@ check:output =~$$CN:\s*Dump requested check:output =~$$CN:\s*Downloading dump cmd:rspconfig $$CN dump -l |tail -n 1 |tee /tmp/dumpgenerate check:rc == 0 -cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`grep "\[$dumpnumber\] Generated" /tmp/dumpgenerate |cut -d : -f 6`;ls -l /var/log/xcat/dump/*_dump_$dumpnumber.tar.xz|grep $dumpsize|grep $$CN +cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`grep "\[$dumpnumber\] Generated" /tmp/dumpgenerate |cut -d : -f 6`;if lsdef service > /dev/null 2>&1; then xdsh $$SN ls -l /var/log/xcat/dump/*_dump_$dumpnumber.tar.xz|grep $dumpsize|grep $$CN;else ls -l /var/log/xcat/dump/*_dump_$dumpnumber.tar.xz|grep $dumpsize|grep $$CN;fi check:rc == 0 cmd:rm -rf /tmp/dumpgenerate end From 8cce4d90784afbd5662b9cce8eae89924cb19677 Mon Sep 17 00:00:00 2001 From: huweihua Date: Sun, 31 Mar 2019 22:28:06 -0400 Subject: [PATCH 006/276] add more debug information to investigate why operate goconserver frequently will trigger problem --- xCAT-test/autotest/testcase/install_xCAT/case0 | 9 +++++++++ .../installation/reg_linux_diskless_installation_flat | 8 ++++++++ xCAT-test/autotest/testcase/xcatconfig/case0 | 6 ++++-- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/install_xCAT/case0 b/xCAT-test/autotest/testcase/install_xCAT/case0 index 80d030fa9..87b29595a 100644 --- a/xCAT-test/autotest/testcase/install_xCAT/case0 +++ b/xCAT-test/autotest/testcase/install_xCAT/case0 @@ -37,15 +37,24 @@ cmd:cp /xcat-dep*.tar.bz2 /install_xCAT_xcat-dep.tar.bz2 check:rc==0 cmd:ls /go-xcat check:rc==0 +cmd:service goconserver status +cmd:service conserver status cmd:chmod 777 /go-xcat; /go-xcat --xcat-core=/install_xCAT_xcat-core.tar.bz2 --xcat-dep=/install_xCAT_xcat-dep.tar.bz2 -y install; check:rc==0 cmd:source "/etc/profile.d/xcat.sh";env;lsxcatd -v check:rc==0 check:output=~Version +cmd:service goconserver status +cmd:service conserver status cmd:service xcatd status check:rc==0 check:output=~running cmd:rm -rf /install_xCAT_xcat-core.tar.bz2 /install_xCAT_xcat-dep.tar.bz2 +cmd:service goconserver stop +cmd:service conserver stop +cmd:sleep 5 +cmd:service goconserver status +cmd:service conserver status end diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index c1bfd7c5c..30928dc85 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -11,9 +11,13 @@ check:rc==0 cmd:makedns -n check:rc==0 +cmd:service goconserver status +cmd:service conserver status cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 cmd:sleep 20 +cmd:service goconserver status +cmd:service conserver status cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]] && [[ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]]; then getmacs -D $$CN; fi check:rc==0 cmd:makedhcp -n @@ -76,7 +80,11 @@ check:rc==0 cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" cmd:xdsh $$CN "cat /test.synclist" check:rc==0 +cmd:service goconserver status +cmd:service conserver status cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi +cmd:service goconserver status +cmd:service conserver status cmd:if [[ -f /test.synclist.bak ]] ;then mv -f /test.synclist.bak /test.synclist;else rm -rf /test.synclist;fi cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists= check:rc==0 diff --git a/xCAT-test/autotest/testcase/xcatconfig/case0 b/xCAT-test/autotest/testcase/xcatconfig/case0 index 038d238fc..33d2f71df 100644 --- a/xCAT-test/autotest/testcase/xcatconfig/case0 +++ b/xCAT-test/autotest/testcase/xcatconfig/case0 @@ -99,6 +99,8 @@ description:To regenerate cretials label:mn_only #step1:backup: /etc/xcat/ca /etc/xcat/cert cmd:cp -r /etc/xcat/ca /etc/xcat/cabak;cp -r /etc/xcat/cert /etc/xcat/certbak +cmd: service goconserver status +cmd:service conserver status #step2:run command and check the output cmd:xcatconfig -c 2>&1 | tee /tmp/xcatconfig.test check:rc==0 @@ -118,8 +120,8 @@ cmd:rm -rf /tmp/xcatconfig.test check:rc==0 cmd:rm -rf /etc/xcat/cabak /etc/xcat/certbak check:rc==0 -cmd:if service goconserver status > /dev/null 2>&1; then service goconserver restart; fi -cmd:if service conserver status > /dev/null 2>&1; then service conserver restart ; fi +cmd:if service goconserver status; then echo "----->To restart goconserver"; service goconserver restart; sleep 10; echo "---------------------"; service goconserver status;echo "---------------------"; makegocons $$CN; fi +cmd:if service conserver status; then echo "---->To restart conserver"; service conserver restart;sleep 10;echo "---------------------"; service conserver status;echo "---------------------"; makeconservercf $$CN; fi cmd:if lsdef service > /dev/null 2>&1; then updatenode service -P servicenode;fi check:rc==0 cmd:if lsdef service > /dev/null 2>&1; then rpower $$CN stat;fi From d48d856e2d8c245fa15e2739fd21d32b1cb3dd06 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 2 Apr 2019 14:47:58 +0800 Subject: [PATCH 007/276] Fix bug of command line argument processing --- xCAT-server/share/xcat/tools/go-xcat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 139d945fd..f5d13af01 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -1979,8 +1979,8 @@ do GO_XCAT_ACTION="$1" case "$1 $2" in "completely uninstall"|"smoke test") - shift GO_XCAT_ACTION="$1 $2" + shift ;; esac ;; From 62032a45eb252b2bff16110702d74c1e1b2fb50f Mon Sep 17 00:00:00 2001 From: litingt Date: Tue, 2 Apr 2019 02:55:00 -0400 Subject: [PATCH 008/276] update go-xcat cases to support ubuntu18.04.x --- xCAT-test/autotest/testcase/go_xcat/case0 | 1 + xCAT-test/autotest/testcase/go_xcat/case1 | 2 ++ xCAT-test/autotest/testcase/go_xcat/case2 | 1 + 3 files changed, 4 insertions(+) diff --git a/xCAT-test/autotest/testcase/go_xcat/case0 b/xCAT-test/autotest/testcase/go_xcat/case0 index 5578faac9..dd9de6743 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case0 +++ b/xCAT-test/autotest/testcase/go_xcat/case0 @@ -255,6 +255,7 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";els check:rc!=0 cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils bzip2"; fi check:rc==0 +cmd:if xdsh $$CN "grep Ubuntu /etc/*release >/dev/null"; then xdsh $$CN "apt-get install -y gnupg"; fi cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-*-snap.tar.bz2 /xcat-core.tar.bz2" diff --git a/xCAT-test/autotest/testcase/go_xcat/case1 b/xCAT-test/autotest/testcase/go_xcat/case1 index 134f0a843..007e083bb 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case1 +++ b/xCAT-test/autotest/testcase/go_xcat/case1 @@ -43,6 +43,7 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";els check:rc!=0 cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils bzip2"; fi check:rc==0 +cmd:if xdsh $$CN "grep Ubuntu /etc/*release >/dev/null"; then xdsh $$CN "apt-get install -y gnupg"; fi cmd:xdsh $$CN "cd /; rm -rf /go-xcat" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" @@ -85,6 +86,7 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";els check:rc!=0 cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils bzip2"; fi check:rc==0 +cmd:if xdsh $$CN "grep Ubuntu /etc/*release >/dev/null"; then xdsh $$CN "apt-get install -y gnupg"; fi cmd:xdsh $$CN "cd /; rm -rf /go-xcat" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" diff --git a/xCAT-test/autotest/testcase/go_xcat/case2 b/xCAT-test/autotest/testcase/go_xcat/case2 index 98bdef85b..e8d8fd693 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case2 +++ b/xCAT-test/autotest/testcase/go_xcat/case2 @@ -176,6 +176,7 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";els check:rc!=0 cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils bzip2"; fi check:rc==0 +cmd:if xdsh $$CN "grep Ubuntu /etc/*release >/dev/null"; then xdsh $$CN "apt-get install -y gnupg"; fi cmd:xdsh $$CN "cd /; rm -rf /go-xcat" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" From d5ecc62fdb71e3e340951be0700c59ec58dfe663 Mon Sep 17 00:00:00 2001 From: huweihua Date: Tue, 2 Apr 2019 21:53:17 -0400 Subject: [PATCH 009/276] move useless lines --- .../reg_linux_diskless_installation_flat | 8 ----- xCAT-test/autotest/testcase/xcatconfig/case0 | 29 +++++++++++++++++-- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index 30928dc85..c1bfd7c5c 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -11,13 +11,9 @@ check:rc==0 cmd:makedns -n check:rc==0 -cmd:service goconserver status -cmd:service conserver status cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 cmd:sleep 20 -cmd:service goconserver status -cmd:service conserver status cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]] && [[ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]]; then getmacs -D $$CN; fi check:rc==0 cmd:makedhcp -n @@ -80,11 +76,7 @@ check:rc==0 cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" cmd:xdsh $$CN "cat /test.synclist" check:rc==0 -cmd:service goconserver status -cmd:service conserver status cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi -cmd:service goconserver status -cmd:service conserver status cmd:if [[ -f /test.synclist.bak ]] ;then mv -f /test.synclist.bak /test.synclist;else rm -rf /test.synclist;fi cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists= check:rc==0 diff --git a/xCAT-test/autotest/testcase/xcatconfig/case0 b/xCAT-test/autotest/testcase/xcatconfig/case0 index 33d2f71df..f3ba948eb 100644 --- a/xCAT-test/autotest/testcase/xcatconfig/case0 +++ b/xCAT-test/autotest/testcase/xcatconfig/case0 @@ -120,8 +120,33 @@ cmd:rm -rf /tmp/xcatconfig.test check:rc==0 cmd:rm -rf /etc/xcat/cabak /etc/xcat/certbak check:rc==0 -cmd:if service goconserver status; then echo "----->To restart goconserver"; service goconserver restart; sleep 10; echo "---------------------"; service goconserver status;echo "---------------------"; makegocons $$CN; fi -cmd:if service conserver status; then echo "---->To restart conserver"; service conserver restart;sleep 10;echo "---------------------"; service conserver status;echo "---------------------"; makeconservercf $$CN; fi +cmd:#!/bin/bash +rc=0 +if service goconserver status;then + echo "----->goconserver is working, to restart goconserver" + service goconserver restart + sleep 5 + echo "----->To check the status of goconserver" + if ! service goconserver status; then + rc=1 + fi + echo "----->To enforce conserver stop" + service conserver stop + sleep 5 + echo "----->To check the status of conserver" + if service conserver status; then + rc=1 + fi +elif service conserver status;then + echo "----->conserver is working, to restart conserver" + service conserver restart + echo "----->To check the status of conserver" + if ! service conserver status; then + rc=1 + fi +fi +exit $rc +check:rc==0 cmd:if lsdef service > /dev/null 2>&1; then updatenode service -P servicenode;fi check:rc==0 cmd:if lsdef service > /dev/null 2>&1; then rpower $$CN stat;fi From d1ac7c6327618ab25f3452e7dd76f98e8f89c4d8 Mon Sep 17 00:00:00 2001 From: huweihua Date: Wed, 3 Apr 2019 02:16:17 -0400 Subject: [PATCH 010/276] remove useless sleep --- xCAT-test/autotest/testcase/xcatconfig/case0 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/xcatconfig/case0 b/xCAT-test/autotest/testcase/xcatconfig/case0 index f3ba948eb..05f888c72 100644 --- a/xCAT-test/autotest/testcase/xcatconfig/case0 +++ b/xCAT-test/autotest/testcase/xcatconfig/case0 @@ -123,16 +123,14 @@ check:rc==0 cmd:#!/bin/bash rc=0 if service goconserver status;then - echo "----->goconserver is working, to restart goconserver" + echo "----->goconserver is working, to restart goconserver and enforce conserver stop" service goconserver restart + service conserver stop sleep 5 echo "----->To check the status of goconserver" if ! service goconserver status; then rc=1 fi - echo "----->To enforce conserver stop" - service conserver stop - sleep 5 echo "----->To check the status of conserver" if service conserver status; then rc=1 @@ -140,6 +138,7 @@ if service goconserver status;then elif service conserver status;then echo "----->conserver is working, to restart conserver" service conserver restart + sleep 5 echo "----->To check the status of conserver" if ! service conserver status; then rc=1 From feef25ccc0f0dd88336cb6bac7e545a9dc42d6df Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 3 Apr 2019 03:04:20 -0400 Subject: [PATCH 011/276] confignetwork extra params support using nmcli --- xCAT/postscripts/configeth | 48 ++++++++++++++++----------- xCAT/postscripts/nicutils.sh | 64 ++++++++++++++++++++++++++++++++---- 2 files changed, 85 insertions(+), 27 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 80e2e5d56..c545ea2bf 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -162,16 +162,20 @@ function configipv4(){ echo "VLAN=yes" >> $str_conf_file fi - #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" - echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $str_conf_file - i=$((i+1)) - done + #add extra params + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" + echo "$i: name=$name value=$value" + if [ $networkmanager_active -eq 1 ]; then + nmcli con modify $con_name $name $value + else + echo "${name}=${value}" >> $str_conf_file + fi + i=$((i+1)) + done fi } @@ -661,16 +665,20 @@ elif [ "$1" = "-s" ];then fi fi - #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" - echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $str_conf_file - i=$((i+1)) - done + #add extra params + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" + echo "$i: name=$name value=$value" + if [ $networkmanager_active -eq 1 ]; then + nmcli con modify $con_name $name $value + else + echo "${name}=${value}" >> $str_conf_file + fi + i=$((i+1)) + done hostname $NODE if [ -f "/etc/hostname" ]; then diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 22f499f92..b67ca637d 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -1691,6 +1691,7 @@ function create_vlan_interface_nmcli { local _netmask="" local _mtu="" local next_nic="" + rc=0 # in case it's on top of bond, we need to migrate ip from its # member vlan ports. # parser input arguments @@ -1750,9 +1751,14 @@ function create_vlan_interface_nmcli { tmp_con_name=$con_name"-tmp" $nmcli con modify $con_name connection.id $tmp_con_name fi - + #create VLAN connetion $nmcli con add type vlan con-name $con_name dev $ifname id $(( 10#$vlanid )) $_ipaddrs $_mtu connection.autoconnect-priority 9 log_info "create NetworkManager connection for $ifname.$vlanid" + + #add extra params + add_extra_params_nmcli $ifname.$vlanid $con_name + [ $? -ne 0 ] && rc=1 + if [ -z "$next_nic" ]; then $nmcli con up $con_name is_connection_activate_intime $con_name @@ -1770,7 +1776,45 @@ function create_vlan_interface_nmcli { $nmcli con delete $tmp_con_name fi $ip address show dev $ifname.$vlanid | $sed -e 's/^/[vlan] >> /g' | log_lines info - return 0 + return $rc +} +############################################################################### +# +# add extra params for nmcli connection +# +# input : $1 nic device +# $2 nmcli connection name +# return : 1 error +# 0 successful +# +############################################################################### +function add_extra_params_nmcli { + + nicdev=$1 + con_name=$2 + rc=0 + #query extra params + query_extra_params $nicdev + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" + if [ -n "$name" -a -n "$value" ]; then + cmd="$nmcli con modify $con_name $name $value" + log_info $cmd + $cmd + if [ $? -ne 0 ]; then + log_error "add extra params $name $value for $con_name failed" + rc=1 + fi + else + log_error "invalid extra params $name $value, please check nics.nicextraparams" + rc=1 + fi + i=$((i+1)) + done + return $rc } ############################################################################### @@ -1951,10 +1995,13 @@ function create_bridge_interface_nmcli { $nmcli con mod $xcat_con_name ipv4.method manual ipv4.addresses $ipv4_addr/$str_prefix; fi + # add extra params + add_extra_params_nmcli $ifname $xcat_con_name + [ $? -ne 0 ] && rc=1 # bring up interface formally log_info "$nmcli con up $xcat_con_name" $nmcli con up $xcat_con_name - rc=$? + [ $? -ne 0 ] && rc=1 log_info "$nmcli con up $xcat_slave_con" $nmcli con up $xcat_slave_con # If bridge interface is active, delete tmp old connection @@ -1983,7 +2030,7 @@ function create_bridge_interface_nmcli { $nmcli con delete $tmp_slave_con_name fi wait_for_ifstate $ifname UP 20 40 - rc=$? + [ $? -ne 0 ] && rc=1 $ip address show dev $ifname| $sed -e 's/^/[bridge] >> /g' | log_lines info fi @@ -2176,8 +2223,12 @@ function create_bond_interface_nmcli { break fi done - # bring up interface formally + invalid_extra_params=0 if [ $rc -ne 1 ]; then + # add extra params + add_extra_params_nmcli $bondname $xcat_con_name + [ $? -ne 0 ] && invalid_extra_params=1 + # bring up interface formally log_info "$nmcli con up $xcat_con_name" $nmcli con up $xcat_con_name if [ -z "$next_nic" ]; then @@ -2194,8 +2245,6 @@ function create_bond_interface_nmcli { $ip address show dev $bondname| $sed -e 's/^/[bond] >> /g' | log_lines info fi fi - else - rc=0 fi fi @@ -2231,6 +2280,7 @@ function create_bond_interface_nmcli { delete_bond_slaves_con "$tmp_slave_con_names" fi fi + [ $invalid_extra_params -eq 1 ] && rc=$invalid_extra_params return $rc } ###################################################################### From e52acb37993f354c08138714fb87853bb0a94d64 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 3 Apr 2019 15:59:53 -0400 Subject: [PATCH 012/276] Handle openbmc login errors --- xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py | 6 +++++- xCAT-server/lib/xcat/plugins/openbmc.pm | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 3b1fffee4..1565418ae 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -314,8 +314,12 @@ class OpenBMCRest(object): def handle_response (self, resp, cmd=''): - data = resp.json() # it will raise ValueError code = resp.status_code + if code == requests.codes.bad_gateway: + error = "(Verify REST server is running on the BMC)" + self._print_error_log(error, cmd) + raise SelfServerException(code, error, host_and_port=self.bmcip) + data = resp.json() # it will raise ValueError if code != requests.codes.ok: description = ''.join(data['data']['description']) error = '[%d] %s' % (code, description) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index f8f74dc46..f704bf8ae 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -2649,6 +2649,11 @@ sub login_request { xCAT::SvrUtils::sendmsg([1 ,"[" . $login_response->code . "] Login to BMC failed: " . $login_response->status_line . "."], $callback, $node); return 1; } + if ($login_response->code eq 502) { + # Possible reason for 502 code is the REST server not running + xCAT::SvrUtils::sendmsg([1 ,"[" . $login_response->code . "] Login to BMC failed: " . $login_response->status_line . ". Verify REST server is running on the BMC."], $callback, $node); + return 1; + } return 0; } @@ -2950,9 +2955,10 @@ sub rpower_response { retry_after($node, $next_status{ $node_info{$node}{cur_status} }{OFF}, $::RPOWER_CHECK_ON_INTERVAL); return; } else { - #after retry 5 times, the host is still off, print error and return + # if after 5 retries, the host is still off, print error and return my $wait_time_X = $node_info{$node}{wait_on_end} - $node_info{$node}{wait_on_start}; xCAT::SvrUtils::sendmsg([1, "Sent power-on command but state did not change to $::POWER_STATE_ON after waiting $wait_time_X seconds. (State=$all_status)."], $callback, $node); + xCAT::SvrUtils::sendmsg([1, "Run 'reventlog' command to see possible reasons for failure."], $callback, $node); $node_info{$node}{cur_status} = ""; $wait_node_num--; return; From 47a712ad024be47e8237dc8a318ff9cf75cee5e6 Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 4 Apr 2019 02:21:53 -0400 Subject: [PATCH 013/276] add hostname generation on compute node doc --- .../domain_name_resolution.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst b/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst index b5ff7c3da..8cc755e02 100644 --- a/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst +++ b/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst @@ -483,3 +483,20 @@ Limited support for user application networks In some cases you may have additional user application networks in your site that are not specifically used for cluster management. If desired you can create xCAT network definitions for these networks. This not only provides a convenient way to keep track of the network details but the information can also be used to help set up name resolution for these networks on the cluster nodes. When you add a network definition that includes a **"domain"** value then that domain is automatically included the xCAT name resolution set up. This will enable the nodes to be able to resolve hostnames from the other domains. For example, when you run ``makedhcp -n`` it will list all domains defined in the xCAT **"site"** definition and xCAT **"network"** definitions in the **"option domain-search"** entry of the shared-network stanza in the dhcp configuration file. This will cause dhcp to put these domains in the compute nodes' **/etc/resolv.conf** file every time it gets a dhcp lease. + +hostname generation on compute node +----------------------------------- + +After compute node is deployed, its ``hostname`` is coming from ``DHCP``, the default ``hostname`` is the same with the node name. If you want to have persistent ``hostname``, you can use ``confignetwork -s`` to configure the install nic with static IP, at the same time, it configure persistent ``hostname`` on the compute node. + +Execute ``confignetwork -s`` to configure provision ip as static IP: + + a. Add ``confignetwork -s`` into postscript list to execute on reboot :: + + chdef cn1 -p postscripts="confignetwork -s" + + b. If the compute node is already running, use ``updatenode`` command to run ``confignetwork -s`` postscript without rebooting the node :: + + updatenode cn1 -P "confignetwork -s" + + From 6b3ba24d7911c81ee41cd527219978c017016138 Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 4 Apr 2019 04:32:10 -0400 Subject: [PATCH 014/276] unify short and long name format --- .../domain_name_resolution/domain_name_resolution.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst b/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst index 8cc755e02..03eaeaad3 100644 --- a/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst +++ b/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst @@ -484,12 +484,12 @@ In some cases you may have additional user application networks in your site tha For example, when you run ``makedhcp -n`` it will list all domains defined in the xCAT **"site"** definition and xCAT **"network"** definitions in the **"option domain-search"** entry of the shared-network stanza in the dhcp configuration file. This will cause dhcp to put these domains in the compute nodes' **/etc/resolv.conf** file every time it gets a dhcp lease. -hostname generation on compute node ------------------------------------ +hostname setting on compute node +-------------------------------- -After compute node is deployed, its ``hostname`` is coming from ``DHCP``, the default ``hostname`` is the same with the node name. If you want to have persistent ``hostname``, you can use ``confignetwork -s`` to configure the install nic with static IP, at the same time, it configure persistent ``hostname`` on the compute node. +After compute node is deployed, its ``hostname`` is coming from ``DHCP``, the default ``hostname`` is the same with the node name. If you want to have persistent ``hostname``, you can use ``confignetwork -s`` to configure the install NIC with static IP address, at the same time, it persists ``hostname`` on the compute node. -Execute ``confignetwork -s`` to configure provision ip as static IP: +Execute ``confignetwork -s`` to configure provision IP address as static IP address: a. Add ``confignetwork -s`` into postscript list to execute on reboot :: From d068bbc1f3e119e5572f8e10c5623940cd69954e Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 4 Apr 2019 04:58:32 -0400 Subject: [PATCH 015/276] configure multiple ipv4 address for ethernet NIC using nmcli --- xCAT/postscripts/configeth | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index c545ea2bf..7f5704299 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -131,17 +131,21 @@ function configipv4(){ # Write the info to the ifcfg file for redhat con_name="xcat-"${str_if_name} str_conf_file="" - if [ $num_v4num -ne 0 ]; then + if [ $num_v4num -ne 0 ] && [ $networkmanager_active -eq 0 ]; then str_if_name=${str_if_name}:${num_v4num} fi str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}" if [ $networkmanager_active -eq 1 ]; then - is_nmcli_connection_exist $con_name - if [ $? -eq 0 ]; then - tmp_con_name=$con_name"-tmp" - nmcli con modify $con_name connection.id $tmp_con_name + if [ $num_v4num -eq 0 ]; then + is_nmcli_connection_exist $con_name + if [ $? -eq 0 ]; then + tmp_con_name=$con_name"-tmp" + nmcli con modify $con_name connection.id $tmp_con_name + fi + nmcli con add type ethernet con-name $con_name ifname ${str_if_name} ipv4.method manual ipv4.addresses ${str_v4ip}/${str_prefix} connection.autoconnect-priority 9 + else + nmcli con modify $con_name +ipv4.addresses ${str_v4ip}/${str_prefix} fi - nmcli con add type ethernet con-name $con_name ifname ${str_if_name} ipv4.method manual ipv4.addresses ${str_v4ip}/${str_prefix} connection.autoconnect-priority 9 else echo "DEVICE=${str_if_name}" > $str_conf_file echo "BOOTPROTO=none" >> $str_conf_file @@ -345,7 +349,7 @@ function add_ip_temporary(){ else str_label='' ip addr show dev $str_temp_name | grep inet | grep "global" | grep -v ':' | grep "${str_temp_name}" - if [ $? -eq 0 ];then + if [ $? -eq 0 ] && [ $networkmanager_active -eq 0 ]; then for num_i in {1..1000} do ip addr show dev $str_temp_name | grep inet | grep "global" | grep ":${num_i}" From cf14841407a1b4240f1366a7d4b0beec87a72d4a Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 8 Apr 2019 15:00:43 -0400 Subject: [PATCH 016/276] Add server name to rspconfig dump output --- .../lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py | 5 +++-- xCAT-server/lib/xcat/plugins/openbmc.pm | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py index b7398d87c..d31e3e256 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py @@ -49,8 +49,9 @@ class OpenBMCBmcConfigTask(ParallelNodesCommand): formatted_time = time.strftime("%Y%m%d-%H%M", time.localtime(time.time())) dump_log_file = '%s%s_%s_dump_%s.tar.xz' % (XCAT_LOG_DUMP_DIR, formatted_time, node, download_id) + host_name = os.uname()[1].split('.', 1)[0] if flag_dump_process: - self.callback.info('%s: Downloading dump %s to %s' % (node, download_id, dump_log_file)) + self.callback.info('%s: Downloading dump %s to %s:%s' % (node, download_id, host_name, dump_log_file)) obmc.download_dump(download_id, dump_log_file) if os.path.exists(dump_log_file): @@ -61,7 +62,7 @@ class OpenBMCBmcConfigTask(ParallelNodesCommand): if grep_string: self.callback.error('Invalid dump %s was specified. Use -l option to list.' % download_id, node) else: - self.callback.info('%s: Downloaded dump %s to %s.' % (node, download_id, dump_log_file)) + self.callback.info('%s: Downloaded dump %s to %s:%s.' % (node, download_id, host_name, dump_log_file)) else: self.callback.error('Failed to download dump %s to %s.' % (download_id, dump_log_file), node) return diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index f8f74dc46..1cb074b46 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -19,6 +19,7 @@ use JSON; use HTTP::Async; use HTTP::Cookies; use LWP::UserAgent; +use Net::Domain qw(hostname); use File::Basename; use File::Spec; use File::Copy qw/copy cp mv move/; @@ -4196,7 +4197,8 @@ sub dump_download_process { return 1; } if ($h->{message} eq $::RESPONSE_OK) { - xCAT::SvrUtils::sendmsg("Downloading dump $dump_id to $file_name", $callback, $node); + my $host_name = hostname(); + xCAT::SvrUtils::sendmsg("Downloading dump $dump_id to $host_name:$file_name", $callback, $node); my $curl_dwld_result = `$curl_dwld_cmd -s`; if (!$curl_dwld_result) { if ($xcatdebugmode) { @@ -4215,7 +4217,7 @@ sub dump_download_process { # Remove downloaded file, nothing useful inside of it unlink $file_name; } else { - xCAT::SvrUtils::sendmsg("Downloaded dump $dump_id to $file_name", $callback, $node) if ($::VERBOSE); + xCAT::SvrUtils::sendmsg("Downloaded dump $dump_id to $host_name:$file_name", $callback, $node) if ($::VERBOSE); } } else { From 9c81521ab3a93d14886f7903411304fd42b4a1ac Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 8 Apr 2019 15:46:57 -0400 Subject: [PATCH 017/276] Remove some AIX references in docs --- .../advanced/mixed_cluster/support_matrix.rst | 77 +++++++++---------- docs/source/overview/features.rst | 1 - docs/source/overview/support_matrix.rst | 3 - 3 files changed, 37 insertions(+), 44 deletions(-) diff --git a/docs/source/advanced/mixed_cluster/support_matrix.rst b/docs/source/advanced/mixed_cluster/support_matrix.rst index aa895ab0f..08f85eb75 100644 --- a/docs/source/advanced/mixed_cluster/support_matrix.rst +++ b/docs/source/advanced/mixed_cluster/support_matrix.rst @@ -1,46 +1,43 @@ Support Matrix ============== -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| | RHEL | SLES | RHEL | SLES | Ubuntu | RHEL | SLES | Ubuntu | AIX | -| | ppc64 | ppc64 | x86_64 | x86_64 | x86_64 | ppc64le | ppc64le | ppc64el | CN | -| | CN | CN | CN | CN | CN | CN | CN | CN | | -+=========+=========+=========+=========+=========+=========+=========+=========+=========+======+ -| RHEL | | | | | | | | | | -| ppc64 | yes | yes | yes | yes | yes | yes | yes | yes | no | -| MN/SN | | | [1]_ | [1]_ | [1]_ | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| SLES | | | | | | | | | | -| ppc64 | yes | yes | yes | yes | yes | yes | yes | yes | no | -| MN/SN | | | [1]_ | [1]_ | [1]_ | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| RHEL | | | | | | | | | | -| x86_64 | yes | yes | yes | yes | yes | yes | yes | yes | no | -| MN/SN | [4]_ | [4]_ | | | | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| SLES | | | | | | | | | | -| x86_64 | yes | yes | yes | yes | yes | yes | yes | yes | no | -| MN/SN | [4]_ | [4]_ | | | | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| Ubuntu | | | | | | | | | | -| x86_64 | yes | yes | yes | yes | yes | yes | yes | yes | no | -| MN/SN | [5]_ | [5]_ | | | | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| RHEL | | | | | | | | | | -| ppc64le | yes | yes | yes | yes | yes | yes | yes | yes | no | -| MN/SN | [2]_ | [2]_ | | | | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| SLES | | | | | | | | | | -| ppc64le | no | no | yes | yes | yes | yes | yes | yes | no | -| MN/SN | | | | | | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| Ubuntu | | | | | | | | | | -| ppc64el | yes | yes | yes | yes | yes | yes | yes | yes | no | -| MN/SN | [3]_ | [3]_ | | | | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| AIX | no | no | no | no | no | no | no | no | yes | -| MN/SN | | | | | | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| | RHEL | SLES | RHEL | SLES | Ubuntu | RHEL | SLES | Ubuntu | +| | ppc64 | ppc64 | x86_64 | x86_64 | x86_64 | ppc64le | ppc64le | ppc64el | +| | CN | CN | CN | CN | CN | CN | CN | CN | ++=========+=========+=========+=========+=========+=========+=========+=========+=========+ +| RHEL | | | | | | | | | +| ppc64 | yes | yes | yes | yes | yes | yes | yes | yes | +| MN/SN | | | [1]_ | [1]_ | [1]_ | | | | ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| SLES | | | | | | | | | +| ppc64 | yes | yes | yes | yes | yes | yes | yes | yes | +| MN/SN | | | [1]_ | [1]_ | [1]_ | | | | ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| RHEL | | | | | | | | | +| x86_64 | yes | yes | yes | yes | yes | yes | yes | yes | +| MN/SN | [4]_ | [4]_ | | | | | | | ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| SLES | | | | | | | | | +| x86_64 | yes | yes | yes | yes | yes | yes | yes | yes | +| MN/SN | [4]_ | [4]_ | | | | | | | ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| Ubuntu | | | | | | | | | +| x86_64 | yes | yes | yes | yes | yes | yes | yes | yes | +| MN/SN | [5]_ | [5]_ | | | | | | | ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| RHEL | | | | | | | | | +| ppc64le | yes | yes | yes | yes | yes | yes | yes | yes | +| MN/SN | [2]_ | [2]_ | | | | | | | ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| SLES | | | | | | | | | +| ppc64le | no | no | yes | yes | yes | yes | yes | yes | +| MN/SN | | | | | | | | | ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| Ubuntu | | | | | | | | | +| ppc64el | yes | yes | yes | yes | yes | yes | yes | yes | +| MN/SN | [3]_ | [3]_ | | | | | | | ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ Notes: diff --git a/docs/source/overview/features.rst b/docs/source/overview/features.rst index d29c0d3d0..5b3eb17e8 100644 --- a/docs/source/overview/features.rst +++ b/docs/source/overview/features.rst @@ -29,7 +29,6 @@ Features * Esxi * RHEV * Windows - * AIX #. Provision machines in diff --git a/docs/source/overview/support_matrix.rst b/docs/source/overview/support_matrix.rst index 11b6c2743..7e526c614 100644 --- a/docs/source/overview/support_matrix.rst +++ b/docs/source/overview/support_matrix.rst @@ -17,9 +17,6 @@ Operating System & Hardware Support Matrix |CentOS | no | no | no | no | yes | yes | yes | | | | | | | | | | +-------+-------+-------+-----+-------+--------+--------+--------+ -|AIX | yes | no | no | no | no | no | no | -| | | | | | | | | -+-------+-------+-------+-----+-------+--------+--------+--------+ |Windows| no | no | no | no | yes | yes | yes | | | | | | | | | | +-------+-------+-------+-----+-------+--------+--------+--------+ From 932bf55944a5f019fec719356a3b1f8f138b585a Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 8 Apr 2019 16:53:11 -0400 Subject: [PATCH 018/276] Use xCAT::MsgUtils->message instead of xCAT::SvrUtils::sendmsg --- xCAT-server/lib/xcat/plugins/openbmc.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 1cb074b46..b7969c51c 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -4198,7 +4198,7 @@ sub dump_download_process { } if ($h->{message} eq $::RESPONSE_OK) { my $host_name = hostname(); - xCAT::SvrUtils::sendmsg("Downloading dump $dump_id to $host_name:$file_name", $callback, $node); + xCAT::MsgUtils->message("I", { data => ["$node: Downloading dump $dump_id to $host_name:$file_name"] }, $callback); my $curl_dwld_result = `$curl_dwld_cmd -s`; if (!$curl_dwld_result) { if ($xcatdebugmode) { @@ -4217,7 +4217,7 @@ sub dump_download_process { # Remove downloaded file, nothing useful inside of it unlink $file_name; } else { - xCAT::SvrUtils::sendmsg("Downloaded dump $dump_id to $host_name:$file_name", $callback, $node) if ($::VERBOSE); + xCAT::MsgUtils->message("I", { data => ["$node: Downloaded dump $dump_id to $host_name:$file_name"] }, $callback) if ($::VERBOSE); } } else { From 39595c9dd0a8237b7b104d22620f2a4d6612ecc5 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 9 Apr 2019 11:05:11 +0800 Subject: [PATCH 019/276] Make the pkglist for RHEL 8 diskless compute node same as the pkglist for diskfull compute node --- .../netboot/rh/compute.rhels8.ppc64le.pkglist | 28 +------------------ .../netboot/rh/compute.rhels8.x86_64.pkglist | 27 +----------------- 2 files changed, 2 insertions(+), 53 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist index 4405d533e..5919688df 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist @@ -1,36 +1,10 @@ -bash -bc -bzip2 +@minimal-environment chrony -coreutils -curl -dhcp-client -dracut -dracut-network -e2fsprogs -ethtool -file -gzip -hostname -initscripts -iputils -irqbalance kernel -lsvpd net-tools nfs-utils -openssh-clients openssh-server -openssl -parted -procps-ng -rpm rsync -rsyslog -tar util-linux -vim-minimal -xz wget python3 -NetworkManager diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist index 3591e44d0..5919688df 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist @@ -1,35 +1,10 @@ -bash -bc -bzip2 +@minimal-environment chrony -coreutils -curl -dhcp-client -dracut -dracut-network -e2fsprogs -ethtool -file -gzip -hostname -initscripts -iputils -irqbalance kernel net-tools nfs-utils -openssh-clients openssh-server -openssl -parted -procps-ng -rpm rsync -rsyslog -tar util-linux -vim-minimal -xz wget python3 -NetworkManager From 8c0224ea805f6e7076ef2d0a69f302bd07fee8cb Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 9 Apr 2019 11:07:54 +0800 Subject: [PATCH 020/276] Make the pkglist for RHEL 8 diskless service node same as the pkglist for diskfull service node --- .../netboot/rh/service.rhels8.ppc64le.pkglist | 28 +------------------ .../netboot/rh/service.rhels8.x86_64.pkglist | 27 +----------------- 2 files changed, 2 insertions(+), 53 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist index de6892304..de6dd02e5 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist @@ -1,38 +1,12 @@ -bash -bc -bzip2 +@minimal-environment chrony -coreutils -curl -dhcp-client -dracut -dracut-network -e2fsprogs -ethtool -file -gzip -hostname -initscripts -iputils -irqbalance kernel -lsvpd net-tools nfs-utils -openssh-clients openssh-server -openssl -parted -procps-ng -rpm rsync -rsyslog -tar util-linux -vim-minimal -xz wget perl-DBD-MySQL perl-DBD-Pg python3 -NetworkManager diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist index 52da27a2e..de6dd02e5 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist @@ -1,37 +1,12 @@ -bash -bc -bzip2 +@minimal-environment chrony -coreutils -curl -dhcp-client -dracut -dracut-network -e2fsprogs -ethtool -file -gzip -hostname -initscripts -iputils -irqbalance kernel net-tools nfs-utils -openssh-clients openssh-server -openssl -parted -procps-ng -rpm rsync -rsyslog -tar util-linux -vim-minimal -xz wget perl-DBD-MySQL perl-DBD-Pg python3 -NetworkManager From 135f4cdceab28ba804bfd0f9d4336ac3568710c0 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 9 Apr 2019 11:26:17 -0400 Subject: [PATCH 021/276] Use Sys::Hostname instead of Net::Domain --- xCAT-server/lib/xcat/plugins/openbmc.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index b7969c51c..8d8e9da51 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -19,7 +19,7 @@ use JSON; use HTTP::Async; use HTTP::Cookies; use LWP::UserAgent; -use Net::Domain qw(hostname); +use Sys::Hostname; use File::Basename; use File::Spec; use File::Copy qw/copy cp mv move/; @@ -4197,8 +4197,8 @@ sub dump_download_process { return 1; } if ($h->{message} eq $::RESPONSE_OK) { - my $host_name = hostname(); - xCAT::MsgUtils->message("I", { data => ["$node: Downloading dump $dump_id to $host_name:$file_name"] }, $callback); + my @host_name = split(/\./, hostname()); + xCAT::MsgUtils->message("I", { data => ["$node: Downloading dump $dump_id to $host_name[0]:$file_name"] }, $callback); my $curl_dwld_result = `$curl_dwld_cmd -s`; if (!$curl_dwld_result) { if ($xcatdebugmode) { @@ -4217,7 +4217,7 @@ sub dump_download_process { # Remove downloaded file, nothing useful inside of it unlink $file_name; } else { - xCAT::MsgUtils->message("I", { data => ["$node: Downloaded dump $dump_id to $host_name:$file_name"] }, $callback) if ($::VERBOSE); + xCAT::MsgUtils->message("I", { data => ["$node: Downloaded dump $dump_id to $host_name[0]:$file_name"] }, $callback) if ($::VERBOSE); } } else { From 336a4b283933c37938da2010304f244a4dfd5d94 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 9 Apr 2019 11:57:01 -0400 Subject: [PATCH 022/276] Add some more debugs to travis --- travis.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/travis.pl b/travis.pl index 11119f160..3404908fb 100644 --- a/travis.pl +++ b/travis.pl @@ -150,6 +150,7 @@ sub check_pr_format{ $check_result_str .= "> **PR FORMAT CORRECT**"; send_back_comment("$check_result_str"); }else{ + # Warning if missing milestone or labels, others are errors if($checkrst =~ /milestone/ || $checkrst =~ /labels/){ $check_result_str .= "> **PR FORMAT WARNING** : $checkrst"; send_back_comment("$check_result_str"); @@ -259,8 +260,13 @@ sub send_back_comment{ } } - print "[send_back_comment] method = $post_method to $post_url\n"; - `curl -u "$ENV{'xcatbotuser'}:$ENV{'xcatbotpw'}" -X $post_method -d '{"body":"$message"}' $post_url`; + print "[send_back_comment] method = $post_method to $post_url. Message = $message\n"; + if ( $ENV{'xcatbotuser'} and $ENV{'xcatbotpw'}) { + `curl -u "$ENV{'xcatbotuser'}:$ENV{'xcatbotpw'}" -X $post_method -d '{"body":"$message"}' $post_url`; + } + else { + print "Not able to update pull request with message: $message\n"; + } } #-------------------------------------------------------- From 6acc81a78682141c9e3f8a9cf44da7b59edb1f6d Mon Sep 17 00:00:00 2001 From: huweihua Date: Tue, 9 Apr 2019 22:34:44 -0400 Subject: [PATCH 023/276] replace makeconserver by makegocons --- .../autotest/testcase/migration/sles_migration | 15 ++++++--------- .../testcase/migration/ubuntu_migration1_p8le | 7 ++----- .../testcase/migration/ubuntu_migration1_vm | 6 ++---- .../testcase/migration/ubuntu_migration2_p8le | 7 ++----- .../testcase/migration/ubuntu_migration2_vm | 6 ++---- 5 files changed, 14 insertions(+), 27 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index 2e429094e..80561503f 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -14,11 +14,9 @@ cmd:makedns -n check:rc==0 cmd:service named restart check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN -cmd:sleep 60 +cmd:sleep 20 cmd:if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]; then getmacs -D $$CN; fi check:rc==0 cmd:makedhcp -n @@ -112,6 +110,7 @@ cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi check:rc==0 cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi @@ -122,7 +121,6 @@ start:sles_migration2 os:Linux description:update xCAT from $$MIGRATION22VERSION to latest version, these two global parameter defined in config file label:others,migration,invoke_provision - cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;echo "poweroffsn">/tmp/poweroffsn;fi check:rc==0 cmd:if [[ "__GETNODEATTR($$SN,groups)__" =~ "service" ]];then chdef $$SN -m groups=service;echo "servicelabel" >/tmp/servicelabel;fi @@ -135,11 +133,9 @@ cmd:makedns -n check:rc==0 cmd:service named restart check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN -cmd:sleep 60 +cmd:sleep 20 cmd:if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]; then getmacs -D $$CN; fi check:rc==0 cmd:makedhcp -n @@ -233,6 +229,7 @@ cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi check:rc==0 cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le index 5bd7ce898..355ffb9d4 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le @@ -2,7 +2,6 @@ start:ubuntu_migration1_p8le os:Linux description:update xCAT from $$UBUNTU_MIGRATION1_VERSION to latest version, these two global parameter defined in config file label:others,migration,invoke_provision - cmd:copycds $$ISO check:rc==0 cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu" ]];then mkdir /tmp/iso; mount -o loop $$MINIISO /tmp/iso ; mkdir -p /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot; cp /tmp/iso/install/initrd.gz /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot;umount /tmp/iso; rmdir /tmp/iso; fi @@ -13,10 +12,8 @@ cmd:makedhcp -a check:rc==0 cmd:makedns -n check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN @@ -117,6 +114,6 @@ cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" check:output!~node0001 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 - +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi end diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm index 9171b01e6..9e6bdeb2e 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm @@ -2,7 +2,6 @@ start:ubuntu_migration1_vm os:Linux description:update xCAT from $$UBUNTU_MIGRATION1_VERSION to latest version, these two global parameter defined in config file label:others,migration,invoke_provision - cmd:copycds $$ISO check:rc==0 cmd:makedns -n @@ -12,10 +11,8 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN @@ -116,4 +113,5 @@ cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" check:output!~node0001 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi end diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le index 301d31f22..9587ebb69 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le @@ -2,7 +2,6 @@ start:ubuntu_migration2_p8le os:Linux description:update xCAT from $$UBUNTU_MIGRATION2_VERSION to latest version, these two global parameter defined in config file label:others,migration,invoke_provision - cmd:copycds $$ISO check:rc==0 cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu" ]];then mkdir /tmp/iso; mount -o loop $$MINIISO /tmp/iso ; mkdir -p /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot; cp /tmp/iso/install/initrd.gz /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot;umount /tmp/iso; rmdir /tmp/iso; fi @@ -13,10 +12,8 @@ cmd:makedhcp -a check:rc==0 cmd:makedns -n check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN @@ -117,6 +114,6 @@ cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" check:output!~node0001 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 - +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi end diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm index bd98c5e63..0eb9c3b8d 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm @@ -2,7 +2,6 @@ start:ubuntu_migration2_vm os:Linux description:update xCAT from $$UBUNTU_MIGRATION2_VERSION to latest version, these two global parameter defined in config file label:others,migration,invoke_provision - cmd:copycds $$ISO check:rc==0 cmd:makedns -n @@ -12,10 +11,8 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN @@ -116,4 +113,5 @@ cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" check:output!~node0001 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi end From 63625c6aae6be306c4094ca3d04f24826daa1286 Mon Sep 17 00:00:00 2001 From: bybai Date: Tue, 9 Apr 2019 22:47:45 -0400 Subject: [PATCH 024/276] configib support nmcli --- xCAT/postscripts/configib | 64 ++++++++++++++++++++++++++++++------ xCAT/postscripts/nicutils.sh | 9 ++--- 2 files changed, 59 insertions(+), 14 deletions(-) diff --git a/xCAT/postscripts/configib b/xCAT/postscripts/configib index eb3d56f1b..dee2b92c1 100755 --- a/xCAT/postscripts/configib +++ b/xCAT/postscripts/configib @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash # IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html # Internal script used by confignics only # xCAT post script for configuring ib adapters. @@ -29,6 +29,16 @@ else log_label="xcat" fi +######################################################################## +# nmcli_used=0: use network.service +# nmcli_used=1: use NetworkManager +######################################################################## +nmcli_used=0 +ps -ef|grep -v grep|grep NetworkManager >/dev/null 2>/dev/null +if [ $? -eq 0 ]; then + nmcli_used=1 +fi + #This is the number of ports for each ib adpator. portnum=1 if [ -n "$NIC_IBAPORTS" ]; then @@ -461,11 +471,20 @@ IPADDR_$ipindex=$nicip" >> $dir/ifcfg-$nic # First ip address if [ $ipindex -eq 1 ] then + nmcontrol="" + devtype="" + if [ $nmcli_used -eq 0 ]; then + nmcontrol="NM_CONTROLLED=no" + else + devtype="TYPE=InfiniBand" + fi # Write the info to the ifcfg file echo "DEVICE=$nic -NM_CONTROLLED=no +$nmcontrol +$devtype BOOTPROTO=none ONBOOT=yes +NAME=$nic IPADDR=$nicip" > $dir/ifcfg-$nic # ipv6 if echo $nicip | grep : 2>&1 1>/dev/null @@ -514,11 +533,25 @@ IPV6ADDR=$nicip/$netmask" >> $dir/ifcfg-$nic echo "IPV6_DEFAULTGW=$gateway" >> $dir/ifcfg-$nic fi else # ipv4 address - echo "DEVICE=$nic:$ipindex + cfgfile=$dir"/ifcfg-"$nic + if [ $nmcli_used -eq 0 ]; then + cfgfile=$dir"/ifcfg-"$nic":"$ipindex + cfgcontent= "DEVICE=$nic:$ipindex NM_CONTROLLED=no BOOTPROTO=none ONBOOT=yes -IPADDR=$nicip" > $dir/ifcfg-$nic:$ipindex +NETMASK=$netmask +IPADDR=$nicip +DEVICE=$nic:$ipindex" + else + cfgcontent="NETMASK$ipindex=$netmask +IPADDR$ipindex=$nicip" + fi + if [ $nmcli_used -eq 0 ]; then + echo "$cfgcontent" > $cfgfile + else + echo "$cfgcontent" >> $cfgfile + fi if [[ "$OSVER" == rhels6* ]] then #get prefix from netmask, this is for IPv4 only @@ -526,11 +559,15 @@ IPADDR=$nicip" > $dir/ifcfg-$nic:$ipindex prefix=$(convert_netmask_to_cidr $netmask) echo "PREFIX=$prefix" >> $dir/ifcfg-$nic:$ipindex else - echo "NETMASK=$netmask" >> $dir/ifcfg-$nic:$ipindex + echo "$nicnetmask" >> $cfgfile fi if [ -n "$gateway" ]; then - echo "GATEWAY=$gateway" >> $dir/ifcfg-$nic:$ipindex + if [ $nmcli_used -eq 0 ]; then + echo "GATEWAY=$gateway" >> $cfgfile + else + echo "GATEWAY$ipindex=$gateway" >> $cfgfile + fi fi #add extra params @@ -540,12 +577,14 @@ IPADDR=$nicip" > $dir/ifcfg-$nic:$ipindex name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $dir/ifcfg-$nic:$ipindex + echo "${name}=${value}" >> $cfgfile i=$((i+1)) done # need to run ifup eth1:1 for RedHat - goodnics="$goodnics,$nic:$ipindex" + if [ $nmcli_used -eq 0 ]; then + goodnics="$goodnics,$nic:$ipindex" + fi fi fi # end not the first ip address elif [ $OS_name == 'ubuntu' ] @@ -705,8 +744,13 @@ then sleep 2 ifup $tmp > /dev/null 2>&1 done - else - ifup $nic > /dev/null 2>&1 + else + if [ $nmcli_used -eq 1 ]; then + nmcli con reload $dir/ifcfg-$nic + nmcli con up $nic 2>&1 + else + ifup $nic > /dev/null 2>&1 + fi fi fi done diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 22f499f92..660151c08 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -1595,13 +1595,14 @@ function check_NetworkManager_or_network_service() { if [ $? -ne 0 ]; then log_error "There is no nmcli" else - stopservice network | log_lines info - disableservice network | log_lines info - stopservice networking | log_lines info - disableservice networking | log_lines info return 1 fi fi + #In RH8 postscripts stage, nmcli can not modify persistent configure file + ps -ef|grep -v grep|grep NetworkManager >/dev/null 2>/dev/null + if [ $? -eq 0 ]; then + return 0 + fi checkservicestatus network > /dev/null 2>/dev/null || checkservicestatus wicked > /dev/null 2>/dev/null if [ $? -eq 0 ]; then stopservice NetworkManager | log_lines info From 89bc1a780a754a07261eaf721a92144fd49579fe Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 10 Apr 2019 01:57:19 -0400 Subject: [PATCH 025/276] let configeth work in postscripts RH8 nmcli --- xCAT/postscripts/configeth | 69 ++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 17 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 7f5704299..c19775684 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -31,6 +31,12 @@ networkmanager_active=0 checkservicestatus NetworkManager > /dev/null if [ $? -eq 0 ]; then networkmanager_active=1 +else + #In RH8 postscripts stage, NetworkManager is active but nmcli cannot modify NIC configure file + ps -ef|grep -v grep|grep NetworkManager >/dev/null 2>/dev/null + if [ $? -eq 0 ]; then + networkmanager_active=2 + fi fi str_conf_file="" str_conf_file_xcatbak="" @@ -135,6 +141,9 @@ function configipv4(){ str_if_name=${str_if_name}:${num_v4num} fi str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}" + if [ $networkmanager_active -ne 0 ]; then + str_conf_file="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}" + fi if [ $networkmanager_active -eq 1 ]; then if [ $num_v4num -eq 0 ]; then is_nmcli_connection_exist $con_name @@ -146,6 +155,19 @@ function configipv4(){ else nmcli con modify $con_name +ipv4.addresses ${str_v4ip}/${str_prefix} fi + elif [ $networkmanager_active -eq 2 ]; then + if [ $num_v4num -eq 0 ]; then + echo "DEVICE=${str_if_name}" > $str_conf_file + echo "BOOTPROTO=none" >> $str_conf_file + echo "IPADDR=${str_v4ip}" >> $str_conf_file + echo "NETMASK=${str_v4mask}" >> $str_conf_file + echo "NAME=xcat-${str_if_name}" >> $str_conf_file + echo "ONBOOT=yes" >> $str_conf_file + echo "AUTOCONNECT_PRIORITY=9" >> $str_conf_file + else + echo "IPADDR$num_v4num=${str_v4ip}" >> $str_conf_file + echo "NETMASK$num_v4num=${str_v4mask}" >> $str_conf_file + fi else echo "DEVICE=${str_if_name}" > $str_conf_file echo "BOOTPROTO=none" >> $str_conf_file @@ -156,10 +178,10 @@ function configipv4(){ fi if [ "$str_nic_mtu" != "$str_default_token" ]; then if [ $networkmanager_active -eq 1 ]; then - nmcli con modify $con_name mtu $str_nic_mtu + nmcli con modify $con_name mtu $str_nic_mtu else echo "MTU=${str_nic_mtu}" >> $str_conf_file - fi + fi fi if [[ ${str_if_name} == [a-zA-Z0-9]*.[0-9]* ]]; then @@ -174,10 +196,12 @@ function configipv4(){ value="${array_extra_param_values[$i]}" echo "$i: name=$name value=$value" if [ $networkmanager_active -eq 1 ]; then - nmcli con modify $con_name $name $value - else - echo "${name}=${value}" >> $str_conf_file + str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}-1" + if [ -e $str_conf_file_1 ]; then + echo "${name}=${value}" >> $str_conf_file_1 + fi fi + echo "${name}=${value}" >> $str_conf_file i=$((i+1)) done fi @@ -638,6 +662,9 @@ elif [ "$1" = "-s" ];then con_name="xcat-install-"${str_inst_nic} str_inst_prefix=$(v4mask2prefix ${str_inst_mask}) str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_inst_nic}" + if [ $networkmanager_active -eq 2 ]; then + str_conf_file="/etc/sysconfig/network-scripts/ifcfg-xcat-install-${str_inst_nic}" + fi if [ $networkmanager_active -eq 1 ]; then is_nmcli_connection_exist "$con_name" if [ $? -eq 0 ]; then @@ -651,14 +678,18 @@ elif [ "$1" = "-s" ];then echo "NETMASK=${str_inst_mask}" >> $str_conf_file echo "BOOTPROTO=none" >> $str_conf_file echo "ONBOOT=yes" >> $str_conf_file + echo "NAME=xcat-install-${str_inst_nic}" >> $str_conf_file echo "HWADDR=${str_inst_mac}" >> $str_conf_file fi + if [ $networkmanager_active -eq 2 ]; then + echo "AUTOCONNECT_PRIORITY=9" >> $str_conf_file + fi if [ -n "${str_inst_mtu}" ];then - if [ $networkmanager_active -eq 1 ]; then - nmcli con modify $con_name mtu ${str_inst_mtu} + if [ $networkmanager_active -eq 1 ]; then + nmcli con modify $con_name mtu ${str_inst_mtu} else echo "MTU=${str_inst_mtu}" >> $str_conf_file - fi + fi fi if [ -n "$str_inst_gateway" ];then grep -i "GATEWAY" /etc/sysconfig/network @@ -669,7 +700,7 @@ elif [ "$1" = "-s" ];then fi fi - #add extra params + #add extra params i=0 while [ $i -lt ${#array_extra_param_names[@]} ] do @@ -677,10 +708,12 @@ elif [ "$1" = "-s" ];then value="${array_extra_param_values[$i]}" echo "$i: name=$name value=$value" if [ $networkmanager_active -eq 1 ]; then - nmcli con modify $con_name $name $value - else - echo "${name}=${value}" >> $str_conf_file - fi + str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-install-${str_if_name}-1" + if [ -e $str_conf_file_1 ]; then + echo "${name}=${value}" >> $str_conf_file_1 + fi + fi + echo "${name}=${value}" >> $str_conf_file i=$((i+1)) done @@ -704,7 +737,8 @@ elif [ "$1" = "-s" ];then else ip link set dev $str_inst_nic down fi - if [ $networkmanager_active -eq 1 ]; then + if [ $networkmanager_active -eq 1 ]; then + nmcli con reload nmcli con up $con_name else ifup $str_inst_nic @@ -1123,11 +1157,12 @@ else if [ $reboot_nic_bool -eq 1 ]; then if_state=0 echo "bring up ip" - if [ $networkmanager_active -eq 1 ]; then + if [ $networkmanager_active -eq 1 ]; then + nmcli con reload nmcli con up $con_name - else + else ifup $str_nic_name - fi + fi if [ $? -ne 0 ]; then if_state=$(wait_for_ifstate $str_nic_name UP 20 5) fi From 11e45fd741a762901fe30bbe0c9a2c47f4505ad8 Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 10 Apr 2019 04:36:46 -0400 Subject: [PATCH 026/276] unify nicextraparams interface for RH8 and RH7 --- xCAT/postscripts/configeth | 40 ++++++++++++++++++---------------- xCAT/postscripts/confignetwork | 3 ++- xCAT/postscripts/nicutils.sh | 17 +++++++++------ 3 files changed, 33 insertions(+), 27 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index c19775684..6b116c27b 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -183,27 +183,27 @@ function configipv4(){ echo "MTU=${str_nic_mtu}" >> $str_conf_file fi fi - + if [ $networkmanager_active -eq 1 ]; then + str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}-1" + if [ -f $str_conf_file_1 ]; then + grep -x "NAME=$con_name" $str_conf_file_1 >/dev/null 2>/dev/null + if [ $? -eq 0 ]; then + str_conf_file=$str_conf_file_1 + fi + fi + fi if [[ ${str_if_name} == [a-zA-Z0-9]*.[0-9]* ]]; then echo "VLAN=yes" >> $str_conf_file fi - #add extra params i=0 while [ $i -lt ${#array_extra_param_names[@]} ] do name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" - echo "$i: name=$name value=$value" - if [ $networkmanager_active -eq 1 ]; then - str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}-1" - if [ -e $str_conf_file_1 ]; then - echo "${name}=${value}" >> $str_conf_file_1 - fi - fi - echo "${name}=${value}" >> $str_conf_file + echo "${name}=${value}" >> $str_conf_file i=$((i+1)) - done + done fi } @@ -699,7 +699,15 @@ elif [ "$1" = "-s" ];then echo "GATEWAY=${str_inst_gateway}" >> /etc/sysconfig/network fi fi - + if [ $networkmanager_active -eq 1 ]; then + str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}-1" + if [ -f $str_conf_file_1 ]; then + grep $con_name $str_conf_file_1 >/dev/null 2>/dev/null + if [ $? -eq 0 ]; then + $str_conf_file=$str_conf_file_1 + fi + fi + fi #add extra params i=0 while [ $i -lt ${#array_extra_param_names[@]} ] @@ -707,12 +715,6 @@ elif [ "$1" = "-s" ];then name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" echo "$i: name=$name value=$value" - if [ $networkmanager_active -eq 1 ]; then - str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-install-${str_if_name}-1" - if [ -e $str_conf_file_1 ]; then - echo "${name}=${value}" >> $str_conf_file_1 - fi - fi echo "${name}=${value}" >> $str_conf_file i=$((i+1)) done @@ -740,7 +742,7 @@ elif [ "$1" = "-s" ];then if [ $networkmanager_active -eq 1 ]; then nmcli con reload nmcli con up $con_name - else + else ifup $str_inst_nic fi if [ $? -ne 0 ]; then diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index 40f4d4ace..89f06d305 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -63,7 +63,8 @@ function get_nic_cfg_file_content { elif [ $is_debian -eq 1 ]; then cfg_file="$nwdir/${cfg_dev}" fi - if [ "$networkmanager_active" = "1" ]; then + ps -ef|grep -v grep|grep NetworkManager >/dev/null 2>/dev/null + if [ $? -eq 0 ]; then $ip address show dev ${cfg_dev}| $sed -e 's/^/[Ethernet] >> /g' | log_lines info else if [ -f $cfg_file ]; then diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index b67ca637d..86acd954f 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -1793,6 +1793,14 @@ function add_extra_params_nmcli { nicdev=$1 con_name=$2 rc=0 + str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${con_name}" + str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-${con_name}-1" + if [ -f $str_conf_file_1 ]; then + grep -x "NAME=$con_name" $str_conf_file_1 >/dev/null 2>/dev/null + if [ $? -eq 0 ]; then + str_conf_file=$str_conf_file_1 + fi + fi #query extra params query_extra_params $nicdev i=0 @@ -1801,19 +1809,14 @@ function add_extra_params_nmcli { name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" if [ -n "$name" -a -n "$value" ]; then - cmd="$nmcli con modify $con_name $name $value" - log_info $cmd - $cmd - if [ $? -ne 0 ]; then - log_error "add extra params $name $value for $con_name failed" - rc=1 - fi + echo "$name=$value" >> $str_conf_file else log_error "invalid extra params $name $value, please check nics.nicextraparams" rc=1 fi i=$((i+1)) done + $nmcli con reload $str_conf_file return $rc } From 45631ac21794458387f6c2d9e2c2370392d49e11 Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 10 Apr 2019 06:06:40 -0400 Subject: [PATCH 027/276] create bridge on RH8 in postscripts --- xCAT/postscripts/confignetwork | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index 89f06d305..5916b00af 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -563,8 +563,10 @@ function configure_nicdevice { #openvswitch bridge type is bridge_ovs elif [ x"$nic_dev_type" = "xbridge_ovs" -o x"$nic_dev_type" = "xbridge" ]; then if [ "$networkmanager_active" = "0" ]; then + ps -ef|grep -v grep|grep NetworkManager >/dev/null 2>/dev/null + nmcli_used=$? check_brctl $nic_dev_type - if [ $? -ne 0 ]; then + if [ $? -ne 0 ] && [ $nmcli_used -ne 0 ]; then errorcode=1 else create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type From 54a55a4d0d3fcf5cc25b0f66543b67f0eddbc3a6 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 10 Apr 2019 14:26:33 -0400 Subject: [PATCH 028/276] Verify debootstrap command can be executed --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index ab7896726..e8f490bd8 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -333,10 +333,14 @@ unless ($onlyinitrd) { } } + if (! -x $aptcmd1) { + print "Error: Can not execute $aptcmd1 command. Make sure you are running on a Debian based system.\n"; + exit 1; + } print "Run cmd [$aptcmd1 $aptcmd2] to create rootimage bootstraps\n"; my $rc = system("$aptcmd1 $aptcmd2"); if ($rc) { - print "Error: cannnot create bootstraps for rootimage. Make sure you specified full http mirror path.\n"; + print "Error: Can not create bootstraps for rootimage. Make sure you specified full http mirror path.\n"; exit 1; } From 002c40f9e6ca708f5da3150d384f4598c0fd47a7 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 10 Apr 2019 15:21:51 -0400 Subject: [PATCH 029/276] Verify zypper command can be executed --- xCAT-server/share/xcat/netboot/sles/genimage | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 5e241ea7d..5f7f528a8 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -255,6 +255,12 @@ unless ($onlyinitrd) { my $non_interactive; if (!$prompt) { $non_interactive = "--non-interactive --no-gpg-checks --gpg-auto-import-keys"; } + my $zypper_cmd = "zypper"; + if (! -x $zypper_cmd) { + print "Can not execute $zypper_cmd command. Make sure you are running on SUSE based system"; + exit 1; + } + if ($osver_host >= 11) { #zypper in SLES11 is different system("rm -rf $rootimg_dir/etc/zypp/repos.d/$osver-*.repo"); From 68925429a3dbb87b6be0edba51e49db97f9eef35 Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 11 Apr 2019 04:37:50 -0400 Subject: [PATCH 030/276] polished networkmanager_active logic --- xCAT/postscripts/configeth | 48 ++++++++++++++++------------------ xCAT/postscripts/confignetwork | 31 +++++++++++++--------- 2 files changed, 41 insertions(+), 38 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 6b116c27b..6e540fe4e 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -46,7 +46,7 @@ function configipv4(){ str_v4ip=$2 str_v4net=$3 str_v4mask=$4 - num_v4num=$5 + num_v4num=$5 #If NIC has multiple IPs, the ordinal number of IP is num_v4num str_extra_params=$6 str_nic_mtu=$7 @@ -137,13 +137,6 @@ function configipv4(){ # Write the info to the ifcfg file for redhat con_name="xcat-"${str_if_name} str_conf_file="" - if [ $num_v4num -ne 0 ] && [ $networkmanager_active -eq 0 ]; then - str_if_name=${str_if_name}:${num_v4num} - fi - str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}" - if [ $networkmanager_active -ne 0 ]; then - str_conf_file="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}" - fi if [ $networkmanager_active -eq 1 ]; then if [ $num_v4num -eq 0 ]; then is_nmcli_connection_exist $con_name @@ -155,7 +148,16 @@ function configipv4(){ else nmcli con modify $con_name +ipv4.addresses ${str_v4ip}/${str_prefix} fi + str_conf_file="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}" + str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}-1" + if [ -f $str_conf_file_1 ]; then + grep -x "NAME=$con_name" $str_conf_file_1 >/dev/null 2>/dev/null + if [ $? -eq 0 ]; then + str_conf_file=$str_conf_file_1 + fi + fi elif [ $networkmanager_active -eq 2 ]; then + str_conf_file="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}" if [ $num_v4num -eq 0 ]; then echo "DEVICE=${str_if_name}" > $str_conf_file echo "BOOTPROTO=none" >> $str_conf_file @@ -169,6 +171,11 @@ function configipv4(){ echo "NETMASK$num_v4num=${str_v4mask}" >> $str_conf_file fi else + str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}" + #If using network service, the NIC alias device format is : like eth0:1 + if [ $num_v4num -ne 0 ]; then + str_if_name=${str_if_name}:${num_v4num} + fi echo "DEVICE=${str_if_name}" > $str_conf_file echo "BOOTPROTO=none" >> $str_conf_file echo "NM_CONTROLLED=no" >> $str_conf_file @@ -183,15 +190,6 @@ function configipv4(){ echo "MTU=${str_nic_mtu}" >> $str_conf_file fi fi - if [ $networkmanager_active -eq 1 ]; then - str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}-1" - if [ -f $str_conf_file_1 ]; then - grep -x "NAME=$con_name" $str_conf_file_1 >/dev/null 2>/dev/null - if [ $? -eq 0 ]; then - str_conf_file=$str_conf_file_1 - fi - fi - fi if [[ ${str_if_name} == [a-zA-Z0-9]*.[0-9]* ]]; then echo "VLAN=yes" >> $str_conf_file fi @@ -672,6 +670,13 @@ elif [ "$1" = "-s" ];then nmcli con modify $con_name connection.id $tmp_con_name fi nmcli con add type ethernet con-name $con_name ifname ${str_inst_nic} ipv4.method manual ipv4.addresses ${str_inst_ip}/${str_inst_prefix} connection.autoconnect-priority 9 + str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}-1" + if [ -f $str_conf_file_1 ]; then + grep $con_name $str_conf_file_1 >/dev/null 2>/dev/null + if [ $? -eq 0 ]; then + $str_conf_file=$str_conf_file_1 + fi + fi else echo "DEVICE=${str_inst_nic}" > $str_conf_file echo "IPADDR=${str_inst_ip}" >> $str_conf_file @@ -698,15 +703,6 @@ elif [ "$1" = "-s" ];then else echo "GATEWAY=${str_inst_gateway}" >> /etc/sysconfig/network fi - fi - if [ $networkmanager_active -eq 1 ]; then - str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}-1" - if [ -f $str_conf_file_1 ]; then - grep $con_name $str_conf_file_1 >/dev/null 2>/dev/null - if [ $? -eq 0 ]; then - $str_conf_file=$str_conf_file_1 - fi - fi fi #add extra params i=0 diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index 5916b00af..1389836cb 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -63,6 +63,7 @@ function get_nic_cfg_file_content { elif [ $is_debian -eq 1 ]; then cfg_file="$nwdir/${cfg_dev}" fi + #TODO:this is networkmanager_active=2 ps -ef|grep -v grep|grep NetworkManager >/dev/null 2>/dev/null if [ $? -eq 0 ]; then $ip address show dev ${cfg_dev}| $sed -e 's/^/[Ethernet] >> /g' | log_lines info @@ -562,16 +563,20 @@ function configure_nicdevice { #linux bridge type is bridge #openvswitch bridge type is bridge_ovs elif [ x"$nic_dev_type" = "xbridge_ovs" -o x"$nic_dev_type" = "xbridge" ]; then - if [ "$networkmanager_active" = "0" ]; then - ps -ef|grep -v grep|grep NetworkManager >/dev/null 2>/dev/null - nmcli_used=$? - check_brctl $nic_dev_type - if [ $? -ne 0 ] && [ $nmcli_used -ne 0 ]; then - errorcode=1 + ps -ef|grep -v grep|grep NetworkManager >/dev/null 2>/dev/null + nmcli_used=$? + if [ "$networkmanager_active" != "1" ]; then + if [ "$networkmanager_active" = "0" ]; then + check_brctl $nic_dev_type + if [ $? -ne 0 ]; then + errorcode=1 + else + create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type + if else create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type fi - elif [ "$networkmanager_active" = "1" ]; then + else create_bridge_interface_nmcli ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type _ipaddr=$ipaddrs fi if [ $? -ne 0 ]; then @@ -588,9 +593,9 @@ function configure_nicdevice { vlanname=`echo "$nic_dev" | $sed -e 's/^\(.*\)vla\?n\?\([0-9]\+\)$/\1/'` fi ipaddrs=$(find_nic_ips $nic_dev) - if [ "$networkmanager_active" = "0" ]; then + if [ "$networkmanager_active" != "1" ]; then create_vlan_interface ifname=$vlanname vlanid=$vlanid - elif [ "$networkmanager_active" = "1" ]; then + else create_vlan_interface_nmcli ifname=$vlanname vlanid=$vlanid ipaddrs=$ipaddrs next_nic=$is_mid_device fi if [ $? -ne 0 ]; then @@ -599,9 +604,9 @@ function configure_nicdevice { fi #configure bond elif [ x"$nic_dev_type" = "xbond" ]; then - if [ "$networkmanager_active" = "0" ]; then + if [ "$networkmanager_active" != "1" ]; then create_bond_interface ifname=$nic_dev slave_ports=$base_nic_for_bond slave_type=$base_nic_type - elif [ "$networkmanager_active" = "1" ]; then + else create_bond_interface_nmcli bondname=$nic_dev slave_ports=$base_nic_for_bond slave_type=$base_nic_type _ipaddr=$ipaddrs next_nic=$is_mid_device fi if [ $? -ne 0 ]; then @@ -658,13 +663,15 @@ if [ $boot_install_nic -eq 1 ];then fi #check if using NetworkManager or network service -networkmanager_active=2 +networkmanager_active=3 check_NetworkManager_or_network_service is_active=$? if [ $is_active -eq 0 ]; then networkmanager_active=0 elif [ $is_active -eq 1 ]; then networkmanager_active=1 +elif [ $is_active -eq 2 ]; then + networkmanager_active=2 else exit 1 fi From 34963827476a46dced4e82761311b8c3f1e17fff Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 11 Apr 2019 16:43:15 +0800 Subject: [PATCH 031/276] Add tar back to the diskless pkglist files --- xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist | 1 + xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist | 1 + xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist | 1 + xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist | 1 + 4 files changed, 4 insertions(+) diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist index 5919688df..f2d8cc2d7 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist @@ -5,6 +5,7 @@ net-tools nfs-utils openssh-server rsync +tar util-linux wget python3 diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist index 5919688df..f2d8cc2d7 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist @@ -5,6 +5,7 @@ net-tools nfs-utils openssh-server rsync +tar util-linux wget python3 diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist index de6dd02e5..6985b9585 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist @@ -5,6 +5,7 @@ net-tools nfs-utils openssh-server rsync +tar util-linux wget perl-DBD-MySQL diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist index de6dd02e5..6985b9585 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist @@ -5,6 +5,7 @@ net-tools nfs-utils openssh-server rsync +tar util-linux wget perl-DBD-MySQL From d8cb9b5b048d897d364d2ef9341383e16c4ca6bc Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 11 Apr 2019 04:48:33 -0400 Subject: [PATCH 032/276] reduce if/else times --- xCAT/postscripts/configib | 10 +++------- xCAT/postscripts/nicutils.sh | 5 +++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/xCAT/postscripts/configib b/xCAT/postscripts/configib index dee2b92c1..0d71a760d 100755 --- a/xCAT/postscripts/configib +++ b/xCAT/postscripts/configib @@ -533,7 +533,6 @@ IPV6ADDR=$nicip/$netmask" >> $dir/ifcfg-$nic echo "IPV6_DEFAULTGW=$gateway" >> $dir/ifcfg-$nic fi else # ipv4 address - cfgfile=$dir"/ifcfg-"$nic if [ $nmcli_used -eq 0 ]; then cfgfile=$dir"/ifcfg-"$nic":"$ipindex cfgcontent= "DEVICE=$nic:$ipindex @@ -541,15 +540,12 @@ NM_CONTROLLED=no BOOTPROTO=none ONBOOT=yes NETMASK=$netmask -IPADDR=$nicip -DEVICE=$nic:$ipindex" +IPADDR=$nicip" + echo "$cfgcontent" > $cfgfile else + cfgfile=$dir"/ifcfg-"$nic cfgcontent="NETMASK$ipindex=$netmask IPADDR$ipindex=$nicip" - fi - if [ $nmcli_used -eq 0 ]; then - echo "$cfgcontent" > $cfgfile - else echo "$cfgcontent" >> $cfgfile fi if [[ "$OSVER" == rhels6* ]] diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 660151c08..25462374b 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -1580,7 +1580,8 @@ function decode_arguments { ############################################################################### # # check NetworkManager -# output: 2 error +# output: 3 error +# 2 using NetworkManager but service(systemctl) can not used, this happens in RH8 postscripts # 1 using NetworkManager # 0 using network # @@ -1601,7 +1602,7 @@ function check_NetworkManager_or_network_service() { #In RH8 postscripts stage, nmcli can not modify persistent configure file ps -ef|grep -v grep|grep NetworkManager >/dev/null 2>/dev/null if [ $? -eq 0 ]; then - return 0 + return 2 fi checkservicestatus network > /dev/null 2>/dev/null || checkservicestatus wicked > /dev/null 2>/dev/null if [ $? -eq 0 ]; then From 3f4c7431c5fd594a1c2bfc52ad87239351ab3ab9 Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 11 Apr 2019 05:07:50 -0400 Subject: [PATCH 033/276] polished --- xCAT/postscripts/configib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/postscripts/configib b/xCAT/postscripts/configib index 0d71a760d..552a35454 100755 --- a/xCAT/postscripts/configib +++ b/xCAT/postscripts/configib @@ -553,7 +553,7 @@ IPADDR$ipindex=$nicip" #get prefix from netmask, this is for IPv4 only prefix=24 prefix=$(convert_netmask_to_cidr $netmask) - echo "PREFIX=$prefix" >> $dir/ifcfg-$nic:$ipindex + echo "PREFIX=$prefix" >> $cfgfile else echo "$nicnetmask" >> $cfgfile fi From 6d549c1fdd2910e8642dfc45c3875be5a16c4b1a Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 4 Apr 2019 17:13:59 +0800 Subject: [PATCH 034/276] Get disk size of install disk --- .../share/xcat/install/scripts/pre.rhels8 | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/xCAT-server/share/xcat/install/scripts/pre.rhels8 b/xCAT-server/share/xcat/install/scripts/pre.rhels8 index 66abd34db..11a9ee9d7 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/pre.rhels8 @@ -206,6 +206,26 @@ base64decode() done } +getdisksize() +{ + local disk="$1" + + local blah + local blocks + local name + + while read -r blah blah blocks name + do + if [ "${name}" = "${disk}" ] + then + echo "${blocks}" + break + fi + done >/tmp/partitionfile fi +DISKSIZE="$(getdisksize "${instdisk}")" + # TODO: Ondisk detection, /dev/disk/by-id/edd-int13_dev80 for legacy maybe, and no idea about efi. At least maybe blacklist SAN if mptsas/mpt2sas/megaraid_sas seen... echo "part /boot --fstype=$BOOTFSTYPE --asprimary --ondisk=$instdisk --size=512" >>/tmp/partitionfile echo "part pv.000997 --grow --asprimary --ondisk=$instdisk --size=18432" >>/tmp/partitionfile From 2e726e81a94d4715c296c406486c2011e6f4c04c Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Mon, 8 Apr 2019 13:48:49 +0800 Subject: [PATCH 035/276] A new partition scheme for RHEL 8 compute node --- .../share/xcat/install/scripts/pre.rhels8 | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/pre.rhels8 b/xCAT-server/share/xcat/install/scripts/pre.rhels8 index 11a9ee9d7..115a2e6b0 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/pre.rhels8 @@ -206,10 +206,14 @@ base64decode() done } +# $1 - The device name, eg., sda +# Returns the device size, unit is KB. getdisksize() { local disk="$1" + [ -z "${disk}" ] && return + local blah local blocks local name @@ -265,15 +269,21 @@ fi DISKSIZE="$(getdisksize "${instdisk}")" # TODO: Ondisk detection, /dev/disk/by-id/edd-int13_dev80 for legacy maybe, and no idea about efi. At least maybe blacklist SAN if mptsas/mpt2sas/megaraid_sas seen... -echo "part /boot --fstype=$BOOTFSTYPE --asprimary --ondisk=$instdisk --size=512" >>/tmp/partitionfile +echo "part /boot --fstype=$BOOTFSTYPE --asprimary --ondisk=$instdisk --size=1024" >>/tmp/partitionfile echo "part pv.000997 --grow --asprimary --ondisk=$instdisk --size=18432" >>/tmp/partitionfile echo "volgroup xcatvg --pesize=4096 pv.000997" >>/tmp/partitionfile -echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg --grow --size=4096 --maxsize=20480" >>/tmp/partitionfile -echo "logvol /var --fstype=$FSTYPE --name=var --vgname=xcatvg --grow --size=2048 --maxsize=8192" >>/tmp/partitionfile -echo "logvol /tmp --fstype=$FSTYPE --name=tmp --vgname=xcatvg --grow --size=1024 --maxsize=4096" >>/tmp/partitionfile -echo "logvol /home --fstype=$FSTYPE --name=home --vgname=xcatvg --grow --percent=10 --maxsize=10240" >>/tmp/partitionfile echo "logvol swap --name=swap --vgname=xcatvg --recommended" >>/tmp/partitionfile +if [ "${DISKSIZE} -lt "62914560" ] +then + echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg --grow --size=10240 --percent=85" >>/tmp/partitionfile +else + echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg --grow --size=10240 --maxsize=20480" >>/tmp/partitionfile + echo "logvol /var --fstype=$FSTYPE --name=var --vgname=xcatvg --grow --size=4096 --maxsize=8192" >>/tmp/partitionfile + echo "logvol /tmp --fstype=$FSTYPE --name=tmp --vgname=xcatvg --grow --size=4096 --maxsize=8192" >>/tmp/partitionfile + echo "logvol /home --fstype=$FSTYPE --name=home --vgname=xcatvg --grow --percent=10 --size=1024 --maxsize=10240" >>/tmp/partitionfile +fi + # Specify "bootloader" configuration in "/tmp/partitionfile" if there is no user customized partition file BOOTLOADER="bootloader" From a62468da3448e6a9bf4967d1a1375001b5209d90 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 9 Apr 2019 11:15:32 +0800 Subject: [PATCH 036/276] Patch pre.rhels8 --- xCAT-server/share/xcat/install/scripts/pre.rhels8 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/pre.rhels8 b/xCAT-server/share/xcat/install/scripts/pre.rhels8 index 115a2e6b0..4cb204623 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/pre.rhels8 @@ -212,6 +212,8 @@ getdisksize() { local disk="$1" + disk="${disk#/dev/}" + [ -z "${disk}" ] && return local blah @@ -274,14 +276,14 @@ echo "part pv.000997 --grow --asprimary --ondisk=$instdisk --size=18432" >>/tmp/ echo "volgroup xcatvg --pesize=4096 pv.000997" >>/tmp/partitionfile echo "logvol swap --name=swap --vgname=xcatvg --recommended" >>/tmp/partitionfile -if [ "${DISKSIZE} -lt "62914560" ] +if [ "${DISKSIZE}" -lt "62914560" ] then - echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg --grow --size=10240 --percent=85" >>/tmp/partitionfile + echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg --grow --percent=86" >>/tmp/partitionfile else echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg --grow --size=10240 --maxsize=20480" >>/tmp/partitionfile echo "logvol /var --fstype=$FSTYPE --name=var --vgname=xcatvg --grow --size=4096 --maxsize=8192" >>/tmp/partitionfile echo "logvol /tmp --fstype=$FSTYPE --name=tmp --vgname=xcatvg --grow --size=4096 --maxsize=8192" >>/tmp/partitionfile - echo "logvol /home --fstype=$FSTYPE --name=home --vgname=xcatvg --grow --percent=10 --size=1024 --maxsize=10240" >>/tmp/partitionfile + echo "logvol /home --fstype=$FSTYPE --name=home --vgname=xcatvg --grow --percent=10 --maxsize=10240" >>/tmp/partitionfile fi # Specify "bootloader" configuration in "/tmp/partitionfile" if there is no user customized partition file From a3cf49f4c54f450658ea340c550c4a79b571b730 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 11 Apr 2019 15:30:25 -0400 Subject: [PATCH 037/276] Replace the README.rst with a Markdown file, add badges for documentation status --- README.md | 25 +++++++++++++++++++++++++ README.rst | 26 -------------------------- 2 files changed, 25 insertions(+), 26 deletions(-) create mode 100644 README.md delete mode 100644 README.rst diff --git a/README.md b/README.md new file mode 100644 index 000000000..099daf883 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# xCAT + +xCAT is a toolkit for deployment and administration of clusters of all sizes. + +# Documentation + +xCAT Documentation is hosted on Read The Docs: https://xcat-docs.readthedocs.io + +## Status + +| xCAT Version | Build Status | +|---|---| +| Latest (master branch) | [![Documentation Status](https://readthedocs.org/projects/xcat-docs/badge/?version=latest)](https://xcat-docs.readthedocs.io/en/latest/) | +| Stable (latest release) | [![Documentation Status](https://readthedocs.org/projects/xcat-docs/badge/?version=stable)](https://xcat-docs.readthedocs.io/en/stable/) | + +Looking for [older versions](https://readthedocs.org/projects/xcat-docs/versions/)? + +# Open Source License + +xCAT is made available under the EPL license: https://opensource.org/licenses/eclipse-1.0.php + +# Developers + +Want to help? Check out the [developers guide](http://xcat-docs.readthedocs.io/en/latest/developers)! + diff --git a/README.rst b/README.rst deleted file mode 100644 index 36d9cfc0c..000000000 --- a/README.rst +++ /dev/null @@ -1,26 +0,0 @@ -xCAT ----- - -xCAT is a toolkit for the deployment and administration of clusters. - -Documentation -------------- - -`The stable documentation of xCAT `_ - -`The latest documentation of xCAT `_ - -`The documentation of xCAT each release `_ - - -Open Source License -------------------- - -xCAT is made available as open source software under the EPL license: -http://www.opensource.org/licenses/eclipse-1.0.php - -Developers ----------- - -Developers and prospective contributors are encouraged to read the `Developers Guide `_ -In particular the `GitHub `_ related subsection. From 8251a32bdb37609943117d7f070e137626d64ae2 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 11 Apr 2019 15:34:32 -0400 Subject: [PATCH 038/276] Update the README under the docs directory --- docs/README.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/README.md b/docs/README.md index 8b4779eaf..c15ea02a1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,14 +1,12 @@ # Welcome to the xCAT documentation -The latest docs are here: http://xcat-docs.readthedocs.io/en/latest/ +The xCAT docs are hosted here: https://xcat-docs.readthedocs.io/ and are written in reStructuredText (`.rst`). -The documentation project is written in restructured text (.rst) using Sphinx and hosted on ReadTheDocs. +## Building docs locally -## Building Documentation +* Clone this project -* Clone the project - -* Using pip, install or update sphinx (See: http://pip.readthedocs.org/) +* Install or update sphinx (See: https://pip.readthedocs.io/) ``` pip install sphinx ``` @@ -17,15 +15,15 @@ The documentation project is written in restructured text (.rst) using Sphinx an pip install sphinx --upgrade ``` -* Using pip, install ReadTheDocs theme +* Install ReadTheDocs theme ``` pip install sphinx_rtd_theme ``` * Build the Docs ``` - cd xcat-core/docs - make html + cd xcat-core/docs + make html ``` -* View the docs by opening index.html from a web browser under xcat-core/docs/build/html/index.html +* View the documentation by pointing a browser to: `xcat-core/docs/build/html/index.html` From f4d291954b38ab45299bd4cd17b47408dd752c9a Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 11 Apr 2019 15:35:54 -0400 Subject: [PATCH 039/276] Some additional formatting in the README --- docs/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/README.md b/docs/README.md index c15ea02a1..3c105885e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,17 +2,17 @@ The xCAT docs are hosted here: https://xcat-docs.readthedocs.io/ and are written in reStructuredText (`.rst`). -## Building docs locally +## Building Docs * Clone this project * Install or update sphinx (See: https://pip.readthedocs.io/) ``` - pip install sphinx + pip install sphinx ``` or ``` - pip install sphinx --upgrade + pip install sphinx --upgrade ``` * Install ReadTheDocs theme From 8e343110c7fc0da692b83532277a40aecc3ad17c Mon Sep 17 00:00:00 2001 From: bybai Date: Fri, 12 Apr 2019 02:29:23 -0400 Subject: [PATCH 040/276] polishe --- xCAT/postscripts/configeth | 2 +- xCAT/postscripts/confignetwork | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 6e540fe4e..98807699e 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -171,11 +171,11 @@ function configipv4(){ echo "NETMASK$num_v4num=${str_v4mask}" >> $str_conf_file fi else - str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}" #If using network service, the NIC alias device format is : like eth0:1 if [ $num_v4num -ne 0 ]; then str_if_name=${str_if_name}:${num_v4num} fi + str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}" echo "DEVICE=${str_if_name}" > $str_conf_file echo "BOOTPROTO=none" >> $str_conf_file echo "NM_CONTROLLED=no" >> $str_conf_file diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index 1389836cb..9f96a4bda 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -563,8 +563,6 @@ function configure_nicdevice { #linux bridge type is bridge #openvswitch bridge type is bridge_ovs elif [ x"$nic_dev_type" = "xbridge_ovs" -o x"$nic_dev_type" = "xbridge" ]; then - ps -ef|grep -v grep|grep NetworkManager >/dev/null 2>/dev/null - nmcli_used=$? if [ "$networkmanager_active" != "1" ]; then if [ "$networkmanager_active" = "0" ]; then check_brctl $nic_dev_type @@ -572,7 +570,7 @@ function configure_nicdevice { errorcode=1 else create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type - if + fi else create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type fi From d92f45a906868d4be0f9cbfb7b64668ed8f31b87 Mon Sep 17 00:00:00 2001 From: bybai Date: Fri, 12 Apr 2019 03:04:10 -0400 Subject: [PATCH 041/276] polished --- xCAT/postscripts/confignetwork | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index 9f96a4bda..232d9890d 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -563,17 +563,15 @@ function configure_nicdevice { #linux bridge type is bridge #openvswitch bridge type is bridge_ovs elif [ x"$nic_dev_type" = "xbridge_ovs" -o x"$nic_dev_type" = "xbridge" ]; then - if [ "$networkmanager_active" != "1" ]; then - if [ "$networkmanager_active" = "0" ]; then - check_brctl $nic_dev_type - if [ $? -ne 0 ]; then - errorcode=1 - else - create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type - fi + if [ "$networkmanager_active" = "0" ]; then + check_brctl $nic_dev_type + if [ $? -ne 0 ]; then + errorcode=1 else create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type fi + elif [ "$networkmanager_active" = "2" ]; then + create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type else create_bridge_interface_nmcli ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type _ipaddr=$ipaddrs fi From 46914b45ac7108c69e9eb2af9e4ec72f183bff11 Mon Sep 17 00:00:00 2001 From: litingt Date: Fri, 12 Apr 2019 04:23:25 -0400 Subject: [PATCH 042/276] update according to comments --- xCAT-test/autotest/testcase/rspconfig/cases1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/rspconfig/cases1 b/xCAT-test/autotest/testcase/rspconfig/cases1 index 9224d8873..f4155714d 100644 --- a/xCAT-test/autotest/testcase/rspconfig/cases1 +++ b/xCAT-test/autotest/testcase/rspconfig/cases1 @@ -113,7 +113,7 @@ cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;rspconfig $$CN d check:rc == 0 cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;grep "Downloading dump $dumpnumber to /var/log/xcat/dump/" /tmp/dumpdown check:rc == 0 -cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`rspconfig $$CN dump -l |grep "\[$dumpnumber\] Generated" |cut -d : -f 6`;if lsdef service > /dev/null 2>&1; then xdsh $$SN ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize;else ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize;fi +cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`rspconfig $$CN dump -l |grep "\[$dumpnumber\] Generated" |cut -d : -f 6`;sn=`lsdef $$CN -i servicenode -c | awk -F '=' '{print $2}'`;if [[ -z "$sn" ]]; then ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize;else xdsh $sn ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize;fi check:rc == 0 cmd:rspconfig $$CN dump -g |tee /tmp/dumpgenerate check:rc == 0 @@ -123,7 +123,7 @@ cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;rspconfig $$CN d check:rc == 0 cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;grep "Downloading dump $dumpnumber to /var/log/xcat/dump/" /tmp/dumpdown check:rc == 0 -cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`rspconfig $$CN dump -l |grep "\[$dumpnumber\] Generated" |cut -d : -f 6`;if lsdef service > /dev/null 2>&1; then xdsh $$SN ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize;else ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize;fi +cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`rspconfig $$CN dump -l |grep "\[$dumpnumber\] Generated" |cut -d : -f 6`;sn=`lsdef $$CN -i servicenode -c | awk -F '=' '{print $2}'`;if [[ -z "$sn" ]]; then ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize;else xdsh $sn ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize;fi check:rc == 0 cmd:rspconfig $$CN dump -d all check:rc == 0 @@ -145,7 +145,7 @@ check:output =~$$CN:\s*Dump requested check:output =~$$CN:\s*Downloading dump cmd:rspconfig $$CN dump -l |tail -n 1 |tee /tmp/dumpgenerate check:rc == 0 -cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`grep "\[$dumpnumber\] Generated" /tmp/dumpgenerate |cut -d : -f 6`;if lsdef service > /dev/null 2>&1; then xdsh $$SN ls -l /var/log/xcat/dump/*_dump_$dumpnumber.tar.xz|grep $dumpsize|grep $$CN;else ls -l /var/log/xcat/dump/*_dump_$dumpnumber.tar.xz|grep $dumpsize|grep $$CN;fi +cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`grep "\[$dumpnumber\] Generated" /tmp/dumpgenerate |cut -d : -f 6`;sn=`lsdef $$CN -i servicenode -c | awk -F '=' '{print $2}'`;if [[ -z "$sn" ]]; then ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize|grep $$CN;else xdsh $sn ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize|grep $$CN;fi check:rc == 0 cmd:rm -rf /tmp/dumpgenerate end From ac6f514ca9a7d4ee26dc297f1561aaff78d5ee11 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 12 Apr 2019 13:24:49 -0400 Subject: [PATCH 043/276] Undo verify packaging command PR 6216 --- xCAT-server/share/xcat/netboot/sles/genimage | 6 ------ xCAT-server/share/xcat/netboot/ubuntu/genimage | 4 ---- 2 files changed, 10 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 5f7f528a8..5e241ea7d 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -255,12 +255,6 @@ unless ($onlyinitrd) { my $non_interactive; if (!$prompt) { $non_interactive = "--non-interactive --no-gpg-checks --gpg-auto-import-keys"; } - my $zypper_cmd = "zypper"; - if (! -x $zypper_cmd) { - print "Can not execute $zypper_cmd command. Make sure you are running on SUSE based system"; - exit 1; - } - if ($osver_host >= 11) { #zypper in SLES11 is different system("rm -rf $rootimg_dir/etc/zypp/repos.d/$osver-*.repo"); diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index e8f490bd8..3bf94808f 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -333,10 +333,6 @@ unless ($onlyinitrd) { } } - if (! -x $aptcmd1) { - print "Error: Can not execute $aptcmd1 command. Make sure you are running on a Debian based system.\n"; - exit 1; - } print "Run cmd [$aptcmd1 $aptcmd2] to create rootimage bootstraps\n"; my $rc = system("$aptcmd1 $aptcmd2"); if ($rc) { From 428483035f92dce1791aed70388847fc553eb73c Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 16 Apr 2019 14:41:08 +0800 Subject: [PATCH 044/276] Only pass "--compress" argument to dracut when ($dracutver > "033") --- xCAT-server/share/xcat/netboot/rh/genimage | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 6a1ee4d50..da8e4117e 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -1150,15 +1150,15 @@ sub mkinitrd_dracut { # force the dracut run in non-hostonly mode for dracut higher than version 033 if ($dracutver > "033") { $additional_options .= " -N"; - } - #if "pigz" is available in the rootimg, use "pigz" instead of "gzip" - my $compress = qx(chroot $rootimg_dir bash -c "type -p pigz"|tr -d "\n"); - if ($compress) { + #if "pigz" is available in the rootimg, use "pigz" instead of "gzip" + my $compress = qx(chroot $rootimg_dir bash -c "type -p pigz"|tr -d "\n"); + if ($compress) { - #take the online cpu numerber as the pigz processes number - my $processnum = qx(lscpu -p=cpu --online|grep -v '#'|wc -l|tr -d "\n"); - $additional_options .= " --compress \"$compress -p $processnum \""; + #take the online cpu numerber as the pigz processes number + my $processnum = qx(lscpu -p=cpu --online|grep -v '#'|wc -l|tr -d "\n"); + $additional_options .= " --compress \"$compress -p $processnum \""; + } } print "\nchroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver\n"; From b9636cf2faaf8b033697fe88deea0f17377d54e4 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 16 Apr 2019 15:22:39 +0800 Subject: [PATCH 045/276] Change the document for github issue #6224 --- .../common/deployment/acc_initrd_rootimg_gen.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst index 635905e82..f0056b03a 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst @@ -20,7 +20,7 @@ The parallel compression tool ``pigz`` can be enabled by installing ``pigz`` pac Refer to the http://fedoraproject.org/wiki/EPEL for more details on EPEL - 1) Enabling the ``pigz`` in ``genimage`` (only supported in RHELS6 or above) + 1) Enabling the ``pigz`` in ``genimage`` (only supported in RHEL 7 or above) ``pigz`` should be installed in the diskless rootimg. Download ``pigz`` package from https://dl.fedoraproject.org/pub/epel/ , then customize the diskless osimage to install ``pigz`` as the additional packages, see :doc:`Install Additional Other Packages` for more details. From 2df0f3f36bc5c4576e88d2a6b3544df42843a118 Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 17 Apr 2019 03:01:59 -0400 Subject: [PATCH 046/276] update cases to apply in docker container --- xCAT-test/autotest/testcase/makedns/cases0 | 10 ++++------ xCAT-test/autotest/testcase/makehosts/cases0 | 17 +++++++++++------ xCAT-test/autotest/testcase/nodeset/cases0 | 7 +++++-- xCAT-test/autotest/testcase/passwd/case0 | 2 +- xCAT-test/autotest/testcase/psh/cases0 | 7 ++++--- 5 files changed, 25 insertions(+), 18 deletions(-) diff --git a/xCAT-test/autotest/testcase/makedns/cases0 b/xCAT-test/autotest/testcase/makedns/cases0 index 117e86d83..c5c3e8bfd 100644 --- a/xCAT-test/autotest/testcase/makedns/cases0 +++ b/xCAT-test/autotest/testcase/makedns/cases0 @@ -123,10 +123,9 @@ check:output~=zone "100.100.100.IN-ADDR.ARPA." cmd:nslookup dnstestnode $$MN check:output~=Server: $$MN check:output!~(server can't find dnstestnode) -cmd:rm -f /etc/hosts -check:rc==0 -cmd:mv /etc/hosts.testbak /etc/hosts +cmd:yes|cp -rf /etc/hosts.testbak /etc/hosts check:rc==0 +cmd:rm -rf /etc/hosts.testbak cmd:chtab -d netname=testnetwork networks check:rc==0 cmd:makedns -n @@ -169,10 +168,9 @@ check:rc==0 check:output~= cmd:rm -f /tmp/makedns_named_conf.org /tmp/makedns_named_conf.new check:rc==0 -cmd:rm -f /etc/hosts -check:rc==0 -cmd:mv /etc/hosts.testbak /etc/hosts +cmd:yes|cp -rf /etc/hosts.testbak /etc/hosts check:rc==0 +cmd:rm -rf /etc/hosts.testbak cmd:chtab -d netname=testnetwork networks check:rc==0 cmd:makedns -n diff --git a/xCAT-test/autotest/testcase/makehosts/cases0 b/xCAT-test/autotest/testcase/makehosts/cases0 index 4f5050142..acdc1a4b6 100644 --- a/xCAT-test/autotest/testcase/makehosts/cases0 +++ b/xCAT-test/autotest/testcase/makehosts/cases0 @@ -141,7 +141,10 @@ start:makehost_n_r label:mn_only,dns,wait_fix descriptions:modify makehosts testcases according to special node name eg:s01 and s01r* . for issue #2717 and #2683 cmd:cp -f /etc/hosts /etc/hosts.xcatbakautotest -cmd:sed -i '/s01/d' /etc/hosts +cmd:cp -f /etc/hosts /etc/hosts.bak +cmd:sed -i '/s01/d' /etc/hosts.xcatbakautotest +cmd:sed -i '/s01r1b01/d' /etc/hosts.xcatbakautotest +cmd:yes|cp -rf /etc/hosts.xcatbakautotest /etc/hosts cmd:cat /etc/hosts cmd:lsdef s01;if [ $? -eq 0 ]; then lsdef -l s01 -z >/tmp/s01.standa ;rmdef s01;fi check:rc==0 @@ -168,7 +171,7 @@ else exit 1 fi check:rc==0 -cmd:sed -i '/s01/d' /etc/hosts +cmd:yes|cp -rf /etc/hosts.xcatbakautotest /etc/hosts cmd:makehosts s01 check:rc==0 cmd:#!/bin/bash @@ -187,7 +190,8 @@ else exit 1 fi check:rc==0 -cmd:sed -i '/s01/d' /etc/hosts +cmd:cat /etc/hosts +cmd:yes|cp -rf /etc/hosts.xcatbakautotest /etc/hosts cmd:makehosts service check:rc==0 cmd:#!/bin/bash @@ -221,7 +225,7 @@ for i in {1..5}; do done exit 1 check:rc==0 -cmd:sed -i '/s01/d' /etc/hosts +cmd:yes|cp -rf /etc/hosts.xcatbakautotest /etc/hosts cmd:domain=$(lsdef -t site -i domain -c |awk -F'=' '{print $2}'); echo "70.2.0.254 s01 s01.$domain" >> /etc/hosts; echo "80.2.0.254 s01r1b01 s01r1b01.$domain" >> /etc/hosts check:rc==0 cmd:grep "s01" /etc/hosts @@ -241,7 +245,7 @@ for i in {1..5}; do done exit 1 check:rc==0 -cmd:sed -i '/s01/d' /etc/hosts +cmd:yes|cp -rf /etc/hosts.xcatbakautotest /etc/hosts cmd:domain=$(lsdef -t site -i domain -c |awk -F'=' '{print $2}'); echo "70.2.0.254 s01 s01.$domain" >> /etc/hosts; echo "80.2.0.254 s01r1b01 s01r1b01.$domain" >> /etc/hosts check:rc==0 cmd:grep "s01" /etc/hosts @@ -265,7 +269,8 @@ cmd:if [ -e /tmp/s01.standa ]; then rmdef s01; cat /tmp/s01.standa | mkdef -z; r check:rc==0 cmd:if [ -e /tmp/s01r1b01.standa ]; then rmdef s01r1b01; cat /tmp/s01r1b01.standa | mkdef -z; rm -rf /tmp/s01r1b01.standa;else rmdef s01r1b01; fi check:rc==0 -cmd:mv -f /etc/hosts.xcatbakautotest /etc/hosts +cmd:yes|cp -rf /etc/hosts.bak /etc/hosts +cmd:rm -rf /etc/hosts.bak /etc/hosts.xcatbakautotest end start:makehosts_regex diff --git a/xCAT-test/autotest/testcase/nodeset/cases0 b/xCAT-test/autotest/testcase/nodeset/cases0 index de7aa775e..3550b3a22 100644 --- a/xCAT-test/autotest/testcase/nodeset/cases0 +++ b/xCAT-test/autotest/testcase/nodeset/cases0 @@ -286,6 +286,7 @@ cmd:lsdef testnode1 > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef testnode1 -z cmd:rm -f /tftpboot/petitboot/testnode1 cmd:mkdef -t node -o testnode1 arch=ppc64le cons=bmc groups=ipmi ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=ipmi profile=compute os=rhels7.99 check:rc==0 +cmd:cp -f /etc/hosts /etc/hosts.bak cmd:cp -f /etc/hosts /etc/hosts.xcattestbak cmd:echo "10.1.1.200 testnode1" >> /etc/hosts cmd:makedns -n @@ -311,7 +312,8 @@ check:rc!=0 #check:rc!=0 cmd:chdef -t node -o testnode1 ip= check:rc==0 -cmd:sed -i /testnode1/d /etc/hosts +cmd:sed -i /testnode1/d /etc/hosts.xcattestbak +cmd:yes|cp -rf /etc/hosts.xcattestbak /etc/hosts cmd:getent hosts testnode1 | grep testnode1 check:rc!=0 cmd:nodeset testnode1 osimage=rhels7.99-ppc64le-install-compute @@ -319,8 +321,9 @@ check:rc!=0 cmd:noderm testnode1 cmd:rmdef -t osimage -o "rhels7.99-ppc64le-install-compute" cmd:rm -rf /install/rhels7.99 -cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:yes|cp -f /etc/hosts.bak /etc/hosts cmd:if [[ -e /tmp/testnode1.stanza ]]; then cat /tmp/testnode1.stanza |mkdef -z -f;rm -rf /tmp/testnode1.stanza;fi +cmd:rm -rf /etc/hosts.xcattestbak /etc/hosts.bak end start:nodeset_yaboot diff --git a/xCAT-test/autotest/testcase/passwd/case0 b/xCAT-test/autotest/testcase/passwd/case0 index 2b36461f2..1c26e5133 100644 --- a/xCAT-test/autotest/testcase/passwd/case0 +++ b/xCAT-test/autotest/testcase/passwd/case0 @@ -235,7 +235,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then if [ ! -e /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot/initrd.gz ]; then copycds $$ISO;mkdir -p /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot/;touch /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot/initrd.gz;fi;fi cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 -cmd:if grep SUSE /etc/*release;then grep '\$1\$' /install/autoinst/$$CN | awk 'gsub(/^ *| *$/,"")'| awk -v head="" -v tail="" '{print substr($0, index($0,head)+length(head),index($0,tail)-index($0,head)-length(head))}' > /tmp/instcryptedpasswd; elif grep "Red Hat" /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd; elif grep Ubuntu /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $4}' > /tmp/instcryptedpasswd;else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then grep '\$1\$' /install/autoinst/$$CN | awk 'gsub(/^ *| *$/,"")'| awk -v head="" -v tail="" '{print substr($0, index($0,head)+length(head),index($0,tail)-index($0,head)-length(head))}' > /tmp/instcryptedpasswd; elif grep "Red Hat" /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd; elif grep Ubuntu /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $4}' > /tmp/instcryptedpasswd;elif grep "CentOS Linux" /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd;else echo "Sorry,this is not supported os"; fi #cmd:grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd check:rc==0 cmd:diff /tmp/tmpcryptedpasswd /tmp/instcryptedpasswd diff --git a/xCAT-test/autotest/testcase/psh/cases0 b/xCAT-test/autotest/testcase/psh/cases0 index a015f6333..a998cbfeb 100644 --- a/xCAT-test/autotest/testcase/psh/cases0 +++ b/xCAT-test/autotest/testcase/psh/cases0 @@ -54,14 +54,15 @@ description: psh -i interface CN 'uptime' in linux label:others,parallel_cmds os:Linux cmd:cp /etc/hosts /etc/hostsBK +cmd:cp /etc/hosts /etc/hosts.bak check:rc==0 cmd:grep $$CN /etc/hosts -cmd:interface=`xdsh $$CN 'ip route' | awk '/default/ { for (i = 1; i <= NF; ++i) if ("dev" == $i) { print $(i + 1) ; exit } }'`; echo "interface=$interface"; sed -i "/$$CN/s/$/ $$CN-$interface/g" '/etc/hosts';psh -i $interface $$CN 'uptime' +cmd:interface=`xdsh $$CN 'ip route' | awk '/default/ { for (i = 1; i <= NF; ++i) if ("dev" == $i) { print $(i + 1) ; exit } }'`; echo "interface=$interface"; sed -i "/$$CN/s/$/ $$CN-$interface/g" '/etc/hostsBK';yes|cp -rf /etc/hostsBK /etc/hosts;psh -i $interface $$CN 'uptime' check:output=~$$CN check:rc==0 cmd:grep $$CN /etc/hosts -cmd:rm -rf /etc/hosts -cmd:cp /etc/hostsBK /etc/hosts +cmd:yes|cp -rf /etc/hosts.bak /etc/hosts check:rc==0 +cmd:rm -rf /etc/hostsBK /etc/hosts.bak end From a1ec58c5ba8c9f597a881fa06efd8bd73087fd00 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 17 Apr 2019 10:26:50 +0800 Subject: [PATCH 047/276] Add function base64decode() into file pre.pkvm3 --- .../share/xcat/install/scripts/pre.pkvm3 | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/xCAT-server/share/xcat/install/scripts/pre.pkvm3 b/xCAT-server/share/xcat/install/scripts/pre.pkvm3 index 66ae40551..30c620266 100755 --- a/xCAT-server/share/xcat/install/scripts/pre.pkvm3 +++ b/xCAT-server/share/xcat/install/scripts/pre.pkvm3 @@ -7,6 +7,64 @@ if [ "$XCATDEBUGMODE" = "2" ]; then echo 'root:cluster' | chpasswd fi +base64decode() +{ + h0="0"; h1="1"; h2="2"; h3="3"; h4="4"; h5="5"; h6="6"; h7="7"; + h8="8"; h9="9"; h10="A"; h11="B"; h12="C"; h13="D"; h14="E"; h15="F"; + + while : + do + i=0 + while [ "$i" -lt 4 ] + do + read -n 1 c || return + + case "${c}" in + "A") d=0 ;; "B") d=1 ;; "C") d=2 ;; "D") d=3 ;; + "E") d=4 ;; "F") d=5 ;; "G") d=6 ;; "H") d=7 ;; + "I") d=8 ;; "J") d=9 ;; "K") d=10 ;; "L") d=11 ;; + "M") d=12 ;; "N") d=13 ;; "O") d=14 ;; "P") d=15 ;; + "Q") d=16 ;; "R") d=17 ;; "S") d=18 ;; "T") d=19 ;; + "U") d=20 ;; "V") d=21 ;; "W") d=22 ;; "X") d=23 ;; + "Y") d=24 ;; "Z") d=25 ;; "a") d=26 ;; "b") d=27 ;; + "c") d=28 ;; "d") d=29 ;; "e") d=30 ;; "f") d=31 ;; + "g") d=32 ;; "h") d=33 ;; "i") d=34 ;; "j") d=35 ;; + "k") d=36 ;; "l") d=37 ;; "m") d=38 ;; "n") d=39 ;; + "o") d=40 ;; "p") d=41 ;; "q") d=42 ;; "r") d=43 ;; + "s") d=44 ;; "t") d=45 ;; "u") d=46 ;; "v") d=47 ;; + "w") d=48 ;; "x") d=49 ;; "y") d=50 ;; "z") d=51 ;; + "0") d=52 ;; "1") d=53 ;; "2") d=54 ;; "3") d=55 ;; + "4") d=56 ;; "5") d=57 ;; "6") d=58 ;; "7") d=59 ;; + "8") d=60 ;; "9") d=61 ;; "+") d=62 ;; "/") d=63 ;; + "=") d=0 ;; + *) continue ;; + esac + + eval "a${i}=${c}" + eval "b${i}=${d}" + + i=$(( i + 1 )) + done + + o0=$(( ((b0 << 2) | (b1 >> 4)) & 0xff )) + o1=$(( ((b1 << 4) | (b2 >> 2)) & 0xff )) + o2=$(( ((b2 << 6) | b3) & 0xff )) + + [ "${a2}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\"" && + return + [ "${a3}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\"" && + return + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\\x\${h$(( o2 / 16 ))}\${h$(( o2 % 16 ))}\"" + done +} + #find first available block device (sda or vda likely) #TODO: pick a likely non-SAN target if possible From 773ff1b7bf018e678e359111c458bda5f4eca970 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 17 Apr 2019 10:26:50 +0800 Subject: [PATCH 048/276] Add function base64decode() into file pre.rh --- xCAT-server/share/xcat/install/scripts/pre.rh | 58 ++++++++++++++++++- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh b/xCAT-server/share/xcat/install/scripts/pre.rh index fd84bb2b8..99eeaacee 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rh +++ b/xCAT-server/share/xcat/install/scripts/pre.rh @@ -177,11 +177,65 @@ if [ -z "$NODESTATUS" ] || [ "$NODESTATUS" != "0" -a "$NODESTATUS" != "N" -a /tmp/baz.py "installstatus installing" & fi - - /tmp/foo.py >/foo.log 2>&1 & +base64decode() +{ + h0="0"; h1="1"; h2="2"; h3="3"; h4="4"; h5="5"; h6="6"; h7="7"; + h8="8"; h9="9"; h10="A"; h11="B"; h12="C"; h13="D"; h14="E"; h15="F"; + while : + do + i=0 + while [ "$i" -lt 4 ] + do + read -n 1 c || return + + case "${c}" in + "A") d=0 ;; "B") d=1 ;; "C") d=2 ;; "D") d=3 ;; + "E") d=4 ;; "F") d=5 ;; "G") d=6 ;; "H") d=7 ;; + "I") d=8 ;; "J") d=9 ;; "K") d=10 ;; "L") d=11 ;; + "M") d=12 ;; "N") d=13 ;; "O") d=14 ;; "P") d=15 ;; + "Q") d=16 ;; "R") d=17 ;; "S") d=18 ;; "T") d=19 ;; + "U") d=20 ;; "V") d=21 ;; "W") d=22 ;; "X") d=23 ;; + "Y") d=24 ;; "Z") d=25 ;; "a") d=26 ;; "b") d=27 ;; + "c") d=28 ;; "d") d=29 ;; "e") d=30 ;; "f") d=31 ;; + "g") d=32 ;; "h") d=33 ;; "i") d=34 ;; "j") d=35 ;; + "k") d=36 ;; "l") d=37 ;; "m") d=38 ;; "n") d=39 ;; + "o") d=40 ;; "p") d=41 ;; "q") d=42 ;; "r") d=43 ;; + "s") d=44 ;; "t") d=45 ;; "u") d=46 ;; "v") d=47 ;; + "w") d=48 ;; "x") d=49 ;; "y") d=50 ;; "z") d=51 ;; + "0") d=52 ;; "1") d=53 ;; "2") d=54 ;; "3") d=55 ;; + "4") d=56 ;; "5") d=57 ;; "6") d=58 ;; "7") d=59 ;; + "8") d=60 ;; "9") d=61 ;; "+") d=62 ;; "/") d=63 ;; + "=") d=0 ;; + *) continue ;; + esac + + eval "a${i}=${c}" + eval "b${i}=${d}" + + i=$(( i + 1 )) + done + + o0=$(( ((b0 << 2) | (b1 >> 4)) & 0xff )) + o1=$(( ((b1 << 4) | (b2 >> 2)) & 0xff )) + o2=$(( ((b2 << 6) | b3) & 0xff )) + + [ "${a2}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\"" && + return + [ "${a3}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\"" && + return + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\\x\${h$(( o2 / 16 ))}\${h$(( o2 % 16 ))}\"" + done +} #time to ascertain fstype and PReP/UEFI/legacy #also, find first available block device (sda or vda likely) From b8383a7e654d06bdbf581e0563cec2a08b7324fd Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 17 Apr 2019 10:26:50 +0800 Subject: [PATCH 049/276] Add function base64decode() into file pre.sle15 --- .../share/xcat/install/scripts/pre.sle15 | 59 ++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/install/scripts/pre.sle15 b/xCAT-server/share/xcat/install/scripts/pre.sle15 index 733fbe66b..712a69ba3 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.sle15 +++ b/xCAT-server/share/xcat/install/scripts/pre.sle15 @@ -112,7 +112,6 @@ EOF chmod 755 /tmp/foo.awk chmod 755 /tmp/updateflag - /tmp/updateflag $XCATDHOST $XCATDPORT "installmonitor" & NODESTATUS=#TABLEBLANKOKAY:site:key=nodestatus:value# @@ -123,6 +122,64 @@ fi /tmp/foo.awk >/tmp/foo.log 2>&1 & +base64decode() +{ + h0="0"; h1="1"; h2="2"; h3="3"; h4="4"; h5="5"; h6="6"; h7="7"; + h8="8"; h9="9"; h10="A"; h11="B"; h12="C"; h13="D"; h14="E"; h15="F"; + + while : + do + i=0 + while [ "$i" -lt 4 ] + do + read -n 1 c || return + + case "${c}" in + "A") d=0 ;; "B") d=1 ;; "C") d=2 ;; "D") d=3 ;; + "E") d=4 ;; "F") d=5 ;; "G") d=6 ;; "H") d=7 ;; + "I") d=8 ;; "J") d=9 ;; "K") d=10 ;; "L") d=11 ;; + "M") d=12 ;; "N") d=13 ;; "O") d=14 ;; "P") d=15 ;; + "Q") d=16 ;; "R") d=17 ;; "S") d=18 ;; "T") d=19 ;; + "U") d=20 ;; "V") d=21 ;; "W") d=22 ;; "X") d=23 ;; + "Y") d=24 ;; "Z") d=25 ;; "a") d=26 ;; "b") d=27 ;; + "c") d=28 ;; "d") d=29 ;; "e") d=30 ;; "f") d=31 ;; + "g") d=32 ;; "h") d=33 ;; "i") d=34 ;; "j") d=35 ;; + "k") d=36 ;; "l") d=37 ;; "m") d=38 ;; "n") d=39 ;; + "o") d=40 ;; "p") d=41 ;; "q") d=42 ;; "r") d=43 ;; + "s") d=44 ;; "t") d=45 ;; "u") d=46 ;; "v") d=47 ;; + "w") d=48 ;; "x") d=49 ;; "y") d=50 ;; "z") d=51 ;; + "0") d=52 ;; "1") d=53 ;; "2") d=54 ;; "3") d=55 ;; + "4") d=56 ;; "5") d=57 ;; "6") d=58 ;; "7") d=59 ;; + "8") d=60 ;; "9") d=61 ;; "+") d=62 ;; "/") d=63 ;; + "=") d=0 ;; + *) continue ;; + esac + + eval "a${i}=${c}" + eval "b${i}=${d}" + + i=$(( i + 1 )) + done + + o0=$(( ((b0 << 2) | (b1 >> 4)) & 0xff )) + o1=$(( ((b1 << 4) | (b2 >> 2)) & 0xff )) + o2=$(( ((b2 << 6) | b3) & 0xff )) + + [ "${a2}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\"" && + return + [ "${a3}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\"" && + return + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\\x\${h$(( o2 / 16 ))}\${h$(( o2 % 16 ))}\"" + done +} + shopt -s nullglob msgutil_r "$MASTER_IP" "info" "Detecting install disk..." "/var/log/xcat/xcat.log" "$log_label" # From 3a66210a4d90f395cbfb7e5aa223642a366fc813 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 17 Apr 2019 10:26:50 +0800 Subject: [PATCH 050/276] Add function base64decode() into file pre.sles --- .../share/xcat/install/scripts/pre.sles | 60 ++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/pre.sles b/xCAT-server/share/xcat/install/scripts/pre.sles index 5ddc37786..e1ec0409e 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.sles +++ b/xCAT-server/share/xcat/install/scripts/pre.sles @@ -36,7 +36,6 @@ cat << 'EOF' EOF ) > /tmp/updateflag - if [ ! -c /dev/vcs ]; then mknod /dev/vcs c 7 0 fi @@ -112,7 +111,6 @@ EOF chmod 755 /tmp/foo.awk chmod 755 /tmp/updateflag - /tmp/updateflag $XCATDHOST $XCATDPORT "installmonitor" & NODESTATUS=#TABLEBLANKOKAY:site:key=nodestatus:value# @@ -123,6 +121,64 @@ fi /tmp/foo.awk >/tmp/foo.log 2>&1 & +base64decode() +{ + h0="0"; h1="1"; h2="2"; h3="3"; h4="4"; h5="5"; h6="6"; h7="7"; + h8="8"; h9="9"; h10="A"; h11="B"; h12="C"; h13="D"; h14="E"; h15="F"; + + while : + do + i=0 + while [ "$i" -lt 4 ] + do + read -n 1 c || return + + case "${c}" in + "A") d=0 ;; "B") d=1 ;; "C") d=2 ;; "D") d=3 ;; + "E") d=4 ;; "F") d=5 ;; "G") d=6 ;; "H") d=7 ;; + "I") d=8 ;; "J") d=9 ;; "K") d=10 ;; "L") d=11 ;; + "M") d=12 ;; "N") d=13 ;; "O") d=14 ;; "P") d=15 ;; + "Q") d=16 ;; "R") d=17 ;; "S") d=18 ;; "T") d=19 ;; + "U") d=20 ;; "V") d=21 ;; "W") d=22 ;; "X") d=23 ;; + "Y") d=24 ;; "Z") d=25 ;; "a") d=26 ;; "b") d=27 ;; + "c") d=28 ;; "d") d=29 ;; "e") d=30 ;; "f") d=31 ;; + "g") d=32 ;; "h") d=33 ;; "i") d=34 ;; "j") d=35 ;; + "k") d=36 ;; "l") d=37 ;; "m") d=38 ;; "n") d=39 ;; + "o") d=40 ;; "p") d=41 ;; "q") d=42 ;; "r") d=43 ;; + "s") d=44 ;; "t") d=45 ;; "u") d=46 ;; "v") d=47 ;; + "w") d=48 ;; "x") d=49 ;; "y") d=50 ;; "z") d=51 ;; + "0") d=52 ;; "1") d=53 ;; "2") d=54 ;; "3") d=55 ;; + "4") d=56 ;; "5") d=57 ;; "6") d=58 ;; "7") d=59 ;; + "8") d=60 ;; "9") d=61 ;; "+") d=62 ;; "/") d=63 ;; + "=") d=0 ;; + *) continue ;; + esac + + eval "a${i}=${c}" + eval "b${i}=${d}" + + i=$(( i + 1 )) + done + + o0=$(( ((b0 << 2) | (b1 >> 4)) & 0xff )) + o1=$(( ((b1 << 4) | (b2 >> 2)) & 0xff )) + o2=$(( ((b2 << 6) | b3) & 0xff )) + + [ "${a2}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\"" && + return + [ "${a3}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\"" && + return + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\\x\${h$(( o2 / 16 ))}\${h$(( o2 % 16 ))}\"" + done +} + shopt -s nullglob msgutil_r "$MASTER_IP" "info" "Detecting install disk..." "/var/log/xcat/xcat.log" "$log_label" # From b2dd4a5a56667bb11c82e35cb83846e4bcb139a1 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 17 Apr 2019 15:34:25 +0800 Subject: [PATCH 051/276] Revise error handling for function getdisksize() --- xCAT-server/share/xcat/install/scripts/pre.rhels8 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/install/scripts/pre.rhels8 b/xCAT-server/share/xcat/install/scripts/pre.rhels8 index 4cb204623..2fb50c424 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/pre.rhels8 @@ -225,10 +225,11 @@ getdisksize() if [ "${name}" = "${disk}" ] then echo "${blocks}" - break + return fi done Date: Wed, 17 Apr 2019 15:36:38 +0800 Subject: [PATCH 052/276] Revise error handling for function getdisksize() --- xCAT-server/share/xcat/install/scripts/pre.rhels8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/install/scripts/pre.rhels8 b/xCAT-server/share/xcat/install/scripts/pre.rhels8 index 2fb50c424..c98667d42 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/pre.rhels8 @@ -214,7 +214,7 @@ getdisksize() disk="${disk#/dev/}" - [ -z "${disk}" ] && return + [ -z "${disk}" ] && echo "0" && return local blah local blocks From 0bb00bda1718db83960c629995b27f5cca3154a0 Mon Sep 17 00:00:00 2001 From: xuweibj Date: Wed, 17 Apr 2019 04:28:03 -0400 Subject: [PATCH 053/276] Add DB pkgs check on SN for xcatprobe xcatmn --- xCAT-probe/subcmds/xcatmn | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/xCAT-probe/subcmds/xcatmn b/xCAT-probe/subcmds/xcatmn index 612e95620..76b23458d 100755 --- a/xCAT-probe/subcmds/xcatmn +++ b/xCAT-probe/subcmds/xcatmn @@ -172,6 +172,10 @@ sub do_main_job { $rst = check_dhcp_leases(\$checkpoint, \@error); print_check_result($checkpoint, "w", $rst, \@error); $rc |= $rst; + } else { + $rst = check_db_pkgs(\$checkpoint, \@error); + print_check_result($checkpoint, "f", $rst, \@error); + $rc |= $rst; } cleanup(); @@ -1253,6 +1257,37 @@ sub check_daemon_attributes { return ($rst, $rst_type); } +sub check_db_pkgs { + my $checkpoint_ref = shift; + my $error_ref = shift; + my $rst = 0; + + $$checkpoint_ref = "Checking DB packages installatio..."; + @$error_ref = (); + + my $cfgloc_file = "/etc/xcat/cfgloc"; + if (! -e $cfgloc_file) { + push @$error_ref, "$cfgloc_file does not exist, please check xcat installation."; + return 1; + } + my $db_type = `cat $cfgloc_file | awk -F ':' '{print \$1}'`; + chomp($db_type); + my $db_pkg; + my $db_name; + if ($db_type eq "mysql") { + $db_name = "perl-DBD-MySQL or perl-DBD-mysql"; + $db_pkg = `rpm qa | grep -e perl-DBD-MySQL -e perl-DBD-mysql`; + } elsif ($db_type eq "Pg") { + $db_name = "perl-DBD-Pg"; + $db_pkg = `rpm -qa | grep $db_name`; + } + if (!$db_pkg) { + push @$error_ref, "$db_name is not installed, please install it."; + $rst = 1; + } + return $rst; +} + sub returncmdoutput { my $rst = shift; my $error_ref = shift; From c339321d6bce59caaf7f43a8f75af2908acc8ff0 Mon Sep 17 00:00:00 2001 From: xuweibj Date: Wed, 17 Apr 2019 21:48:07 -0400 Subject: [PATCH 054/276] fix issue 6229 based on customer suggestion --- .../python/agent/hwctl/openbmc/openbmc_bmcconfig.py | 12 ++++++------ .../lib/python/agent/hwctl/openbmc_client.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py index d31e3e256..45c83c460 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py @@ -556,12 +556,12 @@ rmdir \"/tmp/$userid\" \n") addon_string = '' if dic_length > 1: addon_string = " for %s" % nic - netinfodict['ip'].append("BMC IP"+addon_string+": %s" % attrs["ip"]) - netinfodict['netmask'].append("BMC Netmask"+addon_string+": %s" % utils.mask_int2str(attrs["netmask"])) - netinfodict['gateway'].append("BMC Gateway"+addon_string+": %s (default: %s)" % (attrs["gateway"], defaultgateway)) - netinfodict['vlan'].append("BMC VLAN ID"+addon_string+": %s" % attrs["vlanid"]) - netinfodict['ipsrc'].append("BMC IP Source"+addon_string+": %s" % attrs["ipsrc"]) - netinfodict['ntpservers'].append("BMC NTP Servers"+addon_string+": %s" % attrs["ntpservers"]) + netinfodict['ip'].append("BMC IP"+addon_string+": %s" % attrs.get("ip", None)) + netinfodict['netmask'].append("BMC Netmask"+addon_string+": %s" % utils.mask_int2str(attrs.get("netmask", 24))) + netinfodict['gateway'].append("BMC Gateway"+addon_string+": %s (default: %s)" % (attrs.get("gateway", None), defaultgateway)) + netinfodict['vlan'].append("BMC VLAN ID"+addon_string+": %s" % attrs.get("vlanid", None)) + netinfodict['ipsrc'].append("BMC IP Source"+addon_string+": %s" % attrs.get("ipsrc", None)) + netinfodict['ntpservers'].append("BMC NTP Servers"+addon_string+": %s" % attrs.get("ntpservers", None)) if ip: for i in netinfodict['ip']: self.callback.info("%s: %s" % (node, i)) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 1565418ae..c6a5e5a07 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -797,7 +797,7 @@ class OpenBMCRest(object): def set_ntp_servers(self, nic, servers): - payload = { "data": [servers] } + payload = { "data": servers.split(',') } url = RSPCONFIG_NETINFO_URL['ntpservers'].replace('#NIC#', nic) self.request('PUT', url, payload=payload, cmd='set_ntp_servers') @@ -915,7 +915,7 @@ class OpenBMCRest(object): netinfo[nicid]["zeroconf"] = v["Address"] continue if 'ip' in netinfo[nicid]: - msg = "%s: Another valid ip %s found." % (node, v["Address"]) + msg = "Another valid ip %s found." % (v["Address"]) self._print_record_log(msg, 'get_netinfo') del netinfo[nicid] netinfo['error'] = 'Interfaces with multiple IP addresses are not supported' From 03bd6f3f24ea9c58eab6410efb784c420a290386 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 17 Apr 2019 22:24:25 -0400 Subject: [PATCH 055/276] Update the cuda setup script to account for difference in rhels 7.5 and 7.6 and some enhancements --- xCAT/postscripts/cuda_power9_setup | 39 +++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/xCAT/postscripts/cuda_power9_setup b/xCAT/postscripts/cuda_power9_setup index 23a9f8aa7..d3e5b33dc 100755 --- a/xCAT/postscripts/cuda_power9_setup +++ b/xCAT/postscripts/cuda_power9_setup @@ -15,19 +15,50 @@ umask 0022 -mkdir ${IMG_ROOTIMGDIR}/etc/systemd/system/nvidia-persistenced.service.d +echo "==> Override settings in /etc/systemd/system/nvidia-persistenced.service.d..." +mkdir -p ${IMG_ROOTIMGDIR}/etc/systemd/system/nvidia-persistenced.service.d printf '[Service]\nPIDFile=/var/run/nvidia-persistenced/nvidia-persistenced.pid\n' > ${IMG_ROOTIMGDIR}/etc/systemd/system/nvidia-persistenced.service.d/pidfile.conf printf '[Service]\nRestart=always\n' > ${IMG_ROOTIMGDIR}/etc/systemd/system/nvidia-persistenced.service.d/restartalways.conf [ ! -z "${IMG_ROOTIMGDIR}" ] && CHROOTCMD="chroot ${IMG_ROOTIMGDIR}" $CHROOTCMD /bin/bash -c "systemctl enable nvidia-persistenced" -if [ -f ${IMG_ROOTIMGDIR}/lib/udev/rules.d/40-redhat.rules ] -then - sed -i /SUBSYSTEM==\"memory\"/d ${IMG_ROOTIMGDIR}/lib/udev/rules.d/40-redhat.rules +# Disable a udev rule installed by default in some Linux distributions that cause hot-pluggable +# memory to be automatically onlined when it is physically probed. +# +# The overrides for /lib/udev rules should be done in /etc/udev +# +UDEV_REDHAT_SOURCE=${IMG_ROOTIMGDIR}/lib/udev/rules.d/40-redhat.rules +UDEV_REDHAT_TARGET=${IMG_ROOTIMGDIR}/etc/udev/rules.d/40-redhat.rules + +# If the file does not exist in /etc/udev, copy it from /lib/udev +if [ ! -e ${UDEV_REDHAT_TARGET} ]; then + cp -n ${UDEV_REDHAT_SOURCE} ${UDEV_REDHAT_TARGET} fi +# Disable udev memory auto-onlining Rule for cuda10.x +# +# For RHELS 7.5 ALT +# +sed -i "s/^\(SUBSYSTEM==\"memory\".*\)/#\1/" ${UDEV_REDHAT_TARGET} +# +# For RHELS 7.6 ALT +# +if [[ `grep 'Memory hotadd request' ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null && grep 'LABEL="memory_hotplug_end' ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null; echo $?` == 0 ]]; then + echo "Detected RHELS 7.6 ALT, modifying ${UDEV_REDHAT_TARGET}..." + # Comment out the memory hotadd request (for reference) + if [[ `grep "## Memory hotadd request" ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null; echo $?` != 0 ]]; then + # but only run one time, not if it's already commented out. (to handle multiple genimage calls) + sed -i '/Memory hotadd request/,+8 s/^/#/' ${UDEV_REDHAT_TARGET} + fi +fi + +echo "Comparing ${UDEV_REDHAT_SOURCE} and ${UDEV_REDHAT_TARGET}" +diff ${UDEV_REDHAT_SOURCE} ${UDEV_REDHAT_TARGET} + +echo "==> Setting NVIDIA options in /usr/lib/modprobe.d/nvidia.conf..." echo 'options nvidia NVreg_EnableStreamMemOPs=1 NVreg_RegistryDwords="PeerMappingOverride=1"' >${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf +echo 'blacklist nouveau' >> ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf if [ -z "${IMG_ROOTIMGDIR}" ] then From 9b41890a2ee87d8cd0a4881251daac77dd9c27f6 Mon Sep 17 00:00:00 2001 From: yangsbj Date: Wed, 17 Apr 2019 23:33:12 -0400 Subject: [PATCH 056/276] support https:// prefix in otherpkgdir and pkgdir; ignore invalid repos --- xCAT-server/share/xcat/netboot/rh/genimage | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index da8e4117e..42abf3e30 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -302,7 +302,7 @@ if($onlyinitrd){ my @pkgdir_internet; #Put all of the http mirrors in this array my $dir; foreach $dir (@pkgdirs) { - if ($dir =~ /^http.*/) { + if ($dir =~ /^http[s]?:|^ftp:/) { push @pkgdir_internet, $dir; } else { find(\&isyumdir, <$dir/>); @@ -336,11 +336,11 @@ if($onlyinitrd){ my $repnum = 0; foreach $srcdir (@yumdirs) { - print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\n\n"; + print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\nskip_if_unavailable=True\n\n"; $repnum += 1; } foreach $srcdir (@pkgdir_internet) { - print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=$srcdir\ngpgpcheck=0\n\n"; + print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=$srcdir\ngpgpcheck=0\nskip_if_unavailable=True\n\n"; $repnum += 1; } $repnum -= 1; @@ -486,7 +486,7 @@ if($onlyinitrd){ my @otherpkgdir_url; my @otherpkgdir_local; foreach my $tmpdir (split ',', $srcdir_otherpkgs){ - if($tmpdir =~ /^http:.*/){ + if($tmpdir =~ /^http[s]?:|^ftp:/){ push @otherpkgdir_url, $tmpdir; }else{ push @otherpkgdir_local,$tmpdir; @@ -516,12 +516,12 @@ if($onlyinitrd){ if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next; } foreach(@otherpkgdir_url){ - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=$_\ngpgpcheck=0\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=$_\ngpgpcheck=0\nskip_if_unavailable=True\n\n"; $repohash{$pass}{$index} = 1; $index++; } - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs_local/$_\ngpgpcheck=0\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs_local/$_\ngpgpcheck=0\nskip_if_unavailable=True\n\n"; $repohash{$pass}{$index} = 1; $index++; my $pa = $extra_hash{$pass}{$_}; @@ -1161,6 +1161,7 @@ sub mkinitrd_dracut { } } + print "\nchroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver\n"; !system("chroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver") or die("Error: failed to generate the initial ramdisk for $mode.\n"); From 9bad0ff8811557a0d70f54c5a960f850680390d5 Mon Sep 17 00:00:00 2001 From: huweihua Date: Thu, 18 Apr 2019 02:52:05 -0400 Subject: [PATCH 057/276] add tar to compute.rhels8.pkglist --- xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist b/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist index 3c2a86882..1f6c79c13 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist +++ b/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist @@ -7,3 +7,4 @@ rsync util-linux wget python3 +tar From 7bac32b9e88ae48b4ee98ba7c17a5a8ad0942a45 Mon Sep 17 00:00:00 2001 From: huweihua Date: Thu, 18 Apr 2019 03:04:54 -0400 Subject: [PATCH 058/276] add tar to more pkglist files which related rhels8 --- xCAT-server/share/xcat/install/rh/service.rhels8.pkglist | 1 + xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist | 1 + xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist | 1 + xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist | 1 + xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist | 1 + 5 files changed, 5 insertions(+) diff --git a/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist b/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist index f5e1af162..eff931916 100644 --- a/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist +++ b/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist @@ -11,3 +11,4 @@ perl-DBD-MySQL perl-DBD-Pg unixODBC python3 +tar diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist index f2d8cc2d7..91f826442 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist @@ -9,3 +9,4 @@ tar util-linux wget python3 +tar diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist index f2d8cc2d7..91f826442 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist @@ -9,3 +9,4 @@ tar util-linux wget python3 +tar diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist index 6985b9585..a1d6a20b2 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist @@ -11,3 +11,4 @@ wget perl-DBD-MySQL perl-DBD-Pg python3 +tar diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist index 6985b9585..a1d6a20b2 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist @@ -11,3 +11,4 @@ wget perl-DBD-MySQL perl-DBD-Pg python3 +tar From 5368829ded10b52392f4f8db06dc2ac45a2b1be8 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 18 Apr 2019 16:58:46 +0800 Subject: [PATCH 059/276] Remove conserver-xcat from RPM requirements --- xCAT/xCAT.spec | 10 ---------- xCATsn/xCATsn.spec | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index 1a1308820..f52bb3a90 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -63,16 +63,6 @@ Requires: perl-IO-Stty %endif %endif -# The aix rpm cmd forces us to do this outside of ifos type stmts -%if %notpcm -%ifos linux -%if %nots390x -# PCM does not use or ship conserver -Requires: conserver-xcat -%endif -%endif -%endif - %ifos linux Requires: goconserver %endif diff --git a/xCATsn/xCATsn.spec b/xCATsn/xCATsn.spec index 102218b0e..6e10a4756 100644 --- a/xCATsn/xCATsn.spec +++ b/xCATsn/xCATsn.spec @@ -46,16 +46,6 @@ Requires: perl-IO-Stty %endif %endif -# The aix rpm cmd forces us to do this outside of ifos type stmts -%if %notpcm -%ifos linux -%ifnarch s390x -# PCM does not use or ship conserver -Requires: conserver-xcat -%endif -%endif -%endif - %ifos linux Requires: goconserver %endif From d710fb4b308e13fc453efa1bfc3398a878eb1348 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 18 Apr 2019 17:05:33 +0800 Subject: [PATCH 060/276] Remove conserver-xcat from go-xcat package list --- xCAT-server/share/xcat/tools/go-xcat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index f5d13af01..c567cbcde 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -163,13 +163,13 @@ GO_XCAT_DEP_PACKAGE_LIST=() # The package list of all the packages should be installed GO_XCAT_INSTALL_LIST=(perl-xCAT xCAT xCAT-buildkit xCAT-client xCAT-genesis-scripts-ppc64 xCAT-genesis-scripts-x86_64 xCAT-server - conserver-xcat elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat + elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat xCAT-genesis-base-ppc64 xCAT-genesis-base-x86_64 xnba-undi yaboot-xcat) # For Debian/Ubuntu, it will need a sight different package list type dpkg >/dev/null 2>&1 && GO_XCAT_INSTALL_LIST=(perl-xcat xcat xcat-buildkit xcat-client xcat-genesis-scripts-amd64 xcat-genesis-scripts-ppc64 xcat-server - conserver-xcat elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat + elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat xcat-genesis-base-amd64 xcat-genesis-base-ppc64 xnba-undi) # The package list of all the packages should be installed GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}" From 13cd3186eaadef55f4d50f02fe8d852fa8ba7eb0 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 18 Apr 2019 17:06:35 +0800 Subject: [PATCH 061/276] Bump go-xcat version --- xCAT-server/share/xcat/tools/go-xcat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index c567cbcde..3a1c74191 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,7 +2,7 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.36 +# Version 1.0.38 # # Copyright (C) 2016, 2017, 2018 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) From c06f1a4213d0962ccfbd63c69ab39251e241c836 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 5 Dec 2018 16:05:49 +0800 Subject: [PATCH 062/276] Update xCAT-server.spec to require a new version of grub2-xcat --- xCAT-server/xCAT-server.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index e491c4927..85c4e3f2c 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -48,7 +48,7 @@ Obsoletes: atftp-xcat # # PCM does not use or ship grub2-xcat %if %nots390x -Requires: grub2-xcat perl-Net-HTTPS-NB perl-HTTP-Async +Requires: grub2-xcat >= 2.02-0.76 perl-Net-HTTPS-NB perl-HTTP-Async %endif %endif %endif From c7157ef2d170b2264a70332fc45ba4d296ad295c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Obih=C3=B6rnchen?= Date: Thu, 18 Apr 2019 15:22:06 +0200 Subject: [PATCH 063/276] Fix reventlog for python2 python2 does not have encoding and errors in open() --- xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index c6a5e5a07..06631bfce 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -661,7 +661,7 @@ class OpenBMCRest(object): # Check if policy table file is there ras_event_mapping = {} if os.path.isfile(RAS_POLICY_TABLE): - with open(RAS_POLICY_TABLE, encoding="utf8", errors='ignore') as data_file: + with open(RAS_POLICY_TABLE) as data_file: policy_hash = json.load(data_file) if policy_hash: ras_event_mapping = policy_hash['events'] From e918121d9247e8da0312a95582ef240c282ff4bc Mon Sep 17 00:00:00 2001 From: xuweibj Date: Thu, 18 Apr 2019 21:57:56 -0400 Subject: [PATCH 064/276] enhance openbmc ntpservers output --- xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 06631bfce..4f1a65b20 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -930,7 +930,7 @@ class OpenBMCRest(object): utils.update2Ddict(netinfo, nicid, "vlanid", info.get("Id", "Disable")) utils.update2Ddict(netinfo, nicid, "mac", info["MACAddress"]) ntpservers = None - tmp_ntpservers = ''.join(info["NTPServers"]) + tmp_ntpservers = ','.join(info["NTPServers"]) if tmp_ntpservers: ntpservers = tmp_ntpservers utils.update2Ddict(netinfo, nicid, "ntpservers", ntpservers) From 5a6cbce2cd8047a4197f51451c0311d9d5bc2c79 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Fri, 19 Apr 2019 11:45:53 +0800 Subject: [PATCH 065/276] Use xCAT Automatic Signing Key, 5619700D to do the signing. --- builddep.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builddep.sh b/builddep.sh index 8f66989c4..926fa7bdb 100755 --- a/builddep.sh +++ b/builddep.sh @@ -116,7 +116,7 @@ if [ "$OSNAME" != "AIX" ]; then echo '%_signature gpg' >> $MACROS fi if ! $GREP -q '%_gpg_name' $MACROS 2>/dev/null; then - echo '%_gpg_name xCAT Security Key' >> $MACROS + echo '%_gpg_name xCAT Automatic Signing Key' >> $MACROS fi # Sign the rpms that are not already signed. The "standard input reopened" warnings are normal. @@ -127,12 +127,12 @@ if [ "$OSNAME" != "AIX" ]; then echo "===> Creating repodata directories..." for i in `find -mindepth 2 -maxdepth 2 -type d `; do if [ -n "$VERBOSEMODE" ]; then - createrepo --checksum sha $i # specifying checksum so the repo will work on rhel5 + createrepo $i # specifying checksum so the repo will work on rhel5 else - createrepo --checksum sha $i >/dev/null + createrepo $i >/dev/null fi rm -f $i/repodata/repomd.xml.asc - gpg -a --detach-sign $i/repodata/repomd.xml + gpg -a --detach-sign --default-key 5619700 $i/repodata/repomd.xml if [ ! -f $i/repodata/repomd.xml.key ]; then cp $GSA/../keys/repomd.xml.key $i/repodata fi From 66ccfe948a844530a78d02def76e63f6b84f37c3 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Fri, 19 Apr 2019 14:26:11 +0800 Subject: [PATCH 066/276] Use xCAT Automatic Signing Key, 5619700D to do the signing. --- builddep.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builddep.sh b/builddep.sh index 926fa7bdb..9f0f4fb0c 100755 --- a/builddep.sh +++ b/builddep.sh @@ -132,7 +132,7 @@ if [ "$OSNAME" != "AIX" ]; then createrepo $i >/dev/null fi rm -f $i/repodata/repomd.xml.asc - gpg -a --detach-sign --default-key 5619700 $i/repodata/repomd.xml + gpg -a --detach-sign --default-key 5619700D $i/repodata/repomd.xml if [ ! -f $i/repodata/repomd.xml.key ]; then cp $GSA/../keys/repomd.xml.key $i/repodata fi From 17748beb539e90ebc7a6e8ed40c4f36ed74d3936 Mon Sep 17 00:00:00 2001 From: bybai Date: Fri, 19 Apr 2019 06:42:13 -0400 Subject: [PATCH 067/276] change /var/named permission to default 0750 --- xCAT-server/lib/xcat/plugins/ddns.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 556a217b8..6a7135157 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -918,7 +918,7 @@ sub process_request { unless ($ret) { xCAT::SvrUtils::sendmsg("DNS setup is completed", $callback); } - + chmod 0750, $ctx->{dbdir}; umask($oldmask); } From 73f9b49e27c84153b44780a6d156d075554a6d49 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Mon, 22 Apr 2019 13:18:30 +0800 Subject: [PATCH 068/276] Remove package conserver-xcat from service node otherpkgs package lists --- .../share/xcat/install/rh/service.rhels7.ppc64.otherpkgs.pkglist | 1 - .../xcat/install/rh/service.rhels7.ppc64le.otherpkgs.pkglist | 1 - .../xcat/install/rh/service.rhels7.x86_64.otherpkgs.pkglist | 1 - .../xcat/install/sles/service.sles12.ppc64le.otherpkgs.pkglist | 1 - .../xcat/install/sles/service.sles12.x86_64.otherpkgs.pkglist | 1 - .../xcat/netboot/rh/service.rhels7.ppc64le.otherpkgs.pkglist | 1 - .../xcat/netboot/rh/service.rhels7.x86_64.otherpkgs.pkglist | 1 - .../xcat/netboot/sles/service.sles12.ppc64le.otherpkgs.pkglist | 1 - .../xcat/netboot/sles/service.sles12.x86_64.otherpkgs.pkglist | 1 - 9 files changed, 9 deletions(-) diff --git a/xCAT-server/share/xcat/install/rh/service.rhels7.ppc64.otherpkgs.pkglist b/xCAT-server/share/xcat/install/rh/service.rhels7.ppc64.otherpkgs.pkglist index 29fefdb45..05e14fa53 100644 --- a/xCAT-server/share/xcat/install/rh/service.rhels7.ppc64.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/install/rh/service.rhels7.ppc64.otherpkgs.pkglist @@ -1,4 +1,3 @@ xcat/xcat-core/xCATsn -xcat/xcat-dep/rh7/ppc64/conserver-xcat xcat/xcat-dep/rh7/ppc64/perl-Net-Telnet xcat/xcat-dep/rh7/ppc64/perl-Expect diff --git a/xCAT-server/share/xcat/install/rh/service.rhels7.ppc64le.otherpkgs.pkglist b/xCAT-server/share/xcat/install/rh/service.rhels7.ppc64le.otherpkgs.pkglist index 66c23dbd6..f987967b0 100644 --- a/xCAT-server/share/xcat/install/rh/service.rhels7.ppc64le.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/install/rh/service.rhels7.ppc64le.otherpkgs.pkglist @@ -1,4 +1,3 @@ xcat/xcat-core/xCATsn -xcat/xcat-dep/rh7/ppc64le/conserver-xcat xcat/xcat-dep/rh7/ppc64le/perl-Net-Telnet xcat/xcat-dep/rh7/ppc64le/perl-Expect diff --git a/xCAT-server/share/xcat/install/rh/service.rhels7.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/install/rh/service.rhels7.x86_64.otherpkgs.pkglist index 26339bcdb..08dec8c94 100644 --- a/xCAT-server/share/xcat/install/rh/service.rhels7.x86_64.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/install/rh/service.rhels7.x86_64.otherpkgs.pkglist @@ -1,4 +1,3 @@ xcat/xcat-core/xCATsn -xcat/xcat-dep/rh7/x86_64/conserver-xcat xcat/xcat-dep/rh7/x86_64/perl-Net-Telnet xcat/xcat-dep/rh7/x86_64/perl-Expect diff --git a/xCAT-server/share/xcat/install/sles/service.sles12.ppc64le.otherpkgs.pkglist b/xCAT-server/share/xcat/install/sles/service.sles12.ppc64le.otherpkgs.pkglist index 6d403afb2..265b14490 100644 --- a/xCAT-server/share/xcat/install/sles/service.sles12.ppc64le.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/install/sles/service.sles12.ppc64le.otherpkgs.pkglist @@ -1,2 +1 @@ xcat/xcat-core/xCATsn -xcat/xcat-dep/sles12/ppc64le/conserver-xcat diff --git a/xCAT-server/share/xcat/install/sles/service.sles12.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/install/sles/service.sles12.x86_64.otherpkgs.pkglist index 8c4f4de49..265b14490 100644 --- a/xCAT-server/share/xcat/install/sles/service.sles12.x86_64.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/install/sles/service.sles12.x86_64.otherpkgs.pkglist @@ -1,2 +1 @@ xcat/xcat-core/xCATsn -xcat/xcat-dep/sles12/x86_64/conserver-xcat diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels7.ppc64le.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels7.ppc64le.otherpkgs.pkglist index 66c23dbd6..f987967b0 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels7.ppc64le.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels7.ppc64le.otherpkgs.pkglist @@ -1,4 +1,3 @@ xcat/xcat-core/xCATsn -xcat/xcat-dep/rh7/ppc64le/conserver-xcat xcat/xcat-dep/rh7/ppc64le/perl-Net-Telnet xcat/xcat-dep/rh7/ppc64le/perl-Expect diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels7.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels7.x86_64.otherpkgs.pkglist index 26339bcdb..08dec8c94 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels7.x86_64.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels7.x86_64.otherpkgs.pkglist @@ -1,4 +1,3 @@ xcat/xcat-core/xCATsn -xcat/xcat-dep/rh7/x86_64/conserver-xcat xcat/xcat-dep/rh7/x86_64/perl-Net-Telnet xcat/xcat-dep/rh7/x86_64/perl-Expect diff --git a/xCAT-server/share/xcat/netboot/sles/service.sles12.ppc64le.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/sles/service.sles12.ppc64le.otherpkgs.pkglist index 6d403afb2..265b14490 100644 --- a/xCAT-server/share/xcat/netboot/sles/service.sles12.ppc64le.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/netboot/sles/service.sles12.ppc64le.otherpkgs.pkglist @@ -1,2 +1 @@ xcat/xcat-core/xCATsn -xcat/xcat-dep/sles12/ppc64le/conserver-xcat diff --git a/xCAT-server/share/xcat/netboot/sles/service.sles12.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/sles/service.sles12.x86_64.otherpkgs.pkglist index 7fe170d23..5e66cf547 100644 --- a/xCAT-server/share/xcat/netboot/sles/service.sles12.x86_64.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/netboot/sles/service.sles12.x86_64.otherpkgs.pkglist @@ -1,3 +1,2 @@ -perl-doc xcat/xcat-core/xCATsn -xcat/xcat-dep/sles12/x86_64/conserver-xcat From 62ba3bc57dcf32d1151c27b41304460f63d23c73 Mon Sep 17 00:00:00 2001 From: huweihua Date: Mon, 22 Apr 2019 04:42:07 -0400 Subject: [PATCH 069/276] refine test case rspconfig_set_hostname_equal_star_with_bmc_is_hostname for task #165 --- xCAT-test/autotest/testcase/rspconfig/cases0 | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/rspconfig/cases0 b/xCAT-test/autotest/testcase/rspconfig/cases0 index 8bc7f1bc2..7dfede674 100644 --- a/xCAT-test/autotest/testcase/rspconfig/cases0 +++ b/xCAT-test/autotest/testcase/rspconfig/cases0 @@ -311,6 +311,7 @@ cmd:lsdef bogus-bmc-hostname check:rc == 0 cmd:makehosts bogus-bmc-hostname check:rc == 0 +cmd:makedns -n cmd:makedns bogus-bmc-hostname check:rc == 0 cmd:chdef $$CN bmc=bogus-bmc-hostname From c7145b61a11f4658ad7b4c95c862de5d2765956b Mon Sep 17 00:00:00 2001 From: bybai Date: Mon, 22 Apr 2019 05:00:58 -0400 Subject: [PATCH 070/276] improved --- xCAT-server/lib/xcat/plugins/ddns.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 6a7135157..0b7b272b5 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -206,6 +206,7 @@ sub process_request { $callback = shift; my $oldmask = umask(0007); my $ctx = {}; + my $permissionmode; my @nodes = (); my $hadargs = 0; my $allnodes; @@ -777,6 +778,8 @@ sub process_request { #We manipulate local namedconf $ctx->{dbdir} = get_dbdir(); $ctx->{zonesdir} = get_zonesdir(); + #backup named directory permission + $permissionmode = (stat($ctx->{dbdir}))[2] & 07777; chmod 0775, $ctx->{dbdir}; # assure dynamic dns can actually execute against the directory if ($::VERBOSE) { @@ -918,7 +921,10 @@ sub process_request { unless ($ret) { xCAT::SvrUtils::sendmsg("DNS setup is completed", $callback); } - chmod 0750, $ctx->{dbdir}; + #restore named directory permission + if (defined($permissionmode)) { + chmod $permissionmode, $ctx->{dbdir}; + } umask($oldmask); } From ca3251aaf1ecc82f67c9c1774012abbc1b9bb2bb Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Mon, 22 Apr 2019 17:36:40 +0800 Subject: [PATCH 071/276] Let makentp fall back to use ntpd when systemctl is not available. --- xCAT-server/lib/xcat/plugins/makentp.pm | 3 ++- xCAT/postscripts/setupntp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/makentp.pm b/xCAT-server/lib/xcat/plugins/makentp.pm index 35d20ee84..47aeca6cc 100755 --- a/xCAT-server/lib/xcat/plugins/makentp.pm +++ b/xCAT-server/lib/xcat/plugins/makentp.pm @@ -253,7 +253,8 @@ sub process_request { } # Handle chronyd here, - if (-f "/usr/sbin/chronyd") { + if (-x "/usr/sbin/chronyd" && + (-x "/usr/bin/systemctl" || -x "/bin/systemctl")) { send_msg(\%request, 0, "Will configure chronyd instead."); my $cmd = "/install/postscripts/setupntp " . diff --git a/xCAT/postscripts/setupntp b/xCAT/postscripts/setupntp index 75809581a..a95c621da 100755 --- a/xCAT/postscripts/setupntp +++ b/xCAT/postscripts/setupntp @@ -130,6 +130,7 @@ then fi check_executes chronyd >/dev/null 2>&1 || USE_NTPD="yes" +check_executes systemctl >/dev/null 2>&1 || USE_NTPD="yes" if [ -n "${USE_NTPD}" ] then From bcd01d19bad1303f9f54d02a519274b35e814a73 Mon Sep 17 00:00:00 2001 From: Weihua Hu Date: Tue, 23 Apr 2019 13:15:58 +0800 Subject: [PATCH 072/276] Add documentation in RTD for how to use an xCAT docker image (#6222) * Add docs for xcat container 2.14.6 * Modify depending on comments * remove outdated documents * Modify depending on comments * update for comments * update depending on comments * update depending on mark's comment * update depending on ertao's comment * modify depending on Mark's comments * modify depending on xiaopeng's comment --- .../advanced/docker/docker_registry.rst | 171 ------------ .../dockerized_xcat/dockerized_xcat.rst | 97 ------- .../run_xcat_in_docker_compose.rst | 156 ----------- .../run_xcat_in_docker_host.rst | 104 +++++++ .../run_xcat_in_docker_native.rst | 77 ------ .../dockerized_xcat/setup_docker_host.rst | 25 -- docs/source/advanced/docker/index.rst | 4 +- .../advanced/docker/lifecycle_management.rst | 256 ------------------ 8 files changed, 105 insertions(+), 785 deletions(-) delete mode 100644 docs/source/advanced/docker/docker_registry.rst delete mode 100644 docs/source/advanced/docker/dockerized_xcat/dockerized_xcat.rst delete mode 100644 docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_compose.rst create mode 100644 docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst delete mode 100644 docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_native.rst delete mode 100644 docs/source/advanced/docker/dockerized_xcat/setup_docker_host.rst delete mode 100644 docs/source/advanced/docker/lifecycle_management.rst diff --git a/docs/source/advanced/docker/docker_registry.rst b/docs/source/advanced/docker/docker_registry.rst deleted file mode 100644 index f088fbe57..000000000 --- a/docs/source/advanced/docker/docker_registry.rst +++ /dev/null @@ -1,171 +0,0 @@ -Docker Registry in xCAT -======================= - -Docker Registry is a stateless, highly scalable server side application that stores and lets you distribute Docker images. - -This document describes how to set up a local private docker registry on Ubuntu 15.04 on x86_64. - -.. note:: Ensure that docker registry is not already set up on this docker host. - -Setting Up Docker Host ----------------------- - -Install Docker version 1.6.0 or newer. - -Setting Up Docker Registry Manually ------------------------------------ - -Docker registry needed to be set up on xCAT's MN. - -This section describes two methods of setting up docker registry manually. - -First, create some folders where files for this tutorial will live. :: - - mkdir /docker-registry && cd $_ - mkdir certs - -Copy xCAT server certificate and key to certs folder. :: - - cp /etc/xcat/cert/server-cert.pem certs/domain.crt - cp /etc/xcat/cert/server-key.pem certs/domain.key - -Method 1: Start Docker Registry Directly -```````````````````````````````````````` - -Create Configuration File -''''''''''''''''''''''''' - -Define configuration file ``docker-registry`` under ``/docker-registry/`` folder as below. :: - - #!/bin/bash - - docker_command=$1 - if [ $docker_command = "start" ]; then - docker_ps_result=$(docker ps -a | grep "registry") - if [ -z $docker_ps_result ]; then - docker run -d -p 5000:5000 --restart=always --name registry \ - -v `pwd`/data:/data \ - -e REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/data \ - -v `pwd`/certs:/certs \ - -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \ - -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \ - registry:2 - else - docker start registry - fi - elif [ $docker_command = "stop" ]; then - docker stop registry - else - echo "The parameter is wrong." - fi - -Starting Docker Registry as a Service -''''''''''''''''''''''''''''''''''''' - -Create ``docker-registry.service`` file in ``/etc/systemd/system/``, add the following contents to it. :: - - [Unit] - Description=Docker Registry - - [Service] - Type=oneshot - RemainAfterExit=yes - WorkingDirectory=/docker-registry - ExecStart=/bin/bash docker-registry start - ExecStop=/bin/bash docker-registry stop - - [Install] - WantedBy=default.target - -Start registry service: :: - - service docker-registry start - -Method 2: Managing Docker Registry with Compose -``````````````````````````````````````````````` - -Docker Compose it is a tool for defining and running Docker applications. It could help setting up registry. - -Install Docker Compose -'''''''''''''''''''''' - -Compose can also be run inside a container, from a small bash script wrapper. To install compose as a container run: :: - - curl -L https://github.com/docker/compose/releases/download/1.5.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose - chmod +x /usr/local/bin/docker-compose - -Create Configuration File -''''''''''''''''''''''''' - -Define configuration file ``docker-compose.yml`` under ``/docker-registry/`` folder as below. :: - - registry: - restart: always - image: registry:2 - ports: - - 5000:5000 - environment: - REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data - REGISTRY_HTTP_TLS_CERTIFICATE: /certs/domain.crt - REGISTRY_HTTP_TLS_KEY: /certs/domain.key - volumes: - - ./data:/data - - ./certs:/certs - -The environment section sets environment variables in the Docker registry container. The Docker registry app knows to check this environment variable when it starts up and to start saving its data to the ``/data`` folder as a result. - -Starting Docker Registry as a Service -''''''''''''''''''''''''''''''''''''' - -Create ``docker-registry.service`` file in ``/etc/systemd/system/``, add the following contents to it. :: - - [Uint] - Description=Docker Registry - - [Service] - Type=simple - Restart=on-failure - RestartSec=30s - WorkingDirectory=/docker-registry - ExecStart=/usr/local/bin/docker-compose up - - [Install] - WantedBy=default.target - -Start registry service: :: - - service docker-registry start - -Accessing Docker Registry from other docker host ------------------------------------------------- - -Copy ca.crt file from xCAT MN to a client machine. Client machine must be a docker host. :: - - scp username@xCAT_MN_ip:/etc/xcat/cert/ca.pem /etc/docker/certs.d/domainname:5000/ca.crt - -List Available Images in Registry -````````````````````````````````````` -:: - - curl -k https://domainname:5000/v2/_catalog - -Pull Images from Registry -````````````````````````` -Just use the "tag" image name, which includes the domain name, port, and image name. :: - - docker pull domainname:5000/imagename - -Push Images to Registry -``````````````````````` - -Before the image can be pushed to the registry, it must be tagged with the location of the private registry. :: - - docker tag imagename domainname:5000/imagename - -Now we can push that image to our registry. :: - - docker push domainname:5000/imagename - -**note:** If there is a problem with the CA certificate, edit the file ``/etc/default/docker`` so that there is a line that reads: ``DOCKER_OPTS="--insecure-registry domianname:5000"`` . Then restart Docker daemon ``service docker restart`` . - - diff --git a/docs/source/advanced/docker/dockerized_xcat/dockerized_xcat.rst b/docs/source/advanced/docker/dockerized_xcat/dockerized_xcat.rst deleted file mode 100644 index e6eb29fff..000000000 --- a/docs/source/advanced/docker/dockerized_xcat/dockerized_xcat.rst +++ /dev/null @@ -1,97 +0,0 @@ -Dockerized xCAT -================ - - -Overview --------- - -`Docker `_ is a popular containment environment making it easier to create, deploy, and run applications/services. With Docker, applications/services are shipped as **Docker images** and run in **Docker containers**. **Docker containers** include the application/services and all of its running environment, which have isolated namespace and network stack but share the kernel on the host operating system. The server on which **Docker containers** run is called **Docker host**. **Docker image** can only run on **Docker host** with the same architecture. - - -.. image:: ./imgs/xcatindocker4.jpg - :height: 500 px - :width: 600 px - :scale: 50 % - :alt: alternate text - :align: right - - -**Compose** is a native tool shipped by Docker to define and run applications in Docker containers. You use a Compose file to configure your applications/services. Then, using a single command, you create and start all the services from your configuration. - -By pulling xCAT Docker image and running xCAT Docker image in a container, you get a well-configured xCAT Management Node to start cluster management work, without worrying about the xCAT installation and configuration on different OS and various hardware platforms. - - -xCAT Docker images ------------------- - -xCAT ships 2 Docker images for Docker host with different architecture: - -* "xcat/xcat-ubuntu-x86_64": run on x86_64 Docker host -* "xcat/xcat-ubuntu-ppc64le": run on ppc64le Docker host - -Each of the xCAT Docker images above has 3 tags corresponding to different xCAT release inside Docker image: - -* "latest" : the latest xCAT release -* "2.11" : xCAT 2.11 release -* "dev" : the latest xCAT development snapshot build - -A Docker image with specified tag should be denoted in format "[docker image name]:[tag]", for example, "xcat/xcat-ubuntu-x86_64:2.11". If not specified, default tag is "latest". - - -Run xCAT in Docker ------------------- - -Each container with xCAT Docker image running inside is a xCAT management node, the container connects to the compute nodes and hardware control points in the cluster via "bridge" network on the Docker host. Generally, a xCAT container should connect to 2 types of networks( the 2 types of networks might be one network in some cluster): - -* "mgtnet": Management network, the network used by the Management Node to install operating systems and manage the nodes. The Management Node and in-band Network Interface Card (NIC) of the nodes are connected to this network. A bridge "mgtbr" will be created and attached to the network interface facing the compute nodes on Docker host -* "svcnet": Service network, the network used by the Management Node to control the nodes using out-of-band management using the Service Processor. A bridge "svcbr" will be created and attached to the network interface facing the hardware control points - -You are required to determine and specify some necessary information, so that xCAT is well configured and running when the container is started. This includes: - -* Docker container: xCAT Docker image with specified xCAT release; the data volumes with directories on Docker host including xCAT DB tables, the osimage resources and xCAT logs, which can be used to save and restore the data of xCAT service -* network information: the network configuration of the xCAT container -* cluster information: the domain of the cluster - -The information can be specified in 2 ways to run xCAT container: - -* in options and arguments of docker commands such as ``docker network create`` or ``docker run`` -* in the "docker-compose.yml", which contains all the configuration to start xCAT containers with Compose. This is the recommended way to start xCAT container. - -The 2 ways are described step-by-step in the following sections of this documentation. We recommend you start xCAT container with Compose. - -When xCAT Docker container is started, you can access it with ``sudo docker attach``, however, we recommend you to access it via "ssh". - - - -.. toctree:: - :maxdepth: 2 - - setup_docker_host.rst - run_xcat_in_docker_compose.rst - run_xcat_in_docker_native.rst - - - -Work with xCAT --------------- - -Once xCAT Docker container is running, you can use xCAT with the shell inside the container. Since the ssh service has been enabled on the Docker container startup, you can connect to the container via ssh. The default root password is "cluster". - -Once you attach or ssh to the container, you will find that xCAT is running and configured, you can play with xCAT and manage your cluster now. - -Currently, since xCAT can only generate the diskless osimages of Linux distributions with the same OS version and architecture with xCAT MN. If you need to provision diskless osimages besides ubuntu x86_64 with xCAT running in the Docker, you can use ``imgexport`` and ``imgimport`` to import the diskless osimages generated before. - -If you start up the xCAT Docker container by following the steps described in sections above strictly, without specifying "--dns=IP_ADDRESS...", "--dns-search=DOMAIN...", or "--dns-opt=OPTION..." options, Docker uses the /etc/resolv.conf of the host machine (where the docker daemon runs). Any DNS problem inside container, make sure the DNS server on the Docker host works well. - -Save and Restore xCAT data ----------------------------- - -According to the policy of Docker, Docker image should only be the service deployment unit, it is not recommended to save data in Docker image. Docker uses "Data Volume" to save persistent data inside container, which can be simply taken as a shared directory between Docker host and Docker container. - -For dockerized xCAT, there are 3 volumes recommended to save and restore xCAT user data. - -* "/install": save the osimage resources under "/install" directory -* "/var/log/xcat/": save xCAT logs -* "/.dbbackup": save and restore xCAT DB tables. You can save the xCAT DB tables with ``dumpxCATdb -p /.dbbackup/`` inside container and xCAT will restore the tables on the container start up. - - diff --git a/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_compose.rst b/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_compose.rst deleted file mode 100644 index c50d05e68..000000000 --- a/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_compose.rst +++ /dev/null @@ -1,156 +0,0 @@ -Run xCAT in Docker with Compose (Recommended) -============================================= - - -An example configuration in the documentation ---------------------------------------------- - -To demonstrate the steps to run xCAT in a Docker container, take a cluster with the following configuration as an example :: - - - The name of the docker container running xCAT: xcatmn - The hostname of container xcatmn: xcatmn - The dns domain of the cluster: clusters.com - - The management network object: mgtnet - The network bridge of management network on Docker host: mgtbr - The management network interface on the Docker host facing the compute nodes: eno1 - The IP address of eno1 on Docker host: 10.5.107.1/8 - The IP address of xCAT container in management network: 10.5.107.101 - - The service network object: svcnet - The network bridge of service network on Docker host: svcbr - The service network interface on the Docker host facing the hardware control points: eno2 - The IP address of eno2 on Docker host: 192.168.0.1/8 - The IP address of xCAT container in service network: 192.168.0.101 - - -Install Compose on Docker host ------------------------------- - -Compose v1.7.0 or above should be installed on Docker host: :: - - curl -L https://github.com/docker/compose/releases/download/1.7.0-rc1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose - chmod +x /usr/local/bin/docker-compose - - -Customize docker-compose file ------------------------------ - -xCAT ships a docker-compose template `docker-compose.yml `_, which is a self-description file including all the configurations to run xCAT in container. You can make up your compose file based on it if you are familiar with `Compose file `_ , otherwise, you can simply customize it with the following steps: - -1. Specify the xCAT Docker image - -:: - - image: [xCAT Docker image name]:[tag] - -specify the name and tag of xCAT Docker image, for example "xcat/xcat-ubuntu-x86_64:2.11" - -2. Specify the cluster domain name - -:: - - extra_hosts: - - "xcatmn.[cluster domain name] xcatmn:[Container's IP address in management network]" - -specify the cluster domain name,i.e, "site.domain" on xCAT Management Node, for example "clusters.com", and the IP address of xCAT Docker container in the management network, such as "10.5.107.101" - -3. Specify the IP address of xCAT container in service network and management network - -:: - - networks: - - svcnet: - ipv4_address : [Container's IP address in service network] - - mgtnet: - ipv4_address : [Container's IP address in management network] - -specify the IP address of Docker container in service network and management network. If the "svcnet" is the same as "mgtnet", the 2 "svcnet" lines should be commented out. - -4. Specify the Docker network objects for management network and service network - -:: - - networks: - - #management network, attached to the network interface on Docker host - #facing the nodes to provision - mgtnet: - driver: "bridge" - driver_opts: - com.docker.network.bridge.name: "mgtbr" - ipam: - config: - - subnet: [subnet of mgtbr in CIDR] - gateway:[IP address of mgtbr] - - #service network, attached to the network interface on - #Docker host facing the bmc network - svcnet: - driver: "bridge" - driver_opts: - com.docker.network.bridge.name: "svcbr" - ipam: - config: - - subnet: [subnet of svcbr in CIDR] - gateway: [IP address of svcbr] - -specify the network configuration of bridge networks "mgtnet" and "svcnet", the network configuration of the bridge networks should be same as the network interfaces attached to the bridges. The "mgtnet" and "svcnet" might the same network in some cluster, in this case, you can ignore the lines for "svcnet". - -5. Specify the Data Volumes for xCAT Docker container - -:: - - volumes: - #the "/install" volume is used to keep user data in xCAT, - #such as osimage resources - #the user data can be accessible if specified - - [The directory on Docker host mounted to "/install" inside container]:/install - #the "/.dbbackup" volume is used to backup and restore xCAT DB tables - #Dockerized xCAT will restore xCAT DB tables if specified - #"dumpxCATdb -p /.dbbackup" should be run manually to save xCAT DB inside container - - [The directory on Docker host mounted to save xCAT DB inside container]:/.dbbackup - #the "/.logs" value is used to keep xCAT logs - #the xCAT logs will be kept if specified - - [The directory on Docker host to save xCAT logs inside container]:/var/log/xcat/ - -specify the volumes of the xCAT container used to save and restore xCAT data - - -Start xCAT Docker container with Compose ----------------------------------------- -After the "docker-compose.yml" is ready, the xCAT Docker container can be started with [1]_ :: - - docker-compose -f "docker-compose.yml" up -d; \ - ifconfig eno1 0.0.0.0; \ - brctl addif mgtbr eno1; \ - ip link set mgtbr up; \ - docker-compose logs -f - -This command starts up the Docker container and attaches the network interface "eno1" of Docker host to the bridge network "mgtbr". It is a little complex due to a Compose bug `#1003 `_ . The commands should be run successively in one line to avoid breaking the network connection of the network interface of Docker host. - -To remove the container, you can run :: - - docker-compose -f "docker-compose.yml" down; \ - ifdown eno1; \ - ifup eno1 - -To update the xCAT Docker image, you can run :: - - docker-compose -f "docker-compose.yml" pull - - -Known Issues ------------- - -.. [1] - -When you start up xCAT Docker container, you might see an error message at the end of the output like :: - - Couldn't connect to Docker daemon at http+unix://var/run/docker.sock - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. - -You can ignore it, the container has already been running. It is a Docker bug `#1214 `_ - diff --git a/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst b/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst new file mode 100644 index 000000000..b77fe96b5 --- /dev/null +++ b/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst @@ -0,0 +1,104 @@ +Quick Start to Use xCAT Docker Image +==================================== + +A new Docker image will be published for each new release of xCAT. Use ``docker search xcat2`` to list all Docker images xCAT has released. xCAT Docker image offical organization is ``xcat``, repository is ``xcat2``. :: + + [dockerhost]# sudo docker search xcat2 + NAME DESCRIPTION STARS OFFICIAL AUTOMATED + xcat/xcat2 ... ... ... ... + +The xCAT Docker images are tagged to match the xCAT releases, If you want to deploy the xCAT 2.14.6 version, pull down the ``xcat/xcat2:2.14.6`` image. xCAT Docker image also has a ``latest`` tag to point to the latest release. Currently xCAT Docker images are based on CentOS. + +.. Attention:: + To do discovery for POWER9 bare metal server, please refer to :doc:`xCAT Genesis Base ` + +Prerequisite for Docker Host +---------------------------- + +* To run xCAT under Docker, the services ``SELinux`` and ``AppArmor`` on Docker host must be disabled. + + SELinux can be disabled with: :: + + echo 0 > /selinux/enforce + sed -i 's/^SELINUX=.*$/SELINUX=disabled/' /etc/selinux/config + + AppArmor can be disabled with: :: + + /etc/init.d/apparmor teardown + + +* To run xCAT under Docker the ports described in :doc:`document ` should be available. + + For Linux user, use the following command to verify ports are not used :: + + netstat -nlp |grep -E ":(3001|3002|68|53|873|80|69|12429|12430|67) " + + +Pull the xCAT Docker Image from DockerHub +----------------------------------------- + +To pull the latest xCAT Docker image, run :: + + [dockerhost]# sudo docker pull xCAT/xCAT2:latest + + +Run xCAT in Docker Container +---------------------------- + +Run the xCAT Docker container with the Docker image ``xCAT/xCAT2:latest`` :: + + + [dockerhost]# sudo docker run -d \ + --name xcatmn \ + --network=host \ + --hostname xcatmn \ + --privileged \ + -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ + -v /xcatdata:/xcatdata \ + -v /var/log/xcat:/var/log/xcat \ + -v /customer_data:/customer_data \ + xcat/xcat2:latest + + +The descriptions: + +:name: + Assign a name to the container, this name can be used to manipulate the container on docker host. + +:--network=host: + Use the host network driver for a container, that container network stack is not isolated from the docker host. + +:hostname: + Specify the hostname of container, which is available inside the container. + +:--privileged=true: + Give extended privileges to this container. + +:-v /sys/fs/cgroup\:/sys/fs/cgroup\:ro: + Is **mandatory** configuration to enable systemd in container. + +:-v /xcatdata\:/xcatdata: + xCAT container will create ``/xcatdata`` volume to store configuration and OS distro data. I.e. xCAT important directories ``/install``, ``/tftpboot`` and ``/etc`` will be saved under ``/xcatdata``. If user does not explicitly mount this directory to docker host, this directory will be mounted under ``/var/lib/docker/volumes/``. + +:-v /var/log/xcat\:/var/log/xcat: + All xCAT running logs are saved under ``/var/log/xcat``. Use this setting to export them to Docker host. + +:-v /customer_data\:/customer_data: + **Is optional**. Use this setting to transfer user data between Docker host and container. + +Run xCAT Command in Docker Container +------------------------------------ + +To enter xCAT Docker container :: + + [dockerhost]# sudo docker exec -it xcatmn bash + [xcatmn]# + +Also can enter xCAT Docker container through ``ssh`` :: + + [anynode]# ssh -p 2200 + +Now container ``xcatmn`` will work as a normal xCAT management node, can run xCAT commands directly. +For example :: + + [xcatmn]# lsxcatd -a diff --git a/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_native.rst b/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_native.rst deleted file mode 100644 index 7fec49456..000000000 --- a/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_native.rst +++ /dev/null @@ -1,77 +0,0 @@ -Run xCAT in Docker with Docker native commands -============================================== - - -Pull the xCAT Docker image from DockerHub ------------------------------------------ - -Now xCAT ships xCAT Docker images(x86_64 and ppc64le) on the `DockerHub `_: - -To pull the latest xCAT Docker image for x86_64, run :: - - sudo docker pull xcat/xcat-ubuntu-x86_64 - -On success, you will see the pulled Docker image on Docker host :: - - [root@dockerhost1 ~]# sudo docker images - REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE - xcat/xcat-ubuntu-x86_64 latest 3a3631463e83 2 days ago 643 MB - - -An example configuration in the documentation ---------------------------------------------- - -To demonstrate the steps to run xCAT in a Docker container, take a cluster with the following configuration as an example :: - - Docker host: dockerhost1 - The name of the docker container running xCAT: xcatmn - The hostname of container xcatmn: xcatmn - - The management network object: mgtnet - The network bridge of management network on Docker host: mgtbr - The management network interface on the Docker host facing the compute nodes: eno1 - The IP address of eno1 on Docker host: 10.5.107.1/8 - The IP address of xCAT container in management network: 10.5.107.101 - - The dns domain of the cluster: clusters.com - - -Create a customized Docker network on the Docker host ------------------------------------------------------ - -**Docker Networks** provide complete isolation for containers, which gives you control over the networks your containers run on. To run xCAT in Docker, you should create a customized bridge network according to the cluster network plan, instead of using the default bridge network created on Docker installation. - -As an example, we create a customized bridge network "mgtbr" which is attached to the network interface "eno1" facing the compute nodes and inherits the network configuration of "eno1". Since the commands to create the network will break the network connection on "eno1", you'd better run the commands in one line instead of running them seperatly :: - - sudo docker network create --driver=bridge --gateway=10.5.107.1 --subnet=10.5.107.0/8 -o "com.docker.network.bridge.name"="mgtbr" mgtnet; \ - ifconfig eno1 0.0.0.0; \ - brctl addif mgtbr eno1; \ - ip link set mgtbr up - -* ``--driver=bridge`` specify the network driver to be "bridge" -* ``--gateway=10.5.107.1`` specify the network gateway to be the IP address of "eno1" on Docker host. which will also be the IP address of network bridge "mgtbr" -* ``--subnet=10.5.107.0/8`` speify the subnet in CIDR format to be the subnet of "eno1" -* ``com.docker.network.bridge.name"="mgtbr"`` specify the bridge name of management network -* ``ifconfig eno1 0.0.0.0`` delete the IP address of "eno1" -* ``brctl addif mgtbr eno1`` attach the bridge "br0" to network interface "eno1" -* ``ip link set mgtbr up`` change the state of "br0" to UP - -When the network is created, you can list it with ``sudo docker network ls`` and get the information of it with ``sudo docker inspect mgtnet``. - - -Run xCAT in Docker container ----------------------------- - -Now run the xCAT Docker container with the Docker image "xcat/xcat-ubuntu-x86_64" and connect it to the newly created customized Docker network "mgtnet" :: - - sudo docker run -it --privileged=true --hostname=xcatmn --name=xcatmn --add-host="xcatmn.clusers.com xcatmn:10.5.107.101" --volume /docker/xcatdata/:/install --net=mgtnet --ip=10.5.107.101 xcat/xcat-ubuntu-x86_64 - -* use ``--privileged=true`` to give extended privileges to this container -* use ``--hostname`` to specify the hostname of the container, which is available inside the container -* use ``--name`` to assign a name to the container, this name can be used to manipulate the container on Docker host -* use ``--add-host="xcatmn.clusers.com xcatmn:10.5.107.101"`` to write the ``/etc/hosts`` entries of Docker container inside container. Since xCAT use the FQDN(Fully Qualified Domain Name) to determine the cluster domain on startup, make sure the format to be " : ", otherwise, you need to set the cluster domain with ``chdef -t site -o clustersite domain="clusters.com"`` inside the container manually -* use ``--volume /docker/xcatdata/:/install`` to mount a pre-created "/docker/xcatdata" directory on Docker host to "/install" directory inside container as a data volume. This is optional, it is mandatory if you want to backup and restore xCAT data. -* use ``--net=mgtnet`` to connect the container to the Docker network "mgtnet" -* use ``--ip=10.5.107.101`` to specify the IP address of the xCAT Docker container - - diff --git a/docs/source/advanced/docker/dockerized_xcat/setup_docker_host.rst b/docs/source/advanced/docker/dockerized_xcat/setup_docker_host.rst deleted file mode 100644 index f0014130c..000000000 --- a/docs/source/advanced/docker/dockerized_xcat/setup_docker_host.rst +++ /dev/null @@ -1,25 +0,0 @@ -Setup Docker host -================= - -Install Docker Engine ---------------------- - -The Docker host to run xCAT Docker image should be a baremental or virtual server with Docker v1.10 or above installed. For the details on system requirements and Docker installation, refer to `Docker Installation Docs `_. - -.. note:: Docker images can only run on Docker hosts with the same architecture. Since xCAT only ships x86_64 and ppc64le Docker images, running xCAT in Docker requires x86_64 or ppc64 Docker Hosts. - -Shutdown the SELinux/Apparmor on Docker host --------------------------------------------- - -If the SELinux or Apparmor on Docker host is enabled, the services/applications inside Docker Container might be confined. To run xCAT in Docker container, SELinux and Apparmor on the Docker host must be disabled. - -SELinux can be disabled with: :: - - echo 0 > /selinux/enforce - sed -i 's/^SELINUX=.*$/SELINUX=disabled/' /etc/selinux/config - -AppArmor can be disabled with: :: - - /etc/init.d/apparmor teardown - - diff --git a/docs/source/advanced/docker/index.rst b/docs/source/advanced/docker/index.rst index 7d275a49f..923559796 100644 --- a/docs/source/advanced/docker/index.rst +++ b/docs/source/advanced/docker/index.rst @@ -4,6 +4,4 @@ Docker .. toctree:: :maxdepth: 2 - dockerized_xcat/dockerized_xcat.rst - lifecycle_management.rst - docker_registry.rst + dockerized_xcat/run_xcat_in_docker_host.rst diff --git a/docs/source/advanced/docker/lifecycle_management.rst b/docs/source/advanced/docker/lifecycle_management.rst deleted file mode 100644 index 3bc48a0c8..000000000 --- a/docs/source/advanced/docker/lifecycle_management.rst +++ /dev/null @@ -1,256 +0,0 @@ -Docker life-cycle management in xCAT -==================================== - -The Docker linux container technology is currently very popular. xCAT can help managing Docker containers. xCAT, as a system management tool has the natural advantage for supporting multiple operating systems, multiple architectures and large scale clusters. - -This document describes how to use xCAT for docker management, from Docker Host setup to docker container operations. - -.. note:: This document was verified with: - * Docker Version 1.10, 1.11 - * Docker API version 1.22 - - Docker Host has been verified on the following OS/ARCH combinations: - * Ubuntu 14.04.3,x86_64 - * Ubuntu 15.10,x86_64 - * Ubuntu 16.04,x86_64 - * Ubuntu 16.04,ppc64el - - -Setting up Docker Host ----------------------- - -The **Docker Host** is the bare metal server or virtual machine where Docker containers can run. It will be called *dockerhost* in the following sections. - -The *dockerhost* at a minimum must provide the following: - -* An Operating System for running docker daemon -* The certification related files to be used by Docker service for trusted connection. - -Preparing osimage for docker host -````````````````````````````````` -The osimage represents the image of the Operating System which will be deployed on the dockerhost. - -Copy files out from DVDs/ISOs and generate -"""""""""""""""""""""""""""""""""""""""""" -**[ubuntu x86_64]** :: - - copycds ubuntu-xxx-server-amd64.iso - -**[ubuntu16.04 ppc64el]** :: - - copycds ubuntu-16.04-server-ppc64el.iso - -Create pkglist and otherpkglist of osimage for dockerhost -""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -The pkglist file should contain the following: :: - - # cat /install/custom/ubuntu/ubuntu.pkglist - openssh-server - ntp - gawk - nfs-common - snmpd - bridge-utils - -The otherpkglist file should contain the following: - -**[ubuntu x86_64]** :: - - # cat /install/custom/ubuntu/ubuntu_docker.pkglist - docker-engine - -**[ubuntu16.04 ppc64el]** - -At the time of this writing (February 2016), docker package is not available for **ppc64el** architecture from docker.org. You can follow instructions below on how to manually download and install it. - -* Download docker engine for ppc64el: - -:: - - wget http://launchpadlibrarian.net/251622081/docker.io_1.10.3-0ubuntu4_ppc64el.deb -O /install/docker_ppc64el/docker.io_1.10.3-0ubuntu4_ppc64el.deb - -* Configure **otherpkgdir** like this: - -:: - - otherpkgdir=/install/docker_ppc64el - -* The **otherpkglist** file should be: - -:: - - # cat /install/custom/ubuntu/ubuntu_docker.pkglist - docker.io - -Create the osimage for dockerhost -""""""""""""""""""""""""""""""""" -The osimage for dockerhost will be like this: - -**[ubuntu x86_64]** :: - - # lsdef -t osimage ub14.04.03-x86_64-dockerhost - Object name: ub14.04.03-x86_64-dockerhost - imagetype=linux - osarch=x86_64 - osname=Linux - osvers=ubuntu14.04.3 - otherpkgdir=https://apt.dockerproject.org/repo ubuntu-trusty main,http://cz.archive.ubuntu.com/ubuntu trusty main - otherpkglist=/install/custom/ubuntu/ubuntu_docker.pkglist - pkgdir=/install/ubuntu14.04.3/x86_64 - pkglist=/install/custom/ubuntu/ubuntu.pkglist - profile=compute - provmethod=install - template=/opt/xcat/share/xcat/install/ubuntu/compute.tmpl - -**[ubuntu16.04 ppc64el]** :: - - # lsdef -t osimage ub16.04-ppc64el-dockerhost - Object name: ub16.04-ppc64el-dockerhost - imagetype=linux - osarch=ppc64el - osname=Linux - osvers=ubuntu16.04 - otherpkgdir=/install/docker_ppc64el - otherpkglist=/install/custom/ubuntu/ubuntu_docker.pkglist - pkgdir=/install/ubuntu16.04/ppc64el - pkglist=/install/custom/ubuntu/ubuntu.pkglist - profile=compute - provmethod=install - template=/opt/xcat/share/xcat/install/ubuntu/compute.tmpl - -Preparing setup trust connection for docker service and create docker network object -```````````````````````````````````````````````````````````````````````````````````` -Currently, a customer defined network object is needed when create a docker container with static IP address, it can be done with the command: :: - - chdef host01 -p postbootscripts="setupdockerhost =/@[:nicname]" - -* netobj_name: the network object to be created, it will be used in *dockernics* when creating docker container -* subnet/netmask@gateway: the network which the IP address of docker container running on the docker host must be located in. If *nicname* is specified, the *subnet/netmask* must be the subnet of the nic *nicname* located in. And *gateway* shall be the IP address of the nic *nicname*. -* nicname: the physical nic name which will be attached to the network object - -For example, a network object *mynet0* with subnet *10.0.0.0/16* and gateway *10.0.101.1* on nic *eth0* can be created with the command: :: - - chdef host01 -p postbootscripts="setupdockerhost mynet0=10.0.0.0/16@10.0.101.1:eth0" - -Start OS provisioning for dockerhost -```````````````````````````````````` - -Reference :ref:`Initialize the Compute for Deployment` for how to finish an OS deployment. - -Docker instance management --------------------------- - -After the dockerhost is ready, a docker instance can be managed through xCAT commands. In xCAT, a docker instance is represented by a node whose definition can be like this: :: - - # lsdef host01c01 - Object name: host01c01 - dockerhost=host01:2375 - dockernics=mynet0 - groups=docker,all - ip=10.0.120.1 - mac=02:42:0a:00:78:01 - mgt=docker - postbootscripts=otherpkgs - postscripts=syslog,remoteshell,syncfiles - -The command :doc:`mkdef ` or :doc:`chdef ` can be used to create a new docker instance node or change the node attributes. Specify any available unused ip address for *ip* attribute. *mac* attribute is optional and if left unset, will be filled in by *mkdocker* command. - -After docker instance node is defined, use command `makehosts host01c01` to add node *host01c01* and its IP address *10.0.120.1* into /etc/hosts. - -Create docker instance -`````````````````````` -:: - - mkdocker [image= [command=] [dockerflag=]] - -* node - The node object which represents the docker instance -* image - The image name that the docker instance will use -* command - The command that the docker will run -* dockerflag - A JSON string which will be used as parameters to create a docker. Reference `docker API v1.22 `_ for more information about which parameters can be specified for "dockerflag". - -To create the docker instance *host01c01* with image *ubuntu* and command */bin/bash*, use: :: - - mkdocker host01c01 image=ubuntu command=/bin/bash dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true}" - -Remove docker instance -`````````````````````` -:: - - rmdocker - -The command **rmdocker host01c01** can be used to remove the docker instance *host01c01*. - -List docker information -``````````````````````` -:: - - lsdocker [-l|--logs] - -To list all the running docker instances on the dockerhost *host01*, use **lsdocker host01**. - -To list the info of docker instance *host01c01*, use **lsdocker host01c01**. - -To get log info of docker instance *host01c01*, use **lsdocker host01c01 --logs**. - -Start docker instance -````````````````````` -:: - - rpower start - -Stop docker instance -```````````````````` -:: - - rpower stop - -Restart docker instance -``````````````````````` -:: - - rpower restart - -Pause all processes within a docker instance -```````````````````````````````````````````` -:: - - rpower pause - -Unpause all processes within a docker instance -`````````````````````````````````````````````` -:: - - rpower unpause - -Check docker instance status -```````````````````````````` -:: - - rpower state - -Troubleshooting --------------------------- - -If things go wrong: - -* After dockerhost node boots, check contents of **/var/log/xcat/xcat.log** file on the dockerhost for errors. - -* Verify **nicname** specified in **Preparing setup trust connection for docker service and create docker network object** section exists on the docker host. Depending on the version of Ubuntu OS and host architecture, it could be **eth0**, or **em1**, or **eno1**, or **enp0s1**. Verify by running on the dockerhost - -:: - - ip addr show dev - -* Run **ps -ef | grep docker** to verify docker engine is running with configured options. It should look something like - -:: - - root 3703 1 0 Apr15 ? 00:12:28 /usr/bin/docker daemon -H unix:///var/run/docker.sock -H tcp://host01:2375 --tls --tlscacert=/root/.docker/ca-cert.pem --tlscert=/root/.docker/dockerhost-cert.pem --tlskey=/root/.docker/dockerhost-cert.pem --tlsverify=true --raw-logs - -If the output is missing some options, verify that file **/lib/systemd/system/docker.service** contains the following lines - -:: - - EnvironmentFile=-/etc/default/docker - ExecStart=/usr/bin/docker daemon $DOCKER_OPTS -H fd:// From 86874cd1679fcdb69d24e91622f1c8aa7c60daf9 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 23 Apr 2019 17:02:04 +0800 Subject: [PATCH 073/276] Add goconserver to the SLES12 otherpkgs.pkglist. In order to pull the xcat-dep directory into the zypper repository --- .../xcat/install/sles/service.sles12.ppc64le.otherpkgs.pkglist | 1 + .../xcat/install/sles/service.sles12.x86_64.otherpkgs.pkglist | 1 + .../xcat/netboot/sles/service.sles12.ppc64le.otherpkgs.pkglist | 1 + .../xcat/netboot/sles/service.sles12.x86_64.otherpkgs.pkglist | 1 + 4 files changed, 4 insertions(+) diff --git a/xCAT-server/share/xcat/install/sles/service.sles12.ppc64le.otherpkgs.pkglist b/xCAT-server/share/xcat/install/sles/service.sles12.ppc64le.otherpkgs.pkglist index 265b14490..096209962 100644 --- a/xCAT-server/share/xcat/install/sles/service.sles12.ppc64le.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/install/sles/service.sles12.ppc64le.otherpkgs.pkglist @@ -1 +1,2 @@ xcat/xcat-core/xCATsn +xcat/xcat-dep/sles12/ppc64le/goconserver diff --git a/xCAT-server/share/xcat/install/sles/service.sles12.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/install/sles/service.sles12.x86_64.otherpkgs.pkglist index 265b14490..a9d86fded 100644 --- a/xCAT-server/share/xcat/install/sles/service.sles12.x86_64.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/install/sles/service.sles12.x86_64.otherpkgs.pkglist @@ -1 +1,2 @@ xcat/xcat-core/xCATsn +xcat/xcat-dep/sles12/x86_64/goconserver diff --git a/xCAT-server/share/xcat/netboot/sles/service.sles12.ppc64le.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/sles/service.sles12.ppc64le.otherpkgs.pkglist index 265b14490..096209962 100644 --- a/xCAT-server/share/xcat/netboot/sles/service.sles12.ppc64le.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/netboot/sles/service.sles12.ppc64le.otherpkgs.pkglist @@ -1 +1,2 @@ xcat/xcat-core/xCATsn +xcat/xcat-dep/sles12/ppc64le/goconserver diff --git a/xCAT-server/share/xcat/netboot/sles/service.sles12.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/sles/service.sles12.x86_64.otherpkgs.pkglist index 5e66cf547..1e7889a64 100644 --- a/xCAT-server/share/xcat/netboot/sles/service.sles12.x86_64.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/netboot/sles/service.sles12.x86_64.otherpkgs.pkglist @@ -1,2 +1,3 @@ -perl-doc xcat/xcat-core/xCATsn +xcat/xcat-dep/sles12/x86_64/goconserver From 3ae58537b73a80bb33d05ac7ac6fe1470c15f228 Mon Sep 17 00:00:00 2001 From: huweihua Date: Tue, 23 Apr 2019 06:47:11 -0400 Subject: [PATCH 074/276] update typo and add one note for xcat docker container document --- .../docker/dockerized_xcat/run_xcat_in_docker_host.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst b/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst index b77fe96b5..826c30ce0 100644 --- a/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst +++ b/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst @@ -39,7 +39,7 @@ Pull the xCAT Docker Image from DockerHub To pull the latest xCAT Docker image, run :: - [dockerhost]# sudo docker pull xCAT/xCAT2:latest + [dockerhost]# sudo docker pull xcat/xcat2:latest Run xCAT in Docker Container @@ -98,6 +98,14 @@ Also can enter xCAT Docker container through ``ssh`` :: [anynode]# ssh -p 2200 +.. Attention:: + Need to set ``site`` table depending on your own environment. + +For example :: + + [xcatmn]# chtab key=master site.value= + + Now container ``xcatmn`` will work as a normal xCAT management node, can run xCAT commands directly. For example :: From c6b322a6c373eaf5e5c13603267c3140975d2abb Mon Sep 17 00:00:00 2001 From: bybai Date: Tue, 23 Apr 2019 23:49:04 -0400 Subject: [PATCH 075/276] confignetwork need run twice when install NIC has alias --- xCAT/postscripts/configeth | 19 ++++++----- xCAT/postscripts/confignetwork | 58 +++++++++++++++++----------------- xCAT/postscripts/nicutils.sh | 14 ++++---- 3 files changed, 45 insertions(+), 46 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 98807699e..70e889b84 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -26,18 +26,17 @@ fi ######################################################################## # networkmanager_active=0: use network.service # networkmanager_active=1: use NetworkManager +# networkmanager_active=2: RH8 postscripts stage, NetworkManager is active but nmcli cannot modify NIC configure file ######################################################################## networkmanager_active=0 -checkservicestatus NetworkManager > /dev/null -if [ $? -eq 0 ]; then - networkmanager_active=1 -else - #In RH8 postscripts stage, NetworkManager is active but nmcli cannot modify NIC configure file - ps -ef|grep -v grep|grep NetworkManager >/dev/null 2>/dev/null - if [ $? -eq 0 ]; then +if [ -n "$NMCLI_USED" ] ; then + if [ "$NMCLI_USED" = "1" ]; then + networkmanager_active=1 + elif [ "$NMCLI_USED" = "2" ]; then networkmanager_active=2 fi fi + str_conf_file="" str_conf_file_xcatbak="" tmp_con_name="" @@ -657,11 +656,11 @@ elif [ "$1" = "-s" ];then echo $NODE > /etc/HOSTNAME else #write ifcfg-* file for redhat - con_name="xcat-install-"${str_inst_nic} + con_name="xcat-"${str_inst_nic} str_inst_prefix=$(v4mask2prefix ${str_inst_mask}) str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_inst_nic}" if [ $networkmanager_active -eq 2 ]; then - str_conf_file="/etc/sysconfig/network-scripts/ifcfg-xcat-install-${str_inst_nic}" + str_conf_file="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_inst_nic}" fi if [ $networkmanager_active -eq 1 ]; then is_nmcli_connection_exist "$con_name" @@ -683,7 +682,7 @@ elif [ "$1" = "-s" ];then echo "NETMASK=${str_inst_mask}" >> $str_conf_file echo "BOOTPROTO=none" >> $str_conf_file echo "ONBOOT=yes" >> $str_conf_file - echo "NAME=xcat-install-${str_inst_nic}" >> $str_conf_file + echo "NAME=xcat-${str_inst_nic}" >> $str_conf_file echo "HWADDR=${str_inst_mac}" >> $str_conf_file fi if [ $networkmanager_active -eq 2 ]; then diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index 232d9890d..d082700da 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -63,9 +63,7 @@ function get_nic_cfg_file_content { elif [ $is_debian -eq 1 ]; then cfg_file="$nwdir/${cfg_dev}" fi - #TODO:this is networkmanager_active=2 - ps -ef|grep -v grep|grep NetworkManager >/dev/null 2>/dev/null - if [ $? -eq 0 ]; then + if [ "$networkmanager_active" != "0" ]; then $ip address show dev ${cfg_dev}| $sed -e 's/^/[Ethernet] >> /g' | log_lines info else if [ -f $cfg_file ]; then @@ -474,9 +472,11 @@ function configure_nicdevice { while [ $num -lt $max ]; do nic_dev=`echo "$nics_pair" |sed -n "${num}p"|awk '{print $1}'` + ipaddrs=$(find_nic_ips $nic_dev) + contain_alias=$(echo $ipaddrs|grep "|") #If install nic is configured, skip to reconfigure it - if [ x"$nic_dev" = x"$installnic" -a $instnic_conf -eq 1 ]; then - log_warn "install nic $nic_dev has been configured, skip to reconfigure it." + if [ x"$nic_dev" = x"$installnic" -a $instnic_conf -eq 1 -a x"$contain_alias" = x ]; then + log_warn "install nic $nic_dev has been configured, skip to reconfigure it $contain_alias." ((num+=1)) continue fi @@ -528,7 +528,6 @@ function configure_nicdevice { echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" nic_pair=`echo "$nics_pair" |sed -n "${num}p"` echo "configure nic and its device : $nic_pair" - ipaddrs=$(find_nic_ips $nic_dev) # if a device is middle device, it may have no IP, for example, configure eth0->vlan.1->br0, vlan1.1 is middle device # is_mid_device is to label if ${nic_dev} is middle device # if $is_mid_device has value, the ${nic_dev} is middle device, or else, it is not middle device @@ -543,8 +542,8 @@ function configure_nicdevice { xcatnet=`query_nicnetworks_net $nic_dev` if [ -n "$ipaddrs" ]; then log_info "configure $nic_dev" - log_info "call: configeth $nic_dev $ipaddrs $xcatnet" - configeth $nic_dev $ipaddrs $xcatnet + log_info "call: NMCLI_USED=$networkmanager_active configeth $nic_dev $ipaddrs $xcatnet" + NMCLI_USED=$networkmanager_active configeth $nic_dev $ipaddrs $xcatnet if [ $? -ne 0 ]; then errorcode=1 fi @@ -637,27 +636,6 @@ errorcode=0 #nictypes should support capital letters, for example, Ethernet and ethernet utolcmd="sed -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" -#get for installnic -installnic='' -installnic=`get_installnic` -instnic_conf=0 -if [ $boot_install_nic -eq 1 ];then - if [ -n "$installnic" ]; then - echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - log_info "configure the install nic $installnic. " - instnic_conf=1 - configeth -s $installnic - if [ $? -ne 0 ]; then - errorcode=1 - fi - get_nic_cfg_file_content $installnic - echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - else - log_error "Can not determine proper install nic." - errorcode=1 - fi -fi - #check if using NetworkManager or network service networkmanager_active=3 check_NetworkManager_or_network_service @@ -672,6 +650,28 @@ else exit 1 fi +#get for installnic +installnic='' +installnic=`get_installnic` +instnic_conf=0 +if [ $boot_install_nic -eq 1 ];then + if [ -n "$installnic" ]; then + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + log_info "configure the install nic $installnic." + log_info "NMCLI_USED=$networkmanager_active configeth -s $installnic" + instnic_conf=1 + NMCLI_USED=$networkmanager_active configeth -s $installnic + if [ $? -ne 0 ]; then + errorcode=1 + fi + get_nic_cfg_file_content $installnic + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + else + log_error "Can not determine proper install nic." + errorcode=1 + fi +fi + #back up all network interface configure files nwdirbak=$nwdir".xcatbak" ls $nwdirbak > /dev/null 2>/dev/null diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 204343a99..5bcb6d18c 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -1587,6 +1587,13 @@ function decode_arguments { # ############################################################################## function check_NetworkManager_or_network_service() { + checkservicestatus network > /dev/null 2>/dev/null || checkservicestatus wicked > /dev/null 2>/dev/null + if [ $? -eq 0 ]; then + stopservice NetworkManager | log_lines info + disableservice NetworkManager | log_lines info + log_info "network service is active" + return 0 + fi #check NetworkManager is active checkservicestatus NetworkManager > /dev/null 2>/dev/null if [ $? -eq 0 ]; then @@ -1604,13 +1611,6 @@ function check_NetworkManager_or_network_service() { if [ $? -eq 0 ]; then return 2 fi - checkservicestatus network > /dev/null 2>/dev/null || checkservicestatus wicked > /dev/null 2>/dev/null - if [ $? -eq 0 ]; then - stopservice NetworkManager | log_lines info - disableservice NetworkManager | log_lines info - log_info "network service is active" - return 0 - fi checkservicestatus networking > /dev/null 2>/dev/null if [ $? -eq 0 ]; then stopservice NetworkManager | log_lines info From d99e2dd610a8c76db064d548ec53054a8f5209b2 Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 24 Apr 2019 03:04:46 -0400 Subject: [PATCH 076/276] update case to apply in container --- .../autotest/testcase/kdump/linux_diskless_kdump | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index b357a0ba2..f5ed9e44a 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -23,7 +23,7 @@ cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arc check:rc==0 cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`;cp $pkglistfile $pkglistfile.bak -cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`; if grep SUSE /etc/*release;then echo -e "kdump\nkexec-tools\nmakedumpfile\nat\n" >> $pkglistfile; elif grep "Red Hat" /etc/*release;then echo -e "kexec-tools\ncrash\nat\n" >> $pkglistfile;fi +cmd:pkglistfile=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'); if grep SUSE /etc/*release;then echo -e "kdump\nkexec-tools\nmakedumpfile\nat\n" >> $pkglistfile; elif grep "Red Hat" /etc/*release;then echo -e "kexec-tools\ncrash\nat\n" >> $pkglistfile; elif grep "CentOS Linux" /etc/*release;then echo -e "kexec-tools\ncrash\nat\n" >> $pkglistfile;fi check:rc==0 cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep exlist|awk -F'=' '{print $2}'`;cp $exlistfile $exlistfile.bak @@ -31,14 +31,14 @@ cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arc check:rc==0 cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`;cp $postinstallfile $postinstallfile.bak -cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`; if grep SUSE /etc/*release;then sed -i "/\/tmp/ s/10/500/g" $postinstallfile; elif grep "Red Hat" /etc/*release;then sed -i /devpts/a"tmpfs /var/tmp tmpfs defaults,size=500m 0 2" $postinstallfile;fi +cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`; if grep SUSE /etc/*release;then sed -i "/\/tmp/ s/10/500/g" $postinstallfile; elif grep "Red Hat" /etc/*release;then sed -i /devpts/a"tmpfs /var/tmp tmpfs defaults,size=500m 0 2" $postinstallfile;elif grep "CentOS Linux" /etc/*release;then sed -i /devpts/a"tmpfs /var/tmp tmpfs defaults,size=500m 0 2" $postinstallfile;fi check:rc==0 -cmd:if [ ! -d /kdumpdir ]; then mkdir -p /kdumpdir && chmod 777 /kdumpdir; fi +cmd:if [ ! -d /opt/xcat/share/xcat/tools/autotest/kdumpdir ]; then mkdir -p /opt/xcat/share/xcat/tools/autotest/kdumpdir && chmod 777 /opt/xcat/share/xcat/tools/autotest/kdumpdir; fi cmd:if [ ! -f /etc/exports ] ;then touch /etc/exports;else cp /etc/exports /etc/exports.bak;fi -cmd:cat /etc/exports|grep kdumpdir; if [ "$?" -ne "0" ]; then echo "/kdumpdir *(rw,no_root_squash,sync,no_subtree_check)" >> /etc/exports; fi +cmd:cat /etc/exports|grep kdumpdir; if [ "$?" -ne "0" ]; then echo "/opt/xcat/share/xcat/tools/autotest/kdumpdir *(rw,no_root_squash,sync,no_subtree_check)" >> /etc/exports; fi cmd:cd /etc; export exports;cd -;service nfs-server restart -cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute dump=nfs://$$MN/kdumpdir +cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute dump=nfs://$$MN/opt/xcat/share/xcat/tools/autotest/kdumpdir check:rc==0 cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute crashkernelsize=auto @@ -68,14 +68,13 @@ check:output=~booted cmd:xdsh $$CN date check:rc==0 check:output=~\d\d:\d\d:\d\d - cmd:xdsh $$CN "echo 'echo 1 > /proc/sys/kernel/sysrq; echo c > /proc/sysrq-trigger' > /tmp/kdump.trigger" cmd:xdsh $$CN "chmod 755 /tmp/kdump.trigger" cmd:xdsh $$CN "service atd start" cmd:xdsh $$CN "at now +1 minutes <<< /tmp/kdump.trigger" cmd:sleep 300 -cmd:vmcorefile=`find /kdumpdir/ -name vmcore`;if [[ -s $vmcorefile ]]; then echo "this file is not empty";else echo "this file is empty"; fi +cmd:vmcorefile=`find /opt/xcat/share/xcat/tools/autotest/kdumpdir/ -name vmcore`;if [[ -s $vmcorefile ]]; then echo "this file is not empty";else echo "this file is empty"; fi check:output=~not empty cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`;mv -f $pkglistfile.bak $pkglistfile @@ -83,7 +82,7 @@ cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arc cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`;mv -f $postinstallfile.bak $postinstallfile cmd:if [ -f /etc/exports.bak ] ;then mv -f /etc/exports.bak /etc/exports; fi -cmd:rm -rf /kdumpdir +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/kdumpdir cmd:cat /tmp/node.stanza | chdef -z;rm -rf /tmp/node.stanza cmd:cat /tmp/osimage.stanza | chdef -z;rm -rf /tmp/osimage.stanza cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then mv $rootimgdir.regbak $rootimgdir -f;fi From 57011694c6e359073367579e87645ced8efc7bcc Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 24 Apr 2019 04:02:42 -0400 Subject: [PATCH 077/276] update kit cases to apply in xcat container --- xCAT-test/autotest/testcase/addkitcomp/case0 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/addkitcomp/case0 b/xCAT-test/autotest/testcase/addkitcomp/case0 index 1265e1d4d..d56567791 100644 --- a/xCAT-test/autotest/testcase/addkitcomp/case0 +++ b/xCAT-test/autotest/testcase/addkitcomp/case0 @@ -39,11 +39,12 @@ check:rc==0 cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits/mykits-1.0-1.tar.bz2 check:rc==0 check:output=~Kit mykits-1.0-1 was successfully added -cmd:mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ osvers=$osbasename-$osmajorversion.$osminorversion;mkdef -t osdistro $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__ basename=$osbasename majorversion=$osmajorversion minorversion=$osminorversion arch=__GETNODEATTR($$CN,arch)__ type=Linux dirpaths=/install/$osbasename-$osmajorversion.$osminorversion/__GETNODEATTR($$CN,arch)__;else mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__;fi check:rc==0 cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -i testimage $kitcompname check:rc==0 check:output=~Assigning kit component +end cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;rmkitcomp -i testimage $kitcompname check:rc==0 check:output=~Removing kitcomponent From 03a1a22c02b8137b21a6a1acdfc55b51444bf8e6 Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 24 Apr 2019 22:34:25 -0400 Subject: [PATCH 078/276] update kit test cases to apply in xcat container --- xCAT-test/autotest/testcase/addkitcomp/case0 | 5 +++-- xCAT-test/autotest/testcase/chkkitcomp/cases0 | 3 ++- xCAT-test/autotest/testcase/rmkit/case0 | 9 ++++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/xCAT-test/autotest/testcase/addkitcomp/case0 b/xCAT-test/autotest/testcase/addkitcomp/case0 index d56567791..49dd8b561 100644 --- a/xCAT-test/autotest/testcase/addkitcomp/case0 +++ b/xCAT-test/autotest/testcase/addkitcomp/case0 @@ -44,11 +44,11 @@ check:rc==0 cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -i testimage $kitcompname check:rc==0 check:output=~Assigning kit component -end cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;rmkitcomp -i testimage $kitcompname check:rc==0 check:output=~Removing kitcomponent check:output=~were removed from osimage testimage successfully +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;rmdef -t osdistro -o $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__;fi cmd:rmkit mykits-1.0-1 check:rc==0 cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits/mykits-1.0-1.tar.bz2 @@ -71,7 +71,7 @@ check:rc==0 cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits/mykits-1.0-1.tar.bz2 check:rc==0 check:output=~Kit mykits-1.0-1 was successfully added -cmd:mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ osvers=$osbasename-$osmajorversion.$osminorversion;mkdef -t osdistro $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__ basename=$osbasename majorversion=$osmajorversion minorversion=$osminorversion arch=__GETNODEATTR($$CN,arch)__ type=Linux dirpaths=/install/$osbasename-$osmajorversion.$osminorversion/__GETNODEATTR($$CN,arch)__;else mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__;fi check:rc==0 cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -f -i testimage $kitcompname check:rc==0 @@ -80,6 +80,7 @@ cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;rmki check:rc==0 check:output=~Removing kitcomponent check:output=~were removed from osimage testimage successfully +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;rmdef -t osdistro -o $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__;fi cmd:rmkit mykits-1.0-1 check:rc==0 cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits/mykits-1.0-1.tar.bz2 diff --git a/xCAT-test/autotest/testcase/chkkitcomp/cases0 b/xCAT-test/autotest/testcase/chkkitcomp/cases0 index 2a8ea8935..0e46d2b1f 100644 --- a/xCAT-test/autotest/testcase/chkkitcomp/cases0 +++ b/xCAT-test/autotest/testcase/chkkitcomp/cases0 @@ -29,7 +29,7 @@ check:rc==0 cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/chkkitcomp/mykits/mykits-1.0-1.tar.bz2 check:rc==0 check:output=~Kit mykits-1.0-1 was successfully added -cmd:mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ osvers=$osbasename-$osmajorversion.$osminorversion;mkdef -t osdistro $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__ basename=$osbasename majorversion=$osmajorversion minorversion=$osminorversion arch=__GETNODEATTR($$CN,arch)__ type=Linux dirpaths=/install/$osbasename-$osmajorversion.$osminorversion/__GETNODEATTR($$CN,arch)__;else mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__;fi check:rc==0 cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -i testimage $kitcompname check:rc==0 @@ -42,6 +42,7 @@ check:rc==0 check:output=~compatible with osimage testimage cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;rmkitcomp -i testimage $kitcompname check:rc==0 +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;rmdef -t osdistro -o $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__;fi cmd:rmkit mykits-1.0-1 check:rc==0 cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/chkkitcomp/mykits/mykits-1.0-1.tar.bz2 diff --git a/xCAT-test/autotest/testcase/rmkit/case0 b/xCAT-test/autotest/testcase/rmkit/case0 index 9cbad4994..b005c9752 100644 --- a/xCAT-test/autotest/testcase/rmkit/case0 +++ b/xCAT-test/autotest/testcase/rmkit/case0 @@ -64,7 +64,7 @@ check:rc==0 cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits/mykits-1.0-1.tar.bz2 check:rc==0 check:output=~Kit mykits-1.0-1 was successfully added -cmd:mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ osvers=$osbasename-$osmajorversion.$osminorversion;mkdef -t osdistro $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__ basename=$osbasename majorversion=$osmajorversion minorversion=$osminorversion arch=__GETNODEATTR($$CN,arch)__ type=Linux dirpaths=/install/$osbasename-$osmajorversion.$osminorversion/__GETNODEATTR($$CN,arch)__;else mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__;fi check:rc==0 cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -i testimage $kitcompname check:rc==0 @@ -79,6 +79,7 @@ cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;rmki check:rc==0 check:output=~Removing kitcomponent check:output=~were removed from osimage testimage successfully +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;rmdef -t osdistro -o $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__;fi cmd:rmkit mykits-1.0-1 check:rc==0 cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits/mykits-1.0-1.tar.bz2 @@ -101,11 +102,12 @@ check:rc==0 cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits/mykits-1.0-1.tar.bz2 check:rc==0 check:output=~Kit mykits-1.0-1 was successfully added -cmd:mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ osvers=$osbasename-$osmajorversion.$osminorversion;mkdef -t osdistro $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__ basename=$osbasename majorversion=$osmajorversion minorversion=$osminorversion arch=__GETNODEATTR($$CN,arch)__ type=Linux dirpaths=/install/$osbasename-$osmajorversion.$osminorversion/__GETNODEATTR($$CN,arch)__;else mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__;fi check:rc==0 cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -i testimage $kitcompname check:rc==0 check:output=~Assigning kit component +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;rmdef -t osdistro -o $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__;fi cmd:rmkit -f mykits-1.0-1 check:rc==0 check:output=~Removing kit mykits-1.0-1 @@ -131,11 +133,12 @@ check:rc==0 cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits/mykits-1.0-1.tar.bz2 check:rc==0 check:output=~Kit mykits-1.0-1 was successfully added -cmd:mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ osvers=$osbasename-$osmajorversion.$osminorversion;mkdef -t osdistro $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__ basename=$osbasename majorversion=$osmajorversion minorversion=$osminorversion arch=__GETNODEATTR($$CN,arch)__ type=Linux dirpaths=/install/$osbasename-$osmajorversion.$osminorversion/__GETNODEATTR($$CN,arch)__;else mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__;fi check:rc==0 cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -i testimage $kitcompname check:rc==0 check:output=~Assigning kit component +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;rmdef -t osdistro -o $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__;fi cmd:rmkit -f mykits-1.0-1 -V check:rc==0 check:output=~Removing kit mykits-1.0-1 From 321c72b2885655848718d3b012d6be589055fb2d Mon Sep 17 00:00:00 2001 From: huweihua Date: Wed, 24 Apr 2019 23:40:21 -0400 Subject: [PATCH 079/276] Add notice of nfs setting in xcat docker container document --- .../docker/dockerized_xcat/run_xcat_in_docker_host.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst b/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst index 826c30ce0..c12a598a5 100644 --- a/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst +++ b/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst @@ -110,3 +110,7 @@ Now container ``xcatmn`` will work as a normal xCAT management node, can run xCA For example :: [xcatmn]# lsxcatd -a + +.. Attention:: + Recommend strongly to use external NFS if needed. If perfer to use xCAT container internal NFS service, the shared directory must be mount to Docker host by ``-v`` option when start xCAT container. + From b5ee90725a600651d1d87e5d576c256544ff6ff4 Mon Sep 17 00:00:00 2001 From: huweihua Date: Thu, 25 Apr 2019 22:53:16 -0400 Subject: [PATCH 080/276] modify depending on Mark's comment --- .../advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst b/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst index c12a598a5..726d9f333 100644 --- a/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst +++ b/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst @@ -112,5 +112,5 @@ For example :: [xcatmn]# lsxcatd -a .. Attention:: - Recommend strongly to use external NFS if needed. If perfer to use xCAT container internal NFS service, the shared directory must be mount to Docker host by ``-v`` option when start xCAT container. + Use of NFS outside of xCAT Docker container is recommended. For NFS service set up inside of xCAT Docker container, mount the shared directory with ``-v`` option when starting xCAT container. From 22e86f8d7dbc016df07e38d4f4715d9d622e5449 Mon Sep 17 00:00:00 2001 From: "Casandra H. Qiu" Date: Sun, 28 Apr 2019 20:23:28 -0400 Subject: [PATCH 081/276] Filter out the http port from cumulus-provision-url --- xCAT/postscripts/configinterface | 1 + xCAT/postscripts/cumulusztp | 1 + xCAT/postscripts/documulusdiscovery | 1 + 3 files changed, 3 insertions(+) diff --git a/xCAT/postscripts/configinterface b/xCAT/postscripts/configinterface index 1ec8d0d8b..f21d0d8cd 100755 --- a/xCAT/postscripts/configinterface +++ b/xCAT/postscripts/configinterface @@ -15,6 +15,7 @@ fi if [ -z "$MASTER" ]; then MASTER=$(cat /var/lib/dhcp/dhclient.eth0.leases|sed -n 's/.*cumulus-provision-url.*http:\/\+\([^\/]\+\)\/.*/\1/p'|tail -1) + MASTER=$(echo $MASTER | awk -F: '{print $1}') if [ -z "$MASTER" ]; then echo "xCAT Master unset! Cannot download interface description" exit 2 diff --git a/xCAT/postscripts/cumulusztp b/xCAT/postscripts/cumulusztp index e9f7a8e6c..38f5ddad9 100755 --- a/xCAT/postscripts/cumulusztp +++ b/xCAT/postscripts/cumulusztp @@ -35,6 +35,7 @@ function get_last_lease() #get ip address for server node server_ip="$(grep 'cumulus-provision-url' < <(get_last_lease eth0) | awk -F/ '{print $3}')" +server_ip="$(echo $server_ip | awk -F: '{print $1}')" hashostname="$(grep 'host-name' < <(get_last_lease eth0))" #download /install/postscripts from MN diff --git a/xCAT/postscripts/documulusdiscovery b/xCAT/postscripts/documulusdiscovery index c3e9d8db7..0d69111a5 100755 --- a/xCAT/postscripts/documulusdiscovery +++ b/xCAT/postscripts/documulusdiscovery @@ -4,6 +4,7 @@ # TODO: Figure out the master based on the DHCP packet XCATMASTER=$(cat /var/lib/dhcp/dhclient.eth0.leases |grep cumulus-provision-url|tail -1|awk -F/ '{print $3}') +XCATMASTER=$(echo $XCATMASTER | awk -F: '{print $1}') XCATPORT=3001 log_label="xcat.documulusdiscovery" From 3bc96bf1d7703777ab0aa16b93eb42d5eee83799 Mon Sep 17 00:00:00 2001 From: bybai Date: Mon, 29 Apr 2019 04:23:37 -0400 Subject: [PATCH 082/276] unify ifcfg-* names --- xCAT/postscripts/configeth | 4 ++-- xCAT/postscripts/confignetwork | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 70e889b84..b2ca8a318 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -660,7 +660,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 2 ]; then - str_conf_file="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_inst_nic}" + str_conf_file="/etc/sysconfig/network-scripts/ifcfg-$con_name" fi if [ $networkmanager_active -eq 1 ]; then is_nmcli_connection_exist "$con_name" @@ -682,7 +682,7 @@ elif [ "$1" = "-s" ];then echo "NETMASK=${str_inst_mask}" >> $str_conf_file echo "BOOTPROTO=none" >> $str_conf_file echo "ONBOOT=yes" >> $str_conf_file - echo "NAME=xcat-${str_inst_nic}" >> $str_conf_file + echo "NAME=${con_name}" >> $str_conf_file echo "HWADDR=${str_inst_mac}" >> $str_conf_file fi if [ $networkmanager_active -eq 2 ]; then diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index d082700da..07e98aa7c 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -473,10 +473,10 @@ function configure_nicdevice { do nic_dev=`echo "$nics_pair" |sed -n "${num}p"|awk '{print $1}'` ipaddrs=$(find_nic_ips $nic_dev) - contain_alias=$(echo $ipaddrs|grep "|") + multiple_ips=$(echo $ipaddrs|grep "|") #If install nic is configured, skip to reconfigure it - if [ x"$nic_dev" = x"$installnic" -a $instnic_conf -eq 1 -a x"$contain_alias" = x ]; then - log_warn "install nic $nic_dev has been configured, skip to reconfigure it $contain_alias." + if [ x"$nic_dev" = x"$installnic" -a $instnic_conf -eq 1 -a x"$multiple_ips" = x ]; then + log_warn "install nic $nic_dev has been configured, continue." ((num+=1)) continue fi From 82078204d357b278d0d12175f2b45b6b6ef8fc96 Mon Sep 17 00:00:00 2001 From: bybai Date: Mon, 29 Apr 2019 05:41:00 -0400 Subject: [PATCH 083/276] ./xCAT/postscripts/nicutils.sh --- xCAT/postscripts/nicutils.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 5bcb6d18c..8b0eeba75 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -1587,6 +1587,10 @@ function decode_arguments { # ############################################################################## function check_NetworkManager_or_network_service() { + #In RH7.6 postscripts stage, network service is active, but xCAT uses NetworkManager to configure IP, + #after that, xCAT disable NetworkManager, when CN is booted, CN use network service. + #In RH8, there is only NetworkManager + #So check network service should before check NetworkManager. checkservicestatus network > /dev/null 2>/dev/null || checkservicestatus wicked > /dev/null 2>/dev/null if [ $? -eq 0 ]; then stopservice NetworkManager | log_lines info From 6b61376595df5137487fd5179580ef909b725a4d Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 30 Apr 2019 11:19:55 +0800 Subject: [PATCH 084/276] Update mariadb related document for RHEL 8 --- .../advanced/hierarchy/databases/mysql_install.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/source/advanced/hierarchy/databases/mysql_install.rst b/docs/source/advanced/hierarchy/databases/mysql_install.rst index 366a083fc..67cb8c8c4 100644 --- a/docs/source/advanced/hierarchy/databases/mysql_install.rst +++ b/docs/source/advanced/hierarchy/databases/mysql_install.rst @@ -21,20 +21,27 @@ MySQL/MariaDB packages are shipped as part of most Linux Distributions. Red Hat Enterprise Linux ------------------------ -* MySQL - Using ``yum``, ensure that the following packages are installed on the management node: :: +* For RHEL 6 and prior, MySQL is shipped. Using ``yum``, ensure that the following packages are installed on the management node: :: perl-DBD-MySQL* mysql-server-5.* mysql-5.* mysql-connector-odbc-* -* MariaDB - Using ``yum``, ensure that the following packages are installed on the management node: :: +* For RHEL 7, MariaDB is shipped. Using ``yum``, ensure that the following packages are installed on the management node: :: mariadb-server-5.* mariadb-5.* perl-DBD-MySQL* mysql-connector-odbc-* +* For RHEL 8, MariaDB is shipped. Using ``dnf``, ensure that the following packages are installed on the management node: :: + + mariadb-server-5.* + mariadb-5.* + perl-DBD-MySQL* + mariadb-connector-odbc-* + Suse Linux Enterprise Server ---------------------------- From 89e9745a4fe802183dccba3ebd7bf84660342f8d Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 30 Apr 2019 11:52:31 +0800 Subject: [PATCH 085/276] Handle site.httpport for grub2-http --- xCAT-server/lib/xcat/plugins/grub2.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index 12048e0d1..f9c133acd 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -230,11 +230,21 @@ sub setstate { # write entries to boot config file, but only if not offline directive if ($cref and $cref->{currstate} ne "offline") { + my $httpport = "80"; + my @hports = xCAT::TableUtils->get_site_attribute("httpport"); + if ($hports[0]) { + $httpport = $hports[0]; + } + print $pcfg "set default=\"xCAT OS Deployment\"\n"; print $pcfg "menuentry \"xCAT OS Deployment\" {\n"; print $pcfg " insmod http\n"; print $pcfg " insmod tftp\n"; - print $pcfg " set root=$grub2protocol,$serverip\n"; + if ($grub2protocol eq "http" && $httpport ne "80") { + print $pcfg " set root=http,$serverip:$httpport\n"; + } else { + print $pcfg " set root=$grub2protocol,$serverip\n"; + } print $pcfg " echo Loading Install kernel ...\n"; my $protocolrootdir = ""; From 267f44de7c3a9402dd9078e173bbf972f9d9b53d Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 30 Apr 2019 12:11:39 +0800 Subject: [PATCH 086/276] Fix dhcp.pm for grub2-http and grub2-tftp --- xCAT-server/lib/xcat/plugins/dhcp.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 3ab6cf491..87c822d66 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -705,7 +705,7 @@ sub addnode } } elsif ($nrent and $nrent->{netboot} and $nrent->{netboot} eq 'yaboot') { $lstatements = 'filename = \"/yb/node/yaboot-' . $node . '\";' . $lstatements; - } elsif ($nrent and $nrent->{netboot} and $nrent->{netboot} eq 'grub2') { + } elsif ($nrent and $nrent->{netboot} and $nrent->{netboot} =~ /^grub2[-]?.*$/) { $lstatements = 'filename = \"/boot/grub2/grub2-' . $node . '\";' . $lstatements; } elsif ($nrent and $nrent->{netboot} and $nrent->{netboot} eq 'petitboot') { $lstatements = 'option conf-file \"http://' . $nxtsrv .':' . $httpport . '/tftpboot/petitboot/' . $node . '\";' . $lstatements; From 480fbe177c03e301181b66604c765a0d094d7a3c Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Mon, 29 Apr 2019 14:01:35 +0800 Subject: [PATCH 087/276] Reconstruction of the osimage resources search policy --- xCAT-server/lib/perl/xCAT/SvrUtils.pm | 90 ++++++++++++++++++--------- 1 file changed, 60 insertions(+), 30 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/SvrUtils.pm b/xCAT-server/lib/perl/xCAT/SvrUtils.pm index 9cde6c855..f2bba9d8f 100755 --- a/xCAT-server/lib/perl/xCAT/SvrUtils.pm +++ b/xCAT-server/lib/perl/xCAT/SvrUtils.pm @@ -446,13 +446,58 @@ sub getsynclistfile() } +=head3 get_os_search_list + Get the list of os names based on specified os name. + This function is used to create a proper file search list for osimage + template or pkglist + + Arguments: + $os + Returns: + An array of the names of os + Globals: + none + Error: + Example: + xCAT::SvrUtils->get_os_search_list("ubuntu18.04.2"); + Will returns + # ubuntu18.04.2 + # ubuntu18.04.1 + # ubuntu18.04.0 + # ubuntu18.04 + # ubuntu18.03 + # ubuntu18.02 + # ubuntu18.01 + # ubuntu18.00 + # ubuntu18 + Comments: + none + +=cut + +sub get_os_search_list { + my $os = shift; + my @word = split(/\./, $os); + my @list = (); + + while ($word[-1] =~ /^[0-9]+$/) { + while ($word[-1] >= 0) { + push(@list, join('.', @word)); + $word[-1] = sprintf("%0" . length($word[-1]) . "d", $word[-1] - 1); + } + pop(@word); + } + push(@list, join('.', @word)); + + return @list; +} + sub get_file_name { my ($searchpath, $extension, $profile, $os, $arch, $genos) = @_; #usally there're only 4 arguments passed for this function #the $genos is only used for the Redhat family - #handle the following ostypes: sles10.2, sles11.1, rhels5.3, rhels5.4, etc if (-r "$searchpath/$profile.$os.$arch.$extension") { @@ -468,27 +513,7 @@ sub get_file_name { return "$searchpath/$profile.$genos.$extension"; } - my $dotpos = rindex($os, "."); - my $osbase = substr($os, 0, $dotpos); - # If the osimge name was specified with -n, the name might contain multiple "." - # Chop them off one at a time until filename match is found - while ($dotpos > 0) { - if (-r "$searchpath/$profile.$osbase.$arch.$extension") { - return "$searchpath/$profile.$osbase.$arch.$extension"; - } - if (-r "$searchpath/$profile.$osbase.$extension") { - return "$searchpath/$profile.$osbase.$extension"; - } - # Chop off "." from the end and try again - $dotpos = rindex($osbase, "."); - $osbase = substr($osbase, 0, $dotpos); - } - - #if there are no '.', pick the two numbers follow by leading string, like sles11 - #then pick one number follow by leading string, like centos7, rhels7 - if ($os =~ m/([a-zA-Z]+\d\d)/) - { - $osbase=$1; + foreach my $osbase (xCAT::SvrUtils::get_os_search_list($os)) { if (-r "$searchpath/$profile.$osbase.$arch.$extension") { return "$searchpath/$profile.$osbase.$arch.$extension"; } @@ -497,14 +522,19 @@ sub get_file_name { } } - if ($os =~ m/([a-zA-Z]+\d)/) - { - $osbase = $1; - if (-r "$searchpath/$profile.$osbase.$arch.$extension") { - return "$searchpath/$profile.$osbase.$arch.$extension"; - } - if (-r "$searchpath/$profile.$osbase.$extension") { - return "$searchpath/$profile.$osbase.$extension"; + # Read the configuration file named LATEST under directory $searchpath + if (open(my $fh, '<', "$searchpath/LATEST")) { + my $fallbackos = <$fh>; + $fallbackos =~ s/^\s+|\s+$//g; + close($fh); + + foreach my $osbase (xCAT::SvrUtils::get_os_search_list($fallbackos)) { + if (-r "$searchpath/$profile.$osbase.$arch.$extension") { + return "$searchpath/$profile.$osbase.$arch.$extension"; + } + if (-r "$searchpath/$profile.$osbase.$extension") { + return "$searchpath/$profile.$osbase.$extension"; + } } } From c02eaba0339dc3988c2cad0ddac7cb7e75f8f3b1 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Mon, 29 Apr 2019 18:15:04 +0800 Subject: [PATCH 088/276] Fix the processing of prefix zero --- xCAT-server/lib/perl/xCAT/SvrUtils.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/SvrUtils.pm b/xCAT-server/lib/perl/xCAT/SvrUtils.pm index f2bba9d8f..235551db7 100755 --- a/xCAT-server/lib/perl/xCAT/SvrUtils.pm +++ b/xCAT-server/lib/perl/xCAT/SvrUtils.pm @@ -465,10 +465,15 @@ sub getsynclistfile() # ubuntu18.04.1 # ubuntu18.04.0 # ubuntu18.04 + # ubuntu18.4 # ubuntu18.03 + # ubuntu18.3 # ubuntu18.02 + # ubuntu18.2 # ubuntu18.01 + # ubuntu18.1 # ubuntu18.00 + # ubuntu18.0 # ubuntu18 Comments: none @@ -481,11 +486,14 @@ sub get_os_search_list { my @list = (); while ($word[-1] =~ /^[0-9]+$/) { - while ($word[-1] >= 0) { - push(@list, join('.', @word)); - $word[-1] = sprintf("%0" . length($word[-1]) . "d", $word[-1] - 1); + my $last = pop(@word); + while ($last >= 0) { + push(@list, join('.', @word, $last)); + if ($last =~ /^0[0-9]/) { + push(@list, join('.', @word, 0 + $last)); + } + $last = sprintf("%0" . length($last) . "d", $last - 1); } - pop(@word); } push(@list, join('.', @word)); From 9b845d1b1127a0c612c705a720491c5e908c1158 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 30 Apr 2019 15:25:03 +0800 Subject: [PATCH 089/276] Remove the configuration part --- xCAT-server/lib/perl/xCAT/SvrUtils.pm | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/SvrUtils.pm b/xCAT-server/lib/perl/xCAT/SvrUtils.pm index 235551db7..9722fdd06 100755 --- a/xCAT-server/lib/perl/xCAT/SvrUtils.pm +++ b/xCAT-server/lib/perl/xCAT/SvrUtils.pm @@ -530,22 +530,6 @@ sub get_file_name { } } - # Read the configuration file named LATEST under directory $searchpath - if (open(my $fh, '<', "$searchpath/LATEST")) { - my $fallbackos = <$fh>; - $fallbackos =~ s/^\s+|\s+$//g; - close($fh); - - foreach my $osbase (xCAT::SvrUtils::get_os_search_list($fallbackos)) { - if (-r "$searchpath/$profile.$osbase.$arch.$extension") { - return "$searchpath/$profile.$osbase.$arch.$extension"; - } - if (-r "$searchpath/$profile.$osbase.$extension") { - return "$searchpath/$profile.$osbase.$extension"; - } - } - } - # No file matching OS name was found, next try just arch, if still nothing -> default to just profile if (-r "$searchpath/$profile.$arch.$extension") { return "$searchpath/$profile.$arch.$extension"; From 7e699899be5f2a20dc227155013f2ae6d330b8ac Mon Sep 17 00:00:00 2001 From: litingt Date: Tue, 30 Apr 2019 05:24:41 -0400 Subject: [PATCH 090/276] update confignetwork cases to support rhels8 change --- .../autotest/testcase/confignetwork/cases0 | 97 +++++++++++-------- 1 file changed, 59 insertions(+), 38 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 34bcc43b2..55a2ca0cb 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -226,7 +226,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:cp -f /etc/hosts /etc/hosts.bak cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC @@ -242,22 +242,23 @@ check:output=~aliases1-1 aliases1-1-1 check:output=~aliases1-2 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 check:output=~BOOTPROTO=none|static -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:output=~12.1.0.100 check:output=~BOOTPROTO=none|static cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 +cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi cmd:xdsh $$CN "rm -rf /tmp/backupnet/" end @@ -269,7 +270,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:cp -f /etc/hosts /etc/hosts.bak cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC @@ -287,24 +288,26 @@ cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~BOOTPROTO=none|static check:output=~CONNECTED_MODE=yes|CONNECTED_MODE yes cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~CONNECTED_MODE=yes|CONNECTED_MODE yes check:output=~BOOTPROTO=none|static cmd:rmdef -t network -o confignetworks_test1 cmd:rmdef -t network -o confignetworks_test2 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/" end @@ -379,6 +382,7 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 +cmd:chtab -d node=$$CN nics end start:confignetwork_disable_set_to_1 @@ -400,6 +404,7 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 +cmd:chtab -d node=$$CN nics end start:confignetwork_niccustomscripts @@ -428,6 +433,7 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:rm -rf /tmp/script1 /install/postscripts/script1 +cmd:chtab -d node=$$CN nics end start:confignetwork_secondarynic_thirdnic_multiplevalue_updatenode @@ -438,7 +444,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 @@ -463,21 +469,21 @@ check:output=~$$CN-$$THIRDNIC-1 check:output=~$$CN-$$THIRDNIC-2 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~12.1.0.100 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/sysconfig/network-scripts/ifcfg-*$$THIRDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:output=~13.1.0.200 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$THIRDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:output=~14.1.0.100 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:rmdef -t network -o 13_1_0_0-255_255_0_0 cmd:rmdef -t network -o 14_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC /etc/network/interfaces.d/$$THIRDNIC:1";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC /etc/network/interfaces.d/$$THIRDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" @@ -486,8 +492,11 @@ cmd:xdsh $$CN "ip addr del 14.1.0.100/16 dev $$THIRDNIC" cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/" +cmd:chtab -d node=$$CN nics end start:confignetwork_vlan_eth0 @@ -539,6 +548,7 @@ cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /tmp/backupnet/* /etc/sysco check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 +cmd:chtab -d node=$$CN nics end start:confignetwork_vlan_false @@ -583,6 +593,7 @@ cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /tmp/backupnet/* /etc/sysco check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 +cmd:chtab -d node=$$CN nics end start:confignetwork_bond_eth2_eth3 @@ -638,6 +649,7 @@ check:rc==0 cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 +cmd:chtab -d node=$$CN nics end start:confignetwork_bond_false @@ -686,6 +698,7 @@ cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysco check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 +cmd:chtab -d node=$$CN nics end start:confignetwork_vlan_bond @@ -696,7 +709,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1500 check:rc==0 @@ -729,10 +742,10 @@ check:output=~bond0.3 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 cmd:rmdef -t network -o confignetworks_test1 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test2 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test3 cmd:rmdef -t network -o confignetworks_test4 @@ -744,14 +757,17 @@ cmd:xdsh $$CN "ip link del dev bond0" cmd:xdsh $$CN "ip link del dev bond0.2" cmd:xdsh $$CN "ip link del dev bond0.3" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 +cmd:chtab -d node=$$CN nics end start:confignetwork_2eth_bridge_br0 @@ -806,6 +822,7 @@ check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" +cmd:chtab -d node=$$CN nics end start:confignetwork_2eth_bridge_br22_br33 @@ -816,7 +833,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 @@ -836,9 +853,10 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br22ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network-scripts/ifcfg-br22"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br22ip /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi +end +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br22ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network-scripts/ifcfg-*br22*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br22ip /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br33ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network-scripts/ifcfg-br33"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br33ip /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br33ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network-scripts/ifcfg-*br33*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br33ip /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~br22 @@ -846,10 +864,8 @@ check:output=~br33 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 cmd:rmdef -t network -o confignetworks_test1 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi -check:rc==0 cmd:rmdef -t network -o confignetworks_test2 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test3 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br22ip=$var1$var2;xdsh $$CN "ip addr del $br22ip/16 dev br22" @@ -863,12 +879,15 @@ cmd:xdsh $$CN "ip link del dev bond0" cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;secondip=$var1$var2;xdsh $$CN "ip addr del $secondip/16 dev $$SECONDNIC" cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;secondip=$var1$var2;xdsh $$CN "ip addr del $secondip/16 dev $$THIRDNIC" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0 /etc/sysconfig/network-scripts/ifcfg-bond0.2 /etc/sysconfig/network-scripts/ifcfg-bond0.3 /etc/sysconfig/network-scripts/ifcfg-br22 /etc/sysconfig/network-scripts/ifcfg-br33"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" +cmd:chtab -d node=$$CN nics end start:confignetwork_installnic_2eth_bridge_br22_br33 @@ -879,7 +898,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 @@ -917,11 +936,9 @@ check:output=~br33 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi -check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi -check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi cmd:rmdef -t network -o 30_5_0_0-255_255_0_0 cmd:xdsh $$CN "ip addr del 30.5.106.8/16 dev br22" cmd:xdsh $$CN "ip link del dev br22" @@ -933,12 +950,14 @@ cmd:xdsh $$CN "ip link del dev bond0.3" cmd:xdsh $$CN "ip link del dev bond0" cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$THIRDNIC" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0 /etc/sysconfig/network-scripts/ifcfg-bond0.2 /etc/sysconfig/network-scripts/ifcfg-bond0.3 /etc/sysconfig/network-scripts/ifcfg-br22 /etc/sysconfig/network-scripts/ifcfg-br33"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:rc==0 +cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" +cmd:chtab -d node=$$CN nics end start:confignetwork__bridge_false @@ -972,6 +991,7 @@ cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" +cmd:chtab -d node=$$CN nics end start:confignetwork_static_installnic @@ -997,4 +1017,5 @@ cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysco cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" cmd:xdsh $$CN "if [ -f /etc/init.d/network ] ; then /etc/init.d/network restart ; elif [ -f /etc/init.d/networking ] ; then /etc/init.d/networking restart ; fi" cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" +cmd:chtab -d node=$$CN nics end From d5e61bafc691a53f3144e3b937969dfff352617e Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 30 Apr 2019 14:48:22 -0400 Subject: [PATCH 091/276] Make rflash -c match output of hpm check --- xCAT-server/lib/xcat/plugins/ipmi.pm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 309c85cb9..c1acfe332 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -2464,9 +2464,8 @@ sub rflash { my $c_id = ${ $sessdata->{component_ids} }[$i]; my $version = $firmware_version{$c_id}; my $format_string = $comp_string{$c_id}; - my $format_ver = sprintf("%3d.%02x.%d", - $version->[0], $version->[1], - $version->[5]*0x1000000 +$version->[4]*0x10000+ $version->[3]*0x100+$version->[2]); + my $format_ver = sprintf("%3d.%02x %02X%02X%02X%02X", + $version->[0], $version->[1], $version->[2], $version->[3], $version->[4], $version->[5]); $msg = $msg . $sessdata->{node} . ": " . "Node firmware version for $format_string component: $format_ver"; if ($i != scalar(@{ $sessdata->{component_ids} }) - 1) { @@ -8820,16 +8819,16 @@ sub hpm_action_version { return -1; } my $version = $hpm_data_hash{1}{action_version}; - my $ver = sprintf("%3d.%02x.%d", $version->[0], $version->[1], - $version->[5]*0x1000000+$version->[4]*0x10000+$version->[3]*0x100+$version->[2]); + my $ver = sprintf("%3d.%02x %02X%02X%02X%02X", $version->[0], $version->[1], + $version->[2], $version->[3], $version->[4], $version->[5]); $callback->({ data => "HPM firmware version for BOOT component:$ver" }); $version = $hpm_data_hash{2}{action_version}; - $ver = sprintf("%3d.%02x.%d", $version->[0], $version->[1], - $version->[5]*0x1000000+$version->[4]*0x10000+$version->[3]*0x100+$version->[2]); + $ver = sprintf("%3d.%02x %02X%02X%02X%02X", $version->[0], $version->[1], + $version->[2], $version->[3], $version->[4], $version->[5]); $callback->({ data => "HPM firmware version for APP component:$ver" }); $version = $hpm_data_hash{4}{action_version}; - $ver = sprintf("%3d.%02x.%d", $version->[0], $version->[1], - $version->[5]*0x1000000+$version->[4]*0x10000+$version->[3]*0x100+$version->[2]); + $ver = sprintf("%3d.%02x %02X%02X%02X%02X", $version->[0], $version->[1], + $version->[2], $version->[3], $version->[4], $version->[5]); $callback->({ data => "HPM firmware version for BIOS component:$ver" }); } From 5f649d78614c93df37aab847ab0e0efe4c83409a Mon Sep 17 00:00:00 2001 From: Kurt H Maier Date: Wed, 1 May 2019 12:54:12 -0700 Subject: [PATCH 092/276] xcatprobe xcatmn: do not check DNS status on mn if site.externaldns=1 --- xCAT-probe/subcmds/xcatmn | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/xCAT-probe/subcmds/xcatmn b/xCAT-probe/subcmds/xcatmn index 76b23458d..6facdd0e6 100755 --- a/xCAT-probe/subcmds/xcatmn +++ b/xCAT-probe/subcmds/xcatmn @@ -946,13 +946,24 @@ sub check_dns_service { my $nodename = `hostname -s 2>&1`; chomp($nodename); + # For mn, 'externaldns' attribute could be set to '0' or '1' or not defined. + # if '1', mn does not need to provide DNS service, so will not check it. + # if '0' or undefined, proceed with check. # For sn, 'setupdns' attribute could be set to '0' or '1'. - # if '0', sn does not need to provie DNS service, will not check it + # if '0', sn does not need to provide DNS service, will not check it my $checkdns = 1; if ($is_sn) { $checkdns = `lsdef $nodename -i setupnameserver -c 2>&1| awk -F'=' '{print \$2}'`; chomp($checkdns); - } + } else { # management node + my $dns_is_external = `lsdef -t site -i externaldns -c 2>&1 | awk -F'=' {print \$2}'`; + chomp($dns_is_external); + if ($dns_is_external eq "1") { + $checkdns = 0; + } else { + $checkdns = 1; + } + } if ($checkdns) { `which nslookup > /dev/null 2>&1`; From 330ada0a34924ed2e6e52ac99e7a1db39b9553cc Mon Sep 17 00:00:00 2001 From: Kurt H Maier Date: Wed, 1 May 2019 13:23:10 -0700 Subject: [PATCH 093/276] probe_utils: add check to see if selinux is enforcing (not just enabled) --- xCAT-probe/lib/perl/probe_utils.pm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/xCAT-probe/lib/perl/probe_utils.pm b/xCAT-probe/lib/perl/probe_utils.pm index 115814943..c45fc753b 100644 --- a/xCAT-probe/lib/perl/probe_utils.pm +++ b/xCAT-probe/lib/perl/probe_utils.pm @@ -240,6 +240,33 @@ sub is_selinux_enable { #------------------------------------------ +=head3 + Description: + Test if SELinux is enforcing in current operating system + Arguments: + None + Returns: + 1 : yes + 0 : no +=cut + +#------------------------------------------ +sub is_selinux_enforcing { + if (-e "/usr/sbin/getenforce") { + my $enforce_mode = `/usr/sbin/getenforce`; + chomp $enforce_mode; + switch ($enforce_mode) { + case "Disabled" { return 0; } + case "Permissive" { return 0; } + case "Enforcing" { return 1; } + else { return 0; } + } else { + return 0; + } +} + +#------------------------------------------ + =head3 Description: Test if firewall is opened in current operating system From 761eb497ca5d0365f8a1db47a5b24c05bcc62746 Mon Sep 17 00:00:00 2001 From: Kurt H Maier Date: Wed, 1 May 2019 13:23:53 -0700 Subject: [PATCH 094/276] xcatprobe xcatmn: warn on selinux permissive, fail on selinux enforcing --- xCAT-probe/subcmds/xcatmn | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/xCAT-probe/subcmds/xcatmn b/xCAT-probe/subcmds/xcatmn index 76b23458d..79b986a42 100755 --- a/xCAT-probe/subcmds/xcatmn +++ b/xCAT-probe/subcmds/xcatmn @@ -93,8 +93,9 @@ sub do_main_job { $rc |= $rst; #check if SElinux is disabled - $rst = check_selinux(\$checkpoint, \@error); - print_check_result($checkpoint, "f", $rst, \@error); + ($rst, $flag) = check_selinux(\$checkpoint, \@error); + print_check_result($checkpoint, $flag, $rst, \@error); + $rst = 0 if ($flag == "w"); $rc |= $rst; #check http service @@ -677,16 +678,26 @@ sub check_selinux { my $checkpoint_ref = shift; my $error_ref = shift; my $rst = 0; + my $flag = "w"; + my $msg = ""; $$checkpoint_ref = "Checking SELinux is disabled..."; @$error_ref = (); if (probe_utils->is_selinux_enable()) { - push @$error_ref, "SELinux is enabled on current server"; + $msg = "SELinux is enabled on current server"; $rst = 1; + $flag = "w"; } - - return $rst; + if (probe_utils->is_selinux_enforcing()) { + $msg = "SELinux is enforcing on current server"; + $rst = 1; + $flag = "f"; + } + if ($rst) { + push @error_ref, "$msg"; + } + return ($rst, $flag); } sub check_firewall { From 1ceff1ac2ad60b448488ceace9554576d69a1965 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 1 May 2019 16:33:33 -0400 Subject: [PATCH 095/276] Support new PowerSupplyRedundancy endpoint --- xCAT-server/lib/xcat/plugins/openbmc.pm | 39 +++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index c730f36c4..529fc758c 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -401,6 +401,13 @@ my %status_info = ( RSPCONFIG_GET_RESPONSE => { process => \&rspconfig_response, }, + RSPCONFIG_GET_PSR_REQUEST => { + method => "GET", + init_url => "$openbmc_project_url/control/power_supply_redundancy", + }, + RSPCONFIG_GET_PSR_RESPONSE => { + process => \&rspconfig_response, + }, RSPCONFIG_GET_NIC_REQUEST => { method => "GET", init_url => "$openbmc_project_url/network/enumerate", @@ -2560,8 +2567,20 @@ sub deal_with_response { # if ($node_info{$node}{cur_status} eq "RFLASH_DELETE_IMAGE_RESPONSE") { $error = "Invalid ID provided to delete. Use the -l option to view valid firmware IDs."; - } elsif (($node_info{$node}{cur_status} eq "RSPCONFIG_API_CONFIG_QUERY_RESPONSE") || - ($node_info{$node}{cur_status} eq "RSPCONFIG_API_CONFIG_ATTR_RESPONSE")) { + } elsif ($node_info{$node}{cur_status} eq "RSPCONFIG_API_CONFIG_ATTR_RESPONSE") { + # Set attribute call returned with 404, display an error + $error = "$::RESPONSE_NOT_FOUND - Requested endpoint does not exist or may indicate function is not supported on this OpenBMC firmware."; + } elsif ($node_info{$node}{cur_status} eq "RSPCONFIG_API_CONFIG_QUERY_RESPONSE") { + # Query attribute call came back with 404. If this is for Power Supply Redundency, + # send request with a new path RSPCONFIG_GET_PSR_REQUEST, response processing will print the value + if ($response_info->{'data'}->{'description'} =~ /PowerSupplyRedundancy/) { + $node_info{$node}{cur_status} = "RSPCONFIG_GET_PSR_REQUEST"; + $next_status{RSPCONFIG_GET_PSR_REQUEST} = "RSPCONFIG_GET_PSR_RESPONSE"; + gen_send_request($node); + + return; + } + # Query atribute call came back with 404, not for Power Supply Redundency. Display an error $error = "$::RESPONSE_NOT_FOUND - Requested endpoint does not exist or may indicate function is not supported on this OpenBMC firmware."; } else { $error = "[" . $response->code . "] " . $response_info->{'data'}->{'description'}; @@ -3808,6 +3827,22 @@ sub rspconfig_response { } } + if ($node_info{$node}{cur_status} eq "RSPCONFIG_GET_PSR_RESPONSE") { + # Processing response from Power Supply Redundency + if ($response_info->{'message'} eq $::RESPONSE_OK) { + foreach my $key_url (keys %{$response_info->{data}}) { + # We only care about this one key_url + if ($key_url eq "PowerSupplyRedundancyEnabled") { + my $display_value = $api_config_info{"RSPCONFIG_POWERSUPPLY_REDUNDANCY"}{"attr_value"}{"disabled"}; + my $display_name = $api_config_info{"RSPCONFIG_POWERSUPPLY_REDUNDANCY"}{"display_name"}; + if ($response_info->{data}{$key_url} eq "true") { + $display_value = $api_config_info{"RSPCONFIG_POWERSUPPLY_REDUNDANCY"}{"attr_value"}{"enabled"}; + } + xCAT::SvrUtils::sendmsg($display_name . ": " . $display_value, $callback, $node); + } + } + } + } if ($next_status{ $node_info{$node}{cur_status} }) { if ($node_info{$node}{cur_status} eq "RSPCONFIG_CHECK_RESPONSE") { $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }{$origin_type}; From 1cbe1ee8f42cf15665e93ea6f44d6f7eee0c674a Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 2 May 2019 15:51:15 -0400 Subject: [PATCH 096/276] Add some debug into copycds to help when issues come up, allow for user to specify options to copycds --- xCAT-server/lib/xcat/plugins/anaconda.pm | 76 ++++++++++++++++++------ 1 file changed, 57 insertions(+), 19 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 96f6a840b..e2eca4bd7 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2022,28 +2022,46 @@ sub copycd { #If they say to call it something unidentifiable, give up? + $callback->( + { + error => "The name specified ($distname) is not supported. Use the following format: rh*,pkvm*,centos*,fedora*,SL*,ol*" + } + ); return; } - unless (-r $mntpath . "/.discinfo") - { - return; - } + my $dinfo; - open($dinfo, $mntpath . "/.discinfo"); - my $did = <$dinfo>; - chomp($did); - my $desc = <$dinfo>; - chomp($desc); - my $darch = <$dinfo>; - chomp($darch); - my $dno = <$dinfo>; - chomp($dno); + my $did; + my $desc; + my $darch; + my $dno; + + if (-r $mntpath . "/.discinfo") + { + print "DEBUG - Attempt to detemine OS information from the .discinfo file ...\n"; + open($dinfo, $mntpath . "/.discinfo"); + + $did = <$dinfo>; + chomp($did); + $desc = <$dinfo>; + chomp($desc); + $darch = <$dinfo>; + chomp($darch); + $dno = <$dinfo>; + chomp($dno); + + close($dinfo); + } + else + { + print "DEBUG - No .discinfo file found on media, will continue ...\n"; + } if ($darch and $darch =~ /i.86/) { $darch = "x86"; } - close($dinfo); + if ($xCAT::data::discinfo::distnames{$did}) { unless ($distname) @@ -2052,10 +2070,18 @@ sub copycd } } + unless ($dno) { + if ($distname =~ /((?:\d+\.)+\d+)/) { + # Attempt to detemine the number of the OS from distname passed in + $dno = $1; + } + } + print "DEBUG - Distname=$distname, OS=$desc, ARCH=$arch, Version=$dno\n"; + unless ($distname) { - print "INFO - Could not find ID=$did in the discinfo database for OS=$desc ARCH=$darch NUM=$dno\n"; - print "INFO - Attempting to auto-detect...\n"; + print "DEBUG - Could not find ID=$did in the discinfo database for OS=$desc ARCH=$darch NUM=$dno\n"; + print "DEBUG - Attempting to auto-detect...\n"; if ($desc =~ /IBM_PowerKVM/) { # check for PowerKVM support @@ -2102,8 +2128,9 @@ sub copycd } else { - print "INFO - Could not auto-detect operating system.\n"; - return; #Do nothing, not ours.. + print "DEBUG - Could not auto-detect operating system.\n"; + # Cannot continue with what was detected, or attributes provided + return; } } if ($darch) @@ -2124,6 +2151,17 @@ sub copycd if ($arch eq "ppc") { $arch = "ppc64" } } + # At this point, arch should have been detected from the .discinfo, if not, then we require the user to provide it. + unless ($arch) + { + $callback->( + { + error => "ARCH not be detected, provide an OS ARCH using the -a option. (ppc64le, x86_64)" + } + ); + return; + } + if ($inspection) { my $retinfo = "DISTNAME:$distname\n" . "ARCH:$arch\n"; @@ -2137,13 +2175,13 @@ sub copycd ); return; } - print "INFO - detected distname=$distname, arch=$arch\n"; %{$request} = (); #clear request we've got it. my $disccopiedin = 0; my $osdistroname = $distname . "-" . $arch; my $defaultpath = "$installroot/$distname/$arch"; + print "DEBUG - Detected distname=$distname, arch=$arch defaultpath=$defaultpath osdistroname=$osdistroname\n"; unless ($path) { $path = $defaultpath; From 0cdc4a3cf744b145bf420081bee319f0705d89f7 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Fri, 3 May 2019 08:25:49 +0800 Subject: [PATCH 097/276] remove conserver related steps from perf baseline case (#6284) --- xCAT-test/autotest/testcase/performance/case0 | 7 ------- 1 file changed, 7 deletions(-) diff --git a/xCAT-test/autotest/testcase/performance/case0 b/xCAT-test/autotest/testcase/performance/case0 index 647c7f9bb..01cf61124 100644 --- a/xCAT-test/autotest/testcase/performance/case0 +++ b/xCAT-test/autotest/testcase/performance/case0 @@ -33,13 +33,6 @@ cmd:chdef -t node -o $$CN servicenode= monserver= nfsserver= tftpserver= xcatma check:rc==0 cmd:chdef -t node -o $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster= status= check:rc==0 -cmd:makeconservercf -check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN -cmd:cat /etc/conserver.cf | grep $$SN -check:output=~$$SN -cmd:sleep 20 cmd:makedhcp -n check:rc==0 cmd:makedhcp -a From ada5acbe72a5a12f6b2a7272fdf5302d9aac920b Mon Sep 17 00:00:00 2001 From: xuweibj Date: Sat, 4 May 2019 22:50:39 -0400 Subject: [PATCH 098/276] fix issue 6270, support new interface of powersupplyredundancy on python --- .../agent/hwctl/openbmc/openbmc_bmcconfig.py | 22 +++++++++++++++++++ .../lib/python/agent/hwctl/openbmc_client.py | 8 +++++++ 2 files changed, 30 insertions(+) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py index 45c83c460..902858229 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py @@ -404,6 +404,25 @@ rmdir \"/tmp/$userid\" \n") self.callback.info("%s: BMC Setting %s..." % (node, openbmc.RSPCONFIG_APIS[key]['display_name'])) + def _get_powersupplyredundancy_value(self, node, obmc): + try: + psr_info = obmc.get_powersupplyredundancy() + for key, value in psr_info.items(): + if key == 'PowerSupplyRedundancyEnabled': + result = '%s: %s: %s' % (node, openbmc.RSPCONFIG_APIS['powersupplyredundancy']['display_name'], + openbmc.RSPCONFIG_APIS['powersupplyredundancy']['attr_values'][str(value)][0]) + return self.callback.info(result) + except SelfServerException as e: + return self.callback.error(e.message, node) + except SelfClientException as e: + if e.code == 404: + return self.callback.error('404 Not Found - Requested endpoint does not exist or may ' \ + 'indicate function is not supported on this OpenBMC firmware.', node) + if e.code == 403: + return self.callback.error('403 Forbidden - Requested endpoint does not exist or may ' \ + 'indicate function is not yet supported by OpenBMC firmware.', node) + return self.callback.error(e.message, node) + def _get_apis_values(self, key, **kw): node = kw['node'] obmc = openbmc.OpenBMCRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, @@ -416,6 +435,9 @@ rmdir \"/tmp/$userid\" \n") return self.callback.error(e.message, node) except SelfClientException as e: if e.code == 404: + if key == 'powersupplyredundancy': + return self._get_powersupplyredundancy_value(node, obmc) + return self.callback.error('404 Not Found - Requested endpoint does not exist or may ' \ 'indicate function is not supported on this OpenBMC firmware.', node) if e.code == 403: diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 4f1a65b20..3f1565833 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -200,12 +200,16 @@ RSPCONFIG_APIS = { 'baseurl': "/sensors/chassis/PowerSupplyRedundancy/", 'set_url': "action/setValue", 'get_url': "action/getValue", + 'get_url_new': '/control/power_supply_redundancy', 'get_method': 'POST', + 'get_method_new': 'GET', 'get_data': [], 'display_name': "BMC PowerSupplyRedundancy", 'attr_values': { 'disabled': ["Disabled"], 'enabled': ["Enabled"], + 'False': ['Disabled'], + 'True': ["Enabled"], }, }, 'powerrestorepolicy': { @@ -790,6 +794,10 @@ class OpenBMCRest(object): data={"data": attr_info['get_data']} return self.request(method, get_url, payload=data, cmd="get_%s" % key) + def get_powersupplyredundancy(self): + attr_info = RSPCONFIG_APIS['powersupplyredundancy'] + return self.request(attr_info['get_method_new'], attr_info['get_url_new'], cmd='get_powersupplyredundancy') + def set_admin_passwd(self, passwd): payload = { "data": [passwd] } From 7788b72009e001ea33b18b746833c058f511ec89 Mon Sep 17 00:00:00 2001 From: litingt Date: Sat, 4 May 2019 23:11:09 -0400 Subject: [PATCH 099/276] update according to comments --- xCAT-test/autotest/testcase/confignetwork/cases0 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 55a2ca0cb..ff236520f 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -242,6 +242,7 @@ check:output=~aliases1-1 aliases1-1-1 check:output=~aliases1-2 cmd:updatenode $$CN -P confignetwork check:rc==0 +cmd:xdsh $$CN date cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 check:output=~BOOTPROTO=none|static @@ -469,6 +470,7 @@ check:output=~$$CN-$$THIRDNIC-1 check:output=~$$CN-$$THIRDNIC-2 cmd:updatenode $$CN -P confignetwork check:rc==0 +cmd:xdsh $$CN date cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi @@ -853,7 +855,6 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -end cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br22ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network-scripts/ifcfg-*br22*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br22ip /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br33ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network-scripts/ifcfg-*br33*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br33ip /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi From c801d2c2f2ce8d628bd9b22f3c6db36a93848d4c Mon Sep 17 00:00:00 2001 From: litingt Date: Sun, 5 May 2019 02:42:00 -0400 Subject: [PATCH 100/276] remove kit cases from bundle since it is not supported in the new os version --- .../autotest/bundle/rhels_ppc_weekly.bundle | 42 ------------------- .../autotest/bundle/rhels_ppcle_weekly.bundle | 42 ------------------- .../autotest/bundle/rhels_x86_weekly.bundle | 42 ------------------- 3 files changed, 126 deletions(-) diff --git a/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle index f523dfe2f..d3175dcdb 100644 --- a/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle @@ -9,48 +9,6 @@ packimage_m_tar_c_xz packimage_o_p_a_m reg_linux_statelite_installation_hierarchy_by_nfs reg_linux_statelite_installation_hierarchy_by_ramdisk -addkit_v -addkit_h -addkit_kit -addkit_i -addkit_multikit -addkit_p -addkitcomp_v -addkitcomp_h -addkitcomp_i -addkitcomp_f -buildkit_v -buildkit_h -buildkit_create -buildkit_create_l -buildkit_cleanrepo_all -buildkit_buildtar -chkkitcomp_v -chkkitcomp_h -chkkitcomp_V -lskit_v -lskit_h -lskit_F -lskit_K -lskit_R -lskit_C -lskitcomp_v -lskitcomp_h -lskitcomp_C -lskitcomp_S -lskitdeployparam_v -lskitdeployparam_h -lskitdeployparam_no_param -lskitdeployparam_k_1 -lskitdeployparam_c_1 -rmkit_v -rmkit_h -rmkit_t_no -rmkit_t_yes -rmkit_f -rmkit_V -rmkitcomp_v -rmkitcomp_h bmcdiscover_h bmcdiscover_nmap_range bmcdiscover_v diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle index f4f1f4460..87c1908ef 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle @@ -9,48 +9,6 @@ packimage_m_tar_c_xz packimage_o_p_a_m reg_linux_statelite_installation_hierarchy_by_nfs reg_linux_statelite_installation_hierarchy_by_ramdisk -addkit_v -addkit_h -addkit_kit -addkit_i -addkit_multikit -addkit_p -addkitcomp_v -addkitcomp_h -addkitcomp_i -addkitcomp_f -buildkit_v -buildkit_h -buildkit_create -buildkit_create_l -buildkit_cleanrepo_all -buildkit_buildtar -chkkitcomp_v -chkkitcomp_h -chkkitcomp_V -lskit_v -lskit_h -lskit_F -lskit_K -lskit_R -lskit_C -lskitcomp_v -lskitcomp_h -lskitcomp_C -lskitcomp_S -lskitdeployparam_v -lskitdeployparam_h -lskitdeployparam_no_param -lskitdeployparam_k_1 -lskitdeployparam_c_1 -rmkit_v -rmkit_h -rmkit_t_no -rmkit_t_yes -rmkit_f -rmkit_V -rmkitcomp_v -rmkitcomp_h bmcdiscover_h bmcdiscover_nmap_range bmcdiscover_v diff --git a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle index a06f89c06..bf120992e 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle @@ -9,48 +9,6 @@ packimage_m_tar_c_xz packimage_o_p_a_m reg_linux_statelite_installation_hierarchy_by_nfs reg_linux_statelite_installation_hierarchy_by_ramdisk -addkit_v -addkit_h -addkit_kit -addkit_i -addkit_multikit -addkit_p -addkitcomp_v -addkitcomp_h -addkitcomp_i -addkitcomp_f -buildkit_v -buildkit_h -buildkit_create -buildkit_create_l -buildkit_cleanrepo_all -buildkit_buildtar -chkkitcomp_v -chkkitcomp_h -chkkitcomp_V -lskit_v -lskit_h -lskit_F -lskit_K -lskit_R -lskit_C -lskitcomp_v -lskitcomp_h -lskitcomp_C -lskitcomp_S -lskitdeployparam_v -lskitdeployparam_h -lskitdeployparam_no_param -lskitdeployparam_k_1 -lskitdeployparam_c_1 -rmkit_v -rmkit_h -rmkit_t_no -rmkit_t_yes -rmkit_f -rmkit_V -rmkitcomp_v -rmkitcomp_h bmcdiscover_h bmcdiscover_nmap_range bmcdiscover_v From 97fc55f4cab76a8d2d50b743fc72c6a21fa3b5e8 Mon Sep 17 00:00:00 2001 From: litingt Date: Mon, 6 May 2019 02:47:00 -0400 Subject: [PATCH 101/276] update confignetwork cases to support new os --- .../autotest/testcase/confignetwork/cases0 | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index ff236520f..3aef7c7d3 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -287,12 +287,12 @@ check:output=~$$CN-$$SECONDNIC-1 check:output=~$$CN-$$SECONDNIC-2 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~BOOTPROTO=none|static check:output=~CONNECTED_MODE=yes|CONNECTED_MODE yes -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~CONNECTED_MODE=yes|CONNECTED_MODE yes @@ -568,7 +568,7 @@ cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicne check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:xdsh $$CN "if grep SUSE /etc/*release;then grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC; elif grep Ubuntu /etc/*release;then grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" +cmd:xdsh $$CN "if grep SUSE /etc/*release;then grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*; elif grep Ubuntu /etc/*release;then grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" check:output=~11.1.0.100 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= check:rc==0 @@ -733,9 +733,9 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond2ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network/ifcfg-bond0.2"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network-scripts/ifcfg-bond0.2"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond2ip /etc/network/interfaces.d/bond0.2";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond2ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network/ifcfg-bond0.2"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network-scripts/ifcfg-*bond0.2*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond2ip /etc/network/interfaces.d/bond0.2";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond3ip=$var2$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network-scripts/ifcfg-bond0.3"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond3ip /etc/network/interfaces.d/bond0.3";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond3ip=$var2$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network-scripts/ifcfg-*bond0.3*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond3ip /etc/network/interfaces.d/bond0.3";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~bond0 @@ -766,7 +766,6 @@ check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" -check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 cmd:chtab -d node=$$CN nics @@ -921,14 +920,14 @@ cmd:chdef $$CN nicdevices.br22=bond0.2 nicdevices.br33=bond0.3 nictypes.br22=bri check:rc==0 cmd:updatenode $$CN -P "confignetwork -s" check:rc==0 -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$installnic*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ check:output=~BOOTPROTO=none|static -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network-scripts/ifcfg-br22"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network-scripts/ifcfg-*br22*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi check:output=~30.5.106.8 check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network-scripts/ifcfg-br33"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network-scripts/ifcfg-*br33*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:output=~40.5.106.8 check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" From df0cbdec9138a6894192275b49e6d1429378d5be Mon Sep 17 00:00:00 2001 From: bybai Date: Mon, 6 May 2019 05:50:17 -0400 Subject: [PATCH 102/276] add wait time to wait nmcli device ready --- xCAT/postscripts/nicutils.sh | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 8b0eeba75..22fcd6959 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -1738,7 +1738,7 @@ function create_vlan_interface_nmcli { return 1 fi _netmask=$(v4mask2prefix $_netmask_long) - _ipaddrs="method none ip4 $ipaddr/$_netmask" + _ipaddrs="ip4 $ipaddr/$_netmask" fi fi fi @@ -1758,7 +1758,7 @@ function create_vlan_interface_nmcli { $nmcli con modify $con_name connection.id $tmp_con_name fi #create VLAN connetion - $nmcli con add type vlan con-name $con_name dev $ifname id $(( 10#$vlanid )) $_ipaddrs $_mtu connection.autoconnect-priority 9 + $nmcli con add type vlan con-name $con_name dev $ifname id $(( 10#$vlanid )) method none $_ipaddrs $_mtu connection.autoconnect-priority 9 autoconnect yes log_info "create NetworkManager connection for $ifname.$vlanid" #add extra params @@ -1859,6 +1859,35 @@ function is_connection_activate_intime { fi } +############################################################################### +# +# wait_nic_connect_intime +# +# input : nic name +# time_out (optional, 40 seconds by default) +# return : connection name +# +############################################################################### + +function wait_nic_connect_intime { + nic_name=$1 + time_out=40 + con_name='' + if [ ! -z "$2" ]; then + time_out=$2 + fi + i=0 + while [ $i -lt "$time_out" ]; do + con_name=$(nmcli dev show $_port|grep GENERAL.CONNECTION|awk -F: '{print $2}'|sed 's/^[ \t]*//g') + if [ ! -z "$con_name" -a "$con_name" != "--" ]; then + break + fi + sleep 1 + i=$((i+1)) + done + echo $con_name +} + ############################################################################### # # create bridge @@ -1975,7 +2004,7 @@ function create_bridge_interface_nmcli { return 1 fi fi - con_use_same_dev=$(nmcli dev show $_port|grep GENERAL.CONNECTION|awk -F: '{print $2}'|sed 's/^[ \t]*//g') + con_use_same_dev=$(wait_nic_connect_intime $_port) if [ "$con_use_same_dev" != "--" -a -n "$con_use_same_dev" ]; then cmd="$nmcli con mod "$con_use_same_dev" master $ifname $_mtu connection.autoconnect-priority 9" xcat_slave_con=$con_use_same_dev From 131247e356220428b1fc920d32e8137a0cf99474 Mon Sep 17 00:00:00 2001 From: bybai Date: Mon, 6 May 2019 06:11:12 -0400 Subject: [PATCH 103/276] replace _port, use nic_name --- xCAT/postscripts/nicutils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 22fcd6959..6c5e5cb23 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -1878,7 +1878,7 @@ function wait_nic_connect_intime { fi i=0 while [ $i -lt "$time_out" ]; do - con_name=$(nmcli dev show $_port|grep GENERAL.CONNECTION|awk -F: '{print $2}'|sed 's/^[ \t]*//g') + con_name=$(nmcli dev show $nic_name|grep GENERAL.CONNECTION|awk -F: '{print $2}'|sed 's/^[ \t]*//g') if [ ! -z "$con_name" -a "$con_name" != "--" ]; then break fi From 7d0e1c9f48c7d9d0c5efab78626586f007743354 Mon Sep 17 00:00:00 2001 From: litingt Date: Mon, 6 May 2019 23:30:06 -0400 Subject: [PATCH 104/276] update the script to remove false error --- xCAT-test/autotest/testcase/genesis/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index 2509ed9de..61a566060 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -1,6 +1,6 @@ #!/bin/bash function check_destiny(){ -chdef testnode arch=ppc64le cons=ipmi groups=all ip=60.1.1.1 netboot=$NETBOOT; +chdef testnode arch=ppc64le cons=ipmi groups=all ip=60.1.1.1 mac=4e:ee:ee:ee:ee:0e netboot=$NETBOOT; masterip=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print $2}'`; masternet=`ifconfig | awk "BEGIN{RS=\"\"}/\<$masterip\>/{print \$1}"|head -n 1 | awk -F ' ' '{print $1}'|awk -F ":" '{print \$1}' 2>&1`; net2=`netstat -i -a|grep -v Kernel|grep -v Iface |grep -v lo|grep -v $masternet|head -n 1|awk '{print $1}'`;echo net2 is $net2; From ad1df10c74f922c8f012862422a29281af125a80 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 7 May 2019 13:19:43 +0800 Subject: [PATCH 105/276] Add pkglist files for Ubuntu 18.04.2 --- .../compute.ubuntu18.04.2.ppc64el.pkglist | 19 +++++++++++++++++++ .../compute.ubuntu18.04.2.ppc64le.pkglist | 1 + .../compute.ubuntu18.04.2.x86_64.pkglist | 19 +++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist create mode 120000 xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64le.pkglist create mode 100644 xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.x86_64.pkglist diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist new file mode 100644 index 000000000..f9cd24b54 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist @@ -0,0 +1,19 @@ +bash +ifupdown +nfs-common +openssl +isc-dhcp-client +libc-bin +linux-image-generic-hwe-18.04 +openssh-server +openssh-client +wget +rsync +busybox-static +gawk +dnsutils +tar +gzip +xz-utils +cpio +chrony diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64le.pkglist new file mode 120000 index 000000000..390b76eff --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64le.pkglist @@ -0,0 +1 @@ +compute.ubuntu18.04.2.ppc64el.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.x86_64.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.x86_64.pkglist new file mode 100644 index 000000000..f9cd24b54 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.x86_64.pkglist @@ -0,0 +1,19 @@ +bash +ifupdown +nfs-common +openssl +isc-dhcp-client +libc-bin +linux-image-generic-hwe-18.04 +openssh-server +openssh-client +wget +rsync +busybox-static +gawk +dnsutils +tar +gzip +xz-utils +cpio +chrony From 5499f716a022845878d1d8832c926f1d61b1290d Mon Sep 17 00:00:00 2001 From: litingt Date: Tue, 7 May 2019 03:34:21 -0400 Subject: [PATCH 106/276] update to add more debug information in case rpower_wrongpasswd --- xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh b/xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh index 45b1b1891..766de4673 100755 --- a/xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh +++ b/xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh @@ -59,6 +59,7 @@ value=""; if [[ $output =~ $value ]];then return 0; else + echo "The expected output is \"$value\" since there password is wrong, but the real output is $output" return 1; fi } From 5188f3a526a469d19367fc57c59373e28c55c499 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 7 May 2019 10:36:19 -0400 Subject: [PATCH 107/276] Add non zero return code to the error callback --- xCAT-server/lib/xcat/plugins/anaconda.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index e2eca4bd7..358678482 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2024,7 +2024,7 @@ sub copycd #If they say to call it something unidentifiable, give up? $callback->( { - error => "The name specified ($distname) is not supported. Use the following format: rh*,pkvm*,centos*,fedora*,SL*,ol*" + error => "The name specified ($distname) is not supported. Use the following format: rh*,pkvm*,centos*,fedora*,SL*,ol*", errorcode => [1] } ); return; @@ -2143,7 +2143,7 @@ sub copycd { $callback->( { - error => "Requested distribution architecture $arch, but media is $darch" + error => "Requested distribution architecture $arch, but media is $darch", errorcode => [1] } ); return; @@ -2156,7 +2156,7 @@ sub copycd { $callback->( { - error => "ARCH not be detected, provide an OS ARCH using the -a option. (ppc64le, x86_64)" + error => "ARCH not be detected, provide an OS ARCH using the -a option. (ppc64le, x86_64)", errorcode => [1] } ); return; From f89f611ca913fa715f6b4b0a78e15eec1841fa10 Mon Sep 17 00:00:00 2001 From: Kurt H Maier Date: Tue, 7 May 2019 13:01:17 -0700 Subject: [PATCH 108/276] probe-utils.pm: refactor switch statement switch() is only available if explicitly declared. switch to a for block using elsif to return a value. --- xCAT-probe/lib/perl/probe_utils.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/xCAT-probe/lib/perl/probe_utils.pm b/xCAT-probe/lib/perl/probe_utils.pm index c45fc753b..239adf963 100644 --- a/xCAT-probe/lib/perl/probe_utils.pm +++ b/xCAT-probe/lib/perl/probe_utils.pm @@ -252,17 +252,20 @@ sub is_selinux_enable { #------------------------------------------ sub is_selinux_enforcing { + my $retval = 0; if (-e "/usr/sbin/getenforce") { my $enforce_mode = `/usr/sbin/getenforce`; chomp $enforce_mode; - switch ($enforce_mode) { - case "Disabled" { return 0; } - case "Permissive" { return 0; } - case "Enforcing" { return 1; } - else { return 0; } + for ($enforce_mode) { + if (/Disabled/) { $retval = 0; } + elsif (/Permissive/) { $retval = 0; } + elsif (/Enforcing/) { $retval = 1; } + else { $retval = 0; } + } } else { - return 0; + $retval = 0; } + return $retval; } #------------------------------------------ From 1f34af896f3a51a011ce7a024a7b38e539defec0 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 7 May 2019 16:19:48 -0400 Subject: [PATCH 109/276] Add xcatprobe testcase --- xCAT-test/autotest/testcase/probe/xcatproble_list | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 xCAT-test/autotest/testcase/probe/xcatproble_list diff --git a/xCAT-test/autotest/testcase/probe/xcatproble_list b/xCAT-test/autotest/testcase/probe/xcatproble_list new file mode 100644 index 000000000..f7752dda6 --- /dev/null +++ b/xCAT-test/autotest/testcase/probe/xcatproble_list @@ -0,0 +1,7 @@ +start:xcatprobe_work +description:To test if xcatprobe list works. This case must run in xcat mn +label:mn_only,ci_test +cmd:xcatprobe -l +check:rc == 0 +check:output =~ Supported sub commands are: +end From 59f8845d37796d182f9366e52ad5cd612fbb058f Mon Sep 17 00:00:00 2001 From: Kurt H Maier Date: Tue, 7 May 2019 13:52:34 -0700 Subject: [PATCH 110/276] probe_utils: remove extraneous else block --- xCAT-probe/lib/perl/probe_utils.pm | 2 -- 1 file changed, 2 deletions(-) diff --git a/xCAT-probe/lib/perl/probe_utils.pm b/xCAT-probe/lib/perl/probe_utils.pm index 239adf963..69d427dcd 100644 --- a/xCAT-probe/lib/perl/probe_utils.pm +++ b/xCAT-probe/lib/perl/probe_utils.pm @@ -262,8 +262,6 @@ sub is_selinux_enforcing { elsif (/Enforcing/) { $retval = 1; } else { $retval = 0; } } - } else { - $retval = 0; } return $retval; } From e8aa0c8599c54efac887a0eea64aaa70cb53062b Mon Sep 17 00:00:00 2001 From: Kurt H Maier Date: Tue, 7 May 2019 14:05:25 -0700 Subject: [PATCH 111/276] probe_utils: simplify selinux enforcing check --- xCAT-probe/lib/perl/probe_utils.pm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/xCAT-probe/lib/perl/probe_utils.pm b/xCAT-probe/lib/perl/probe_utils.pm index 69d427dcd..71e3ae8d6 100644 --- a/xCAT-probe/lib/perl/probe_utils.pm +++ b/xCAT-probe/lib/perl/probe_utils.pm @@ -256,11 +256,8 @@ sub is_selinux_enforcing { if (-e "/usr/sbin/getenforce") { my $enforce_mode = `/usr/sbin/getenforce`; chomp $enforce_mode; - for ($enforce_mode) { - if (/Disabled/) { $retval = 0; } - elsif (/Permissive/) { $retval = 0; } - elsif (/Enforcing/) { $retval = 1; } - else { $retval = 0; } + if ($enforce_mode eq "Enforcing") { + $retval = 1; } } return $retval; From 17732be50e2aa1c0b94e50f637ee98c43fef897d Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 8 May 2019 00:00:32 -0400 Subject: [PATCH 112/276] extend nmcli autoconnect-retries and autoconnect-slaves instead of default value --- xCAT/postscripts/nicutils.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 6c5e5cb23..594b7576a 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -1758,7 +1758,7 @@ function create_vlan_interface_nmcli { $nmcli con modify $con_name connection.id $tmp_con_name fi #create VLAN connetion - $nmcli con add type vlan con-name $con_name dev $ifname id $(( 10#$vlanid )) method none $_ipaddrs $_mtu connection.autoconnect-priority 9 autoconnect yes + $nmcli con add type vlan con-name $con_name dev $ifname id $(( 10#$vlanid )) method none $_ipaddrs $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-slaves 1 log_info "create NetworkManager connection for $ifname.$vlanid" #add extra params @@ -1970,7 +1970,7 @@ function create_bridge_interface_nmcli { fi fi log_info "create bridge connection $xcat_con_name" - cmd="$nmcli con add type bridge con-name $xcat_con_name ifname $ifname $_mtu connection.autoconnect-priority 9" + cmd="$nmcli con add type bridge con-name $xcat_con_name ifname $ifname $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-retries 0 connection.autoconnect-slaves 1" log_info $cmd $cmd if [ $? -ne 0 ]; then @@ -2006,10 +2006,10 @@ function create_bridge_interface_nmcli { fi con_use_same_dev=$(wait_nic_connect_intime $_port) if [ "$con_use_same_dev" != "--" -a -n "$con_use_same_dev" ]; then - cmd="$nmcli con mod "$con_use_same_dev" master $ifname $_mtu connection.autoconnect-priority 9" + cmd="$nmcli con mod "$con_use_same_dev" master $ifname $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-slaves 1" xcat_slave_con=$con_use_same_dev else - cmd="$nmcli con add type $_pretype con-name $xcat_slave_con ifname $_port master $ifname $_mtu connection.autoconnect-priority 9" + cmd="$nmcli con add type $_pretype con-name $xcat_slave_con ifname $_port master $ifname $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-slaves 1" fi log_info "create $_pretype slaves connetcion $xcat_slave_con for bridge" log_info "$cmd" @@ -2183,9 +2183,9 @@ function create_bond_interface_nmcli { log_info "create bond connection $xcat_con_name" cmd="" if [ -n "$next_nic" ]; then - cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts autoconnect yes connection.autoconnect-priority 9" + cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts autoconnect yes connection.autoconnect-priority 9 connection.autoconnect-slaves 1 connection.autoconnect-retries 0" else - cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts method none ipv4.method manual ipv4.addresses $ipv4_addr/$str_prefix $_mtu connection.autoconnect-priority 9" + cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts method none ipv4.method manual ipv4.addresses $ipv4_addr/$str_prefix $_mtu connection.autoconnect-priority 9 connection.autoconnect-slaves 1 connection.autoconnect-retries 0" fi log_info $cmd $cmd From 04f5b301654404e32bf056f20f057b55bdcd5a86 Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 8 May 2019 04:06:59 -0400 Subject: [PATCH 113/276] update bundle since rhels8 is initial supported from 2.15 --- xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle | 2 -- xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle | 2 -- xCAT-test/autotest/bundle/rhels_x86_weekly.bundle | 2 -- 3 files changed, 6 deletions(-) diff --git a/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle index d3175dcdb..a10b9a6fe 100644 --- a/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle @@ -25,5 +25,3 @@ reg_linux_statelite_installation_flat rmimage_diskless rpower_reset runcmdinstaller_command -redhat_migration1 -redhat_migration2 diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle index 87c1908ef..f6c619655 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle @@ -28,6 +28,4 @@ reg_linux_statelite_installation_flat rmimage_diskless 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 bf120992e..b33107385 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle @@ -28,5 +28,3 @@ reg_linux_statelite_installation_flat rmimage_diskless rpower_reset runcmdinstaller_command -redhat_migration1 -redhat_migration2 From d4af78ec5e454148aa6bb3e37887eb2d2091a295 Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 8 May 2019 04:40:59 -0400 Subject: [PATCH 114/276] add more debug information in the case --- .../autotest/testcase/genesis/genesistest.pl | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index 8f4b9405f..612e75f9e 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -69,11 +69,14 @@ if (!defined($noderange)) { my $os = &get_os; if ($check_genesis_file) { send_msg(2, "[$$]:Check genesis file..............."); + print "[$$]:Check genesis file...............\n"; &check_genesis_file(&get_arch); if ($?) { send_msg(0, "genesis file not available"); + print "genesis file is not available\n"; } else { send_msg(2, "genesis file available"); + print "genesis file is available\n"; } } my $master=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print \$2}'`; @@ -90,57 +93,72 @@ if (!(-e $nodestanza)) { #################################### if ($genesis_nodesetshell_test) { send_msg(2, "[$$]:Running nodesetshell test..............."); + print "[$$]:Running nodesetshell test...............\n"; `nodeset $noderange shell`; if ($?) { send_msg(0, "[$$]:nodeset shell failed..............."); + print "[$$]:nodeset shell failed...............\n"; exit 1; } `rpower $noderange boot`; if ($?) { send_msg(0, "[$$]:rpower node failed..............."); + print "[$$]:rpower node failed...............\n"; exit 1; } #run nodeshell test send_msg(2, "prepare for nodeshell script."); + print "prepare for nodeshell script.\n"; if ( &testxdsh(3)) { send_msg(0, "[$$]:Could not verify test results using xdsh..............."); + print "[$$]:Could not verify test results using xdsh...............\n"; exit 1; } send_msg(2, "[$$]:Running nodesetshell test success..............."); + print "[$$]:Running nodesetshell test success...............\n"; } #################################### ####runcmd test for genesis #################################### if ($genesis_runcmd_test) { send_msg(2, "[$$]:Running runcmd test..............."); + print "[$$]:Running runcmd test...............\n"; if (&testxdsh(&rungenesiscmd(&get_arch))) { send_msg(0, "[$$]:Could not verify test results using xdsh..............."); + print "[$$]:Could not verify test results using xdsh...............\n"; exit 1; } send_msg(2, "[$$]:Running runcmd test success..............."); + print "[$$]:Running runcmd test success...............\n"; } ################################## ####runimg test for genesis ################################## if ($genesis_runimg_test) { send_msg(2, "[$$]:Run runimg test..............."); + print "[$$]:Run runimg test...............\n"; if (&testxdsh(&rungenesisimg)) { send_msg(0, "[$$]:Could not verify test results using xdsh ..............."); + print "[$$]:Could not verify test results using xdsh ...............\n"; exit 1; } send_msg(2, "[$$]:Running runimage test success..............."); + print "[$$]:Running runimage test success...............\n"; } ################################### ####clear test environment ################################### if ($clear_env) { send_msg(2, "[$$]:clear genesis test enviroment..............."); + print "[$$]:clear genesis test enviroment...............\n"; if (&clearenv(&get_arch)) { send_msg(0, "[$$]:clear environment failed..............."); + print "[$$]:clear environment failed...............\n"; exit 1; } send_msg(2, "[$$]:clear genesis test enviroment success..............."); + print "[$$]:clear genesis test enviroment success...............\n"; } ################################## #check_genesis_file @@ -151,6 +169,7 @@ sub check_genesis_file { my $genesis_scripts; if ($os =~ "unknown") { send_msg(0, "The OS is not supported."); + print "The OS is not supported.\n"; return 1; } elsif ($os =~ "ubuntu") { $genesis_base = `dpkg -l | grep -i "ii xcat-genesis-base" | grep -i "$arch"`; @@ -161,6 +180,7 @@ sub check_genesis_file { } unless ($genesis_base and $genesis_scripts) { send_msg(0, "xCAT-genesis for $arch did not be installed."); + print "xCAT-genesis for $arch did not be installed.\n"; return 1; } return 0; @@ -180,6 +200,7 @@ sub rungenesiscmd { #means runcmd test using test scripts genesistest.pl writes send_msg(2, "no runcmd scripts for test prepared."); + print "no runcmd scripts for test prepared.\n"; open(TESTCMD, ">$runcmd_script") or die "Can't open testscripts for writing: $!"; print TESTCMD join("\n", "#!/bin/bash"), "\n"; @@ -191,6 +212,7 @@ sub rungenesiscmd { #means runcmd test using test scripts user writes send_msg(2, "runcmd scripts for test ready."); + print "runcmd scripts for test ready.\n"; } $genesis_bin_dir = "$genesis_base_dir/$arch/fs/bin"; copy("$runcmd_script", "$genesis_bin_dir"); @@ -198,10 +220,12 @@ sub rungenesiscmd { `mknb $arch`; if ($?) { send_msg(0, "mknb $arch failed for runcmd test."); + print "mknb $arch failed for runcmd test.\n"; } `rinstall $noderange "runcmd=cmdtest,shell"`; if ($?) { send_msg(0, "rinstall noderange shell failed for runcmd test"); + print "rinstall noderange shell failed for runcmd test\n"; } return $value; } @@ -220,6 +244,7 @@ sub rungenesisimg { #means runimg test using test scripts genesistest.pl writes send_msg(2, "no runimg scripts for test prepared."); + print "no runimg scripts for test prepared.\n"; open(TESTIMG, ">$runimg_script") or die "Can't open testscripts for writing: $!"; print TESTIMG join("\n", "#!/bin/bash"), "\n"; @@ -232,6 +257,7 @@ sub rungenesisimg { #means runimg test using test scripts user writes send_msg(2, "runimg scripts for test ready."); + print "runimg scripts for test ready.\n"; } copy("$runimg_script", "/install/my_image/runme.sh") or die "Copy failed: $!"; chmod 0755, "/install/my_image/runme.sh"; @@ -240,6 +266,7 @@ sub rungenesisimg { `rinstall $noderange "runimage=http://$master/install/my_image/my_image.tgz",shell`; if ($?) { send_msg(0, "rinstall noderange failed for runimg"); + print "rinstall noderange failed for runimg\n"; } return $value; } @@ -268,6 +295,7 @@ sub testxdsh { foreach (1 .. 10) { sleep 300; send_msg(1,"try to run xdsh to check the results again"); + print "try to run xdsh to check the results again\n"; `xdsh $noderange -t 2 cat $checkfile 2>&1| grep $checkstring `; last if ($? == 0); } @@ -294,6 +322,7 @@ sub clearenv { unlink("$runimg_script"); rmdir("$runmedir"); send_msg(2, "clear runimage test environment"); + print "clear runimage test environment\n"; } if (-e "$runcmd_script") { my $genesis_bin_dir = "$genesis_base_dir/$arch/fs/bin"; @@ -303,12 +332,14 @@ sub clearenv { `mknb $arch`; if ($?) { send_msg(0, "mknb for runcmd test environment failed"); + print "mknb for runcmd test environment failed\n"; exit 1; } } `rinstall $noderange boot`; if ($?) { send_msg(0, "rinstall node failed"); + print "rinstall node failed\n"; exit 1; } if (-e "$nodestanza") { From 14c6042ca12b1e1b23da60ac6df7f5bacadbc0d6 Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 8 May 2019 22:49:00 -0400 Subject: [PATCH 115/276] extend connection.autoconnect-retries for xcat nmcli connection --- xCAT/postscripts/nicutils.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 594b7576a..d27cd5573 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -1758,7 +1758,7 @@ function create_vlan_interface_nmcli { $nmcli con modify $con_name connection.id $tmp_con_name fi #create VLAN connetion - $nmcli con add type vlan con-name $con_name dev $ifname id $(( 10#$vlanid )) method none $_ipaddrs $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-slaves 1 + $nmcli con add type vlan con-name $con_name dev $ifname id $(( 10#$vlanid )) method none $_ipaddrs $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-slaves 1 connection.autoconnect-retries 0 log_info "create NetworkManager connection for $ifname.$vlanid" #add extra params @@ -2006,10 +2006,10 @@ function create_bridge_interface_nmcli { fi con_use_same_dev=$(wait_nic_connect_intime $_port) if [ "$con_use_same_dev" != "--" -a -n "$con_use_same_dev" ]; then - cmd="$nmcli con mod "$con_use_same_dev" master $ifname $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-slaves 1" + cmd="$nmcli con mod "$con_use_same_dev" master $ifname $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-slaves 1 connection.autoconnect-retries 0" xcat_slave_con=$con_use_same_dev else - cmd="$nmcli con add type $_pretype con-name $xcat_slave_con ifname $_port master $ifname $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-slaves 1" + cmd="$nmcli con add type $_pretype con-name $xcat_slave_con ifname $_port master $ifname $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-slaves 1 connection.autoconnect-retries 0" fi log_info "create $_pretype slaves connetcion $xcat_slave_con for bridge" log_info "$cmd" @@ -2067,7 +2067,7 @@ function create_bridge_interface_nmcli { if [ $? -eq 0 ]; then $nmcli con delete $tmp_slave_con_name fi - wait_for_ifstate $ifname UP 20 40 + wait_for_ifstate $ifname UP 40 40 [ $? -ne 0 ] && rc=1 $ip address show dev $ifname| $sed -e 's/^/[bridge] >> /g' | log_lines info fi @@ -2229,7 +2229,7 @@ function create_bond_interface_nmcli { $ip link set dev $ifslave down wait_for_ifstate $ifslave DOWN 20 2 fi - cmd="$nmcli con add type $slave_type con-name $xcat_slave_con $_mtu method none ifname $ifslave master $xcat_con_name autoconnect yes connection.autoconnect-priority 9" + cmd="$nmcli con add type $slave_type con-name $xcat_slave_con $_mtu method none ifname $ifslave master $xcat_con_name autoconnect yes connection.autoconnect-priority 9 connection.autoconnect-retries 0" log_info $cmd $cmd if [ $? -ne 0 ]; then From b4d710e9280b11fa4c61733ea28f7dd7d9c40a77 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 9 May 2019 13:18:33 +0800 Subject: [PATCH 116/276] Add directory /etc/systemd/system/ to the systemd service search path --- xCAT/postscripts/xcatlib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/postscripts/xcatlib.sh b/xCAT/postscripts/xcatlib.sh index e7b059494..2c6a3aa44 100755 --- a/xCAT/postscripts/xcatlib.sh +++ b/xCAT/postscripts/xcatlib.sh @@ -317,7 +317,7 @@ function servicemap { #all the service unit files are placed under /lib/systemd/system/ on ubuntu #all the service unit files are placed under /usr/lib/systemd/system/ on redhat and sles #path should be delimited with space - path="/usr/lib/systemd/system/ /lib/systemd/system/" + path="/usr/lib/systemd/system/ /lib/systemd/system/ /etc/systemd/system/" postfix=".service" svcmgrcmd="systemctl" elif [ "$svcmgrtype" = "2" ];then From 929eb79ce75ccc3841257ce96f12a81b0fbd2ae9 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 9 May 2019 16:18:20 +0800 Subject: [PATCH 117/276] Add a new return code 17, for activating --- xCAT/postscripts/xcatlib.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT/postscripts/xcatlib.sh b/xCAT/postscripts/xcatlib.sh index 2c6a3aa44..4c3cf0210 100755 --- a/xCAT/postscripts/xcatlib.sh +++ b/xCAT/postscripts/xcatlib.sh @@ -549,6 +549,8 @@ function checkservicestatus { retcode=1 elif echo $output|grep -E -i "^failed$";then retcode=2 + elif echo $output|grep -E -i "^activating$";then + retcode=17 fi elif [ -n "$svcjob" ];then output=$(initctl status $svcjob) From 53f318113cdeb0965302c255d5c681042c32c245 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 9 May 2019 16:20:38 +0800 Subject: [PATCH 118/276] Abort updatenode if the xCAT compute node is still in post-booting process --- xCAT/postscripts/xcatdsklspost | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 057f25ccf..056d2f2d5 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -285,6 +285,41 @@ else esac fi +# The cheat sheet for ${MODE} +# Empty +# node deployment +# 1 - updatenode -P +# Execute postscripts listed in the postscripts table or parameters +# 2 - updatenode -S +# Perform Software Maintenanc - updatenode -S +# 3 - moncfg rmcmon +# Abosoulted +# 4 +# Statelite mode +# 5 +# Update security +# 6 - xcatpostinit1 +# During node reboot +case "${MODE}" in +"1"|"2"|"5") + # The cheat sheet for checkservicestatus + # Return code + # 0 - active + # 1 - inactive + # 2 - failed + # 3 - others + # 17 - activating + # 127 - error + checkservicestatus xcatpostinit1 >/dev/null 2>&1 + case "$?" in + "17") + echolog "warning" "xCAT post-booting process is not completed yet. Abort. Please try later." + exit 255 + ;; + esac + ;; +esac + update_VPD() { if [ -f /usr/sbin/vpdupdate ]; then From 0c8fc1521cbab166ea7571be9def70176534eaab Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 9 May 2019 16:32:50 +0800 Subject: [PATCH 119/276] Fix typo --- xCAT/postscripts/xcatdsklspost | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 056d2f2d5..3440250cd 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -293,7 +293,7 @@ fi # 2 - updatenode -S # Perform Software Maintenanc - updatenode -S # 3 - moncfg rmcmon -# Abosoulted +# Obsoleted # 4 # Statelite mode # 5 From 050c15f84134e796c865df249454ca0dbe596ec4 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 9 May 2019 09:30:45 -0400 Subject: [PATCH 120/276] Check more of the output --- xCAT-test/autotest/testcase/probe/xcatproble_list | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/probe/xcatproble_list b/xCAT-test/autotest/testcase/probe/xcatproble_list index f7752dda6..1d797da59 100644 --- a/xCAT-test/autotest/testcase/probe/xcatproble_list +++ b/xCAT-test/autotest/testcase/probe/xcatproble_list @@ -2,6 +2,15 @@ start:xcatprobe_work description:To test if xcatprobe list works. This case must run in xcat mn label:mn_only,ci_test cmd:xcatprobe -l -check:rc == 0 -check:output =~ Supported sub commands are: +check:rc==0 +check:output=~Supported sub commands are: +check:output=~detect_dhcp +check:output=~osdeploy +check:output=~nodecheck +check:output=~xcatmn +check:output=~osimagecheck +check:output=~discovery +check:output=~image +check:output=~clusterstatus +check:output=~switch_macmap end From 6ea2ffcee185093485cca5a204df1814118fc307 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 9 May 2019 10:18:35 -0400 Subject: [PATCH 121/276] mend --- xCAT-test/autotest/testcase/probe/xcatproble_list | 1 - 1 file changed, 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/probe/xcatproble_list b/xCAT-test/autotest/testcase/probe/xcatproble_list index 1d797da59..07a9cbabb 100644 --- a/xCAT-test/autotest/testcase/probe/xcatproble_list +++ b/xCAT-test/autotest/testcase/probe/xcatproble_list @@ -2,7 +2,6 @@ start:xcatprobe_work description:To test if xcatprobe list works. This case must run in xcat mn label:mn_only,ci_test cmd:xcatprobe -l -check:rc==0 check:output=~Supported sub commands are: check:output=~detect_dhcp check:output=~osdeploy From d80bda8eb40b0f85c632b47ea881db2f6998f6f0 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 9 May 2019 17:18:54 -0400 Subject: [PATCH 122/276] Plugin should not return error in certain places because it will attempt to look at another plugin --- xCAT-server/lib/xcat/plugins/anaconda.pm | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 358678482..ca5519df8 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2022,11 +2022,7 @@ sub copycd { #If they say to call it something unidentifiable, give up? - $callback->( - { - error => "The name specified ($distname) is not supported. Use the following format: rh*,pkvm*,centos*,fedora*,SL*,ol*", errorcode => [1] - } - ); + print "DEBUG - [anaconda.pm] The name specified ($distname) is not supported for anaconda images, continue to another plugin..."; return; } @@ -2151,14 +2147,10 @@ sub copycd if ($arch eq "ppc") { $arch = "ppc64" } } - # At this point, arch should have been detected from the .discinfo, if not, then we require the user to provide it. + # At this point, if arch is not provided and we cannot determine it, return unless ($arch) { - $callback->( - { - error => "ARCH not be detected, provide an OS ARCH using the -a option. (ppc64le, x86_64)", errorcode => [1] - } - ); + print "DEBUG - [anaconda.pm] ARCH not detected, provided an OS ARCH using the -a option."; return; } From 0ee133ce9b06436d6db2a1b96a170505888b52aa Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 9 May 2019 17:23:50 -0400 Subject: [PATCH 123/276] Improve the debug messages to show plugin --- xCAT-server/lib/xcat/plugins/anaconda.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index ca5519df8..3bb738651 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2034,7 +2034,7 @@ sub copycd if (-r $mntpath . "/.discinfo") { - print "DEBUG - Attempt to detemine OS information from the .discinfo file ...\n"; + print "DEBUG - [anaconda.pm] Attempt to detemine OS information from the .discinfo file ...\n"; open($dinfo, $mntpath . "/.discinfo"); $did = <$dinfo>; @@ -2050,7 +2050,7 @@ sub copycd } else { - print "DEBUG - No .discinfo file found on media, will continue ...\n"; + print "DEBUG - [anaconda.pm] No .discinfo file found on media, will continue ...\n"; } if ($darch and $darch =~ /i.86/) @@ -2072,12 +2072,12 @@ sub copycd $dno = $1; } } - print "DEBUG - Distname=$distname, OS=$desc, ARCH=$arch, Version=$dno\n"; + print "DEBUG - [anaconda.pm] Distname=$distname, OS=$desc, ARCH=$arch, Version=$dno\n"; unless ($distname) { - print "DEBUG - Could not find ID=$did in the discinfo database for OS=$desc ARCH=$darch NUM=$dno\n"; - print "DEBUG - Attempting to auto-detect...\n"; + print "DEBUG - [anaconda.pm] Could not find ID=$did in the discinfo database for OS=$desc ARCH=$darch NUM=$dno\n"; + print "DEBUG - [anaconda.pm] Attempting to auto-detect...\n"; if ($desc =~ /IBM_PowerKVM/) { # check for PowerKVM support @@ -2124,7 +2124,7 @@ sub copycd } else { - print "DEBUG - Could not auto-detect operating system.\n"; + print "DEBUG - [anaconda.pm] Could not auto-detect operating system.\n"; # Cannot continue with what was detected, or attributes provided return; } @@ -2173,7 +2173,7 @@ sub copycd my $osdistroname = $distname . "-" . $arch; my $defaultpath = "$installroot/$distname/$arch"; - print "DEBUG - Detected distname=$distname, arch=$arch defaultpath=$defaultpath osdistroname=$osdistroname\n"; + print "DEBUG - [anaconda.pm] Detected distname=$distname, arch=$arch defaultpath=$defaultpath osdistroname=$osdistroname\n"; unless ($path) { $path = $defaultpath; From 4ae1391051e1e56c5b4c123ccb6d1090f22b8dd2 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 9 May 2019 17:25:21 -0400 Subject: [PATCH 124/276] Missing newline --- xCAT-server/lib/xcat/plugins/anaconda.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 3bb738651..a7764cc8c 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2022,7 +2022,7 @@ sub copycd { #If they say to call it something unidentifiable, give up? - print "DEBUG - [anaconda.pm] The name specified ($distname) is not supported for anaconda images, continue to another plugin..."; + print "DEBUG - [anaconda.pm] The name specified ($distname) is not supported for anaconda images, continue to another plugin...\n"; return; } @@ -2150,7 +2150,7 @@ sub copycd # At this point, if arch is not provided and we cannot determine it, return unless ($arch) { - print "DEBUG - [anaconda.pm] ARCH not detected, provided an OS ARCH using the -a option."; + print "DEBUG - [anaconda.pm] ARCH not detected, provided an OS ARCH using the -a option.\n"; return; } From 829a66801a5b6308ad34cc1dce20cae50e53c5ff Mon Sep 17 00:00:00 2001 From: litingt Date: Fri, 10 May 2019 04:29:19 -0400 Subject: [PATCH 125/276] update to add more debug information --- .../rpower/rpower_wrongpasswd_test.sh | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh b/xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh index 766de4673..e445222ea 100755 --- a/xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh +++ b/xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh @@ -10,32 +10,41 @@ tabdump passwd |grep $MGT function modify_passwd_table(){ Username=`cat $TMPFILE |awk -F "\"" '{print $4}'`; Passwd=`cat $TMPFILE |awk -F "\"" '{print $6}'`; +echo "Execute \"chtab key=$MGT passwd.password=$Passwd.wrong passwd.username=$Username\"" `chtab key=$MGT passwd.password=$Passwd.wrong passwd.username=$Username`; +echo "The password table is\n"; tabdump passwd; } function add_passwd_table() { `chtab key=$MGT passwd.password=$2 passwd.username=$3`; +echo "Execute \"rpower $1 stat\""; rpower $1 stat if [ $? -eq 0 ];then + echo "Execute \"chtab key=$MGT passwd.password=$2.wrong passwd.username=$3\"" `chtab key=$MGT passwd.password=$2.wrong passwd.username=$3`; + echo "Execute \"tabdump passwd\""; tabdump passwd; else - echo "wrong password"; + echo "rpower $1 stat failed.Wrong password is provided, please check bmc username and password"; fi } function modify_node_definition() { chdef $1 bmcpassword=$2 bmcusername=$3 +echo "Execute \"rpower $1 stat\""; rpower $1 stat if [ $? -eq 0 ];then + echo "Execute \"chdef $1 bmcpassword=$2.wrong bmcusername=$3\"" chdef $1 bmcpassword=$2.wrong bmcusername=$3; + echo "Execute \"tabdump passwd\""; tabdump passwd; else - echo "wrong password"; + echo "rpower $1 stat failed.Wrong password is provided, please check bmc username and password"; fi } function clear_env(){ + echo "Restore test environment..."; if [ -f $TMPFILE ];then Username=`cat $TMPFILE |awk -F "\"" '{print $4}'`; Passwd=`cat $TMPFILE |awk -F "\"" '{print $6}'`; @@ -49,7 +58,7 @@ function clear_env(){ } function check_result(){ output=$(rpower $1 stat 2>&1) -echo output is $output +echo "Execute command \"rpower $1 stat\"" value=""; if [[ `lsdef $1 |grep mgt ` =~ "ipmi" ]];then value="Incorrect password provided"; @@ -63,20 +72,17 @@ value=""; return 1; fi } -echo "0 ARG: $0" SCRIPT=$(readlink -f $0) -echo "SCRIPT=$SCRIPT" TMPFILE="/tmp/xcat-test-`basename $SCRIPT`.tmp" -echo "TMPFILE=$TMPFILE" MGT="" if [[ `lsdef $2 |grep mgt` =~ "ipmi" ]];then MGT="ipmi"; else MGT="openbmc"; fi -echo mgt is $MGT +echo "The node's mgt is defined as $MGT" while [ "$#" -gt "0" ] do case $1 in @@ -134,4 +140,3 @@ do esac done - From b024e0fd2694ad3fd2fa009ca82b06b6e2945a02 Mon Sep 17 00:00:00 2001 From: litingt Date: Fri, 10 May 2019 04:35:02 -0400 Subject: [PATCH 126/276] add more debug information --- .../autotest/testcase/genesis/genesistest.pl | 78 ++++++------------- 1 file changed, 24 insertions(+), 54 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index 612e75f9e..3efbdc71a 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -68,21 +68,18 @@ if (!defined($noderange)) { } my $os = &get_os; if ($check_genesis_file) { - send_msg(2, "[$$]:Check genesis file..............."); - print "[$$]:Check genesis file...............\n"; + send_msg(2, "[$$]:Check if genesis packages are installed on mn..............."); &check_genesis_file(&get_arch); if ($?) { - send_msg(0, "genesis file not available"); - print "genesis file is not available\n"; + send_msg(0, "genesis packages are not installed"); } else { - send_msg(2, "genesis file available"); - print "genesis file is available\n"; + send_msg(2, "genesis packages are installed"); } } my $master=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print \$2}'`; if (!$master) { $master=hostname(); } chomp($master); -print "master is $master\n"; +print "xcat management node is $master\n"; $nodestanza="/tmp/$noderange.stanza"; if (!(-e $nodestanza)) { `lsdef $noderange -z > $nodestanza`; @@ -92,73 +89,58 @@ if (!(-e $nodestanza)) { ####nodesetshell test for genesis #################################### if ($genesis_nodesetshell_test) { - send_msg(2, "[$$]:Running nodesetshell test..............."); - print "[$$]:Running nodesetshell test...............\n"; + send_msg(2, "[$$]:Running nodeset NODE shell test..............."); `nodeset $noderange shell`; if ($?) { - send_msg(0, "[$$]:nodeset shell failed..............."); - print "[$$]:nodeset shell failed...............\n"; + send_msg(0, "[$$]:nodeset $noderange shell failed..............."); exit 1; } `rpower $noderange boot`; if ($?) { - send_msg(0, "[$$]:rpower node failed..............."); - print "[$$]:rpower node failed...............\n"; + send_msg(0, "[$$]:rpower $noderange failed..............."); exit 1; } #run nodeshell test send_msg(2, "prepare for nodeshell script."); - print "prepare for nodeshell script.\n"; if ( &testxdsh(3)) { send_msg(0, "[$$]:Could not verify test results using xdsh..............."); - print "[$$]:Could not verify test results using xdsh...............\n"; exit 1; } send_msg(2, "[$$]:Running nodesetshell test success..............."); - print "[$$]:Running nodesetshell test success...............\n"; } #################################### ####runcmd test for genesis #################################### if ($genesis_runcmd_test) { - send_msg(2, "[$$]:Running runcmd test..............."); - print "[$$]:Running runcmd test...............\n"; + send_msg(2, "[$$]:Running nodeset NODE runcmd test..............."); if (&testxdsh(&rungenesiscmd(&get_arch))) { send_msg(0, "[$$]:Could not verify test results using xdsh..............."); - print "[$$]:Could not verify test results using xdsh...............\n"; exit 1; } send_msg(2, "[$$]:Running runcmd test success..............."); - print "[$$]:Running runcmd test success...............\n"; } ################################## ####runimg test for genesis ################################## if ($genesis_runimg_test) { - send_msg(2, "[$$]:Run runimg test..............."); - print "[$$]:Run runimg test...............\n"; + send_msg(2, "[$$]:Run nodeset NODE runimage test..............."); if (&testxdsh(&rungenesisimg)) { send_msg(0, "[$$]:Could not verify test results using xdsh ..............."); - print "[$$]:Could not verify test results using xdsh ...............\n"; exit 1; } send_msg(2, "[$$]:Running runimage test success..............."); - print "[$$]:Running runimage test success...............\n"; } ################################### ####clear test environment ################################### if ($clear_env) { - send_msg(2, "[$$]:clear genesis test enviroment..............."); - print "[$$]:clear genesis test enviroment...............\n"; + send_msg(2, "[$$]:Clear genesis test enviroment..............."); if (&clearenv(&get_arch)) { - send_msg(0, "[$$]:clear environment failed..............."); - print "[$$]:clear environment failed...............\n"; + send_msg(0, "[$$]:Clear environment failed..............."); exit 1; } - send_msg(2, "[$$]:clear genesis test enviroment success..............."); - print "[$$]:clear genesis test enviroment success...............\n"; + send_msg(2, "[$$]:Clear genesis test enviroment success..............."); } ################################## #check_genesis_file @@ -169,7 +151,6 @@ sub check_genesis_file { my $genesis_scripts; if ($os =~ "unknown") { send_msg(0, "The OS is not supported."); - print "The OS is not supported.\n"; return 1; } elsif ($os =~ "ubuntu") { $genesis_base = `dpkg -l | grep -i "ii xcat-genesis-base" | grep -i "$arch"`; @@ -179,8 +160,7 @@ sub check_genesis_file { $genesis_scripts = `rpm -qa | grep -i "xcat-genesis-scripts" | grep -i "$arch"`; } unless ($genesis_base and $genesis_scripts) { - send_msg(0, "xCAT-genesis for $arch did not be installed."); - print "xCAT-genesis for $arch did not be installed.\n"; + send_msg(0, "xCAT-genesis for $arch is not installed."); return 1; } return 0; @@ -200,7 +180,6 @@ sub rungenesiscmd { #means runcmd test using test scripts genesistest.pl writes send_msg(2, "no runcmd scripts for test prepared."); - print "no runcmd scripts for test prepared.\n"; open(TESTCMD, ">$runcmd_script") or die "Can't open testscripts for writing: $!"; print TESTCMD join("\n", "#!/bin/bash"), "\n"; @@ -211,8 +190,7 @@ sub rungenesiscmd { $value = 3; #means runcmd test using test scripts user writes - send_msg(2, "runcmd scripts for test ready."); - print "runcmd scripts for test ready.\n"; + send_msg(2, "runcmd scripts for test are ready."); } $genesis_bin_dir = "$genesis_base_dir/$arch/fs/bin"; copy("$runcmd_script", "$genesis_bin_dir"); @@ -220,12 +198,10 @@ sub rungenesiscmd { `mknb $arch`; if ($?) { send_msg(0, "mknb $arch failed for runcmd test."); - print "mknb $arch failed for runcmd test.\n"; } `rinstall $noderange "runcmd=cmdtest,shell"`; if ($?) { send_msg(0, "rinstall noderange shell failed for runcmd test"); - print "rinstall noderange shell failed for runcmd test\n"; } return $value; } @@ -243,21 +219,18 @@ sub rungenesisimg { $value = 2; #means runimg test using test scripts genesistest.pl writes - send_msg(2, "no runimg scripts for test prepared."); - print "no runimg scripts for test prepared.\n"; + send_msg(2, "no runimg scripts for test are prepared."); open(TESTIMG, ">$runimg_script") - or die "Can't open testscripts for writing: $!"; + or die "Can't open test scripts for writing: $!"; print TESTIMG join("\n", "#!/bin/bash"), "\n"; print TESTIMG join("\n", "#This is test for genesis scripts"), "\n"; print TESTIMG join("\n", "echo \"testimg\" >> $result"), "\n"; close(TESTIMG); - print "value is $value \n"; } else { $value = 3; #means runimg test using test scripts user writes - send_msg(2, "runimg scripts for test ready."); - print "runimg scripts for test ready.\n"; + send_msg(2, "runimg scripts for test are ready."); } copy("$runimg_script", "/install/my_image/runme.sh") or die "Copy failed: $!"; chmod 0755, "/install/my_image/runme.sh"; @@ -265,8 +238,7 @@ sub rungenesisimg { copy("/tmp/my_image.tgz", "/install/my_image") or die "Copy failed: $!"; `rinstall $noderange "runimage=http://$master/install/my_image/my_image.tgz",shell`; if ($?) { - send_msg(0, "rinstall noderange failed for runimg"); - print "rinstall noderange failed for runimg\n"; + send_msg(0, "rinstall noderange runimage=* failed\n"); } return $value; } @@ -275,7 +247,7 @@ sub rungenesisimg { ######################################### sub testxdsh { my $value = shift; - print "value is $value \n"; + print "The input parameter is $value \n"; my $checkstring; my $checkfile; if ($value == 1) { @@ -294,8 +266,7 @@ sub testxdsh { if ($?) { foreach (1 .. 10) { sleep 300; - send_msg(1,"try to run xdsh to check the results again"); - print "try to run xdsh to check the results again\n"; + send_msg(1,"try to run xdsh $noderange to check the results again"); `xdsh $noderange -t 2 cat $checkfile 2>&1| grep $checkstring `; last if ($? == 0); } @@ -321,8 +292,7 @@ sub clearenv { unlink("$runmetar"); unlink("$runimg_script"); rmdir("$runmedir"); - send_msg(2, "clear runimage test environment"); - print "clear runimage test environment\n"; + send_msg(2, "clear nodeset NODE runimage test environment"); } if (-e "$runcmd_script") { my $genesis_bin_dir = "$genesis_base_dir/$arch/fs/bin"; @@ -332,14 +302,12 @@ sub clearenv { `mknb $arch`; if ($?) { send_msg(0, "mknb for runcmd test environment failed"); - print "mknb for runcmd test environment failed\n"; exit 1; } } `rinstall $noderange boot`; if ($?) { - send_msg(0, "rinstall node failed"); - print "rinstall node failed\n"; + send_msg(0, "rinstall $noderange boot failed"); exit 1; } if (-e "$nodestanza") { @@ -405,6 +373,8 @@ sub send_msg { if (!open(LOGFILE, ">> $logfiledir/$logfile")) { return 1; } + + print "$date $$ $content $msg\n"; print LOGFILE "$date $$ $content $msg\n"; close LOGFILE; From 985421561781b53027162c56f18c3cf68f43b644 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 10 May 2019 10:36:31 -0400 Subject: [PATCH 127/276] Inform the user when arch cannot automatically be detected, if we are in the correct plugin --- xCAT-server/lib/xcat/plugins/anaconda.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index a7764cc8c..ccaabae36 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2124,8 +2124,8 @@ sub copycd } else { - print "DEBUG - [anaconda.pm] Could not auto-detect operating system.\n"; # Cannot continue with what was detected, or attributes provided + print "DEBUG - [anaconda.pm] Could not auto-detect operating system. Maybe some other plugin can, return.\n"; return; } } @@ -2147,10 +2147,14 @@ sub copycd if ($arch eq "ppc") { $arch = "ppc64" } } - # At this point, if arch is not provided and we cannot determine it, return + # At this point, if arch is not provided and we cannot determine it, inform the user unless ($arch) { - print "DEBUG - [anaconda.pm] ARCH not detected, provided an OS ARCH using the -a option.\n"; + $callback->( + { + error => "copycds could not identify the ARCH, you may wish to try -a .", errorcode => [1] + } + ); return; } From 9c30f71088cce016d991f2b7af744d20c41ee8c9 Mon Sep 17 00:00:00 2001 From: cxhong Date: Fri, 10 May 2019 12:15:25 -0400 Subject: [PATCH 128/276] Add multiple kernel support to mlnxofed_ib_install script, remove v2 version --- .../advanced/networks/infiniband/index.rst | 2 +- .../infiniband/mlnxofed_configuration.rst | 4 +- ...install_v2.rst => mlnxofed_ib_install.rst} | 4 +- ...ul.rst => mlnxofed_ib_install_diskful.rst} | 0 ...s.rst => mlnxofed_ib_install_diskless.rst} | 0 ...st => mlnxofed_ib_install_preparation.rst} | 6 +- .../ib/scripts/Mellanox/mlnxofed_ib_install | 623 +++++++++++------- .../scripts/Mellanox/mlnxofed_ib_install.v2 | 418 ------------ .../rhel-infiniband-diskfull-install.sh | 6 +- .../rhel-infiniband-diskless-install.sh | 6 +- 10 files changed, 397 insertions(+), 672 deletions(-) rename docs/source/advanced/networks/infiniband/{mlnxofed_ib_install_v2.rst => mlnxofed_ib_install.rst} (78%) rename docs/source/advanced/networks/infiniband/{mlnxofed_ib_install_v2_diskful.rst => mlnxofed_ib_install_diskful.rst} (100%) rename docs/source/advanced/networks/infiniband/{mlnxofed_ib_install_v2_diskless.rst => mlnxofed_ib_install_diskless.rst} (100%) rename docs/source/advanced/networks/infiniband/{mlnxofed_ib_install_v2_preparation.rst => mlnxofed_ib_install_preparation.rst} (87%) delete mode 100755 xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 diff --git a/docs/source/advanced/networks/infiniband/index.rst b/docs/source/advanced/networks/infiniband/index.rst index cb92a7045..8bda17a81 100644 --- a/docs/source/advanced/networks/infiniband/index.rst +++ b/docs/source/advanced/networks/infiniband/index.rst @@ -7,7 +7,7 @@ xCAT has the ability to help with Mellanox InfiniBand (IB) adapter installation .. toctree:: :maxdepth: 2 - mlnxofed_ib_install_v2.rst + mlnxofed_ib_install.rst network_configuration.rst switch_configuration.rst ufm_configuration.rst diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_configuration.rst b/docs/source/advanced/networks/infiniband/mlnxofed_configuration.rst index 046e0a0a7..d7c113849 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_configuration.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_configuration.rst @@ -6,6 +6,6 @@ The process to configure the osimage to install the Mellanox OFED Drivers for Di .. toctree:: :maxdepth: 2 - mlnxofed_ib_install_v2_diskful.rst - mlnxofed_ib_install_v2_diskless.rst + mlnxofed_ib_install_diskful.rst + mlnxofed_ib_install_diskless.rst diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install.rst similarity index 78% rename from docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst rename to docs/source/advanced/networks/infiniband/mlnxofed_ib_install.rst index 25f856007..ea8e63916 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install.rst @@ -1,12 +1,12 @@ Mellanox OFED Installation Script ================================= -Mellanox provides a tested and packaged version of the OpenFabrics Enterprise Distribution (OFED) driver, named Mellanox OFED (MLNX_OFED). To assist with the installation of the MLNX_OFED driver, xCAT provides a sample postscript: ``mlnxofed_ib_install.v2``. +Mellanox provides a tested and packaged version of the OpenFabrics Enterprise Distribution (OFED) driver, named Mellanox OFED (MLNX_OFED). To assist with the installation of the MLNX_OFED driver, xCAT provides a sample postscript: ``mlnxofed_ib_install``. .. toctree:: :maxdepth: 2 - mlnxofed_ib_install_v2_preparation.rst + mlnxofed_ib_install_preparation.rst mlnxofed_configuration.rst mlnxofed_ib_verified_scenario_matrix.rst mlnxofed_ib_known_issue.rst diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_diskful.rst similarity index 100% rename from docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst rename to docs/source/advanced/networks/infiniband/mlnxofed_ib_install_diskful.rst diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_diskless.rst similarity index 100% rename from docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst rename to docs/source/advanced/networks/infiniband/mlnxofed_ib_install_diskless.rst diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_preparation.rst similarity index 87% rename from docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst rename to docs/source/advanced/networks/infiniband/mlnxofed_ib_install_preparation.rst index b4a646868..12fdcd6cf 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_preparation.rst @@ -12,11 +12,11 @@ Download the Mellanox OFED ISO file `here (MLNX_OFED) `. +The ``mlnxofed_ib_install`` is a sample script intended to assist with the installation of the Mellanox OFED drivers. The following support matrix documents the limited number of scenarios that have been verified: :doc:`support matrix `. -#. Copy the ``mlnxofed_ib_install.v2`` to ``/install/postscripts``, renaming to ``mlnxofed_ib_install``. :: +#. Copy the ``mlnxofed_ib_install`` to ``/install/postscripts``, renaming to ``mlnxofed_ib_install``. :: - cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 \ + cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install \ /install/postscripts/mlnxofed_ib_install # ensure the script has execute permission diff --git a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install index d0f63e5a4..df149b25a 100755 --- a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install +++ b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install @@ -1,289 +1,432 @@ -#!/bin/sh +#!/bin/bash +# +# This is the second version of Mellanox IB driver installation sample script +# This is also the version we recommend to use right now. +# What are changed in this version +# 1. The usage interface is changed, using command line arguments instead of using environment attribute +# 2. The way of downloading Mellanox OFED files. +# 3. Some structure of code # -# Sample script to customize options for Mellonax OFED IB support # For AIX: # TBD # For Linux: # - For full-disk installs: -# - Copy rpms to node +# - Copy Mellanox OFED ISO to node # - Install IB rpms # - For diskless images: # - Copy the packages to the images. # - Install IB rpms # +#usage: # -# Usage: -# Copy the xCAT mlnxofed_ib_install script file to postscripts directory: +# Copy the xCAT mlnxofed_ib_install script file to postscripts directory: # cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install /install/postscripts/mlnxofed_ib_install # -# 1. Install the ofed driver for diskful node -# 1.1 Set the postscript as one postbootscripts for the node -# chdef xcat01 -p postbootscripts=mlnxofed_ib_install,configiba -# 1.2 Copy the pkglist to the custom directory: -# cp /opt/xcat/share/xcat/install//compute...pkglist /install/custom/install//compute...pkglist -# Edit your /install/custom/install//compute...pkglist and add: -# #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# -# 1.3 Make sure the related osimage use the customized pkglist. -# lsdef -t osimage -o --install-compute -# if not, change it: -# chdef -t osimage -o --install-compute pkglist=/install/custom/install//compute...pkglist -# 1.4 Do the diskful installation +# Prepare Mellanox OFED ISO file and save it into any subdirectory under /install. +# +# 1. install the ofed driver for diskfull node +# [NOTE] step 1.1-1.2 are only needed by redhat and sles +# 1.1 copy the pkglist to the custom directory: +# cp /opt/xcat/share/xcat/install//compute...pkglist /install/custom/install//compute...pkglist +# Edit your /install/custom/install//compute...pkglist and add: +# #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# +# 1.2 Make the related osimage use the customized pkglist. +# chdef -t osimage -o --install-compute pkglist=/install/custom/install//compute...pkglist +# 1.3 set mlnxofed_ib_install as postbootscripts for the target node. assign necessary attribute for mlnxofed_ib_install at same time. +# chdef -p postbootscripts="mlnxofed_ib_install -p /install//" +# [NOTE] The default options input into Mellanox are '--without-32bit --without-fw-update --force' +# you can appoint the options by yourslef with '-m' option of mlnxofed_ib_install +# In order to distinguish which options are tranfered to Mellanox and which options are belong to mlnxofed_ib_install, any options wanted to transfered to Mellanox must follow behind -m and end with "-end-", for example: +# chdef -p postbootscripts="mlnxofed_ib_install -p /install// -m --without-32bit --add-kernel-support --force -end-" +# 1.4 do the diskfull installation +# nodeset osimage= ...... +# # 2. install the ofed driver for diskless images: -# 2.1 Copy the pkglist to the custom directory: -# cp /opt/xcat/share/xcat/netboot//compute...pkglist /install/custom/netboot//compute...pkglist -# Edit your /install/custom/netboot//.pkglist and add: -# #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# -# 2.2 Add to postinstall scripts -# Edit your /install/custom/netboot//.postinstall and add: -# installroot=$1 ofeddir=/install/post/otherpkgs///ofed/ NODESETSTATE=genimage /install/postscripts/mlnxofed_ib_install -# 2.3 Make sure the related osimage use the customized pkglist and customized compute.postinsall -# lsdef -t osimage -o --netboot-compute -# if not, change it: -# chdef -t osimage -o --netboot-compute pkglist=/install/custom/netboot//compute...pkglist postinstall=/install/custom/netboot//.postinstall -# 2.4 Run genimage -# genimage --netboot-compute -# -# You can obtain more information at: http://xcat-docs.readthedocs.org/ +# [NOTE] step 2.1 is only needed by redhat and sles +# 2.1 copy the pkglist to the custom directory: +# cp /opt/xcat/share/xcat/netboot//compute...pkglist /install/custom/netboot//compute...pkglist +# Edit your /install/custom/netboot//.pkglist and add: +# #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# +# 2.2 Add to postinstall scripts +# Edit your /install/custom/netboot//.postinstall and add: +# /install/postscripts/mlnxofed_ib_install -p /install// -n genimage -i $1 +# 2.3 Make sure the related osimage use the customized pkglist and customized compute.postinsall +# lsdef -t osimage -o --netboot-compute +# if not, change it: +# chdef -t osimage -o --netboot-compute pkglist=/install/custom/netboot//compute...pkglist postinstall=/install/custom/netboot//.postinstall +# 2.4 run genimage +# genimage --netboot-compute # -OS=`uname` -#installroot='/install/netboot/sles11.1/x86_64/compute/rootimg' -INSTALL_DIR='/install' +#set -x -#echo "------------------------------------------" -#echo "OFED_DIR=$ofeddir" -#echo "OSVER=$OSVER" -#echo "arch=$ARCH" -#echo "NODESETSTATE=$NODESETSTATE" -#echo "mlnxofed_options=$mlnxofed_options" -#echo "installroot=$installroot" -#echo "------------------------------------------" - -if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then - str_dir_name=`dirname $0` - . $str_dir_name/xcatlib.sh +OS="$(uname)" +if [ "$OS" = "Linux" ]; then + str_dir_name="${0%/*}" + . "$str_dir_name/xcatlib.sh" 2>/dev/null fi -#use arg for the OFED_DIR if defined, -ARGNUM=$# -if [ $ARGNUM -gt 1 ]; then - if [ $1 = "-s" ]; then - OFED_DIR=$2 - fi +#-------------------------------------------------------- +declare -a MLNXOFED_OPTS + +function usage() { + echo "Usage: mlnxofed_ib_install [-attribute]" + echo " attribute include:" + echo " -h: print this help message" + echo " -p: the path where OFED file is saved. this is necessary attribute" + echo " -m: the options inputted into mlnxofedinstall script, defualt value are --without-32bit --without-fw-update --force" + echo " -i: the image root path. this is necessary attribute in diskless scenario" + echo " -n: nodeset status, the value are one of install, boot or genimage" +} + +while [ "$#" -gt "0" ] +do + case "$1" in + "-p") + shift + OFED_PATH="$1" + ;; + "-m") + shift + while [ "$#" -gt "0" -a "-end-" != "$1" ] + do + MLNXOFED_OPTS=("${MLNXOFED_OPTS[@]}" "$1") + shift + done + ;; + "-i") + shift + IMGROOTPATH="$1" + ;; + "-n") + shift + NODESETSTATE="$1" + ;; + "-h") + usage + exit 0 + ;; + *) + echo "unsupport attribute $1" + exit 0 + ;; + esac + shift +done + +if [ -z "$OFED_PATH" ]; then + echo "[Error] Without Mellanox OFED file path, please assign correct path" >&2 + exit 1 fi -#if arg is not defined, check ofeddir environment variable, -if [ -z "$OFED_DIR" ]; then - OFED_DIR=$ofeddir - #if ofeddir is not defined, use default. - if [ -z "$OFED_DIR" ]; then - # try to default - OFED_DIR=$INSTALL_DIR/post/otherpkgs/$OSVER/$ARCH/ofed - fi +if [ "$NODESETSTATE" = "genimage" -a ! -d "$IMGROOTPATH" ]; then + echo "[Error] this is for diskless installation, please assign correct diskless image root path" >&2 + exit 1 fi -# $mlnxofed_options is an environment variable passed to the mlnxofed_ib_install script. By default mlnxofed_option is '--without-32bit --force' -if [ -z "$mlnxofed_options" ]; then - mlnxofed_options="--without-32bit --force" -fi +[ "${#MLNXOFED_OPTS[@]}" = 0 ] && MLNXOFED_OPTS=(--without-32bit --without-fw-update --force) -if [[ $NODESETSTATE != "genimage" ]]; then - # running as a postscript in a full-disk install or AIX diskless install - installroot="" -fi +OFED_DIR=${OFED_PATH%/*} +OFED_NAME=${OFED_PATH##*/} -if [ $OS != "AIX" ]; then - if [[ $NODESETSTATE == "install" ]] || [[ $NODESETSTATE == "boot" ]]; then - # Being run from a stateful install postscript - # Copy rpms directly from the xCAT management node and install - mkdir -p /tmp/ofed - rm -f -R /tmp/ofed/* - cd /tmp/ofed - #download_dir=`echo $OFED_DIR | cut -d '/' -f3-` - #wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=5 ftp://$SITEMASTER/$download_dir/ 2> /tmp/wget.log - download_dir=$OFED_DIR - num=`echo $download_dir | awk -F"/" '{if($NF==""){print NF-2}else{print NF-1}}'` - wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=$num --reject "index.html*" --no-parent http://$MASTER$download_dir/ 2> /tmp/wget.log - wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=$num --reject "index.html*" --no-parent http://$MASTER$download_dir/.mlnx 2>> /tmp/wget.log - wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=$num --reject "index.html*" --no-parent http://$MASTER$download_dir/.supported_kernels 2>> /tmp/wget.log +echo "Mellanox OFED file path is $OFED_DIR" +echo "Mellanox OFED file is $OFED_NAME" +echo "Mellanox OFED options are ${MLNXOFED_OPTS[@]}" +echo "image root path is $IMGROOTPATH" +echo "NODESETSTATE is $NODESETSTATE" +function hack_uname() +{ + BEFORE_UNAME_R="$($1/bin/uname -r)" + BEFORE_UNAME_M="$($1/bin/uname -m)" + echo "Before hack_uname(), -r=>'${BEFORE_UNAME_R}' -m=>'${BEFORE_UNAME_M}'" + BEFORE_UNAME_R_NEW="$(chroot $1 /bin/uname -r)" + BEFORE_UNAME_M_NEW="$(chroot $1 /bin/uname -m)" + echo "Before hack_uname(), chroot -r=>'${BEFORE_UNAME_R_NEW}' -m=>'${BEFORE_UNAME_M_NEW}'" - if [ -f /etc/os-release ] && - cat /etc/os-release |grep NAME|grep Ubuntu>/dev/null - then - nodename=`hostname` - echo "$nodename 's operating system is Ubuntu." - echo "If you want to install Mellanox_OFED in $nodename, $nodename must have ability to access www.ports.ubuntu.com" - echo -n "checking $nodename 's ability to access www.ports.ubuntu.com ..........." - if ping -c 3 www.ports.ubuntu.com > /dev/null;then - echo "[OK]" - else - echo "[Failed]" - echo "please make your $nodename have ability to access www.ports.ubuntu.com" - exit 1 - fi - - cp /etc/apt/sources.list /etc/apt/sources.list.bak - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty main/d" /etc/apt/sources.list - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty-updates main/d" /etc/apt/sources.list - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty universe/d" /etc/apt/sources.list - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty-updates universe/d" /etc/apt/sources.list - - echo "deb http://ports.ubuntu.com/ubuntu-ports/ trusty main -deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main -deb http://ports.ubuntu.com/ubuntu-ports/ trusty universe -deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe" >> /etc/apt/sources.list - - apt-get clean all - sleep 1 - apt-get update - fi - - #rpm -Uvh --force libibverbs-devel*.rpm - #perl -x mlnxofedinstall --without-32bit --force - - if [ -f /etc/os-release ] && - cat /etc/os-release|grep NAME|grep Ubuntu>/dev/null && - uname -m |grep ppc64 >/dev/null - then - echo "perl -x mlnxofedinstall --without-fw-update $mlnxofed_options" - { - unset ARCH - perl -x mlnxofedinstall --without-fw-update $mlnxofed_options - } - sleep 1 - service openibd restart - else - echo "perl -x mlnxofedinstall --without-fw-update $mlnxofed_options" - perl -x mlnxofedinstall --without-fw-update $mlnxofed_options - fi - rm -Rf /tmp/ofed - #force openibd load all modules in need, restart again - restartservice openibd - fi - - if [[ $NODESETSTATE == "genimage" ]]; then - # Being called from .postinstall script - # Assume we are on the same machine - if [[ $OS == sles* ]] || [[ $OS == suse* ]] || [[ -f /etc/SuSE-release ]]; then - #mkdir $installroot/tmp/ofed_install - #cp -r $OFED_DIR/ $installroot/tmp/ofed_install/ - mkdir -p $installroot/tmp/ofed_install/ofed - ( cd "$OFED_DIR" && tar cf - . ) | ( cd "$installroot/tmp/ofed_install/ofed" && tar xf - ) - #mount -t devtmpfs /dev $installroot/dev/ - #mount -t sysfs /sys $installroot/sys - #mount -t proc /proc $installroot/proc - mount --bind /dev $installroot/dev/ - mount --bind /sys $installroot/sys - mount --bind /proc $installroot/proc - chroot $installroot rpm -e --noscripts --allmatches mlnx-ofa_kernel-kmp-default 2>/dev/null - chroot $installroot rpm -e --nodeps --allmatches libibverbs 2>/dev/null - #chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-32bit --force - chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall $mlnxofed_options - rm -rf $installroot/tmp/ofed_install - umount $installroot/dev/ - umount $installroot/sys - umount $installroot/proc - elif [ -f /etc/os-release ] && - cat /etc/os-release |grep NAME|grep Ubuntu>/dev/null; then - - #mkdir $installroot/tmp/ofed_install - #cp -r $OFED_DIR/ $installroot/tmp/ofed_install/ - mkdir -p $installroot/tmp/ofed_install/ofed - ( cd "$OFED_DIR" && tar cf - . ) | ( cd "$installroot/tmp/ofed_install/ofed" && tar xf - ) - - nodename=`hostname` - echo "$nodename 's operating system is Ubuntu." - echo "If you want to install Mellanox_OFED in $nodename, $nodename must have ability to access public network." - echo -n "checking $nodename 's ability to access public network..........." - if ping -c 3 www.ports.ubuntu.com > /dev/null;then - echo "[OK]" - else - echo "[Failed]" - echo "please make your $nodename have ability to access public network" - exit 1 - fi - - sourceslist="$installroot/etc/apt/sources.list" - cp $sourceslist $sourceslist.bak - - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty main/d" $sourceslist - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty-updates main/d" $sourceslist - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty universe/d" $sourceslist - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty-updates universe/d" $sourceslist - - echo "deb http://ports.ubuntu.com/ubuntu-ports/ trusty main -deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main -deb http://ports.ubuntu.com/ubuntu-ports/ trusty universe -deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe" >> $sourceslist - - chroot $installroot apt-get clean all - sleep 1 - chroot $installroot apt-get update - mount --bind /dev $installroot/dev/ - mount --bind /proc $installroot/proc/ - mount --bind /sys $installroot/sys/ - - mv "${installroot}/bin/uname" "${installroot}/bin/uname.nouse" -# cat <<-EOF >"${installroot}/bin/uname" -# #!/bin/sh -# [ "\$1" = "-r" ] && cd /lib/modules && for d in *; do :; done && echo \$d -# [ "\$1" = "-m" ] && if [ -d "/proc/powerpc" ];then echo ppc64le;else echo x86_64;fi -# [ "\$1" = "-s" ] && echo Linux -# exit 0 -# EOF - - cat <<-EOF >"${installroot}/bin/uname" + mv "$1/bin/uname" "$1/bin/uname.save" + cat <<-EOF >"$1/bin/uname" #!/bin/sh case "\$1" in "-m") - ARCH="\$(dpkg --print-architecture || rpm -q kernel-\$("\$0" -r) --qf '%{arch}')" + ARCH="\$(dpkg --print-architecture 2>/dev/null || rpm -q kernel-\$("\$0" -r) --qf '%{arch}' 2>/dev/null)" case "\$ARCH" in - "amd64") + "amd64") ARCH="x86_64" ;; "ppc64el") - ARCH="ppc64le" - ;; + ARCH="ppc64le" + ;; esac - echo "\$ARCH" + echo "\$ARCH" ;; - "-r") - cd /lib/modules && for d in * ; do : ; done && echo \$d + "-r") + if [ -n "\$KERNELVERSION" ]; then + echo \$KERNELVERSION + else + for d in \$(ls /lib/modules | sort -V) + do + rpm -q kernel-\$d >/dev/null 2>&1 + if [ "\$?" == "0" ] ; then + echo \$d + break + fi + done + fi ;; "-s"|"") - echo "Linux" + echo "Linux" ;; esac exit 0 EOF -# head -n 999 "${installroot}/bin/uname" - chmod 0755 "${installroot}/bin/uname" + chmod 0755 "$1/bin/uname" + AFTER_UNAME_R="$($1/bin/uname -r)" + AFTER_UNAME_M="$($1/bin/uname -m)" + echo "After hack_uname(), -r=>'${AFTER_UNAME_R}', -m=>'${AFTER_UNAME_M}'" + AFTER_UNAME_R_NEW="$(chroot $1 /bin/uname -r)" + AFTER_UNAME_M_NEW="$(chroot $1 /bin/uname -m)" + echo "After hack_uname(), chroot -r=>'${AFTER_UNAME_R_NEW}' -m=>'${AFTER_UNAME_M_NEW}'" +} - chroot $installroot sh -c 'apt-get install -y linux-headers-$(uname -r)' - - echo "perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-fw-update $mlnxofed_options" - chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-fw-update $mlnxofed_options - mv "${installroot}/bin/uname.nouse" "${installroot}/bin/uname" - - rm -rf $installroot/tmp/ofed_install - umount $installroot/dev/ - umount $installroot/proc/ - umount $installroot/sys/ - - else - #mkdir $installroot/tmp/ofed_install - #cp -r $OFED_DIR/ $installroot/tmp/ofed_install/ - mkdir -p $installroot/tmp/ofed_install/ofed - ( cd "$OFED_DIR" && tar cf - . ) | ( cd "$installroot/tmp/ofed_install/ofed" && tar xf - ) - chroot $installroot rpm -e --nodeps --allmatches libibverbs 2>/dev/null - #chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-32bit --force - chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-fw-update $mlnxofed_options - rm -rf $installroot/tmp/ofed_install +function cleanup() +{ + local -i i=0 + local -i max_retry=99 + + if [ "$NODESETSTATE" != "genimage" ]; then + # Clean up the uname hacking + if [ -f "/bin/uname.save" ]; then + mv -f "/bin/uname.save" "/bin/uname" fi + if mount | grep -q "/tmp/ofed/mountpoint"; then + while ! umount "/tmp/ofed/mountpoint" + do + (( ++i > max_retry )) && echo "Umount /tmp/ofed/mountpoint failed" >&2 && break + sleep 1 + done + fi + if [ -d "/tmp/ofed" ]; then + rm -rf -- /tmp/ofed + fi + else + # Clean up the uname hacking + if [ -f "$IMGROOTPATH/bin/uname.save" ]; then + mv -f "$IMGROOTPATH/bin/uname.save" "$IMGROOTPATH/bin/uname" + fi + # Clean up the ofed iso + tmp_imgpath=$IMGROOTPATH + while (echo $tmp_imgpath | grep "/$") + do + tmp_imgpath=${tmp_imgpath%/*} + done + if mount | grep -q "$tmp_imgpath/tmp/ofed/mountpoint"; then + while ! umount "$IMGROOTPATH/tmp/ofed/mountpoint" + do + (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/tmp/ofed/mountpoint failed" >&2 && break + sleep 1 + done + fi + if [ -d "$IMGROOTPATH/tmp/ofed" ]; then + rm -rf -- "$IMGROOTPATH/tmp/ofed" + fi + + i=0 + if mount | grep -q "$IMGROOTPATH/sys"; then + while ! umount "$IMGROOTPATH/sys" + do + (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/sys failed" >&2 && break + sleep 1 + done + fi + i=0 + if mount | grep -q "$IMGROOTPATH/proc"; then + while ! umount "$IMGROOTPATH/proc" + do + (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/proc failed" >&2 && break + sleep 1 + done + fi + i=0 + if mount | grep -q "$IMGROOTPATH/dev"; then + while ! umount "$IMGROOTPATH/dev" + do + (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/dev failed" >&2 && break + sleep 1 + done + fi + fi +} +trap 'cleanup' 0 + + +if [ "$OS" = "Linux" ]; then + if [ "$NODESETSTATE" = "install" -o "$NODESETSTATE" = "boot" ]; then + + #if the host is ubuntn, need to do some network check and configuration + if grep -q Ubuntu /etc/os-release 2>/dev/null + then + echo "$HOSTNAME 's operating system is Ubuntu." + echo "If you want to install Mellanox_OFED in $HOSTNAME, $HOSTNAME must have ability to access ports.ubuntu.com" + echo -n "checking $HOSTNAME 's ability to access ports.ubuntu.com..........." + if ping -c 3 ports.ubuntu.com > /dev/null;then + echo "[OK]" + else + echo "[Failed]" >&2 + echo "[Error] please make your $HOSTNAME has ability to access ports.ubuntu.com" >&2 + exit 1 + fi + + + echo "get distro name form /etc/lsb-release ......" + source /etc/lsb-release >/dev/null 2>&1 + if [ -z "$DISTRIB_CODENAME" ]; then + echo "[Error] can't get DISTRIB_CODENAME " >&2 + exit 1 + fi + echo "DISTRIB_CODENAME=$DISTRIB_CODENAME ...[OK]" + + cp /etc/apt/sources.list /etc/apt/sources.list.bak + sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME main/d" /etc/apt/sources.list + sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME-updates main/d" /etc/apt/sources.list + sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME universe/d" /etc/apt/sources.list + sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME-updates universe/d" /etc/apt/sources.list + + cat <<-EOF >>/etc/apt/sources.list +deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME main +deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates main +deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME universe +deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates universe +EOF + + apt-get clean all + sleep 1 + apt-get update + fi + + # Being run from a stateful install postscript + # Copy ISO directly from the xCAT management node and install + rm -rf -- /tmp/ofed + mkdir -p /tmp/ofed/mountpoint + if [ "$?" != "0" ] ;then + echo "[Error] We are in trouble to mkdir /tmp/ofed/mountpoint, please check your node" >&2 + exit 1 + fi + + cd /tmp/ofed/ + echo "Downloading Mellanox OFED file $OFED_NAME form http://$MASTER/$OFED_DIR .........." + wget -l inf -N --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --no-parent "http://$MASTER/$OFED_DIR/$OFED_NAME" 2> /tmp/wget.log + if [ "$?" != "0" ]; then + echo "[Error] Downloading Mellanox OFED file $OFED_NAME failed" >&2 + exit 1 + fi + if [ ! -f "/tmp/ofed/$OFED_NAME" ]; then + echo "[Failed]" >&2 + exit 1 + fi + echo "[OK]" + + echo "Mounting Mellanox OFED file $OFED_NAME ........." + mount -o loop "/tmp/ofed/$OFED_NAME" /tmp/ofed/mountpoint + if [ ! -f "/tmp/ofed/mountpoint/mlnxofedinstall" -o ! -x "/tmp/ofed/mountpoint/mlnxofedinstall" ]; then + echo "[Failed]" >&2 + exit 1 + fi + echo "[OK]" + + if [ "$NODESETSTATE" = "install" ]; then + hack_uname + fi + + echo "Start Mellanox OFED installation ........." + env -i "PATH=${PATH}" /tmp/ofed/mountpoint/mlnxofedinstall "${MLNXOFED_OPTS[@]}" + + #force openibd load all modules in need, restart again + if [ "$NODESETSTATE" = "boot" ]; then + sleep 1 + service openibd restart + if [ "$?" != "0" ]; then + echo "[Error] service openibd restart failed." + exit 1 + fi + fi + fi + + if [[ "$NODESETSTATE" == "genimage" ]]; then + rm -rf -- "$IMGROOTPATH/tmp/ofed" + mkdir -p "$IMGROOTPATH/tmp/ofed/mountpoint" + if [ "$?" != "0" ] ;then + echo "[Error] We are in trouble to mkdir $IMGROOTPATH/tmp/ofed/mountpoint, please check your node" >&2 + exit 1 + fi + + echo "Mounting Mellanox OFED file $OFED_DIR/$OFED_NAME ........." + mount -o loop "$OFED_DIR/$OFED_NAME" "$IMGROOTPATH/tmp/ofed/mountpoint" + if [ ! -f "$IMGROOTPATH/tmp/ofed/mountpoint/mlnxofedinstall" -o ! -x "$IMGROOTPATH/tmp/ofed/mountpoint/mlnxofedinstall" ]; then + echo "[Failed]" >&2 + exit 1 + fi + echo "[OK]" + + echo "Start Mellanox OFED installation ........." + + mount --bind /dev "$IMGROOTPATH/dev/" + mount --bind /proc "$IMGROOTPATH/proc/" + mount --bind /sys "$IMGROOTPATH/sys/" + + hack_uname "${IMGROOTPATH}" + + # Being called from .postinstall script + # Assume we are on the same machine + if [ -f /etc/SuSE-release ]; then + chroot "$IMGROOTPATH" rpm -e --noscripts --allmatches mlnx-ofa_kernel-kmp-default 2>/dev/null + chroot "$IMGROOTPATH" rpm -e --nodeps --allmatches libibverbs 2>/dev/null + elif grep -q Ubuntu /etc/os-release 2>/dev/null; then + echo "$HOSTNAME 's operating system is Ubuntu." + echo "If you want to install Mellanox_OFED in $HOSTNAME, $HOSTNAME must have ability to access ports.ubuntu.com" + echo -n "checking $HOSTNAME 's ability to access ports.ubuntu.com..........." + if ping -c 3 ports.ubuntu.com > /dev/null; then + echo "[OK]" + else + echo "[Failed]" >&2 + echo "please make your $HOSTNAME has ability to access ports.ubuntu.com" >&2 + exit 1 + fi + + sourceslist="$IMGROOTPATH/etc/apt/sources.list" + cp "$sourceslist" "${sourceslist}.bak" + + echo "get distro name form $IMGROOTPATH/etc/lsb-release ......" + source $IMGROOTPATH/etc/lsb-release >/dev/null 2>&1 + if [ -z "$DISTRIB_CODENAME" ]; then + echo "[Error] can't get DISTRIB_CODENAME " >&2 + exit 1 + fi + echo "DISTRIB_CODENAME=$DISTRIB_CODENAME ...[OK]" + + sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME main/d" $sourceslist + sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME-updates main/d" $sourceslist + sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME universe/d" $sourceslist + sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME-updates universe/d" $sourceslist + + cat <<-EOF >>"$sourceslist" +deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME main +deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates main +deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME universe +deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates universe +EOF + + chroot "$IMGROOTPATH" apt-get clean all + sleep 1 + chroot "$IMGROOTPATH" apt-get update + + chroot "$IMGROOTPATH" sh -c 'apt-get install -y linux-headers-$(uname -r)' + else #for rhels + chroot "$IMGROOTPATH" rpm -e --nodeps --allmatches libibverbs 2>/dev/null + fi + chroot "$IMGROOTPATH" env -i "PATH=${PATH}" /tmp/ofed/mountpoint/mlnxofedinstall "${MLNXOFED_OPTS[@]}" fi fi - diff --git a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 deleted file mode 100755 index e16445aac..000000000 --- a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 +++ /dev/null @@ -1,418 +0,0 @@ -#!/bin/bash -# -# This is the second version of Mellanox IB driver installation sample script -# This is also the version we recommend to use right now. -# What are changed in this version -# 1. The usage interface is changed, using command line arguments instead of using environment attribute -# 2. The way of downloading Mellanox OFED files. -# 3. Some structure of code -# -# For AIX: -# TBD -# For Linux: -# - For full-disk installs: -# - Copy Mellanox OFED ISO to node -# - Install IB rpms -# - For diskless images: -# - Copy the packages to the images. -# - Install IB rpms -# -#usage: -# -# Copy the xCAT mlnxofed_ib_install.v2 script file to postscripts directory and rename to mlnxofed_ib_install: -# cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 /install/postscripts/mlnxofed_ib_install -# -# Prepare Mellanox OFED ISO file and save it into any subdirectory under /install. -# -# 1. install the ofed driver for diskfull node -# [NOTE] step 1.1-1.2 are only needed by redhat and sles -# 1.1 copy the pkglist to the custom directory: -# cp /opt/xcat/share/xcat/install//compute...pkglist /install/custom/install//compute...pkglist -# Edit your /install/custom/install//compute...pkglist and add: -# #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# -# 1.2 Make the related osimage use the customized pkglist. -# chdef -t osimage -o --install-compute pkglist=/install/custom/install//compute...pkglist -# 1.3 set mlnxofed_ib_install as postbootscripts for the target node. assign necessary attribute for mlnxofed_ib_install at same time. -# chdef -p postbootscripts="mlnxofed_ib_install -p /install//" -# [NOTE] The default options input into Mellanox are '--without-32bit --without-fw-update --force' -# you can appoint the options by yourslef with '-m' option of mlnxofed_ib_install -# In order to distinguish which options are tranfered to Mellanox and which options are belong to mlnxofed_ib_install, any options wanted to transfered to Mellanox must follow behind -m and end with "-end-", for example: -# chdef -p postbootscripts="mlnxofed_ib_install -p /install// -m --without-32bit --add-kernel-support --force -end-" -# 1.4 do the diskfull installation -# nodeset osimage= ...... -# -# 2. install the ofed driver for diskless images: -# [NOTE] step 2.1 is only needed by redhat and sles -# 2.1 copy the pkglist to the custom directory: -# cp /opt/xcat/share/xcat/netboot//compute...pkglist /install/custom/netboot//compute...pkglist -# Edit your /install/custom/netboot//.pkglist and add: -# #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# -# 2.2 Add to postinstall scripts -# Edit your /install/custom/netboot//.postinstall and add: -# /install/postscripts/mlnxofed_ib_install -p /install// -n genimage -i $1 -# 2.3 Make sure the related osimage use the customized pkglist and customized compute.postinsall -# lsdef -t osimage -o --netboot-compute -# if not, change it: -# chdef -t osimage -o --netboot-compute pkglist=/install/custom/netboot//compute...pkglist postinstall=/install/custom/netboot//.postinstall -# 2.4 run genimage -# genimage --netboot-compute -# - -#set -x - -OS="$(uname)" -if [ "$OS" = "Linux" ]; then - str_dir_name="${0%/*}" - . "$str_dir_name/xcatlib.sh" 2>/dev/null -fi - -#-------------------------------------------------------- -declare -a MLNXOFED_OPTS - -function usage() { - echo "Usage: mlnxofed_ib_install [-attribute]" - echo " attribute include:" - echo " -h: print this help message" - echo " -p: the path where OFED file is saved. this is necessary attribute" - echo " -m: the options inputted into mlnxofedinstall script, defualt value are --without-32bit --without-fw-update --force" - echo " -i: the image root path. this is necessary attribute in diskless scenario" - echo " -n: nodeset status, the value are one of install, boot or genimage" -} - -while [ "$#" -gt "0" ] -do - case "$1" in - "-p") - shift - OFED_PATH="$1" - ;; - "-m") - shift - while [ "$#" -gt "0" -a "-end-" != "$1" ] - do - MLNXOFED_OPTS=("${MLNXOFED_OPTS[@]}" "$1") - shift - done - ;; - "-i") - shift - IMGROOTPATH="$1" - ;; - "-n") - shift - NODESETSTATE="$1" - ;; - "-h") - usage - exit 0 - ;; - *) - echo "unsupport attribute $1" - exit 0 - ;; - esac - shift -done - -if [ -z "$OFED_PATH" ]; then - echo "[Error] Without Mellanox OFED file path, please assign correct path" >&2 - exit 1 -fi - -if [ "$NODESETSTATE" = "genimage" -a ! -d "$IMGROOTPATH" ]; then - echo "[Error] this is for diskless installation, please assign correct diskless image root path" >&2 - exit 1 -fi - -[ "${#MLNXOFED_OPTS[@]}" = 0 ] && MLNXOFED_OPTS=(--without-32bit --without-fw-update --force) - -OFED_DIR=${OFED_PATH%/*} -OFED_NAME=${OFED_PATH##*/} - -echo "Mellanox OFED file path is $OFED_DIR" -echo "Mellanox OFED file is $OFED_NAME" -echo "Mellanox OFED options are ${MLNXOFED_OPTS[@]}" -echo "image root path is $IMGROOTPATH" -echo "NODESETSTATE is $NODESETSTATE" - -function hack_uname() -{ - BEFORE_UNAME_R="$($1/bin/uname -r)" - BEFORE_UNAME_M="$($1/bin/uname -m)" - echo "Before hack_uname(), -r=>'${BEFORE_UNAME_R}' -m=>'${BEFORE_UNAME_M}'" - mv "$1/bin/uname" "$1/bin/uname.save" - cat <<-EOF >"$1/bin/uname" - #!/bin/sh - case "\$1" in - "-m") - ARCH="\$(dpkg --print-architecture 2>/dev/null || rpm -q kernel-\$("\$0" -r) --qf '%{arch}' 2>/dev/null)" - case "\$ARCH" in - "amd64") - ARCH="x86_64" - ;; - "ppc64el") - ARCH="ppc64le" - ;; - esac - echo "\$ARCH" - ;; - "-r") - if [ -n "\$KERNELVERSION" ]; then - echo \$KERNELVERSION - else - for d in \$(ls /lib/modules | sort -V) ; do : ; done && echo \$d - fi - ;; - "-s"|"") - echo "Linux" - ;; - esac - exit 0 - EOF - - chmod 0755 "$1/bin/uname" - AFTER_UNAME_R="$($1/bin/uname -r)" - AFTER_UNAME_M="$($1/bin/uname -m)" - echo "After hack_uname(), -r=>'${AFTER_UNAME_R}', -m=>'${AFTER_UNAME_M}'" -} - -function cleanup() -{ - local -i i=0 - local -i max_retry=99 - - if [ "$NODESETSTATE" != "genimage" ]; then - # Clean up the uname hacking - if [ -f "/bin/uname.save" ]; then - mv -f "/bin/uname.save" "/bin/uname" - fi - - if mount | grep -q "/tmp/ofed/mountpoint"; then - while ! umount "/tmp/ofed/mountpoint" - do - (( ++i > max_retry )) && echo "Umount /tmp/ofed/mountpoint failed" >&2 && break - sleep 1 - done - fi - if [ -d "/tmp/ofed" ]; then - rm -rf -- /tmp/ofed - fi - else - # Clean up the uname hacking - if [ -f "$IMGROOTPATH/bin/uname.save" ]; then - mv -f "$IMGROOTPATH/bin/uname.save" "$IMGROOTPATH/bin/uname" - fi - - # Clean up the ofed iso - tmp_imgpath=$IMGROOTPATH - while (echo $tmp_imgpath | grep "/$") - do - tmp_imgpath=${tmp_imgpath%/*} - done - if mount | grep -q "$tmp_imgpath/tmp/ofed/mountpoint"; then - while ! umount "$IMGROOTPATH/tmp/ofed/mountpoint" - do - (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/tmp/ofed/mountpoint failed" >&2 && break - sleep 1 - done - fi - if [ -d "$IMGROOTPATH/tmp/ofed" ]; then - rm -rf -- "$IMGROOTPATH/tmp/ofed" - fi - - i=0 - if mount | grep -q "$IMGROOTPATH/sys"; then - while ! umount "$IMGROOTPATH/sys" - do - (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/sys failed" >&2 && break - sleep 1 - done - fi - i=0 - if mount | grep -q "$IMGROOTPATH/proc"; then - while ! umount "$IMGROOTPATH/proc" - do - (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/proc failed" >&2 && break - sleep 1 - done - fi - i=0 - if mount | grep -q "$IMGROOTPATH/dev"; then - while ! umount "$IMGROOTPATH/dev" - do - (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/dev failed" >&2 && break - sleep 1 - done - fi - fi -} -trap 'cleanup' 0 - - -if [ "$OS" = "Linux" ]; then - if [ "$NODESETSTATE" = "install" -o "$NODESETSTATE" = "boot" ]; then - - #if the host is ubuntn, need to do some network check and configuration - if grep -q Ubuntu /etc/os-release 2>/dev/null - then - echo "$HOSTNAME 's operating system is Ubuntu." - echo "If you want to install Mellanox_OFED in $HOSTNAME, $HOSTNAME must have ability to access ports.ubuntu.com" - echo -n "checking $HOSTNAME 's ability to access ports.ubuntu.com..........." - if ping -c 3 ports.ubuntu.com > /dev/null;then - echo "[OK]" - else - echo "[Failed]" >&2 - echo "[Error] please make your $HOSTNAME has ability to access ports.ubuntu.com" >&2 - exit 1 - fi - - - echo "get distro name form /etc/lsb-release ......" - source /etc/lsb-release >/dev/null 2>&1 - if [ -z "$DISTRIB_CODENAME" ]; then - echo "[Error] can't get DISTRIB_CODENAME " >&2 - exit 1 - fi - echo "DISTRIB_CODENAME=$DISTRIB_CODENAME ...[OK]" - - cp /etc/apt/sources.list /etc/apt/sources.list.bak - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME main/d" /etc/apt/sources.list - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME-updates main/d" /etc/apt/sources.list - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME universe/d" /etc/apt/sources.list - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME-updates universe/d" /etc/apt/sources.list - - cat <<-EOF >>/etc/apt/sources.list -deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME main -deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates main -deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME universe -deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates universe -EOF - - apt-get clean all - sleep 1 - apt-get update - fi - - # Being run from a stateful install postscript - # Copy ISO directly from the xCAT management node and install - rm -rf -- /tmp/ofed - mkdir -p /tmp/ofed/mountpoint - if [ "$?" != "0" ] ;then - echo "[Error] We are in trouble to mkdir /tmp/ofed/mountpoint, please check your node" >&2 - exit 1 - fi - - cd /tmp/ofed/ - echo "Downloading Mellanox OFED file $OFED_NAME form http://$MASTER/$OFED_DIR .........." - wget -l inf -N --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --no-parent "http://$MASTER/$OFED_DIR/$OFED_NAME" 2> /tmp/wget.log - if [ "$?" != "0" ]; then - echo "[Error] Downloading Mellanox OFED file $OFED_NAME failed" >&2 - exit 1 - fi - if [ ! -f "/tmp/ofed/$OFED_NAME" ]; then - echo "[Failed]" >&2 - exit 1 - fi - echo "[OK]" - - echo "Mounting Mellanox OFED file $OFED_NAME ........." - mount -o loop "/tmp/ofed/$OFED_NAME" /tmp/ofed/mountpoint - if [ ! -f "/tmp/ofed/mountpoint/mlnxofedinstall" -o ! -x "/tmp/ofed/mountpoint/mlnxofedinstall" ]; then - echo "[Failed]" >&2 - exit 1 - fi - echo "[OK]" - - if [ "$NODESETSTATE" = "install" ]; then - hack_uname - fi - - echo "Start Mellanox OFED installation ........." - env -i "PATH=${PATH}" /tmp/ofed/mountpoint/mlnxofedinstall "${MLNXOFED_OPTS[@]}" - - #force openibd load all modules in need, restart again - if [ "$NODESETSTATE" = "boot" ]; then - sleep 1 - service openibd restart - if [ "$?" != "0" ]; then - echo "[Error] service openibd restart failed." - exit 1 - fi - fi - fi - - if [[ "$NODESETSTATE" == "genimage" ]]; then - rm -rf -- "$IMGROOTPATH/tmp/ofed" - mkdir -p "$IMGROOTPATH/tmp/ofed/mountpoint" - if [ "$?" != "0" ] ;then - echo "[Error] We are in trouble to mkdir $IMGROOTPATH/tmp/ofed/mountpoint, please check your node" >&2 - exit 1 - fi - - echo "Mounting Mellanox OFED file $OFED_DIR/$OFED_NAME ........." - mount -o loop "$OFED_DIR/$OFED_NAME" "$IMGROOTPATH/tmp/ofed/mountpoint" - if [ ! -f "$IMGROOTPATH/tmp/ofed/mountpoint/mlnxofedinstall" -o ! -x "$IMGROOTPATH/tmp/ofed/mountpoint/mlnxofedinstall" ]; then - echo "[Failed]" >&2 - exit 1 - fi - echo "[OK]" - - echo "Start Mellanox OFED installation ........." - - mount --bind /dev "$IMGROOTPATH/dev/" - mount --bind /proc "$IMGROOTPATH/proc/" - mount --bind /sys "$IMGROOTPATH/sys/" - - hack_uname "${IMGROOTPATH}" - - # Being called from .postinstall script - # Assume we are on the same machine - if [ -f /etc/SuSE-release ]; then - chroot "$IMGROOTPATH" rpm -e --noscripts --allmatches mlnx-ofa_kernel-kmp-default 2>/dev/null - chroot "$IMGROOTPATH" rpm -e --nodeps --allmatches libibverbs 2>/dev/null - elif grep -q Ubuntu /etc/os-release 2>/dev/null; then - echo "$HOSTNAME 's operating system is Ubuntu." - echo "If you want to install Mellanox_OFED in $HOSTNAME, $HOSTNAME must have ability to access ports.ubuntu.com" - echo -n "checking $HOSTNAME 's ability to access ports.ubuntu.com..........." - if ping -c 3 ports.ubuntu.com > /dev/null; then - echo "[OK]" - else - echo "[Failed]" >&2 - echo "please make your $HOSTNAME has ability to access ports.ubuntu.com" >&2 - exit 1 - fi - - sourceslist="$IMGROOTPATH/etc/apt/sources.list" - cp "$sourceslist" "${sourceslist}.bak" - - echo "get distro name form $IMGROOTPATH/etc/lsb-release ......" - source $IMGROOTPATH/etc/lsb-release >/dev/null 2>&1 - if [ -z "$DISTRIB_CODENAME" ]; then - echo "[Error] can't get DISTRIB_CODENAME " >&2 - exit 1 - fi - echo "DISTRIB_CODENAME=$DISTRIB_CODENAME ...[OK]" - - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME main/d" $sourceslist - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME-updates main/d" $sourceslist - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME universe/d" $sourceslist - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME-updates universe/d" $sourceslist - - cat <<-EOF >>"$sourceslist" -deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME main -deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates main -deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME universe -deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates universe -EOF - - chroot "$IMGROOTPATH" apt-get clean all - sleep 1 - chroot "$IMGROOTPATH" apt-get update - - chroot "$IMGROOTPATH" sh -c 'apt-get install -y linux-headers-$(uname -r)' - else #for rhels - chroot "$IMGROOTPATH" rpm -e --nodeps --allmatches libibverbs 2>/dev/null - fi - chroot "$IMGROOTPATH" env -i "PATH=${PATH}" /tmp/ofed/mountpoint/mlnxofedinstall "${MLNXOFED_OPTS[@]}" - fi -fi diff --git a/xCAT-test/autotest/testcase/infiniband/rhel-infiniband-diskfull-install.sh b/xCAT-test/autotest/testcase/infiniband/rhel-infiniband-diskfull-install.sh index 5729e2f56..332a863b7 100755 --- a/xCAT-test/autotest/testcase/infiniband/rhel-infiniband-diskfull-install.sh +++ b/xCAT-test/autotest/testcase/infiniband/rhel-infiniband-diskfull-install.sh @@ -135,10 +135,10 @@ mkdir -p /install/custom/install/rh : ) >"/install/custom/install/rh/mlnx.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.otherpkgs.pkglist" -cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 \ - /install/postscripts/mlnxofed_ib_install.v2 +cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install \ + /install/postscripts/mlnxofed_ib_install -chdef "${COMPUTE_NODE}" "postscripts=syslog,remoteshell,syncfiles,mlnxofed_ib_install.v2 -p /install/mlnx/${MLNX_ISO##*/} -m --add-kernel-support" +chdef "${COMPUTE_NODE}" "postscripts=syslog,remoteshell,syncfiles,mlnxofed_ib_install -p /install/mlnx/${MLNX_ISO##*/} -m --add-kernel-support" rm -rf "${OSIMAGE_OTHERPKGDIR}" mkdir -p "${OSIMAGE_OTHERPKGDIR}" diff --git a/xCAT-test/autotest/testcase/infiniband/rhel-infiniband-diskless-install.sh b/xCAT-test/autotest/testcase/infiniband/rhel-infiniband-diskless-install.sh index b0c646118..494b16cfb 100755 --- a/xCAT-test/autotest/testcase/infiniband/rhel-infiniband-diskless-install.sh +++ b/xCAT-test/autotest/testcase/infiniband/rhel-infiniband-diskless-install.sh @@ -138,13 +138,13 @@ mkdir -p /install/custom/netboot/rh : ) >"/install/custom/netboot/rh/mlnx.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.otherpkgs.pkglist" -cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 \ - /install/postscripts/mlnxofed_ib_install.v2 +cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install \ + /install/postscripts/mlnxofed_ib_install ( cat "/opt/xcat/share/xcat/netboot/rh/compute.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.postinstall" cat <<-EOF - NODESETSTATE=genimage IMGROOTPATH=${OSIMAGE_ROOTIMGDIR}/rootimg bash -x /install/postscripts/mlnxofed_ib_install.v2 -p /install/mlnx/${MLNX_ISO##*/} -m --add-kernel-support + NODESETSTATE=genimage IMGROOTPATH=${OSIMAGE_ROOTIMGDIR}/rootimg bash -x /install/postscripts/mlnxofed_ib_install -p /install/mlnx/${MLNX_ISO##*/} -m --add-kernel-support EOF ) >"/install/custom/netboot/rh/mlnx.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.postinstall" chmod 0755 "/install/custom/netboot/rh/mlnx.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.postinstall" From d548bc5bf9a9fafcf938da247b6ec601cf847890 Mon Sep 17 00:00:00 2001 From: bybai Date: Mon, 13 May 2019 05:10:46 -0400 Subject: [PATCH 129/276] optimize confignetwork_2eth_bridge_br22_br33 test case --- xCAT-test/autotest/testcase/confignetwork/cases0 | 3 --- 1 file changed, 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 3aef7c7d3..d41b2772c 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -842,9 +842,6 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r ' check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 -cmd:updatenode $$CN -P confignetwork -check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test3 net=$secondnet mask=255.255.0.0 From bedca476a0a1a088b1076eff411eeb8ddb046a34 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 14 May 2019 13:46:05 +0800 Subject: [PATCH 130/276] Add kernel module tg3 to diskless initrd image for ppc64el --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 3bf94808f..f8203ef02 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -201,7 +201,7 @@ if ($netdriver) { if ($arch eq 'x86' or $arch eq 'x86_64') { @ndrivers = qw/tg3 bnx2 bnx2x e1000 e1000e igb mlx_en virtio_net/; } elsif ($arch eq 'ppc64el') { - @ndrivers = qw/bnx2 bnx2x e1000 e1000e igb ibmveth ehea mlx_en mlx4_en virtio_net/; + @ndrivers = qw/tg3 bnx2 bnx2x e1000 e1000e igb ibmveth ehea mlx_en mlx4_en virtio_net/; } elsif ($arch eq 'ppc64') { @ndrivers = qw/e1000 e1000e igb ibmveth ehea/; } elsif ($arch eq 's390x') { From 2273f7f145938446cd6c5813f66a0ab81856aa16 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 14 May 2019 17:40:03 +0800 Subject: [PATCH 131/276] Remove compute.ubuntu16.04.pkglist --- .../netboot/ubuntu/compute.ubuntu16.04.pkglist | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.pkglist diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.pkglist deleted file mode 100644 index 194157acc..000000000 --- a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.pkglist +++ /dev/null @@ -1,16 +0,0 @@ -bash -nfs-common -openssl -isc-dhcp-client -linux-image-generic-lts-xenial -openssh-server -openssh-client -wget -ntp -rsyslog -rsync -busybox-static -gawk -tar -gzip -xz-utils From 2e9022208a5c8593c1773d85498d704cf1c72505 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 14 May 2019 17:40:23 +0800 Subject: [PATCH 132/276] Diskless package list file for Ubuntu 16.04.5 --- .../ubuntu/compute.ubuntu16.04.5.pkglist | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.5.pkglist diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.5.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.5.pkglist new file mode 100644 index 000000000..d5c414531 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.5.pkglist @@ -0,0 +1,18 @@ +bash +nfs-common +openssl +isc-dhcp-client +libc-bin +linux-image-generic-hwe-16.04 +openssh-server +openssh-client +wget +ntp +ntpdate +rsync +busybox-static +gawk +dnsutils +tar +gzip +xz-utils From 012375b457b476e80bcdc60c1a1401a3273b42df Mon Sep 17 00:00:00 2001 From: cxhong Date: Tue, 14 May 2019 09:21:52 -0400 Subject: [PATCH 133/276] remove not relevant comments --- .../share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install index df149b25a..58a2a4ac6 100755 --- a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install +++ b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install @@ -1,11 +1,6 @@ #!/bin/bash # -# This is the second version of Mellanox IB driver installation sample script -# This is also the version we recommend to use right now. -# What are changed in this version -# 1. The usage interface is changed, using command line arguments instead of using environment attribute -# 2. The way of downloading Mellanox OFED files. -# 3. Some structure of code +# This is the sample Mellanox IB driver installation script # # For AIX: # TBD From 520651eef1b7a494563b7dffe04f9014b86a7029 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 13 May 2019 10:33:30 -0400 Subject: [PATCH 134/276] Verify xcatprobe -l output --- .../autotest/testcase/probe/xcatproble_list | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/xCAT-test/autotest/testcase/probe/xcatproble_list b/xCAT-test/autotest/testcase/probe/xcatproble_list index 07a9cbabb..214711885 100644 --- a/xCAT-test/autotest/testcase/probe/xcatproble_list +++ b/xCAT-test/autotest/testcase/probe/xcatproble_list @@ -1,15 +1,13 @@ start:xcatprobe_work description:To test if xcatprobe list works. This case must run in xcat mn label:mn_only,ci_test +cmd:mkdir -p /tmp/xcatprobe_l cmd:xcatprobe -l +check:rc==0 check:output=~Supported sub commands are: -check:output=~detect_dhcp -check:output=~osdeploy -check:output=~nodecheck -check:output=~xcatmn -check:output=~osimagecheck -check:output=~discovery -check:output=~image -check:output=~clusterstatus -check:output=~switch_macmap +cmd:xcatprobe -l|grep -v "Supported sub commands are" |awk '/^[[:graph:]]/ {print $1}'|sort > /tmp/xcatprobe_l/subcmd_from_xcatprobe_l +cmd:ls -l /opt/xcat/probe/subcmds/ |awk '/^-/ {print $9}'|sort > /tmp/xcatprobe_l/subcmd_under_subcmds_dir +cmd:diff -y /tmp/xcatprobe_l/subcmd_from_xcatprobe_l /tmp/xcatprobe_l/subcmd_under_subcmds_dir +check:rc==0 +cmd:rm -rf /tmp/xcatprobe_l end From 236d6ac7a1b35c873fe73884a0a230e0d24e8c27 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 14 May 2019 12:11:21 -0400 Subject: [PATCH 135/276] Add xcatprobe to CI environment --- travis.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/travis.pl b/travis.pl index 3404908fb..abcf39047 100644 --- a/travis.pl +++ b/travis.pl @@ -382,11 +382,22 @@ sub install_xcat{ print "[install_xcat] $cmd....[Pass]\n"; } } + $cmd = "sudo apt-get install xcat-probe --allow-remove-essential --allow-unauthenticated"; + @output = runcmd("$cmd"); + if($::RUNCMD_RC){ + print RED "[install_xcat] $cmd ....[Failed]\n"; + print Dumper \@output; + $ret = 1; + }else{ + print "[install_xcat] $cmd ....[Pass]:\n"; + } + if($ret){ $check_result_str .= "> **INSTALL XCAT ERROR** : Please click ``Details`` label in ``Merge pull request`` box for detailed information"; send_back_comment("$check_result_str"); return 1; } + $check_result_str .= "> **INSTALL XCAT SUCCESSFUL**"; send_back_comment("$check_result_str"); } From abe32a23c5c4435f28bfc23175fa19a97cd29481 Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 15 May 2019 04:47:49 -0400 Subject: [PATCH 136/276] update case according to bug https://github.com/xcat2/xcat-core/issues/6311 --- .../testcase/installation/reg_linux_diskless_installation_flat | 1 + .../reg_linux_diskless_installation_flat_postscripts_failed | 1 + .../installation/reg_linux_diskless_installation_hierarchy | 1 + 3 files changed, 3 insertions(+) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index c1bfd7c5c..ff5af4262 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -33,6 +33,7 @@ check:rc==0 cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi cmd:mount |sort > /tmp/mountoutput/file.org cmd:cat /tmp/mountoutput/file.org +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:mount |sort > /tmp/mountoutput/file.new diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed index 1b0d15691..08f8b0716 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed @@ -37,6 +37,7 @@ check:rc==0 cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi cmd:mount |sort > /tmp/mountoutput/file.org cmd:cat /tmp/mountoutput/file.org +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:mount |sort > /tmp/mountoutput/file.new diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index b24aafdd1..b33bd429c 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -37,6 +37,7 @@ check:rc==0 cmd:if [[ -f /test.synclist ]] ;then mv -f /test.synclist /test.synclist.bak;fi; cmd:echo "/test.synclist -> /test.synclist" > /test.synclist;chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/test.synclist check:rc==0 +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute From fae699ffa0d0abecbcdf94e37ee751f36e464c2b Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 28 Mar 2019 13:04:07 +0800 Subject: [PATCH 137/276] [go-xcat] Change the year of copyright message --- xCAT-server/share/xcat/tools/go-xcat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 3a1c74191..106147062 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -4,7 +4,7 @@ # # Version 1.0.38 # -# Copyright (C) 2016, 2017, 2018 International Business Machines +# Copyright (C) 2016 - 2019 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) # # From 897e0a60595974e87fe7f6d871ff2e489946d752 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 14 May 2019 16:52:36 +0800 Subject: [PATCH 138/276] [go-xcat] Fix get_package_list_apt() problem when multiple list files exist --- xCAT-server/share/xcat/tools/go-xcat | 39 ++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 106147062..0937f1168 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -748,19 +748,36 @@ function get_package_list_apt() local repo_id="$1" [[ -z "${repo_id}" ]] && return 1 local -i rc=0 - awk '/^Package: / { print $2 }' \ - "/var/lib/apt/lists/"*"_${repo_id}_dists"*"_main_binary-"*"_Packages" \ - 2>/dev/null - # This is a dirty hack, and use recursion. + local -a lists=() + local -a packages=() + local p + local q + + for p in \ + "/var/lib/apt/lists/"*"_${repo_id}_dists"*"_main_binary-"*"_Packages" + do + [[ -f "${p}" && -r "${p}" ]] && lists+=("${p}") + done # For the `devel' branch of the online repo for apt, it has the # subdirectory name of `core-snap' instead of `xcat-core'. - rc="$?" - if [[ "${rc}" -ne "0" && "${repo_id}" = "xcat-core" ]] - then - "${FUNCNAME}" "core-snap" - rc="$?" - fi - return "${rc}" + [[ "${repo_id}" == "xcat-core" ]] && + for p in \ + "/var/lib/apt/lists/"*"_core-snap_dists"*"_main_binary-"*"_Packages" + do + [[ -f "${p}" && -r "${p}" ]] && lists+=("${p}") + done + [[ "${#lists[@]}" -eq "0" ]] && return 1 + + while read -r q + do + for p in "${packages[@]}" + do + [[ "${q}" == "${p}" ]] && continue 2 + done + packages+=("${q}") + done < <(awk '/^Package: / { print $2 }' "${lists[@]}" 2>/dev/null) + + echo "${packages[@]}" } # $1 repo id From 88a435f928eea11789bd1993d2308515adf09b31 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 22 Nov 2018 18:50:12 +0800 Subject: [PATCH 139/276] [go-xcat] Bump version number --- xCAT-server/share/xcat/tools/go-xcat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 0937f1168..fc94c8555 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,7 +2,7 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.38 +# Version 1.0.40 # # Copyright (C) 2016 - 2019 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) From c07688635de595fa5b3f26d5ba88fabdefb04719 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 15 May 2019 19:28:24 +0800 Subject: [PATCH 140/276] [go-xcat] Enhance curl exit code parsing --- xCAT-server/share/xcat/tools/go-xcat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index fc94c8555..75b15ea98 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -883,6 +883,8 @@ function download_file_curl() 88) echo -n "FTP chunk callback reported error" ;; 89) echo -n "no connection available, the session will be queued" ;; 90) echo -n "SSL public key does not matched pinned public key" ;; + 91) echo -n "invalid SSL certificate status" ;; + 92) echo -n "stream error in HTTP/2 framing layer" ;; *) echo -n "unknown error" ;; esac echo ")" From c051cfe948b59f7bda895c8527a73e63b2a98860 Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 15 May 2019 23:21:44 -0400 Subject: [PATCH 141/276] update to only support ubuntu16.04.5 x86 system --- .../testcase/installation/reg_linux_diskless_installation_flat | 3 ++- .../reg_linux_diskless_installation_flat_postscripts_failed | 3 ++- .../installation/reg_linux_diskless_installation_hierarchy | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index ff5af4262..5ec604cbb 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -33,7 +33,8 @@ check:rc==0 cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi cmd:mount |sort > /tmp/mountoutput/file.org cmd:cat /tmp/mountoutput/file.org -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:mount |sort > /tmp/mountoutput/file.new diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed index 08f8b0716..41391a68f 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed @@ -37,7 +37,8 @@ check:rc==0 cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi cmd:mount |sort > /tmp/mountoutput/file.org cmd:cat /tmp/mountoutput/file.org -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:mount |sort > /tmp/mountoutput/file.new diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index b33bd429c..bd8fe4876 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -37,7 +37,8 @@ check:rc==0 cmd:if [[ -f /test.synclist ]] ;then mv -f /test.synclist /test.synclist.bak;fi; cmd:echo "/test.synclist -> /test.synclist" > /test.synclist;chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/test.synclist check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute From 1632353dad1fd6a0869bfebd251cd52e232441d8 Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 16 May 2019 02:04:29 -0400 Subject: [PATCH 142/276] update to give detailed log information --- .../rpower/rpower_wrongpasswd_test.sh | 82 ++++++++++++------- 1 file changed, 54 insertions(+), 28 deletions(-) diff --git a/xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh b/xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh index e445222ea..a20d53dcb 100755 --- a/xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh +++ b/xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh @@ -1,64 +1,88 @@ #!/bin/bash +PATH="/opt/xcat/bin:/opt/xcat/sbin:/opt/xcat/share/xcat/tools:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin" +export PATH + +function runcmd(){ + echo "Run command $*" + result=`$*` + if [[ $? -eq 0 ]];then + echo $result; + echo "Run command $*....[Succeed]\n"; + return 0; + else + echo $result; + echo "Run command $*... [Failed]\n"; + return 1; + fi +} + function check_passwd_table(){ +echo "Run tabdump passwd to check if password with $MGT exists" tabdump passwd |grep $MGT if [ $? -eq 0 ];then `tabdump passwd |grep $MGT>$TMPFILE` else + echo "There is no password in passwd table associated with $MGT" return 1; fi } function modify_passwd_table(){ Username=`cat $TMPFILE |awk -F "\"" '{print $4}'`; Passwd=`cat $TMPFILE |awk -F "\"" '{print $6}'`; -echo "Execute \"chtab key=$MGT passwd.password=$Passwd.wrong passwd.username=$Username\"" -`chtab key=$MGT passwd.password=$Passwd.wrong passwd.username=$Username`; -echo "The password table is\n"; -tabdump passwd; +cmd="chtab key=$MGT passwd.password=$Passwd.wrong passwd.username=$Username"; +runcmd $cmd; +cmd="tabdump passwd"; +runcmd $cmd; } function add_passwd_table() { -`chtab key=$MGT passwd.password=$2 passwd.username=$3`; -echo "Execute \"rpower $1 stat\""; -rpower $1 stat +cmd="chtab key=$MGT passwd.password=$2 passwd.username=$3"; +runcmd $cmd; +cmd="rpower $1 stat"; +runcmd $cmd; if [ $? -eq 0 ];then - echo "Execute \"chtab key=$MGT passwd.password=$2.wrong passwd.username=$3\"" - `chtab key=$MGT passwd.password=$2.wrong passwd.username=$3`; - echo "Execute \"tabdump passwd\""; - tabdump passwd; + cmd="chtab key=$MGT passwd.password=$2.wrong passwd.username=$3"; + runcmd $cmd; + cmd="tabdump passwd"; + runcmd $cmd; else echo "rpower $1 stat failed.Wrong password is provided, please check bmc username and password"; fi } function modify_node_definition() { -chdef $1 bmcpassword=$2 bmcusername=$3 -echo "Execute \"rpower $1 stat\""; -rpower $1 stat +cmd="chdef $1 bmcpassword=$2 bmcusername=$3"; +runcmd $cmd; +cmd="rpower $1 stat"; +runcmd $cmd; if [ $? -eq 0 ];then - echo "Execute \"chdef $1 bmcpassword=$2.wrong bmcusername=$3\"" - chdef $1 bmcpassword=$2.wrong bmcusername=$3; - echo "Execute \"tabdump passwd\""; - tabdump passwd; + runcmd "chdef $1 bmcpassword=$2.wrong bmcusername=$3"; + runcmd "tabdump passwd"; else - echo "rpower $1 stat failed.Wrong password is provided, please check bmc username and password"; + echo "rpower $1 stat failed.Wrong password is provided, please check bmc username and password"; fi } function clear_env(){ - echo "Restore test environment..."; if [ -f $TMPFILE ];then Username=`cat $TMPFILE |awk -F "\"" '{print $4}'`; Passwd=`cat $TMPFILE |awk -F "\"" '{print $6}'`; - chtab key=$MGT passwd.password=$Passwd passwd.username=$Username;tabdump passwd; - chdef $1 bmcpassword= bmcusername=; + cmd="chtab key=$MGT passwd.password=$Passwd passwd.username=$Username"; + runcmd $cmd; + cmd="tabdump passwd"; + runcmd $cmd; + cmd="chdef $1 bmcpassword= bmcusername="; + runcmd $cmd; rm -rf $TMPFILE; else - `chtab -d key=$MGT passwd`; - chdef $1 bmcpassword= bmcusername=; + cmd="chtab -d key=$MGT passwd"; + runcmd $cmd; + cmd="chdef $1 bmcpassword= bmcusername="; + runcmd $cmd; fi } function check_result(){ output=$(rpower $1 stat 2>&1) -echo "Execute command \"rpower $1 stat\"" +echo "rpower $1 stat output is $output" value=""; if [[ `lsdef $1 |grep mgt ` =~ "ipmi" ]];then value="Incorrect password provided"; @@ -68,7 +92,7 @@ value=""; if [[ $output =~ $value ]];then return 0; else - echo "The expected output is \"$value\" since there password is wrong, but the real output is $output" + echo "The expected output is \"$value\" since there password is wrong, but the real output is $output" return 1; fi } @@ -82,7 +106,7 @@ MGT="" else MGT="openbmc"; fi -echo "The node's mgt is defined as $MGT" +echo "The node $2's mgt is defined as $MGT" while [ "$#" -gt "0" ] do case $1 in @@ -110,7 +134,8 @@ do "-apt"|"--addpasswdtable" ) check_passwd_table if [[ $? -eq 0 ]];then - `chtab -d key=ipmi passwd`; + cmd="chtab -d key=ipmi passwd"; + runcmd $cmd; if [[ $? -eq 1 ]];then exit 1 fi @@ -140,3 +165,4 @@ do esac done + From 3ac15dbe852aad7ce1d9d0e9e72c54cfc6766d08 Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 16 May 2019 02:54:12 -0400 Subject: [PATCH 143/276] update test.sh to add network information --- xCAT-test/autotest/testcase/genesis/test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index 61a566060..60b37a2f9 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -6,7 +6,7 @@ masternet=`ifconfig | awk "BEGIN{RS=\"\"}/\<$masterip\>/{print \$1}"|head -n 1 net2=`netstat -i -a|grep -v Kernel|grep -v Iface |grep -v lo|grep -v $masternet|head -n 1|awk '{print $1}'`;echo net2 is $net2; net2ip=""; if [[ -z $net2 ]];then - echo "could not verify the test" + echo "There is no second network,could not verify the test" return 1; else net2ipstring=`ifconfig $net2 |grep inet|grep -v inet6`; @@ -19,6 +19,7 @@ net2ip=""; net2ip=0.0.0.0; fi ifconfig $net2 60.3.3.3 ; + makenetworks; makehosts testnode; nodeset testnode shell; ifconfig $net2 "$net2ip"; @@ -32,6 +33,7 @@ net2ip=""; fi } function clear_env(){ +rmdef -t network -o 60_0_0_0-255_0_0_0 makehosts -d testnode rmdef testnode if [[ $? -eq 0 ]];then From fd76d16d3e65e20caba22e7dc593f078629c6970 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 16 May 2019 17:15:21 +0800 Subject: [PATCH 144/276] Remove package conserver from Depends section. Move package goconserver from Recommends section to Depends section --- xCAT/debian/control | 4 ++-- xCATsn/debian/control | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT/debian/control b/xCAT/debian/control index 24649a905..d5fd9c5b9 100644 --- a/xCAT/debian/control +++ b/xCAT/debian/control @@ -9,8 +9,8 @@ Homepage: https://xcat.org/ Package: xcat Architecture: amd64 ppc64el -Depends: ${perl:Depends}, xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, isc-dhcp-server, apache2, nfs-kernel-server, libxml-parser-perl, xinetd, rsync, tftpd-hpa, conserver-xcat, libnet-telnet-perl, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) -Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000), goconserver +Depends: ${perl:Depends}, goconserver, xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, isc-dhcp-server, apache2, nfs-kernel-server, libxml-parser-perl, xinetd, rsync, tftpd-hpa, libnet-telnet-perl, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) +Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000) Suggests: yaboot-xcat Description: Metapackage for a common, default xCAT setup xCAT is Extreme Cluster/Cloud Administration Toolkit. xCAT offers complete diff --git a/xCATsn/debian/control b/xCATsn/debian/control index ca494800e..3476c39c0 100644 --- a/xCATsn/debian/control +++ b/xCATsn/debian/control @@ -8,8 +8,8 @@ Homepage: https://xcat.org/ Package: xcatsn Architecture: amd64 ppc64el -Depends: ${perl:Depends}, xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, libxml-parser-perl, tftpd-hpa, conserver-xcat, libnet-telnet-perl, isc-dhcp-server, apache2, nfs-kernel-server, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) -Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000), goconserver +Depends: ${perl:Depends}, goconserver, xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, libxml-parser-perl, tftpd-hpa, libnet-telnet-perl, isc-dhcp-server, apache2, nfs-kernel-server, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) +Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000) Suggests: yaboot-xcat Description: Metapackage for a common, default xCAT service node setup xCATsn is a service node management package intended for at-scale From 15f1c37152aff20bdf4b146a61d477c4eeb4447a Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 16 May 2019 17:17:09 +0800 Subject: [PATCH 145/276] Update grub2-xcat requirement --- xCAT-server/debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/debian/control b/xCAT-server/debian/control index ae2306ed9..9e8998bcb 100644 --- a/xCAT-server/debian/control +++ b/xCAT-server/debian/control @@ -8,7 +8,7 @@ Homepage: https://xcat.org/ Package: xcat-server Architecture: all -Depends: ${perl:Depends}, grub2-xcat, perl-xcat (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libsys-syslog-perl, libio-socket-ssl-perl, libxml-simple-perl, make, libdbd-sqlite3-perl, libexpect-perl, libnet-dns-perl, libsoap-lite-perl, libxml-libxml-perl, libsnmp-perl, debootstrap, libdigest-sha-perl,libcrypt-rijndael-perl,libcrypt-cbc-perl,libjson-perl, libnet-https-nb-perl, libhttp-async-perl +Depends: ${perl:Depends}, grub2-xcat (>= 2.02-0.76.el7.1.snap201905160255), perl-xcat (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libsys-syslog-perl, libio-socket-ssl-perl, libxml-simple-perl, make, libdbd-sqlite3-perl, libexpect-perl, libnet-dns-perl, libsoap-lite-perl, libxml-libxml-perl, libsnmp-perl, debootstrap, libdigest-sha-perl,libcrypt-rijndael-perl,libcrypt-cbc-perl,libjson-perl, libnet-https-nb-perl, libhttp-async-perl Description: Server and configuration utilities of xCAT xCAT-server provides the core server and configuration management components of xCAT. From 3e249fe7665fc74323e98e1682d3f751c107183b Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 16 May 2019 17:30:32 +0800 Subject: [PATCH 146/276] Update grub2-xcat requirement --- xCAT-server/xCAT-server.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 85c4e3f2c..a406d654f 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -48,7 +48,7 @@ Obsoletes: atftp-xcat # # PCM does not use or ship grub2-xcat %if %nots390x -Requires: grub2-xcat >= 2.02-0.76 perl-Net-HTTPS-NB perl-HTTP-Async +Requires: grub2-xcat >= 2.02-0.76.el7.1.snap201905160255 perl-Net-HTTPS-NB perl-HTTP-Async %endif %endif %endif From 0aa94b362b5da4070a04d8883d2f890ea1ee7642 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 16 May 2019 10:27:26 -0400 Subject: [PATCH 147/276] Link switchprobe file when building xcatprobe on Ubuntu --- xCAT-probe/debian/dirs | 2 ++ xCAT-probe/debian/xcatprobe.links | 1 + 2 files changed, 3 insertions(+) create mode 100644 xCAT-probe/debian/xcatprobe.links diff --git a/xCAT-probe/debian/dirs b/xCAT-probe/debian/dirs index 728459eec..dcc64ee60 100644 --- a/xCAT-probe/debian/dirs +++ b/xCAT-probe/debian/dirs @@ -1,2 +1,4 @@ opt/xcat/bin opt/xcat/probe +opt/xcat/probe/subcmds +opt/xcat/probe/subcmds/bin diff --git a/xCAT-probe/debian/xcatprobe.links b/xCAT-probe/debian/xcatprobe.links new file mode 100644 index 000000000..8737b5e45 --- /dev/null +++ b/xCAT-probe/debian/xcatprobe.links @@ -0,0 +1 @@ +/opt/xcat/bin/xcatclient /opt/xcat/probe/subcmds/bin/switchprobe From a93262d79ca2c432b46b57bd65fc51d393318aa5 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 16 May 2019 11:09:05 -0400 Subject: [PATCH 148/276] Just testing --- xCAT-probe/debian/{xcatprobe.links => xcat-probe.links} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename xCAT-probe/debian/{xcatprobe.links => xcat-probe.links} (100%) diff --git a/xCAT-probe/debian/xcatprobe.links b/xCAT-probe/debian/xcat-probe.links similarity index 100% rename from xCAT-probe/debian/xcatprobe.links rename to xCAT-probe/debian/xcat-probe.links From e071aa2b877849de4971c97b5db54faf54b7fc58 Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 16 May 2019 23:36:17 -0400 Subject: [PATCH 149/276] fix confignetwork confignetwork_installnic_2eth_bridge_br22_br33 failure --- xCAT-test/autotest/testcase/confignetwork/cases0 | 8 ++------ xCAT/postscripts/nicutils.sh | 6 ++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index d41b2772c..68ba386c5 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -903,10 +903,6 @@ cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicne check:rc==0 cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:chdef $$CN nicips.$$THIRDNIC=12.1.0.100 nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=12_1_0_0-255_255_0_0 -check:rc==0 -cmd:updatenode $$CN -P confignetwork -check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 cmd:mkdef -t network -o 30_5_0_0-255_255_0_0 net=30.5.0.0 mask=255.255.0.0 @@ -921,6 +917,8 @@ cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{pr check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ check:output=~BOOTPROTO=none|static +cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" +check:output=~bond0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network-scripts/ifcfg-*br22*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi check:output=~30.5.106.8 check:rc==0 @@ -930,8 +928,6 @@ check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~br22 check:output=~br33 -cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" -check:output=~bond0 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index d27cd5573..905b6f52c 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -27,6 +27,7 @@ brctl="brctl" uniq="uniq" xargs="xargs" modprobe="modprobe" +xcatcreatedcon='' if [ -n "$LOGLABEL" ]; then log_label=$LOGLABEL else @@ -2067,6 +2068,10 @@ function create_bridge_interface_nmcli { if [ $? -eq 0 ]; then $nmcli con delete $tmp_slave_con_name fi + if [ -n "$xcatcreatedcon" ]; then + $nmcli con up $xcatcreatedcon + log_info "$nmcli con up $xcatcreatedcon" + fi wait_for_ifstate $ifname UP 40 40 [ $? -ne 0 ] && rc=1 $ip address show dev $ifname| $sed -e 's/^/[bridge] >> /g' | log_lines info @@ -2187,6 +2192,7 @@ function create_bond_interface_nmcli { else cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts method none ipv4.method manual ipv4.addresses $ipv4_addr/$str_prefix $_mtu connection.autoconnect-priority 9 connection.autoconnect-slaves 1 connection.autoconnect-retries 0" fi + xcatcreatedcon=$xcat_con_name log_info $cmd $cmd if [ $? -ne 0 ]; then From 7b4f2217403388790f7adcf885a35fa15722d144 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 20 May 2019 13:14:02 -0400 Subject: [PATCH 150/276] Remove docker man pages --- .../references/man1/lsdocker.1.rst | 102 ----------- .../references/man1/mkdocker.1.rst | 169 ------------------ .../admin-guides/references/man1/rflash.1.rst | 4 +- .../references/man1/rmdocker.1.rst | 62 ------- .../admin-guides/references/man1/rpower.1.rst | 25 --- .../admin-guides/references/man5/site.5.rst | 7 +- xCAT-client/pods/man1/lsdocker.1.pod | 57 ------ xCAT-client/pods/man1/mkdocker.1.pod | 100 ----------- xCAT-client/pods/man1/rmdocker.1.pod | 37 ---- xCAT-client/pods/man1/rpower.1.pod | 16 -- 10 files changed, 4 insertions(+), 575 deletions(-) delete mode 100644 docs/source/guides/admin-guides/references/man1/lsdocker.1.rst delete mode 100644 docs/source/guides/admin-guides/references/man1/mkdocker.1.rst delete mode 100644 docs/source/guides/admin-guides/references/man1/rmdocker.1.rst delete mode 100644 xCAT-client/pods/man1/lsdocker.1.pod delete mode 100644 xCAT-client/pods/man1/mkdocker.1.pod delete mode 100644 xCAT-client/pods/man1/rmdocker.1.pod diff --git a/docs/source/guides/admin-guides/references/man1/lsdocker.1.rst b/docs/source/guides/admin-guides/references/man1/lsdocker.1.rst deleted file mode 100644 index 67b5fd0fa..000000000 --- a/docs/source/guides/admin-guides/references/man1/lsdocker.1.rst +++ /dev/null @@ -1,102 +0,0 @@ - -########## -lsdocker.1 -########## - -.. highlight:: perl - - -**** -NAME -**** - - -\ **lsdocker**\ - List docker instance. - - -******** -SYNOPSIS -******** - - -\ **lsdocker**\ \ *noderange*\ [\ **-l | -**\ **-logs**\ ] - -\ **lsdocker**\ \ *dockerhost*\ - -\ **lsdocker**\ [\ **-h | -**\ **-help**\ ] - -\ **lsdocker**\ {\ **-v | -**\ **-version**\ } - - -*********** -DESCRIPTION -*********** - - -\ **lsdocker**\ To list docker instance info or all the running docker instance info if dockerhost is specified. - - -******* -OPTIONS -******* - - - -\ **-l|-**\ **-logs**\ - - - -To return the logs of docker instance. Only works for docker instance. - - -******** -EXAMPLES -******** - - - -1. To get info for docker instance "host01c01" - - - .. code-block:: perl - - lsdocker host01c01 - - - Output is similar to: - - - .. code-block:: perl - - host01c01: 50800dfd8b5f ubuntu /bin/bash 2016-01-13T06:32:59 running /host01c01 - - - - -2. To get info for running docker instance on dockerhost "host01" - - - .. code-block:: perl - - lsdocker host01 - - - Output is similar to: - - - .. code-block:: perl - - host01: 50800dfd8b5f ubuntu /bin/bash 2016-1-13 - 1:32:59 Up 12 minutes /host01c01 - host01: 875ce11d5987 ubuntu /bin/bash 2016-1-21 - 1:12:37 Up 5 seconds /host01c02 - - - - - -******** -SEE ALSO -******** - - -mkdocker(1)|mkdocker.1, rmdocker(1)|rmdocker.1 - diff --git a/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst b/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst deleted file mode 100644 index f1e2d2e47..000000000 --- a/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst +++ /dev/null @@ -1,169 +0,0 @@ - -########## -mkdocker.1 -########## - -.. highlight:: perl - - -**** -NAME -**** - - -\ **mkdocker**\ - Create docker instance. - - -******** -SYNOPSIS -******** - - -\ **mkdocker**\ \ *noderange*\ [\ **image**\ =\ *image_name*\ [\ **command**\ =\ *command*\ ]] [\ **dockerflag**\ =\ *flags_to_create_instance*\ ] - -\ **mkdocker**\ [\ **-h | -**\ **-help**\ ] - -\ **mkdocker**\ {\ **-v | -**\ **-version**\ } - - -*********** -DESCRIPTION -*********** - - -\ **mkdocker**\ To create docker instances with the specified image, command and/or dockerflags. - - -******* -OPTIONS -******* - - - -\ **image**\ - - The docker image name that the instance will use. - - - -\ **command**\ - - The command that the instance will run based on the \ **image**\ specified. The \ **image**\ option must be specified in order to use this option. - - - -\ **dockerflag**\ - - A JSON string which will be used as parameters to create a docker. Reference https://docs.docker.com/engine/reference/api/docker_remote_api_v1.22/ for more information about which parameters can be specified. - - Some useful flags are: - - - \ **AttachStdin**\ =\ **true | false**\ - - Whether attaches to stdin. - - - - \ **AttachStdout**\ =\ **true | false**\ - - Whether attaches to stdout. - - - - \ **AttachStderr**\ =\ **true | false**\ - - Whether attaches to stderr. - - - - \ **OpenStdin**\ =\ **true | false**\ - - Whether opens stdin. - - - - \ **Tty**\ =\ **true | false**\ - - Attach standard streams to a tty, including stdin if it is not closed. - - - - \ **ExposedPorts**\ - - An object mapping ports to an empty object in the form of: - - - .. code-block:: perl - - "ExposedPorts": { "/\: {}" } - - - - - \ **HostConfig: {"Binds"}**\ - - A list of volume bindings for this docker instance, the form will be: - - - .. code-block:: perl - - "HostConfig": {"Binds":[":"]} - - - - - - - -******** -EXAMPLES -******** - - -1. To create a basic docker instance with stdin opened - - -.. code-block:: perl - - mkdocker host01c01 image=ubuntu command=/bin/bash dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true}" - - -Output is similar to: - - -.. code-block:: perl - - host01c01: Pull image ubuntu start - host01c01: Pull image ubuntu done - host01c01: Remove default network connection - host01c01: Connecting customized network 'mynet0' - host01c01: success - - -2. To create a docker instance which have dir "destdir" in docker instance bind from "srcdir" on dockerhost, and have "Tty" opened with which the docker instance can be attached after started to check the files under "destdir". - - -.. code-block:: perl - - mkdocker host01c01 image=ubuntu command=/bin/bash dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true,\"HostConfig\":{\"Binds\":[\"/srcdir:/destdir\"]}}" - - -Output is similar to: - - -.. code-block:: perl - - host01c01: Remove default network connection - host01c01: Connecting customized network 'mynet0' - host01c01: success - - - -******** -SEE ALSO -******** - - -rmdocker(1)|rmdocker.1, lsdocker(1)|lsdocker.1 - diff --git a/docs/source/guides/admin-guides/references/man1/rflash.1.rst b/docs/source/guides/admin-guides/references/man1/rflash.1.rst index 90c3ed721..0bad888ca 100644 --- a/docs/source/guides/admin-guides/references/man1/rflash.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rflash.1.rst @@ -63,7 +63,7 @@ OpenPOWER OpenBMC specific : \ **rflash**\ \ *noderange*\ \ *tar_file_path*\ {[\ **-c | -**\ **-check**\ ] | [\ **-a | -**\ **-activate**\ ] | [\ **-u | -**\ **-upload**\ ]} -\ **rflash**\ \ *noderange*\ \ *tar_file_directory*\ [\ **-d**\ ] [\ **-**\ **-no-host-reboot**\ ] +\ **rflash**\ \ *noderange*\ \ *tar_file_directory*\ [\ **-d**\ ] \ **rflash**\ \ *noderange*\ \ *image_id*\ {[\ **-a | -**\ **-activate**\ ] | [\ **-**\ **-delete**\ ]} @@ -172,8 +172,6 @@ To apply the firmware level, a reboot is required to BMC and HOST. This option steamlines the update, activate, reboot BMC and reboot HOST procedure. It expects a directory containing both BMC and Host .tar files. When BMC and Host tar files are provided, the command will upload and activate firmware. After BMC becomes activate, it will reboot BMC. If BMC state is Ready, the command will reboot the HOST. If BMC state is NotReady, the command will exit. -\ **Note:**\ When using \ **-**\ **-no-host-reboot**\ , it will not reboot the host after BMC is reboot. - \ **-**\ **-delete**\ : This delete option will delete update image from BMC. It expects an ID as the input. diff --git a/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst b/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst deleted file mode 100644 index db021f2a9..000000000 --- a/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst +++ /dev/null @@ -1,62 +0,0 @@ - -########## -rmdocker.1 -########## - -.. highlight:: perl - - -******** -SYNOPSIS -******** - - -\ **rmdocker**\ \ *noderange*\ [\ **-f | -**\ **-force**\ ] - -\ **rmdocker**\ [\ **-h | -**\ **-help**\ ] - -\ **rmdocker**\ {\ **-v | -**\ **-version**\ } - - -*********** -DESCRIPTION -*********** - - -\ **rmdocker**\ To remove docker instances with the specified node name - - -******* -OPTIONS -******* - - - -\ **-f|-**\ **-force**\ - - - -Force to removal of a running container or failed to disconnect customized network - - -******** -EXAMPLES -******** - - - -.. code-block:: perl - - rmdocker host01c01 - host01c01: Disconnect customized network 'mynet0' done - host01c01: success - - - -******** -SEE ALSO -******** - - -mkdocker(1)|mkdocker.1, lsdocker(1)|lsdocker.1 - diff --git a/docs/source/guides/admin-guides/references/man1/rpower.1.rst b/docs/source/guides/admin-guides/references/man1/rpower.1.rst index 71bdc73a8..a00ece1d9 100644 --- a/docs/source/guides/admin-guides/references/man1/rpower.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rpower.1.rst @@ -120,13 +120,6 @@ zVM specific: \ **rpower**\ \ *noderange*\ [\ **on | off | reset | stat | softoff**\ ] -docker specific: -================ - - -\ **rpower**\ \ *noderange*\ [\ **start | stop | restart | pause | unpause | state**\ ] - - pdu specific: ============= @@ -350,24 +343,6 @@ OPTIONS -\ **start**\ - - To start a created docker instance. - - - -\ **stop**\ - - To stop a created docker instance. - - - -\ **restart**\ - - To restart a created docker instance. - - - \ **pause**\ To pause all processes in the instance. diff --git a/docs/source/guides/admin-guides/references/man5/site.5.rst b/docs/source/guides/admin-guides/references/man5/site.5.rst index 2855062a2..a8920d5e5 100644 --- a/docs/source/guides/admin-guides/references/man5/site.5.rst +++ b/docs/source/guides/admin-guides/references/man5/site.5.rst @@ -465,10 +465,9 @@ site Attributes: xcatlport: The port used by xcatd command log writer process to collect command output. - xcatsslversion: The SSL_version option xcatd used and passed to - IO::Socket::SSL->start_SSL(). By default, this value is - set to empty. In this case, xcatd will use - 'SSLv23:!SSLv2:!SSLv3:!TLSv1' internally. + xcatsslversion: This is the SSL_version option xcatd used and passed to + IO::Socket::SSL->start_SSL(). By default, this value is set to empty. + In this case, xcatd will use SSLv23:!SSLv2:!SSLv3:!TLSv1 internally. For more detail, see https://metacpan.org/pod/IO::Socket::SSL xcatsslciphers: The ssl cipher by xcatd. Default is 3DES. diff --git a/xCAT-client/pods/man1/lsdocker.1.pod b/xCAT-client/pods/man1/lsdocker.1.pod deleted file mode 100644 index 9448f87f8..000000000 --- a/xCAT-client/pods/man1/lsdocker.1.pod +++ /dev/null @@ -1,57 +0,0 @@ -=head1 NAME - -B - List docker instance. - -=head1 SYNOPSIS - -B I [B<-l>|B<--logs>] - -B I - -B [B<-h>|B<--help>] - -B {B<-v>|B<--version>} - - -=head1 DESCRIPTION - -B To list docker instance info or all the running docker instance info if dockerhost is specified. - -=head1 OPTIONS - -=over 3 - -=item B<-l|--logs> - -=back - -To return the logs of docker instance. Only works for docker instance. - -=head1 EXAMPLES - -=over 3 - -=item 1. -To get info for docker instance "host01c01" - - lsdocker host01c01 - -Output is similar to: - - host01c01: 50800dfd8b5f ubuntu /bin/bash 2016-01-13T06:32:59 running /host01c01 - -=item 2. -To get info for running docker instance on dockerhost "host01" - - lsdocker host01 - -Output is similar to: - - host01: 50800dfd8b5f ubuntu /bin/bash 2016-1-13 - 1:32:59 Up 12 minutes /host01c01 - host01: 875ce11d5987 ubuntu /bin/bash 2016-1-21 - 1:12:37 Up 5 seconds /host01c02 - -=back - -=head1 SEE ALSO - -L, L diff --git a/xCAT-client/pods/man1/mkdocker.1.pod b/xCAT-client/pods/man1/mkdocker.1.pod deleted file mode 100644 index 0ac21f038..000000000 --- a/xCAT-client/pods/man1/mkdocker.1.pod +++ /dev/null @@ -1,100 +0,0 @@ -=head1 NAME - -B - Create docker instance. - -=head1 SYNOPSIS - -B I [B=I [B=I]] [B=I] - -B [B<-h>|B<--help>] - -B {B<-v>|B<--version>} - - -=head1 DESCRIPTION - -B To create docker instances with the specified image, command and/or dockerflags. - -=head1 OPTIONS - -=over 3 - -=item B - -The docker image name that the instance will use. - -=item B - -The command that the instance will run based on the B specified. The B option must be specified in order to use this option. - -=item B - -A JSON string which will be used as parameters to create a docker. Reference https://docs.docker.com/engine/reference/api/docker_remote_api_v1.22/ for more information about which parameters can be specified. - -Some useful flags are: - -=over 3 - -=item B=B|B - -Whether attaches to stdin. - -=item B=B|B - -Whether attaches to stdout. - -=item B=B|B - -Whether attaches to stderr. - -=item B=B|B - -Whether opens stdin. - -=item B=B|B - -Attach standard streams to a tty, including stdin if it is not closed. - -=item B - -An object mapping ports to an empty object in the form of: - - "ExposedPorts": { "/\: {}" } - -=item B - -A list of volume bindings for this docker instance, the form will be: - - "HostConfig": {"Binds":[":"]} - -=back - -=back - -=head1 EXAMPLES - -1. To create a basic docker instance with stdin opened - - mkdocker host01c01 image=ubuntu command=/bin/bash dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true}" - -Output is similar to: - - host01c01: Pull image ubuntu start - host01c01: Pull image ubuntu done - host01c01: Remove default network connection - host01c01: Connecting customized network 'mynet0' - host01c01: success - -2. To create a docker instance which have dir "destdir" in docker instance bind from "srcdir" on dockerhost, and have "Tty" opened with which the docker instance can be attached after started to check the files under "destdir". - - mkdocker host01c01 image=ubuntu command=/bin/bash dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true,\"HostConfig\":{\"Binds\":[\"/srcdir:/destdir\"]}}" - -Output is similar to: - - host01c01: Remove default network connection - host01c01: Connecting customized network 'mynet0' - host01c01: success - -=head1 SEE ALSO - -L, L diff --git a/xCAT-client/pods/man1/rmdocker.1.pod b/xCAT-client/pods/man1/rmdocker.1.pod deleted file mode 100644 index d02992870..000000000 --- a/xCAT-client/pods/man1/rmdocker.1.pod +++ /dev/null @@ -1,37 +0,0 @@ - -=head1 NAME - -B - Remove docker instance. - -=head1 SYNOPSIS - -B I [B<-f>|B<--force>] - -B [B<-h>|B<--help>] - -B {B<-v>|B<--version>} - - -=head1 DESCRIPTION - -B To remove docker instances with the specified node name - -=head1 OPTIONS - -=over 3 - -=item B<-f|--force> - -=back - -Force to removal of a running container or failed to disconnect customized network - -=head1 EXAMPLES - - rmdocker host01c01 - host01c01: Disconnect customized network 'mynet0' done - host01c01: success - -=head1 SEE ALSO - -L, L diff --git a/xCAT-client/pods/man1/rpower.1.pod b/xCAT-client/pods/man1/rpower.1.pod index cadf6cf85..8a2e97f58 100644 --- a/xCAT-client/pods/man1/rpower.1.pod +++ b/xCAT-client/pods/man1/rpower.1.pod @@ -66,10 +66,6 @@ B I [B|B|B|B|B] B I [B|B|B|B|B] -=head2 docker specific: - -B I [B|B|B|B|B|B] - =head2 pdu specific: B I [B|B|B|B] @@ -227,18 +223,6 @@ To specify that the target node will be power down if B action failed. To specify that the target node will be reset if B action failed. -=item B - -To start a created docker instance. - -=item B - -To stop a created docker instance. - -=item B - -To restart a created docker instance. - =item B To pause all processes in the instance. From 9d5bc0d9841110fe1f91aaa0b1317ec105360c78 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 21 May 2019 13:23:10 +0800 Subject: [PATCH 151/276] Remove xinetd from Depends --- xCAT/debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/debian/control b/xCAT/debian/control index d5fd9c5b9..4b3fedcc3 100644 --- a/xCAT/debian/control +++ b/xCAT/debian/control @@ -9,7 +9,7 @@ Homepage: https://xcat.org/ Package: xcat Architecture: amd64 ppc64el -Depends: ${perl:Depends}, goconserver, xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, isc-dhcp-server, apache2, nfs-kernel-server, libxml-parser-perl, xinetd, rsync, tftpd-hpa, libnet-telnet-perl, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) +Depends: ${perl:Depends}, goconserver, xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, isc-dhcp-server, apache2, nfs-kernel-server, libxml-parser-perl, rsync, tftpd-hpa, libnet-telnet-perl, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000) Suggests: yaboot-xcat Description: Metapackage for a common, default xCAT setup From 56281f7b33d3f55dcda2eb157ce7a22865fa0cb7 Mon Sep 17 00:00:00 2001 From: litingt Date: Tue, 21 May 2019 05:00:04 -0400 Subject: [PATCH 152/276] update packimage test cases --- xCAT-test/autotest/testcase/packimg/cases0 | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/xCAT-test/autotest/testcase/packimg/cases0 b/xCAT-test/autotest/testcase/packimg/cases0 index 11d136998..d04d92940 100644 --- a/xCAT-test/autotest/testcase/packimg/cases0 +++ b/xCAT-test/autotest/testcase/packimg/cases0 @@ -64,6 +64,8 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $ check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz /rootimg.cpio.gz.bak;fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg @@ -102,11 +104,13 @@ start:packimage_m_cpio_c_pigz os:Linux description:test packimage -m cpio -c pigz label:others,packaging,invoke_provision -#cmd:copycds $$ISO +cmd:copycds $$ISO cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz /rootimg.cpio.gz.bak;fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg @@ -149,11 +153,13 @@ start:packimage_m_cpio_c_xz os:Linux description:test packimage -m cpio -c xz label:others,packaging,invoke_provision -#cmd:copycds $$ISO +cmd:copycds $$ISO cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.xz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.xz /rootimg.cpio.xz.bak;fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg @@ -192,11 +198,13 @@ start:packimage_m_tar_c_pigz os:Linux description:test packimage -m tar -c pigz label:others,packaging,invoke_provision -#cmd:copycds $$ISO +cmd:copycds $$ISO cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz /rootimg.tar.gz.bak;fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg @@ -250,11 +258,13 @@ start:packimage_m_tar_c_gzip os:Linux description:test packimage -m tar -c gzip label:others,packaging,invoke_provision -#cmd:copycds $$ISO +cmd:copycds $$ISO cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz /rootimg.tar.gz.bak;fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg @@ -304,11 +314,13 @@ start:packimage_m_tar_c_xz os:Linux description:test packimage -m tar -c xz label:others,packaging,invoke_provision -#cmd:copycds $$ISO +cmd:copycds $$ISO cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.xz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.xz /rootimg.tar.xz.bak;fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg From 54cd535f0652f5c5736f03290725a5c3559adb17 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 21 May 2019 14:11:20 -0400 Subject: [PATCH 153/276] Improve messages for rflash --- perl-xCAT/xCAT/PPCrflash.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/PPCrflash.pm b/perl-xCAT/xCAT/PPCrflash.pm index 4e080174b..b80bb82e2 100644 --- a/perl-xCAT/xCAT/PPCrflash.pm +++ b/perl-xCAT/xCAT/PPCrflash.pm @@ -225,7 +225,7 @@ sub parse_args { return (usage()); } - $request->{callback}->({ data => ["It may take considerable time to complete, depending on the number of systems being updated. In particular, power subsystem updates may take an hour or more if there are many attached managed systems. Please waiting. "] }); + $request->{callback}->({ data => ["It may take considerable time to complete, depending on the number of systems being updated. In particular, power subsystem updates may take an hour or more if there are many attached managed systems. Please wait. "] }); if ($request->{hwtype} =~ /^(fsp|bpa)$/ && $opt{activate} =~ /^disruptive$/) { $request->{callback}->({ data => ["You can find the log files in the /var/log/xcatd/dfm/rflash/."] }); @@ -844,7 +844,7 @@ sub rflash { } - push(@value, [ $hmc, "copy files to $hmc completely" ]); + push(@value, [ $hmc, "copying of files to $hmc completed" ]); ############################################### # Now that all the stanzas files have been built and copied to the HMCs, @@ -886,7 +886,7 @@ sub rflash { my $rsp = {}; $rsp->{data}->[0] = "Error from xdsh. Return Code = $::RUNCMD_RC"; xCAT::MsgUtils->message("S", $rsp, $::CALLBACK, 1); - dpush(\@value, [ $hmc, "failed to run xdsh" ]); + dpush(\@value, [ $hmc, "failed to run xdsh command - $cmd_hmc" ]); push(@value, [ $hmc, $rsp->{data}->[0] ]); push(@value, [ $hmc, "Failed to upgrade the firmware of $mtms_t on $hmc" ]); return (\@value); From a761eb5404511a18c2590e915a528d1813e13e68 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 22 May 2019 13:56:36 -0400 Subject: [PATCH 154/276] Improve the message when the existing firmware level doesn't match the images provided (signed vs test) --- perl-xCAT/xCAT/PPCrflash.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/PPCrflash.pm b/perl-xCAT/xCAT/PPCrflash.pm index b80bb82e2..da305f0ff 100644 --- a/perl-xCAT/xCAT/PPCrflash.pm +++ b/perl-xCAT/xCAT/PPCrflash.pm @@ -528,7 +528,8 @@ sub get_lic_filenames { @dirlist = grep /\.rpm$/, @dirlist; @dirlist = grep /$1/, @dirlist; if (!scalar(@dirlist)) { - $msg = "There isn't a package suitable for $mtms"; + # the last grep above is using $1, which is $pns, the output message should help figure out what is wrong + $msg = "Existing firmware type is: $pns, no matching firmware package found in directory"; return ("", "", "", $msg, -1); } if (scalar(@dirlist) > 1) { From 7f2d26d0e06e93678bdbd9f0fb1ec658835d6405 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 23 May 2019 15:07:46 +0800 Subject: [PATCH 155/276] For Ubuntu 18.04.2, change back to use the original linux-image-generic kernel --- .../xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist index f9cd24b54..9547e08c9 100644 --- a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist @@ -4,7 +4,7 @@ nfs-common openssl isc-dhcp-client libc-bin -linux-image-generic-hwe-18.04 +linux-image-generic openssh-server openssh-client wget From ae3bf7b3148c8ac5d81850b3ebd4594e4e1dc3e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=E1=B4=8F=C9=B4=C9=A2=20Jie?= Date: Thu, 23 May 2019 15:41:52 +0800 Subject: [PATCH 156/276] Revert "For Ubuntu 18.04.2, change back to use the original linux-image-generic kernel" --- .../xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist index 9547e08c9..f9cd24b54 100644 --- a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist @@ -4,7 +4,7 @@ nfs-common openssl isc-dhcp-client libc-bin -linux-image-generic +linux-image-generic-hwe-18.04 openssh-server openssh-client wget From 5860c0bab2fcdeca40eeeb496344bfd71edfaccf Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 23 May 2019 17:37:04 +0800 Subject: [PATCH 157/276] Revise the test case for workaround github issue #6305 #6338 --- .../testcase/installation/reg_linux_diskless_installation_flat | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index 5ec604cbb..46cf71186 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -33,6 +33,7 @@ check:rc==0 cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi cmd:mount |sort > /tmp/mountoutput/file.org cmd:cat /tmp/mountoutput/file.org +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu18.04.2" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64el" ]] && [[ "__GETNODEATTR($$CN,mgt)__" =~ "kvm" ]] ; then mkdir -p /install/custom/netboot/ubuntu; sed -e 's@linux-image-generic-hwe-18.04@linux-image-generic@g' /install/custom/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist; chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute pkglist=/install/custom/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist; fi cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute From 4998ee39084244960f772b6f0e2240f42c66e981 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 23 May 2019 17:55:13 +0800 Subject: [PATCH 158/276] Fix regular expression --- .../testcase/installation/reg_linux_diskless_installation_flat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index 46cf71186..b048d547a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -33,7 +33,7 @@ check:rc==0 cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi cmd:mount |sort > /tmp/mountoutput/file.org cmd:cat /tmp/mountoutput/file.org -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu18.04.2" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64el" ]] && [[ "__GETNODEATTR($$CN,mgt)__" =~ "kvm" ]] ; then mkdir -p /install/custom/netboot/ubuntu; sed -e 's@linux-image-generic-hwe-18.04@linux-image-generic@g' /install/custom/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist; chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute pkglist=/install/custom/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist; fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu18.04.2" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ ppc64(el|le) ]] && [[ "__GETNODEATTR($$CN,mgt)__" =~ "kvm" ]] ; then mkdir -p /install/custom/netboot/ubuntu; sed -e 's@linux-image-generic-hwe-18.04@linux-image-generic@g' /install/custom/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist; chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute pkglist=/install/custom/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist; fi cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute From 7b5ef2fd52f13ab2cff40739d1bdd049e483eae6 Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 23 May 2019 22:43:38 -0400 Subject: [PATCH 159/276] refine test.sh to add more debug info --- xCAT-test/autotest/testcase/genesis/test.sh | 39 ++++++++++++++++----- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index 60b37a2f9..a946db89c 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -1,9 +1,26 @@ #!/bin/bash +PATH="/opt/xcat/bin:/opt/xcat/sbin:/opt/xcat/share/xcat/tools:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin" +export PATH +function runcmd(){ + echo "Run command $*" + result=`$*` + if [[ $? -eq 0 ]];then + echo $result; + echo "Run command $*....[Succeed]\n"; + return 0; + else + echo $result; + echo "Run command $*... [Failed]\n"; + return 1; + fi +} + function check_destiny(){ -chdef testnode arch=ppc64le cons=ipmi groups=all ip=60.1.1.1 mac=4e:ee:ee:ee:ee:0e netboot=$NETBOOT; +cmd="chdef testnode arch=ppc64le cons=ipmi groups=all ip=60.1.1.1 mac=4e:ee:ee:ee:ee:0e netboot=$NETBOOT"; +runcmd $cmd; masterip=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print $2}'`; masternet=`ifconfig | awk "BEGIN{RS=\"\"}/\<$masterip\>/{print \$1}"|head -n 1 | awk -F ' ' '{print $1}'|awk -F ":" '{print \$1}' 2>&1`; -net2=`netstat -i -a|grep -v Kernel|grep -v Iface |grep -v lo|grep -v $masternet|head -n 1|awk '{print $1}'`;echo net2 is $net2; +net2=`netstat -i -a|grep -v Kernel|grep -v Iface |grep -v lo|grep -v $masternet|head -n 1|awk '{print $1}'`; net2ip=""; if [[ -z $net2 ]];then echo "There is no second network,could not verify the test" @@ -18,16 +35,22 @@ net2ip=""; else net2ip=0.0.0.0; fi - ifconfig $net2 60.3.3.3 ; - makenetworks; - makehosts testnode; - nodeset testnode shell; - ifconfig $net2 "$net2ip"; + echo "The original net2 ip is $net2ip" + cmd="ifconfig $net2 60.3.3.3"; + runcmd $cmd; + cmd="makenetworks"; + runcmd $cmd; + echo -e "\n60.1.1.1 testnode" >> /etc/hosts + cmd="nodeset testnode shell"; + runcmd $cmd; + cmd="ifconfig $net2 $net2ip"; + runcmd $cmd; + echo "Check if nodeset testnode shell is added to $SHELLFOLDER" cat "$SHELLFOLDER"testnode |grep "xcatd=60.3.3.3:3001 destiny=shell"; if [[ $? -eq 0 ]] ;then return 0; else - echo wrong; + echo "nodeset testnode shell failed"; return 1; fi fi From 6a2cacb0fa3f3aae0c0cfb663468af428074de59 Mon Sep 17 00:00:00 2001 From: litingt Date: Fri, 24 May 2019 05:07:37 -0400 Subject: [PATCH 160/276] update case to add clear part --- xCAT-test/autotest/testcase/genesis/cases0 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT-test/autotest/testcase/genesis/cases0 b/xCAT-test/autotest/testcase/genesis/cases0 index 5ebe97e30..ed1b4ee59 100644 --- a/xCAT-test/autotest/testcase/genesis/cases0 +++ b/xCAT-test/autotest/testcase/genesis/cases0 @@ -38,8 +38,12 @@ label:others,genesis description:very if computenode need to do nodeset shell in different net with master will success cmd:/opt/xcat/share/xcat/tools/autotest/testcase/genesis/test.sh --check xnba check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/genesis/test.sh -c +check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/genesis/test.sh --check grub2 check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/genesis/test.sh -c +check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/genesis/test.sh --check petitboot check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/genesis/test.sh -c From 934d92db9f4cf20b6dc2e28912498bf8d5578d23 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 28 May 2019 14:34:48 -0400 Subject: [PATCH 161/276] More message improvements --- perl-xCAT/xCAT/PPCrflash.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/PPCrflash.pm b/perl-xCAT/xCAT/PPCrflash.pm index da305f0ff..178817bbb 100644 --- a/perl-xCAT/xCAT/PPCrflash.pm +++ b/perl-xCAT/xCAT/PPCrflash.pm @@ -376,8 +376,7 @@ sub preprocess_for_rflash { my @xmllist = grep /\.xml$/, @dirlist; if (@rpmlist == 0 | @xmllist == 0) { - #send_msg($request, 1, "There isn't any rpm and xml files in the directory $packages_d!"); - $callback->({ data => ["There isn't any rpm and xml files in the directory $packages_d!"] }); + $callback->({ data => ["There are no rpm and xml files in the directory $packages_d!"] }); $request = (); return -1; } From 2fbb4ec2694bae1c7a9d0964345c64f639002861 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 3 Jun 2019 11:37:36 -0400 Subject: [PATCH 162/276] Usage never gets printed if nothing is passed to script --- xCAT-test/autotest/testcase/genesis/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index a946db89c..7fabd6842 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -67,7 +67,7 @@ rmdef testnode } NETBOOT="" SHELLFOLDER="" -while [ "$#" -gt "0" ] +while [ "$#" -ge "0" ] do case $1 in "--check" ) @@ -96,7 +96,7 @@ do ;; *) echo - echo "Please Insert $0: -cd|-c" + echo "Error: Usage: $0: -cd|-c" echo exit 1; ;; From 651d853ef30da2621ea6304809f4d5d875cbc18a Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 3 Jun 2019 11:42:26 -0400 Subject: [PATCH 163/276] Need -e option for echo to print newline --- xCAT-test/autotest/testcase/genesis/test.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index 7fabd6842..242f1d141 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -6,11 +6,11 @@ function runcmd(){ result=`$*` if [[ $? -eq 0 ]];then echo $result; - echo "Run command $*....[Succeed]\n"; + echo -e "Run command $*....[Succeed]\n"; return 0; else echo $result; - echo "Run command $*... [Failed]\n"; + echo -e "Run command $*... [Failed]\n"; return 1; fi } @@ -23,7 +23,7 @@ masternet=`ifconfig | awk "BEGIN{RS=\"\"}/\<$masterip\>/{print \$1}"|head -n 1 net2=`netstat -i -a|grep -v Kernel|grep -v Iface |grep -v lo|grep -v $masternet|head -n 1|awk '{print $1}'`; net2ip=""; if [[ -z $net2 ]];then - echo "There is no second network,could not verify the test" + echo "There is no second network, could not verify the test" return 1; else net2ipstring=`ifconfig $net2 |grep inet|grep -v inet6`; @@ -35,7 +35,7 @@ net2ip=""; else net2ip=0.0.0.0; fi - echo "The original net2 ip is $net2ip" + echo "The original net2 IP is $net2ip" cmd="ifconfig $net2 60.3.3.3"; runcmd $cmd; cmd="makenetworks"; From 15274f1d831bd772046f532cbcc5123687cd25e4 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 3 Jun 2019 11:47:34 -0400 Subject: [PATCH 164/276] Format the script with 4 spaces --- xCAT-test/autotest/testcase/genesis/test.sh | 117 ++++++++++---------- 1 file changed, 59 insertions(+), 58 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index 242f1d141..d528a3395 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -15,26 +15,26 @@ function runcmd(){ fi } -function check_destiny(){ -cmd="chdef testnode arch=ppc64le cons=ipmi groups=all ip=60.1.1.1 mac=4e:ee:ee:ee:ee:0e netboot=$NETBOOT"; -runcmd $cmd; -masterip=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print $2}'`; -masternet=`ifconfig | awk "BEGIN{RS=\"\"}/\<$masterip\>/{print \$1}"|head -n 1 | awk -F ' ' '{print $1}'|awk -F ":" '{print \$1}' 2>&1`; -net2=`netstat -i -a|grep -v Kernel|grep -v Iface |grep -v lo|grep -v $masternet|head -n 1|awk '{print $1}'`; -net2ip=""; +function check_destiny() { + cmd="chdef testnode arch=ppc64le cons=ipmi groups=all ip=60.1.1.1 mac=4e:ee:ee:ee:ee:0e netboot=$NETBOOT"; + runcmd $cmd; + masterip=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print $2}'`; + masternet=`ifconfig | awk "BEGIN{RS=\"\"}/\<$masterip\>/{print \$1}"|head -n 1 | awk -F ' ' '{print $1}'|awk -F ":" '{print \$1}' 2>&1`; + net2=`netstat -i -a|grep -v Kernel|grep -v Iface |grep -v lo|grep -v $masternet|head -n 1|awk '{print $1}'`; + net2ip=""; if [[ -z $net2 ]];then echo "There is no second network, could not verify the test" return 1; else net2ipstring=`ifconfig $net2 |grep inet|grep -v inet6`; - if [[ $? -eq 0 ]];then - net2ip=`ifconfig $net2 |grep inet|grep -v inet6|awk -F ' ' '{print $2}'|awk -F ":" '{print $2}'`; - if [[ -z $net2ip ]];then - net2ip=`ifconfig $net2 |grep inet|grep -v inet6|awk -F ' ' '{print $2}'`; - fi - else - net2ip=0.0.0.0; + if [[ $? -eq 0 ]];then + net2ip=`ifconfig $net2 |grep inet|grep -v inet6|awk -F ' ' '{print $2}'|awk -F ":" '{print $2}'`; + if [[ -z $net2ip ]];then + net2ip=`ifconfig $net2 |grep inet|grep -v inet6|awk -F ' ' '{print $2}'`; fi + else + net2ip=0.0.0.0; + fi echo "The original net2 IP is $net2ip" cmd="ifconfig $net2 60.3.3.3"; runcmd $cmd; @@ -47,58 +47,59 @@ net2ip=""; runcmd $cmd; echo "Check if nodeset testnode shell is added to $SHELLFOLDER" cat "$SHELLFOLDER"testnode |grep "xcatd=60.3.3.3:3001 destiny=shell"; - if [[ $? -eq 0 ]] ;then - return 0; - else - echo "nodeset testnode shell failed"; - return 1; - fi + if [[ $? -eq 0 ]] ;then + return 0; + else + echo "nodeset testnode shell failed"; + return 1; + fi fi } -function clear_env(){ -rmdef -t network -o 60_0_0_0-255_0_0_0 -makehosts -d testnode -rmdef testnode + +function clear_env() { + rmdef -t network -o 60_0_0_0-255_0_0_0 + makehosts -d testnode + rmdef testnode if [[ $? -eq 0 ]];then return 0; else return 1; fi } + NETBOOT="" SHELLFOLDER="" -while [ "$#" -ge "0" ] -do - case $1 in - "--check" ) - NETBOOT=$2; - if [[ $NETBOOT =~ petitboot ]];then - SHELLFOLDER="/tftpboot/petitboot/"; - elif [[ $NETBOOT =~ xnba ]];then - SHELLFOLDER="/tftpboot/xcat/xnba/nodes/" - else - SHELLFOLDER="/tftpboot/boot/grub2/"; - fi - check_destiny ; - if [[ $? -eq 1 ]];then - exit 1 - else - exit 0 - fi - ;; - "-c"|"--clear" ) - clear_env; - if [[ $? -eq 1 ]];then - exit 1 - else - exit 0 - fi - ;; - *) - echo - echo "Error: Usage: $0: -cd|-c" - echo - exit 1; - ;; - esac +while [ "$#" -ge "0" ]; do + case $1 in + "--check" ) + NETBOOT=$2; + if [[ $NETBOOT =~ petitboot ]];then + SHELLFOLDER="/tftpboot/petitboot/"; + elif [[ $NETBOOT =~ xnba ]];then + SHELLFOLDER="/tftpboot/xcat/xnba/nodes/" + else + SHELLFOLDER="/tftpboot/boot/grub2/"; + fi + check_destiny ; + if [[ $? -eq 1 ]];then + exit 1 + else + exit 0 + fi + ;; + "-c"|"--clear" ) + clear_env; + if [[ $? -eq 1 ]];then + exit 1 + else + exit 0 + fi + ;; + *) + echo + echo "Error: Usage: $0: -cd|-c" + echo + exit 1; + ;; + esac done From e2de8a0b35e32ee6a56db5a249f37655bee8b4e9 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 3 Jun 2019 11:50:10 -0400 Subject: [PATCH 165/276] Let's make the testnode a variable, so we can call it whateveer we want --- xCAT-test/autotest/testcase/genesis/test.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index d528a3395..35ec70c57 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -15,9 +15,12 @@ function runcmd(){ fi } +TESTNODE=testnode + function check_destiny() { - cmd="chdef testnode arch=ppc64le cons=ipmi groups=all ip=60.1.1.1 mac=4e:ee:ee:ee:ee:0e netboot=$NETBOOT"; + cmd="chdef ${TESTNODE} arch=ppc64le cons=ipmi groups=all ip=60.1.1.1 mac=4e:ee:ee:ee:ee:0e netboot=$NETBOOT"; runcmd $cmd; + lsdef ${TESTNODE} masterip=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print $2}'`; masternet=`ifconfig | awk "BEGIN{RS=\"\"}/\<$masterip\>/{print \$1}"|head -n 1 | awk -F ' ' '{print $1}'|awk -F ":" '{print \$1}' 2>&1`; net2=`netstat -i -a|grep -v Kernel|grep -v Iface |grep -v lo|grep -v $masternet|head -n 1|awk '{print $1}'`; @@ -40,17 +43,17 @@ function check_destiny() { runcmd $cmd; cmd="makenetworks"; runcmd $cmd; - echo -e "\n60.1.1.1 testnode" >> /etc/hosts - cmd="nodeset testnode shell"; + echo -e "\n60.1.1.1 ${TESTNODE}" >> /etc/hosts + cmd="nodeset ${TESTNODE} shell"; runcmd $cmd; cmd="ifconfig $net2 $net2ip"; runcmd $cmd; - echo "Check if nodeset testnode shell is added to $SHELLFOLDER" - cat "$SHELLFOLDER"testnode |grep "xcatd=60.3.3.3:3001 destiny=shell"; + echo "Check if nodeset ${TESTNODE} shell is added to $SHELLFOLDER" + cat "$SHELLFOLDER"${TESTNODE} |grep "xcatd=60.3.3.3:3001 destiny=shell"; if [[ $? -eq 0 ]] ;then return 0; else - echo "nodeset testnode shell failed"; + echo "\'nodeset ${TESTNODE} shell\' FAILED"; return 1; fi fi @@ -58,8 +61,8 @@ function check_destiny() { function clear_env() { rmdef -t network -o 60_0_0_0-255_0_0_0 - makehosts -d testnode - rmdef testnode + makehosts -d ${TESTNODE} + rmdef ${TESTNODE} if [[ $? -eq 0 ]];then return 0; else From 5428d0be9aa62ea3f93b8fdeaa95d1597bf60f49 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 3 Jun 2019 11:53:08 -0400 Subject: [PATCH 166/276] We are not taking the return code from runcmd, so don't echo it --- xCAT-test/autotest/testcase/genesis/test.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index 35ec70c57..2f41273ed 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -2,14 +2,12 @@ PATH="/opt/xcat/bin:/opt/xcat/sbin:/opt/xcat/share/xcat/tools:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin" export PATH function runcmd(){ - echo "Run command $*" + echo "Run command $* ..." result=`$*` if [[ $? -eq 0 ]];then - echo $result; - echo -e "Run command $*....[Succeed]\n"; + echo -e "Run command $*... [Succeed]\n"; return 0; else - echo $result; echo -e "Run command $*... [Failed]\n"; return 1; fi From d5995891532d65dd3c97bf296913c830a8e08879 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 3 Jun 2019 11:59:10 -0400 Subject: [PATCH 167/276] Add debug and make variables all UPPERCASE --- xCAT-test/autotest/testcase/genesis/test.sh | 35 ++++++++++++--------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index 2f41273ed..e7f5eeff6 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -19,34 +19,41 @@ function check_destiny() { cmd="chdef ${TESTNODE} arch=ppc64le cons=ipmi groups=all ip=60.1.1.1 mac=4e:ee:ee:ee:ee:0e netboot=$NETBOOT"; runcmd $cmd; lsdef ${TESTNODE} - masterip=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print $2}'`; - masternet=`ifconfig | awk "BEGIN{RS=\"\"}/\<$masterip\>/{print \$1}"|head -n 1 | awk -F ' ' '{print $1}'|awk -F ":" '{print \$1}' 2>&1`; - net2=`netstat -i -a|grep -v Kernel|grep -v Iface |grep -v lo|grep -v $masternet|head -n 1|awk '{print $1}'`; - net2ip=""; - if [[ -z $net2 ]];then + MASTERIP=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print $2}'`; + MASTERNET=`ifconfig | awk "BEGIN{RS=\"\"}/\<$MASTERIP\>/{print \$1}"|head -n 1 | awk -F ' ' '{print $1}'|awk -F ":" '{print \$1}' 2>&1`; + NET2=`netstat -i -a|grep -v Kernel|grep -v Iface |grep -v lo|grep -v $MASTERNET|head -n 1|awk '{print $1}'`; + NET2IP=""; + + echo "MASTERIP=$MASTERIP" + echo "MASTERNET=$MASTERNET" + echo "NET2=$NET2" + echo "NET2IP=$NET2IP" + + if [[ -z $NET2 ]];then echo "There is no second network, could not verify the test" return 1; else - net2ipstring=`ifconfig $net2 |grep inet|grep -v inet6`; + NET2IPstring=`ifconfig $NET2 |grep inet|grep -v inet6`; if [[ $? -eq 0 ]];then - net2ip=`ifconfig $net2 |grep inet|grep -v inet6|awk -F ' ' '{print $2}'|awk -F ":" '{print $2}'`; - if [[ -z $net2ip ]];then - net2ip=`ifconfig $net2 |grep inet|grep -v inet6|awk -F ' ' '{print $2}'`; + echo "Something is set for $NET2IPstring ... using it." + NET2IP=`ifconfig $NET2 |grep inet|grep -v inet6|awk -F ' ' '{print $2}'|awk -F ":" '{print $2}'`; + if [[ -z $NET2IP ]];then + NET2IP=`ifconfig $NET2 |grep inet|grep -v inet6|awk -F ' ' '{print $2}'`; fi else - net2ip=0.0.0.0; + NET2IP=0.0.0.0; fi - echo "The original net2 IP is $net2ip" - cmd="ifconfig $net2 60.3.3.3"; + echo "The original NET2 IP is $NET2IP" + cmd="ifconfig $NET2 60.3.3.3"; runcmd $cmd; cmd="makenetworks"; runcmd $cmd; echo -e "\n60.1.1.1 ${TESTNODE}" >> /etc/hosts cmd="nodeset ${TESTNODE} shell"; runcmd $cmd; - cmd="ifconfig $net2 $net2ip"; + cmd="ifconfig $NET2 $NET2IP"; runcmd $cmd; - echo "Check if nodeset ${TESTNODE} shell is added to $SHELLFOLDER" + echo "Check if 'nodeset ${TESTNODE} shell' is added to $SHELLFOLDER" cat "$SHELLFOLDER"${TESTNODE} |grep "xcatd=60.3.3.3:3001 destiny=shell"; if [[ $? -eq 0 ]] ;then return 0; From 2e1550fc805313a70e8f858b06eac32a21160a6f Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 3 Jun 2019 12:03:05 -0400 Subject: [PATCH 168/276] Make TESTNODE IP a variable --- xCAT-test/autotest/testcase/genesis/test.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index e7f5eeff6..f574896e9 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -14,11 +14,14 @@ function runcmd(){ } TESTNODE=testnode +TESTNODE_IP=60.1.1.1 + function check_destiny() { - cmd="chdef ${TESTNODE} arch=ppc64le cons=ipmi groups=all ip=60.1.1.1 mac=4e:ee:ee:ee:ee:0e netboot=$NETBOOT"; + cmd="chdef ${TESTNODE} arch=ppc64le cons=ipmi groups=all ip=${TESTNODE_IP} mac=4e:ee:ee:ee:ee:0e netboot=$NETBOOT"; runcmd $cmd; lsdef ${TESTNODE} + MASTERIP=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print $2}'`; MASTERNET=`ifconfig | awk "BEGIN{RS=\"\"}/\<$MASTERIP\>/{print \$1}"|head -n 1 | awk -F ' ' '{print $1}'|awk -F ":" '{print \$1}' 2>&1`; NET2=`netstat -i -a|grep -v Kernel|grep -v Iface |grep -v lo|grep -v $MASTERNET|head -n 1|awk '{print $1}'`; @@ -43,6 +46,8 @@ function check_destiny() { else NET2IP=0.0.0.0; fi + + # Seems like this NET2IP doesn't do anything with it, what happens if it's not in the 60 network echo "The original NET2 IP is $NET2IP" cmd="ifconfig $NET2 60.3.3.3"; runcmd $cmd; From 55161696343fe1ce2c7c31925dbf9fbd186322a9 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 3 Jun 2019 12:13:07 -0400 Subject: [PATCH 169/276] Change the network to a 192.168 private network --- xCAT-test/autotest/testcase/genesis/test.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index f574896e9..b16abb4bc 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -13,9 +13,14 @@ function runcmd(){ fi } +# We should be using private networks TESTNODE=testnode TESTNODE_IP=60.1.1.1 +MASTER_PRIVATE_IP="192.168.1.1" +MASTER_PRIVATE_NETMASK="255.255.0.0" +MASTER_PRIVATE_NETWORK="192.168.0.0-255_255_0_0" + function check_destiny() { cmd="chdef ${TESTNODE} arch=ppc64le cons=ipmi groups=all ip=${TESTNODE_IP} mac=4e:ee:ee:ee:ee:0e netboot=$NETBOOT"; @@ -49,28 +54,28 @@ function check_destiny() { # Seems like this NET2IP doesn't do anything with it, what happens if it's not in the 60 network echo "The original NET2 IP is $NET2IP" - cmd="ifconfig $NET2 60.3.3.3"; + cmd="ifconfig $NET2 $MASTER_PRIVATE_IP netmask $MASTER_PRIVATE_NETMASK"; runcmd $cmd; cmd="makenetworks"; runcmd $cmd; - echo -e "\n60.1.1.1 ${TESTNODE}" >> /etc/hosts + makehosts ${TESTNODE} cmd="nodeset ${TESTNODE} shell"; runcmd $cmd; cmd="ifconfig $NET2 $NET2IP"; runcmd $cmd; echo "Check if 'nodeset ${TESTNODE} shell' is added to $SHELLFOLDER" - cat "$SHELLFOLDER"${TESTNODE} |grep "xcatd=60.3.3.3:3001 destiny=shell"; + cat "$SHELLFOLDER"${TESTNODE} |grep "xcatd=${MASTER_PRIVATE_IP}:3001 destiny=shell"; if [[ $? -eq 0 ]] ;then return 0; else - echo "\'nodeset ${TESTNODE} shell\' FAILED"; + echo "'nodeset ${TESTNODE} shell' FAILED"; return 1; fi fi } function clear_env() { - rmdef -t network -o 60_0_0_0-255_0_0_0 + rmdef -t network -o ${MASTER_PRIVATE_NETWORK} makehosts -d ${TESTNODE} rmdef ${TESTNODE} if [[ $? -eq 0 ]];then From f8e6f63e49b331b90b89c5319442a54c116d239d Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 3 Jun 2019 12:15:02 -0400 Subject: [PATCH 170/276] Clean up shell folder, and take the / out of the variable --- xCAT-test/autotest/testcase/genesis/test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index b16abb4bc..a5a7dc524 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -63,8 +63,8 @@ function check_destiny() { runcmd $cmd; cmd="ifconfig $NET2 $NET2IP"; runcmd $cmd; - echo "Check if 'nodeset ${TESTNODE} shell' is added to $SHELLFOLDER" - cat "$SHELLFOLDER"${TESTNODE} |grep "xcatd=${MASTER_PRIVATE_IP}:3001 destiny=shell"; + echo "Check if 'nodeset ${TESTNODE} shell' is added to ${SHELLFOLDER}/${TESTNODE}" + cat "${SHELLFOLDER}/${TESTNODE}" |grep "xcatd=${MASTER_PRIVATE_IP}:3001 destiny=shell"; if [[ $? -eq 0 ]] ;then return 0; else @@ -92,11 +92,11 @@ while [ "$#" -ge "0" ]; do "--check" ) NETBOOT=$2; if [[ $NETBOOT =~ petitboot ]];then - SHELLFOLDER="/tftpboot/petitboot/"; + SHELLFOLDER="/tftpboot/petitboot"; elif [[ $NETBOOT =~ xnba ]];then - SHELLFOLDER="/tftpboot/xcat/xnba/nodes/" + SHELLFOLDER="/tftpboot/xcat/xnba/nodes" else - SHELLFOLDER="/tftpboot/boot/grub2/"; + SHELLFOLDER="/tftpboot/boot/grub2"; fi check_destiny ; if [[ $? -eq 1 ]];then From 10377c477a7b0cd1f6d5e01c0c04d59a7222021c Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 3 Jun 2019 12:16:43 -0400 Subject: [PATCH 171/276] Set the IP for the test node to the same subnet as the 2nd network --- xCAT-test/autotest/testcase/genesis/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index a5a7dc524..a550f15ac 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -15,7 +15,7 @@ function runcmd(){ # We should be using private networks TESTNODE=testnode -TESTNODE_IP=60.1.1.1 +TESTNODE_IP="192.168.3.1" MASTER_PRIVATE_IP="192.168.1.1" MASTER_PRIVATE_NETMASK="255.255.0.0" From 4ac6be1cb263067909b60f47af227e75cead0982 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 3 Jun 2019 12:23:55 -0400 Subject: [PATCH 172/276] network name is incorrect --- xCAT-test/autotest/testcase/genesis/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index a550f15ac..e4db45273 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -19,7 +19,7 @@ TESTNODE_IP="192.168.3.1" MASTER_PRIVATE_IP="192.168.1.1" MASTER_PRIVATE_NETMASK="255.255.0.0" -MASTER_PRIVATE_NETWORK="192.168.0.0-255_255_0_0" +MASTER_PRIVATE_NETWORK="192_168_0_0-255_255_0_0" function check_destiny() { From 87ae1aa168a80c224c64056647c9fc3982fbd719 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 3 Jun 2019 14:13:29 -0400 Subject: [PATCH 173/276] Print more debug out --- xCAT-test/autotest/testcase/genesis/test.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index e4db45273..8c8a97acb 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -59,11 +59,15 @@ function check_destiny() { cmd="makenetworks"; runcmd $cmd; makehosts ${TESTNODE} + grep ${TESTNODE} /etc/hosts cmd="nodeset ${TESTNODE} shell"; runcmd $cmd; cmd="ifconfig $NET2 $NET2IP"; runcmd $cmd; echo "Check if 'nodeset ${TESTNODE} shell' is added to ${SHELLFOLDER}/${TESTNODE}" + echo "===============================================" + cat "${SHELLFOLDER}/${TESTNODE}" + echo "===============================================" cat "${SHELLFOLDER}/${TESTNODE}" |grep "xcatd=${MASTER_PRIVATE_IP}:3001 destiny=shell"; if [[ $? -eq 0 ]] ;then return 0; From 71ee0da3ddbd2c4a8f98f3917ba9f2afc18c9efe Mon Sep 17 00:00:00 2001 From: cxhong Date: Wed, 5 Jun 2019 16:07:58 -0400 Subject: [PATCH 174/276] Add bzip2 to rhels8 pkglist --- xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist | 1 + xCAT-server/share/xcat/install/rh/service.rhels8.pkglist | 1 + xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist | 1 + xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist | 1 + xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist | 1 + xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist | 1 + 6 files changed, 6 insertions(+) diff --git a/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist b/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist index 1f6c79c13..0feb58550 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist +++ b/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist @@ -8,3 +8,4 @@ util-linux wget python3 tar +bzip2 diff --git a/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist b/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist index eff931916..1cc601f9e 100644 --- a/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist +++ b/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist @@ -12,3 +12,4 @@ perl-DBD-Pg unixODBC python3 tar +bzip2 diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist index 91f826442..7c33f0d7b 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist @@ -10,3 +10,4 @@ util-linux wget python3 tar +bzip2 diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist index 91f826442..7c33f0d7b 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist @@ -10,3 +10,4 @@ util-linux wget python3 tar +bzip2 diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist index a1d6a20b2..e15993e89 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist @@ -12,3 +12,4 @@ perl-DBD-MySQL perl-DBD-Pg python3 tar +bzip2 diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist index a1d6a20b2..e15993e89 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist @@ -12,3 +12,4 @@ perl-DBD-MySQL perl-DBD-Pg python3 tar +bzip2 From cb340bd4efc137e30cd8350efac9b745c06e33c6 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 6 Jun 2019 09:58:50 -0400 Subject: [PATCH 175/276] Add a checkrc to break out when non zero return code. Add more debug to make this build work in our own clone environmemt --- builddep.sh | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/builddep.sh b/builddep.sh index 9f0f4fb0c..9c2fd55a0 100755 --- a/builddep.sh +++ b/builddep.sh @@ -12,7 +12,7 @@ # - createrepo command needs to be present on the build machine # # Usage: builddep.sh [attr=value attr=value ...] -# DESTDIR= - the dir to place the dep tarball in. The default is ../../../xcat-dep, +# DESTDIR= - the dir to place the dep tarball in. The default is ../../xcat-dep, # relative to where this script is located. # UP=0 or UP=1 - override the default upload behavior # FRSYUM=0 - put the directory of individual rpms in the project web area instead @@ -87,13 +87,37 @@ if [ -z "$DESTDIR" ]; then # This is really a hack here because it depends on the build # environment structure. However, it's not expected that # users are building the xcat-dep packages - DESTDIR=../../xcat-dep + if [[ $XCATCOREDIR == *"xcat2_autobuild_daily_builds"* ]]; then + # This shows we are in the daily build environment path, create the + # deps package at the top level of the build directory + DESTDIR=../../xcat-dep + else + # This means we are building in some other clone of xcat-core, + # so just place the destination one level up. + DESTDIR=../xcat-dep + fi fi +echo "INFO: xcat-dep package will be created here: $XCATCOREDIR/$DESTDIR" + +# Create a function to check the return code, +# if non-zero, we should stop or unexpected things may happen +function checkrc { + if [[ $? != 0 ]]; then + echo "[checkrc] non-zero return code, exiting..." + exit 1 + fi +} + # Sync from the GSA master copy of the dep rpms mkdir -p $DESTDIR/xcat-dep +checkrc + +# Copy over the xcat-dep from master staging area on GSA to the local directory here echo "Syncing RPMs from $GSA/ to $DESTDIR/xcat-dep ..." rsync -ilrtpu --delete $GSA/ $DESTDIR/xcat-dep +checkrc +ls -ltr $DESTDIR/xcat-dep cd $DESTDIR/xcat-dep # add a comment to indicate the latest xcat-dep tar ball name From 7274ce1ddc0dc857a5ce74efe63d2bc7d8e22248 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 6 Jun 2019 10:06:41 -0400 Subject: [PATCH 176/276] Check rc, we are forcing home to /root and it will fail and keep going --- builddep.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builddep.sh b/builddep.sh index 9c2fd55a0..85df1524e 100755 --- a/builddep.sh +++ b/builddep.sh @@ -98,6 +98,7 @@ if [ -z "$DESTDIR" ]; then fi fi +echo "INFO: xcat-dep package name: $DFNAME" echo "INFO: xcat-dep package will be created here: $XCATCOREDIR/$DESTDIR" # Create a function to check the return code, @@ -117,7 +118,7 @@ checkrc echo "Syncing RPMs from $GSA/ to $DESTDIR/xcat-dep ..." rsync -ilrtpu --delete $GSA/ $DESTDIR/xcat-dep checkrc -ls -ltr $DESTDIR/xcat-dep +ls $DESTDIR/xcat-dep cd $DESTDIR/xcat-dep # add a comment to indicate the latest xcat-dep tar ball name @@ -126,6 +127,7 @@ sed -i -e "s#REPLACE_LATEST_SNAP_LINE#The latest xcat-dep tar ball is ${DFNAME}# if [ "$OSNAME" != "AIX" ]; then # Get gpg keys in place mkdir -p $HOME/.gnupg + checkrc for i in pubring.gpg secring.gpg trustdb.gpg; do if [ ! -f $HOME/.gnupg/$i ] || [ `wc -c $HOME/.gnupg/$i|cut -f 1 -d' '` == 0 ]; then rm -f $HOME/.gnupg/$i From 4135fd665b40b9c444890553cf4921b562f763b6 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 6 Jun 2019 10:10:50 -0400 Subject: [PATCH 177/276] Make the gnupg directory a variable so we can more easily change it --- builddep.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/builddep.sh b/builddep.sh index 85df1524e..c6040b15e 100755 --- a/builddep.sh +++ b/builddep.sh @@ -124,20 +124,21 @@ cd $DESTDIR/xcat-dep # add a comment to indicate the latest xcat-dep tar ball name sed -i -e "s#REPLACE_LATEST_SNAP_LINE#The latest xcat-dep tar ball is ${DFNAME}#g" README +GNU_KEYDIR="$HOME/.gnupg" +MACROS=$HOME/.rpmmacros if [ "$OSNAME" != "AIX" ]; then # Get gpg keys in place - mkdir -p $HOME/.gnupg + mkdir -p ${GNU_KEYDIR} checkrc for i in pubring.gpg secring.gpg trustdb.gpg; do - if [ ! -f $HOME/.gnupg/$i ] || [ `wc -c $HOME/.gnupg/$i|cut -f 1 -d' '` == 0 ]; then - rm -f $HOME/.gnupg/$i - cp $GSA/../keys/$i $HOME/.gnupg - chmod 600 $HOME/.gnupg/$i + if [ ! -f ${GNU_KEYDIR}/$i ] || [ `wc -c ${GNU_KEYDIR}/$i|cut -f 1 -d' '` == 0 ]; then + rm -f ${GNU_KEYDIR}/$i + cp $GSA/../keys/$i ${GNU_KEYDIR} + chmod 600 ${GNU_KEYDIR}/$i fi done # Tell rpm to use gpg to sign - MACROS=$HOME/.rpmmacros if ! $GREP -q '%_signature gpg' $MACROS 2>/dev/null; then echo '%_signature gpg' >> $MACROS fi From ffa2ced11660e3298e97dc3333af053c1dce1036 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 6 Jun 2019 10:23:28 -0400 Subject: [PATCH 178/276] Hard stop if the keys are already there so caller needs to decide to remove it or not --- builddep.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/builddep.sh b/builddep.sh index c6040b15e..875fb1002 100755 --- a/builddep.sh +++ b/builddep.sh @@ -47,7 +47,6 @@ if [ "$OSNAME" == "AIX" ]; then else DFNAME=xcat-dep-`date +%Y%m%d%H%M`.tar.bz2 GSA=/gsa/pokgsa/projects/x/xcat/build/linux/xcat-dep - export HOME=/root # This is so rpm and gpg will know home, even in sudo fi if [ ! -d $GSA ]; then @@ -90,11 +89,11 @@ if [ -z "$DESTDIR" ]; then if [[ $XCATCOREDIR == *"xcat2_autobuild_daily_builds"* ]]; then # This shows we are in the daily build environment path, create the # deps package at the top level of the build directory - DESTDIR=../../xcat-dep + DESTDIR=../../xcat-dep-build else # This means we are building in some other clone of xcat-core, # so just place the destination one level up. - DESTDIR=../xcat-dep + DESTDIR=../xcat-dep-build fi fi @@ -128,8 +127,13 @@ GNU_KEYDIR="$HOME/.gnupg" MACROS=$HOME/.rpmmacros if [ "$OSNAME" != "AIX" ]; then # Get gpg keys in place + if [[ -d ${GNU_KEYDIR} ]]; then + echo "WARNING: The gnupg key dir: $GNU_KEYDIR exists, it will be overwitten. Stop." + echo "WARNING: To continue, remove it and rerun the script." + exit 1 + fi mkdir -p ${GNU_KEYDIR} - checkrc + checkrc for i in pubring.gpg secring.gpg trustdb.gpg; do if [ ! -f ${GNU_KEYDIR}/$i ] || [ `wc -c ${GNU_KEYDIR}/$i|cut -f 1 -d' '` == 0 ]; then rm -f ${GNU_KEYDIR}/$i From 33411cd7c884a238ecfe8746d0a6b5aad9395600 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 6 Jun 2019 10:25:40 -0400 Subject: [PATCH 179/276] Check the key dir early on before we start doing anything --- builddep.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/builddep.sh b/builddep.sh index 875fb1002..5e67b76a4 100755 --- a/builddep.sh +++ b/builddep.sh @@ -65,6 +65,14 @@ for pkg in ${REQPKG[*]}; do fi done +GNU_KEYDIR="$HOME/.gnupg" +MACROS=$HOME/.rpmmacros +if [[ -d ${GNU_KEYDIR} ]]; then + echo "WARNING: The gnupg key dir: $GNU_KEYDIR exists, it will be overwitten. Stop." + echo "WARNING: To continue, remove it and rerun the script." + exit 1 +fi + # set grep to quiet by default GREP="grep -q" if [ "$VERBOSE" = "1" -o "$VERBOSE" = "yes" ]; then @@ -123,15 +131,8 @@ cd $DESTDIR/xcat-dep # add a comment to indicate the latest xcat-dep tar ball name sed -i -e "s#REPLACE_LATEST_SNAP_LINE#The latest xcat-dep tar ball is ${DFNAME}#g" README -GNU_KEYDIR="$HOME/.gnupg" -MACROS=$HOME/.rpmmacros if [ "$OSNAME" != "AIX" ]; then # Get gpg keys in place - if [[ -d ${GNU_KEYDIR} ]]; then - echo "WARNING: The gnupg key dir: $GNU_KEYDIR exists, it will be overwitten. Stop." - echo "WARNING: To continue, remove it and rerun the script." - exit 1 - fi mkdir -p ${GNU_KEYDIR} checkrc for i in pubring.gpg secring.gpg trustdb.gpg; do From b7b338c4369dd23354e0383fff6b72240915f521 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 6 Jun 2019 13:16:23 -0400 Subject: [PATCH 180/276] Change the message for key slightly --- builddep.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builddep.sh b/builddep.sh index 5e67b76a4..5c2c71395 100755 --- a/builddep.sh +++ b/builddep.sh @@ -68,8 +68,8 @@ done GNU_KEYDIR="$HOME/.gnupg" MACROS=$HOME/.rpmmacros if [[ -d ${GNU_KEYDIR} ]]; then - echo "WARNING: The gnupg key dir: $GNU_KEYDIR exists, it will be overwitten. Stop." - echo "WARNING: To continue, remove it and rerun the script." + echo "ERROR: The gnupg key dir: $GNU_KEYDIR exists, it will be overwitten. Stop." + echo "ERROR: To continue, remove it and rerun the script." exit 1 fi From 271a496263deb8710545829d1a9fb004ad716993 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 6 Jun 2019 13:43:39 -0400 Subject: [PATCH 181/276] Create more variables for the directory locations, change mklocalrepo to excute if needed --- builddep.sh | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/builddep.sh b/builddep.sh index 5c2c71395..793002d35 100755 --- a/builddep.sh +++ b/builddep.sh @@ -88,12 +88,13 @@ else YUMDIR=htdocs fi -cd `dirname $0` +SCRIPT=$(readlink -f "$0") +SCRIPTPATH=$(dirname "$SCRIPT") +echo "INFO: Running script from here: $SCRIPTPATH ..." + +cd $SCRIPTPATH XCATCOREDIR=`/bin/pwd` if [ -z "$DESTDIR" ]; then - # This is really a hack here because it depends on the build - # environment structure. However, it's not expected that - # users are building the xcat-dep packages if [[ $XCATCOREDIR == *"xcat2_autobuild_daily_builds"* ]]; then # This shows we are in the daily build environment path, create the # deps package at the top level of the build directory @@ -105,8 +106,8 @@ if [ -z "$DESTDIR" ]; then fi fi -echo "INFO: xcat-dep package name: $DFNAME" -echo "INFO: xcat-dep package will be created here: $XCATCOREDIR/$DESTDIR" +echo "INFO: Target package name: $DFNAME" +echo "INFO: Target package will be created here: $XCATCOREDIR/$DESTDIR" # Create a function to check the return code, # if non-zero, we should stop or unexpected things may happen @@ -117,16 +118,17 @@ function checkrc { fi } +WORKING_TARGET_DIR="${DESTDIR}/xcat-dep" # Sync from the GSA master copy of the dep rpms -mkdir -p $DESTDIR/xcat-dep +mkdir -p ${WORKING_TARGET_DIR} checkrc # Copy over the xcat-dep from master staging area on GSA to the local directory here -echo "Syncing RPMs from $GSA/ to $DESTDIR/xcat-dep ..." -rsync -ilrtpu --delete $GSA/ $DESTDIR/xcat-dep +echo "Syncing RPMs from $GSA/ to ${WORKING_TARGET_DIR} ..." +rsync -ilrtpu --delete $GSA/ ${WORKING_TARGET_DIR} checkrc -ls $DESTDIR/xcat-dep -cd $DESTDIR/xcat-dep +ls ${WORKING_TARGET_DIR} +cd ${WORKING_TARGET_DIR} # add a comment to indicate the latest xcat-dep tar ball name sed -i -e "s#REPLACE_LATEST_SNAP_LINE#The latest xcat-dep tar ball is ${DFNAME}#g" README @@ -172,6 +174,14 @@ if [ "$OSNAME" != "AIX" ]; then # Modify xcat-dep.repo files to point to the correct place echo "===> Modifying the xcat-dep.repo files to point to the correct location..." + + # make sure the mklocalrepo.sh script has execute permission (to ensure quality control) + echo "===> Making sure that the mklocalrepo.sh file contains execute permission ..." + ls -ltr ${SCRIPTPATH}/${WORKING_TARGET_DIR}/mklocalrepo.sh + if [[ ! -x "${SCRIPTPATH}/${WORKING_TARGET_DIR}/mklocalrepo.sh" ]]; then + echo "==> Adding execute ..." + chmod +x ${SCRIPTPATH}/${WORKING_TARGET_DIR}/mklocalrepo.sh + fi fi if [ "$OSNAME" == "AIX" ]; then From 9ab31d623870ce50e2525877d966c8eff66550c4 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 6 Jun 2019 13:46:14 -0400 Subject: [PATCH 182/276] Remove dev files if present --- builddep.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/builddep.sh b/builddep.sh index 793002d35..cedc1f25c 100755 --- a/builddep.sh +++ b/builddep.sh @@ -175,13 +175,17 @@ if [ "$OSNAME" != "AIX" ]; then # Modify xcat-dep.repo files to point to the correct place echo "===> Modifying the xcat-dep.repo files to point to the correct location..." - # make sure the mklocalrepo.sh script has execute permission (to ensure quality control) echo "===> Making sure that the mklocalrepo.sh file contains execute permission ..." ls -ltr ${SCRIPTPATH}/${WORKING_TARGET_DIR}/mklocalrepo.sh if [[ ! -x "${SCRIPTPATH}/${WORKING_TARGET_DIR}/mklocalrepo.sh" ]]; then echo "==> Adding execute ..." chmod +x ${SCRIPTPATH}/${WORKING_TARGET_DIR}/mklocalrepo.sh fi + + echo "==> Checking if 'replacelinks' is in the xcat-deps, removing if there ..." + if [[ -f ${SCRIPTPATH}/${WORKING_TARGET_DIR}/replacelinks ]]; then + rm -f ${SCRIPTPATH}/${WORKING_TARGET_DIR}/replacelinks + fi fi if [ "$OSNAME" == "AIX" ]; then From d25fae052cfa853e367a486f4a1f8dbade41fe52 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 6 Jun 2019 13:49:12 -0400 Subject: [PATCH 183/276] Formatted the output a little better --- builddep.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builddep.sh b/builddep.sh index cedc1f25c..6ccf9f9ff 100755 --- a/builddep.sh +++ b/builddep.sh @@ -178,11 +178,11 @@ if [ "$OSNAME" != "AIX" ]; then echo "===> Making sure that the mklocalrepo.sh file contains execute permission ..." ls -ltr ${SCRIPTPATH}/${WORKING_TARGET_DIR}/mklocalrepo.sh if [[ ! -x "${SCRIPTPATH}/${WORKING_TARGET_DIR}/mklocalrepo.sh" ]]; then - echo "==> Adding execute ..." + echo "===> --- found not execute, changing +x ..." chmod +x ${SCRIPTPATH}/${WORKING_TARGET_DIR}/mklocalrepo.sh fi - echo "==> Checking if 'replacelinks' is in the xcat-deps, removing if there ..." + echo "===> Checking if 'replacelinks' is in the xcat-deps, removing if there ..." if [[ -f ${SCRIPTPATH}/${WORKING_TARGET_DIR}/replacelinks ]]; then rm -f ${SCRIPTPATH}/${WORKING_TARGET_DIR}/replacelinks fi From de2cb793d10aebb59879b7d89c6b31c7d008a219 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 6 Jun 2019 14:02:10 -0400 Subject: [PATCH 184/276] Determine XCATCOREDIR on the fly --- builddep.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/builddep.sh b/builddep.sh index 6ccf9f9ff..251ae76d0 100755 --- a/builddep.sh +++ b/builddep.sh @@ -89,11 +89,10 @@ else fi SCRIPT=$(readlink -f "$0") -SCRIPTPATH=$(dirname "$SCRIPT") -echo "INFO: Running script from here: $SCRIPTPATH ..." +XCATCOREDIR=$(dirname "$SCRIPT") +echo "INFO: Running script from here: $XCATCOREDIR ..." -cd $SCRIPTPATH -XCATCOREDIR=`/bin/pwd` +cd $XCATCOREDIR if [ -z "$DESTDIR" ]; then if [[ $XCATCOREDIR == *"xcat2_autobuild_daily_builds"* ]]; then # This shows we are in the daily build environment path, create the @@ -176,15 +175,15 @@ if [ "$OSNAME" != "AIX" ]; then echo "===> Modifying the xcat-dep.repo files to point to the correct location..." echo "===> Making sure that the mklocalrepo.sh file contains execute permission ..." - ls -ltr ${SCRIPTPATH}/${WORKING_TARGET_DIR}/mklocalrepo.sh - if [[ ! -x "${SCRIPTPATH}/${WORKING_TARGET_DIR}/mklocalrepo.sh" ]]; then + ls -ltr ${XCATCOREDIR}/${WORKING_TARGET_DIR}/mklocalrepo.sh + if [[ ! -x "${XCATCOREDIR}/${WORKING_TARGET_DIR}/mklocalrepo.sh" ]]; then echo "===> --- found not execute, changing +x ..." - chmod +x ${SCRIPTPATH}/${WORKING_TARGET_DIR}/mklocalrepo.sh + chmod +x ${XCATCOREDIR}/${WORKING_TARGET_DIR}/mklocalrepo.sh fi echo "===> Checking if 'replacelinks' is in the xcat-deps, removing if there ..." - if [[ -f ${SCRIPTPATH}/${WORKING_TARGET_DIR}/replacelinks ]]; then - rm -f ${SCRIPTPATH}/${WORKING_TARGET_DIR}/replacelinks + if [[ -f ${XCATCOREDIR}/${WORKING_TARGET_DIR}/replacelinks ]]; then + rm -f ${XCATCOREDIR}/${WORKING_TARGET_DIR}/replacelinks fi fi @@ -280,7 +279,9 @@ chmod -R g+w * echo "===> Building the tarball..." # -# Want to stay above xcat-dep so we can rsync the whole directory +# Want to stay one level above xcat-dep so that the script +# can rsync the directory up to xcat.org. +# # DO NOT CHANGE DIRECTORY AFTER THIS POINT!! # cd .. From f059ec0998b94d68ecefc852ae0fd147e49026e0 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 6 Jun 2019 14:33:03 -0400 Subject: [PATCH 185/276] Stop using cd .. , cd .. and change to the exact directory --- builddep.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/builddep.sh b/builddep.sh index 251ae76d0..6ffa3d706 100755 --- a/builddep.sh +++ b/builddep.sh @@ -277,15 +277,16 @@ fi chgrp -R -h $SYSGRP * chmod -R g+w * -echo "===> Building the tarball..." +TARBALL_WORKING_DIR="${XCATCOREDIR}/${DESTDIR}" +echo "===> Building the tarball at: ${TARBALL_WORKING_DIR} ..." # # Want to stay one level above xcat-dep so that the script # can rsync the directory up to xcat.org. # # DO NOT CHANGE DIRECTORY AFTER THIS POINT!! # -cd .. -pwd + +cd ${TARBALL_WORKING_DIR} verbosetar="" if [ -n "$VERBOSEMODE" ]; then From 1abf93e6f4b24bb79f1f73fc7f90451f8086e411 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 6 Jun 2019 19:18:04 -0400 Subject: [PATCH 186/276] Change the destination directory to builddep.sh --- builddep.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builddep.sh b/builddep.sh index 6ffa3d706..97090a5a2 100755 --- a/builddep.sh +++ b/builddep.sh @@ -12,7 +12,7 @@ # - createrepo command needs to be present on the build machine # # Usage: builddep.sh [attr=value attr=value ...] -# DESTDIR= - the dir to place the dep tarball in. The default is ../../xcat-dep, +# DESTDIR= - the dir to place the dep tarball in. The default is ../../xcat-dep-build, # relative to where this script is located. # UP=0 or UP=1 - override the default upload behavior # FRSYUM=0 - put the directory of individual rpms in the project web area instead From 3ec008db60bb08a3802a5c5883ff260af501a2cc Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 10 Jun 2019 16:53:05 -0400 Subject: [PATCH 187/276] Pick correct pkglist/tmpl files based on the osvers --- xCAT-server/lib/perl/xCAT/SvrUtils.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/SvrUtils.pm b/xCAT-server/lib/perl/xCAT/SvrUtils.pm index 9722fdd06..4248cede5 100755 --- a/xCAT-server/lib/perl/xCAT/SvrUtils.pm +++ b/xCAT-server/lib/perl/xCAT/SvrUtils.pm @@ -482,7 +482,9 @@ sub getsynclistfile() sub get_os_search_list { my $os = shift; - my @word = split(/\./, $os); + #example: for os=rhels7.6-alternate + my ($baseos, $alter) = split(/\-/, $os); + my @word = split(/\./, $baseos); my @list = (); while ($word[-1] =~ /^[0-9]+$/) { @@ -713,7 +715,7 @@ sub update_tables_with_templates my $genos = $osver; $genos =~ s/\..*//; if ($genos =~ /rh.*s(\d*)/) { - $genos = "rhel$1"; + $genos = "rhels$1"; } @@ -935,7 +937,7 @@ sub update_tables_with_mgt_image my $genos = $osver; $genos =~ s/\..*//; if ($genos =~ /rh.*s(\d*)/) { - $genos = "rhel$1"; + $genos = "rhels$1"; } #if the osver does not match the osver of MN, return @@ -1141,7 +1143,7 @@ sub update_tables_with_diskless_image my $genos = $osver; $genos =~ s/\..*//; if ($genos =~ /rh.*s(\d*)/) { - $genos = "rhel$1"; + $genos = "rhels$1"; } #print "osver=$osver, arch=$arch, osname=$osname, genos=$genos, profile=$profile\n"; From 3609831b65abcef0346291305eab8ab6dcd56ceb Mon Sep 17 00:00:00 2001 From: cxhong Date: Tue, 11 Jun 2019 11:12:55 -0400 Subject: [PATCH 188/276] Add verification test case for copycds --- xCAT-test/autotest/testcase/copycds/cases0 | 2 ++ .../autotest/testcase/copycds/copycds.sh | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100755 xCAT-test/autotest/testcase/copycds/copycds.sh diff --git a/xCAT-test/autotest/testcase/copycds/cases0 b/xCAT-test/autotest/testcase/copycds/cases0 index b1d796fd5..02e88d4df 100644 --- a/xCAT-test/autotest/testcase/copycds/cases0 +++ b/xCAT-test/autotest/testcase/copycds/cases0 @@ -9,6 +9,8 @@ check:output=~Copying media to /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($ check:output=~Media copy operation successful cmd:ls /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__ check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/copycds/copycds.sh __GETNODEATTR($$CN,os)__ +check:rc==0 end start:lskmodules_o diff --git a/xCAT-test/autotest/testcase/copycds/copycds.sh b/xCAT-test/autotest/testcase/copycds/copycds.sh new file mode 100755 index 000000000..f7e04f842 --- /dev/null +++ b/xCAT-test/autotest/testcase/copycds/copycds.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +if [[ -z ${1} ]]; then + echo "ERROR, pass in the '\$OS' variable as the second argument" + exit 1 +fi +OS=${1} + +if [[ $OS != *"rhels"* ]]; then + echo "INFO: will not run this test for $OS" + exit 0 +fi + +MAJOR_OS_VER=${OS%.*} +if [[ $OS == *"$MAJOR_OS_VER"* ]]; then + IFS=' +' + for image in `lsdef -t osimage -i template -c | grep $OS | grep "install"`; do + THE_NAME=`echo $image | cut -d' ' -f1` + THE_TEMPLATE=`echo $image | cut -d' ' -f2` + TEMPLATE_FILE=`echo $THE_TEMPLATE | cut -d= -f2` + + if [[ $TEMPLATE_FILE != *"$MAJOR_OS_VER"* ]]; then + echo "ERROR - template attribute not set correctly when copycds for $THE_NAME" + echo -e "ERROR - $TEMPLATE_FILE" + exit 1 + else + echo "Template file looks good for $THE_NAME" + echo -e "\t$THE_TEMPLATE" + fi + done +fi + +exit 0 From 7580f125242df8e3864fd8740d56b9abf6c0be1a Mon Sep 17 00:00:00 2001 From: cxhong Date: Wed, 12 Jun 2019 12:05:41 -0400 Subject: [PATCH 189/276] copycds_iso test case failed if os has multiple '.' --- xCAT-test/autotest/testcase/copycds/copycds.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/copycds/copycds.sh b/xCAT-test/autotest/testcase/copycds/copycds.sh index f7e04f842..6945d5492 100755 --- a/xCAT-test/autotest/testcase/copycds/copycds.sh +++ b/xCAT-test/autotest/testcase/copycds/copycds.sh @@ -11,7 +11,7 @@ if [[ $OS != *"rhels"* ]]; then exit 0 fi -MAJOR_OS_VER=${OS%.*} +MAJOR_OS_VER=`echo $OS | cut -d'.' -f1` if [[ $OS == *"$MAJOR_OS_VER"* ]]; then IFS=' ' From 033bc36ab5c0ad4a4f5c154333d76cd4bc649155 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 17 Jun 2019 10:05:38 -0400 Subject: [PATCH 190/276] Delay after rfalsh -d BMC reboot --- xCAT-server/lib/xcat/plugins/openbmc.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 529fc758c..952922b76 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -78,6 +78,7 @@ $::RPOWER_RESET_SLEEP_INTERVAL = 13; $::BMC_MAX_RETRY = 20; $::BMC_CHECK_INTERVAL = 15; +$::BMC_REBOOT_DELAY = 180; $::RSPCONFIG_DUMP_INTERVAL = 15; $::RSPCONFIG_DUMP_MAX_RETRY = 20; @@ -2516,6 +2517,9 @@ sub deal_with_response { return; } } elsif ($response->status_line eq $::RESPONSE_SERVICE_TIMEOUT) { + # Normally we would not wind up here when processing a response from bmcreboot and instead + # handle it in rpower_response() which will be called when 200 OK is returned. But sometimes + # we get 504 Timeout and wind up here. The steps are the same. if ($node_info{$node}{cur_status} eq "RPOWER_RESET_RESPONSE" and defined $status_info{RPOWER_RESET_RESPONSE}{argv} and $status_info{RPOWER_RESET_RESPONSE}{argv} =~ /bmcreboot$/) { my $infomsg = "BMC $::POWER_STATE_REBOOT"; xCAT::SvrUtils::sendmsg($infomsg, $callback, $node); @@ -2523,8 +2527,9 @@ sub deal_with_response { my $timestamp = localtime(); print RFLASH_LOG_FILE_HANDLE "$timestamp ===================Rebooting BMC to apply new BMC firmware===================\n"; print RFLASH_LOG_FILE_HANDLE "BMC $::POWER_STATE_REBOOT\n"; + print RFLASH_LOG_FILE_HANDLE "Waiting for $::BMC_REBOOT_DELAY seconds to give BMC a chance to reboot\n"; close (RFLASH_LOG_FILE_HANDLE); - retry_after($node, "RPOWER_BMC_CHECK_REQUEST", 15); + retry_after($node, "RPOWER_BMC_CHECK_REQUEST", $::BMC_REBOOT_DELAY); return; }else{ $wait_node_num--; @@ -2776,7 +2781,8 @@ sub rpower_response { print RFLASH_LOG_FILE_HANDLE "BMC $::POWER_STATE_REBOOT\n"; my $timestamp = localtime(); print RFLASH_LOG_FILE_HANDLE "$timestamp ===================Reboot BMC to apply new BMC===================\n"; - retry_after($node, "RPOWER_BMC_CHECK_REQUEST", 15); + print RFLASH_LOG_FILE_HANDLE "Waiting for $::BMC_REBOOT_DELAY seconds to give BMC a chance to reboot\n"; + retry_after($node, "RPOWER_BMC_CHECK_REQUEST", $::BMC_REBOOT_DELAY); return; } } From 2c5e727be7df5a5c42718c15d8e04a423754b9b9 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 17 Jun 2019 11:25:03 -0400 Subject: [PATCH 191/276] Use . instead of source to source xcat.sh file --- xCAT-server/sbin/restartxcatd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/sbin/restartxcatd b/xCAT-server/sbin/restartxcatd index 4df45b3a9..852c04e55 100755 --- a/xCAT-server/sbin/restartxcatd +++ b/xCAT-server/sbin/restartxcatd @@ -70,7 +70,7 @@ if (xCAT::Utils->isLinux()) { print "Restarting xCATd "; if (-r "/etc/profile.d/xcat.sh") { - $cmd = "source /etc/profile.d/xcat.sh;"; + $cmd = ". /etc/profile.d/xcat.sh;"; } $cmd .= "xcatd -p /var/run/xcatd.pid"; From 1e7cc676af1b31f9a2bade8000474829e8f165c6 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 17 Jun 2019 15:07:52 -0400 Subject: [PATCH 192/276] Fix restartxcatd man pages --- .../references/man1/restartxcatd.1.rst | 27 ++++++++++++------- xCAT-client/pods/man1/restartxcatd.1.pod | 26 +++++++++++------- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/restartxcatd.1.rst b/docs/source/guides/admin-guides/references/man1/restartxcatd.1.rst index a4348f73f..544df2cdf 100644 --- a/docs/source/guides/admin-guides/references/man1/restartxcatd.1.rst +++ b/docs/source/guides/admin-guides/references/man1/restartxcatd.1.rst @@ -29,21 +29,28 @@ DESCRIPTION The \ **restartxcatd**\ command restarts the xCAT daemon (xcatd). -\ **Linux Specific**\ +\ **Linux Specific**\ : It will perform the xcatd \ *fast restart*\ . The xcatd \ *fast restart*\ is a specific restart which has two advantages compares to the \ *stop*\ and then \ *start*\ . - 1. The interval of xcatd out of service is very short. - 2. The in processing request which initiated by old xcatd will not be stopped by force. The old xcatd will hand over the sockets to new xcatd, but old xcat will still be waiting for the in processing request to finish before the exit. - -It does the same thing as 'service xcatd restart' on NON-systemd enabled Operating System like rh6.x and sles11.x. But for the systemd enabled Operating System like rh7 and sles12, the 'service xcatd restart' just do the \ *stop*\ and \ *start*\ instead of xcatd \ *fast restart*\ . - -It's recommended to use \ **restartxcatd**\ command to restart xcatd on systemd enable system like rh7 and sles12 instead of 'service xcatd restart' or 'systemctl restart xcatd'. - -\ **AIX Specific**\ -It runs 'stopsrc -s xcatd' to stop xcatd first if xcatd is active, then runs 'startsrc -s xcatd' to start xcatd. +1. The interval of xcatd out of service is very short. + + + +2. The in processing request which initiated by old xcatd will not be stopped by force. The old xcatd will hand over the sockets to new xcatd, but old xcat will still be waiting for the in processing request to finish before the exit. + + + +It does the same thing as \ **service xcatd restart**\ on NON-systemd enabled Operating System like rh6.x and sles11.x. But for the systemd enabled Operating System like rh7 and sles12, the \ **service xcatd restart**\ will just do the \ *stop*\ and \ *start*\ instead of xcatd \ *fast restart*\ . + +It's recommended to use \ **restartxcatd**\ command to restart xcatd on systemd enabled system like rh7 and sles12 instead of \ **service xcatd restart**\ or \ **systemctl restart xcatd**\ . + +\ **AIX Specific**\ : + + +It runs \ **stopsrc -s xcatd**\ to stop xcatd first if xcatd is active, then runs \ **startsrc -s xcatd**\ to start xcatd. If the xcatd subsystem was not created, \ **restartxcatd**\ will create it automatically. diff --git a/xCAT-client/pods/man1/restartxcatd.1.pod b/xCAT-client/pods/man1/restartxcatd.1.pod index a85a93ac4..c0e1c7cf3 100644 --- a/xCAT-client/pods/man1/restartxcatd.1.pod +++ b/xCAT-client/pods/man1/restartxcatd.1.pod @@ -11,25 +11,31 @@ B [[B<-h>|B<--help>] | [B<-v>|B<--version>] | [B<-r>|B<--reload>]] The B command restarts the xCAT daemon (xcatd). -B +B: + +=over 4 + +It will perform the xcatd I. The xcatd I is a specific restart which has two advantages compares to the I and then I. =over 2 -It will perform the xcatd I. The xcatd I is a specific restart which has two advantages compares to the I and then I. - 1. The interval of xcatd out of service is very short. - 2. The in processing request which initiated by old xcatd will not be stopped by force. The old xcatd will hand over the sockets to new xcatd, but old xcat will still be waiting for the in processing request to finish before the exit. +=item 1. The interval of xcatd out of service is very short. -It does the same thing as 'service xcatd restart' on NON-systemd enabled Operating System like rh6.x and sles11.x. But for the systemd enabled Operating System like rh7 and sles12, the 'service xcatd restart' just do the I and I instead of xcatd I. - -It's recommended to use B command to restart xcatd on systemd enable system like rh7 and sles12 instead of 'service xcatd restart' or 'systemctl restart xcatd'. +=item 2. The in processing request which initiated by old xcatd will not be stopped by force. The old xcatd will hand over the sockets to new xcatd, but old xcat will still be waiting for the in processing request to finish before the exit. =back -B +It does the same thing as B on NON-systemd enabled Operating System like rh6.x and sles11.x. But for the systemd enabled Operating System like rh7 and sles12, the B will just do the I and I instead of xcatd I. -=over 2 +It's recommended to use B command to restart xcatd on systemd enabled system like rh7 and sles12 instead of B or B. -It runs 'stopsrc -s xcatd' to stop xcatd first if xcatd is active, then runs 'startsrc -s xcatd' to start xcatd. +=back + +B: + +=over 4 + +It runs B to stop xcatd first if xcatd is active, then runs B to start xcatd. If the xcatd subsystem was not created, B will create it automatically. From a7e5b6de655ff8d51374366bfaf887003cd1e464 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 17 Sep 2018 10:54:25 -0400 Subject: [PATCH 193/276] This custom partition section is very confusing, attempt to clean up a bit... --- .../common/deployment/cfg_partition.rst | 47 ++++++++++++------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst index 1748b8675..d3eda191b 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst @@ -1,38 +1,48 @@ .. BEGIN_Overview -By default, xCAT will install the operating system on the first disk and with default partitions layout in the node. However, you may choose to customize the disk partitioning during the install process and define a specific disk layout. You can do this in one of two ways: '**partition definition file**' or '**partition definition script**'. +By default, xCAT will attempt to determine the first physical disk and use a generic default partition scheme for the operating system. You may require a more customized disk partitioning scheme and can accomplish this in one of the following methods: -.. note:: ``partition definition file`` can be used for RedHat, SLES, and Ubuntu. Because disk configuraiton for Ubuntu is different from RedHat, there may be some special sections required for Ubuntu. + * partition definition file + * partition definition script -.. warning:: ``partition definition script`` has only been tested on RedHat and Ubuntu, use at your own risk for SLES. +.. note:: **partition definition file** can be used for RedHat, SLES, and Ubuntu. However, disk configuration for Ubuntu is different from RedHat/SLES, there may be some special sections required for Ubuntu. + +.. warning:: **partition definition script** has only been verified on RedHat and Ubuntu, use at your own risk for SLES. .. END_Overview .. BEGIN_partition_definition_file_Overview -You could create a customized osimage partition file, say /install/custom/my-partitions, that contains the disk partitioning definition, then associate the partition file with osimage, the nodeset command will insert the contents of this file directly into the generated autoinst configuration file that will be used by the OS installer. +The following steps are required for this method: + + #. Create a partition file + #. Associate the partition file with an xCAT osimage + +The ``nodeset`` command will then insert the contents of this partition file into the generated autinst config file that will be used by the operation system installer. .. END_partition_definition_file_Overview .. BEGIN_partition_definition_file_content -The partition file must follow the partitioning syntax of the installer(e.g. kickstart for RedHat, AutoYaST for SLES, Preseed for Ubuntu). you could refer to the `Kickstart documentation `_ or `Autoyast documentation `_ or `Preseed documentation `_ write your own partitions layout. Meanwhile, RedHat and SuSE provides some tools that could help generate kickstart/autoyast templates, in which you could refer to the partition section for the partitions layout information: +The partition file must follow the partitioning syntax of the respective installer -* **[RedHat]** + * Redhat: `Kickstart documentation `_ - - The file /root/anaconda-ks.cfg is a sample kickstart file created by RedHat installer during the installation process based on the options that you selected. - - system-config-kickstart is a tool with graphical interface for creating kickstart files + * The file ``/root/anaconda-ks.cfg`` is a sample kickstart file created by RedHat installing during the installation process based on the options that you selected. + * system-config-kickstart is a tool with graphical interface for creating kickstart files -* **[SLES]** + * SLES: `Autoyast documentation `_ - - Use yast2 autoyast in GUI or CLI mode to customize the installation options and create autoyast file - - Use yast2 clone_system to create autoyast configuration file /root/autoinst.xml to clone an existing system + * Use yast2 autoyast in GUI or CLI mode to customize the installation options and create autoyast file + * Use yast2 clone_system to create autoyast configuration file /root/autoinst.xml to clone an existing system -* **[Ubuntu]** + * Ubuntu: `Preseed documentation `_ - - For detailed information see the files partman-auto-recipe.txt and partman-auto-raid-recipe.txt included in the debian-installer package. Both files are also available from the debian-installer source repository. Note that the supported functionality may change between releases. + * For detailed information see the files ``partman-auto-recipe.txt`` and ``partman-auto-raid-recipe.txt`` included in the debian-installer package. Both files are also available from the debian-installer source repository. + +.. note:: Supported functionality may change between releases of the Operating System, always refer to the latest documentation provided by the OS. .. END_partition_definition_file_content @@ -349,14 +359,17 @@ Here is partition definition file example for Ubuntu standard partition in x86_6 .. BEGIN_partition_definition_file_Associate_partition_file_with_osimage_common -Run the following commands to associate the partition with the osimage: :: +If your custom partition file is located at: ``/install/custom/my-partitions``, run the following command to associate the partition file with an osimage: :: chdef -t osimage partitionfile=/install/custom/my-partitions - nodeset osimage= -- For RedHat, when nodeset runs and generates the /install/autoinst file for a node, it will replace the #XCAT_PARTITION_START#...#XCAT_PARTITION_END# directives from your osimage template with the contents of your custom partitionfile. +To generate the configuration, run the ``nodeset`` command: :: -- For Ubuntu, when nodeset runs and generates the /install/autoinst file for a node, it will generate a script to write the partition configuration to /tmp/partitionfile, this script will replace the #XCA_PARTMAN_RECIPE_SCRIPT# directive in /install/autoinst/.pre. + nodeset osimage= + +.. note:: **RedHat:** Running ``nodeset`` will generate the ``/install/autoinst`` file for the node. It will replace the ``#XCAT_PARTITION_START#`` and ``#XCAT_PARTITION_END#`` directives with the contents of your custom partition file. + +.. note:: **Ubuntu:** Running ``nodeset`` will generate the ``/install/autoinst`` file for the node. It will write the partition file to ``/tmp/partitionfile`` and replace the ``#XCA_PARTMAN_RECIPE_SCRIPT#`` directive in ``/install/autoinst/.pre`` with the contents of your custom partition file. .. END_partition_definition_file_Associate_partition_file_with_osimage_common From 143092c8188e196d75ed1e79b5c146a7ce654215 Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 24 Jun 2019 14:58:51 -0400 Subject: [PATCH 194/276] use `ip addr` instead of `ifconfig` command --- xCAT-test/autotest/testcase/genesis/test.sh | 22 +++++---------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index 8c8a97acb..28d59879f 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -30,39 +30,27 @@ function check_destiny() { MASTERIP=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print $2}'`; MASTERNET=`ifconfig | awk "BEGIN{RS=\"\"}/\<$MASTERIP\>/{print \$1}"|head -n 1 | awk -F ' ' '{print $1}'|awk -F ":" '{print \$1}' 2>&1`; NET2=`netstat -i -a|grep -v Kernel|grep -v Iface |grep -v lo|grep -v $MASTERNET|head -n 1|awk '{print $1}'`; - NET2IP=""; echo "MASTERIP=$MASTERIP" echo "MASTERNET=$MASTERNET" echo "NET2=$NET2" - echo "NET2IP=$NET2IP" if [[ -z $NET2 ]];then echo "There is no second network, could not verify the test" return 1; else - NET2IPstring=`ifconfig $NET2 |grep inet|grep -v inet6`; - if [[ $? -eq 0 ]];then - echo "Something is set for $NET2IPstring ... using it." - NET2IP=`ifconfig $NET2 |grep inet|grep -v inet6|awk -F ' ' '{print $2}'|awk -F ":" '{print $2}'`; - if [[ -z $NET2IP ]];then - NET2IP=`ifconfig $NET2 |grep inet|grep -v inet6|awk -F ' ' '{print $2}'`; - fi - else - NET2IP=0.0.0.0; - fi - - # Seems like this NET2IP doesn't do anything with it, what happens if it's not in the 60 network - echo "The original NET2 IP is $NET2IP" - cmd="ifconfig $NET2 $MASTER_PRIVATE_IP netmask $MASTER_PRIVATE_NETMASK"; + echo "Add ip addr $MASTER_PRIVATE_IP/$MASTER_PRIVATE_NETMASK to $NET2" + cmd="ip addr add $MASTER_PRIVATE_IP/$MASTER_PRIVATE_NETMASK dev $NET2"; runcmd $cmd; + echo "Running makenetworks command" cmd="makenetworks"; runcmd $cmd; makehosts ${TESTNODE} grep ${TESTNODE} /etc/hosts cmd="nodeset ${TESTNODE} shell"; runcmd $cmd; - cmd="ifconfig $NET2 $NET2IP"; + echo "Delete ip addr $MASTER_PRIVATE_IP/$MASTER_PRIVATE_NETMASK from $NET2" + cmd="ip addr del $MASTER_PRIVATE_IP/$MASTER_PRIVATE_NETMASK dev $NET2"; runcmd $cmd; echo "Check if 'nodeset ${TESTNODE} shell' is added to ${SHELLFOLDER}/${TESTNODE}" echo "===============================================" From 810cd9d0c2e79e2e15dce191d0b5648e4c9f3527 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 24 Jun 2019 15:13:45 -0400 Subject: [PATCH 195/276] fix spelling issue for autoinst --- .../manage_clusters/common/deployment/cfg_partition.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst index d3eda191b..2381906a3 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst @@ -19,7 +19,7 @@ The following steps are required for this method: #. Create a partition file #. Associate the partition file with an xCAT osimage -The ``nodeset`` command will then insert the contents of this partition file into the generated autinst config file that will be used by the operation system installer. +The ``nodeset`` command will then insert the contents of this partition file into the generated autoinst config file that will be used by the operation system installer. .. END_partition_definition_file_Overview From 943b5d43ce7ca9f4d9d803612bb26b06b76e4f2e Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 24 Jun 2019 15:14:29 -0400 Subject: [PATCH 196/276] Formatting changes --- .../manage_clusters/common/deployment/cfg_partition.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst index 2381906a3..9f3ad3ec8 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst @@ -30,7 +30,7 @@ The partition file must follow the partitioning syntax of the respective install * Redhat: `Kickstart documentation `_ - * The file ``/root/anaconda-ks.cfg`` is a sample kickstart file created by RedHat installing during the installation process based on the options that you selected. + * The file ``/root/anaconda-ks.cfg`` is a sample kickstart file created by RedHat installing during the installation process based on the options that you selected. * system-config-kickstart is a tool with graphical interface for creating kickstart files * SLES: `Autoyast documentation `_ @@ -42,7 +42,7 @@ The partition file must follow the partitioning syntax of the respective install * For detailed information see the files ``partman-auto-recipe.txt`` and ``partman-auto-raid-recipe.txt`` included in the debian-installer package. Both files are also available from the debian-installer source repository. -.. note:: Supported functionality may change between releases of the Operating System, always refer to the latest documentation provided by the OS. +.. note:: Supported functionality may change between releases of the Operating System, always refer to the latest documentation provided by the operating system. .. END_partition_definition_file_content From 953c6cf7bdd88aaa49ce9a2ebe9ae7d9f2c8ae38 Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 24 Jun 2019 16:42:04 -0400 Subject: [PATCH 197/276] remove echo message to avoid duplicate. --- xCAT-test/autotest/testcase/genesis/test.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index 28d59879f..83378c407 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -39,17 +39,14 @@ function check_destiny() { echo "There is no second network, could not verify the test" return 1; else - echo "Add ip addr $MASTER_PRIVATE_IP/$MASTER_PRIVATE_NETMASK to $NET2" cmd="ip addr add $MASTER_PRIVATE_IP/$MASTER_PRIVATE_NETMASK dev $NET2"; runcmd $cmd; - echo "Running makenetworks command" cmd="makenetworks"; runcmd $cmd; makehosts ${TESTNODE} grep ${TESTNODE} /etc/hosts cmd="nodeset ${TESTNODE} shell"; runcmd $cmd; - echo "Delete ip addr $MASTER_PRIVATE_IP/$MASTER_PRIVATE_NETMASK from $NET2" cmd="ip addr del $MASTER_PRIVATE_IP/$MASTER_PRIVATE_NETMASK dev $NET2"; runcmd $cmd; echo "Check if 'nodeset ${TESTNODE} shell' is added to ${SHELLFOLDER}/${TESTNODE}" From 66b85b695031e97a868c62693bf96f8f37cd2d84 Mon Sep 17 00:00:00 2001 From: cxhong Date: Tue, 25 Jun 2019 10:10:16 -0400 Subject: [PATCH 198/276] Get input from command line for `xdsh -c` command --- xCAT-test/autotest/testcase/xdsh/cases0 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/xdsh/cases0 b/xCAT-test/autotest/testcase/xdsh/cases0 index 3166cbc8d..744385b1b 100644 --- a/xCAT-test/autotest/testcase/xdsh/cases0 +++ b/xCAT-test/autotest/testcase/xdsh/cases0 @@ -31,7 +31,7 @@ cmd:xdsh $$SN "ls -l /var/xcat/syncfiles" > /dev/null 2>&1; if [ "$?" -ne "0" ]; check:rc==0 cmd: xdsh $$SN "echo 'test' > /var/xcat/syncfiles/xdsh_c.tmp" check:rc==0 -cmd: xdsh $$SN -c +cmd: echo Y | xdsh $$SN -c 2>/dev/null check:rc==0 cmd:xdsh $$SN "ls -l /var/xcat/syncfiles" check:rc==0 @@ -44,7 +44,7 @@ cmd:xdsh $$CN "ls -l /var/xcat/node/syncfiles" > /dev/null 2>&1; if [ "$?" -ne " check:rc==0 cmd: xdsh $$CN "echo 'test' > /var/xcat/node/syncfiles/xdsh_c.tmp" check:rc==0 -cmd: xdsh $$CN -c +cmd: echo Y | xdsh $$CN -c 2>/dev/null check:rc==0 cmd:xdsh $$CN "ls -l /var/xcat/node" check:rc==0 From b0d21777e435bd3de8c88bdf9885669befc80db6 Mon Sep 17 00:00:00 2001 From: cxhong Date: Thu, 27 Jun 2019 16:24:40 -0400 Subject: [PATCH 199/276] fix weekly test cases failure --- xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl | 1 + xCAT-test/autotest/testcase/bmcdiscover/cases0 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl b/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl index f7cc1ecff..f3f8be272 100644 --- a/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl +++ b/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl @@ -112,6 +112,7 @@ onboot + true false diff --git a/xCAT-test/autotest/testcase/bmcdiscover/cases0 b/xCAT-test/autotest/testcase/bmcdiscover/cases0 index 5cc7fc0d7..169986750 100644 --- a/xCAT-test/autotest/testcase/bmcdiscover/cases0 +++ b/xCAT-test/autotest/testcase/bmcdiscover/cases0 @@ -73,7 +73,7 @@ label:others,discovery cmd:bmcdiscover --range $$bmcrange -u $$bmcusername -p $$bmcpasswd -w check:rc==0 check:output=~Writing node -check:output=~$$bmcrange,.+,.+,$$bmcusername,$$bmcpasswd +check:output=~$$bmcrange end From b3804d5997e92fb600851c99fcd336bb520be822 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 8 Jul 2019 14:18:44 -0400 Subject: [PATCH 200/276] Adding some notes to clarify based on some internal questions that have been raised on this workaround --- docs/source/references/coral/known_issues/genesis_base.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/references/coral/known_issues/genesis_base.rst b/docs/source/references/coral/known_issues/genesis_base.rst index 3df864a89..19cec3574 100644 --- a/docs/source/references/coral/known_issues/genesis_base.rst +++ b/docs/source/references/coral/known_issues/genesis_base.rst @@ -1,7 +1,7 @@ xCAT Genesis Base ================= -*Note*: Please rebuild ``xCAT-genesis-base`` with ``xCAT-genesis-builder`` version equal and newer than *2.13.10* before updating xCAT *2.13.10* and higher. +.. note:: Ensure that you rebuild ``xCAT-genesis-base`` with ``xCAT-genesis-builder`` version >= to *2.13.10* before updating xCAT to *2.13.10* or higher. xCAT ships a ``xCAT-genesis-base`` package as part of xcat-deps. This is a light-weight diskless linux image based on Fedora (Fedora26, currently) that is used by xCAT to do hardware discovery. @@ -10,6 +10,8 @@ To support the Power9 hardware, changes are made to the kernel in the Red Hat En Work-around ----------- +.. note:: The genesis-base must be compiled on the Power9 hardware. If the management node is not Power9 hardware, manually provision a compute node, build the genesis-base RPM, then install it on the management node. + xCAT cannot ship a kernel based on RHEL distribution, so the customer needs to build a version of the ``xCAT-genesis-base`` on-site using a server running Red Hat Enterprise Linux. 1. Download the latest timestamp version of the ``xCAT-genesis-builder`` RPM provided here: http://xcat.org/files/xcat/xcat-dep/2.x_Linux/beta/ From 954e60a6242f13cd841f9814ecf46510142ca92c Mon Sep 17 00:00:00 2001 From: cxhong Date: Tue, 9 Jul 2019 15:10:05 -0400 Subject: [PATCH 201/276] Add new Edgecore Mac address to switchinfo file --- perl-xCAT/xCAT/data/switchinfo.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/perl-xCAT/xCAT/data/switchinfo.pm b/perl-xCAT/xCAT/data/switchinfo.pm index 6fab0f150..7cf372ac9 100644 --- a/perl-xCAT/xCAT/data/switchinfo.pm +++ b/perl-xCAT/xCAT/data/switchinfo.pm @@ -22,6 +22,8 @@ our %global_mac_identity = ( "a8:2b:b5" => "Edgecore Networks Switch", "3c:2c:99" => "Edgecore Networks Switch", "70:72:cf" => "Edgecore Networks Switch", + "80:a2:35" => "Edgecore Networks Switch", + "b8:6a:97" => "Edgecore Networks Switch", "6c:64:1a" => "Penguin Computing switch" ); From 5839a9b7f4c1f79ea7c8750b91035797edd08ee4 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 15 Jul 2019 13:15:12 -0400 Subject: [PATCH 202/276] Simplify the text of the page --- docs/source/overview/xcat2_release.rst | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 158eda50c..a82bbe5b8 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -1,11 +1,7 @@ xCAT2 Release Information ========================= -The following table is a summary of the new operating system (OS), hardware, and features that are added to each xCAT release. The OS and hardware listed in the table have been fully tested with xCAT. For a more detailed list of new function, bug fixes, restrictions and known problems, refer to the individual release notes for a specific release. - -* **RHEL** - Red Hat Enterprise Linux -* **SLES** - Suse Linux Enterprise Server -* **UBT** - Ubuntu +The following tables documents the xCAT release versions and release dates. For a more detailed list of functions and fixes, refer to the release notes. xCAT 2.14.x ----------- From 641e9c4c8bec3a3a085f0b370917d5cff1ffb639 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 15 Jul 2019 13:19:06 -0400 Subject: [PATCH 203/276] Add release information for 2.14 --- docs/source/overview/_files/2.14.x.csv | 8 +++ docs/source/overview/xcat2_release.rst | 67 +++----------------------- 2 files changed, 14 insertions(+), 61 deletions(-) create mode 100644 docs/source/overview/_files/2.14.x.csv diff --git a/docs/source/overview/_files/2.14.x.csv b/docs/source/overview/_files/2.14.x.csv new file mode 100644 index 000000000..f9eb20dd2 --- /dev/null +++ b/docs/source/overview/_files/2.14.x.csv @@ -0,0 +1,8 @@ +Version,Release Date,Release Notes +2.14.6,2019-03-29,`2.14.6 Release Notes `_ +2.14.5,2018-12-07,`2.14.5 Release Notes `_ +2.14.4,2018-10-19,`2.14.4 Release Notes `_ +2.14.3,2018-08-24,`2.14.3 Release Notes `_ +2.14.2,2018-07-13,`2.14.2 Release Notes `_ +2.14.1,2018-06-01,`2.14.1 Release Notes `_ +2.14.0,2018-04-20,`2.14.0 Release Notes `_ diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index a82bbe5b8..5a37d133e 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -3,68 +3,13 @@ xCAT2 Release Information The following tables documents the xCAT release versions and release dates. For a more detailed list of functions and fixes, refer to the release notes. -xCAT 2.14.x ------------ +.. tabularcolumns:: |p{1cm}|p{7cm}|p{7cm} -+---------------------------------+---------------+-------------+----------------------------------+ -|xCAT |New OS |New |New Feature | -|Version | |Hardware | | -+=================================+===============+=============+==================================+ -|| xCAT 2.14.6 2019/03/29 | | | | -|| | | | | -| `2.14.6 Release Notes `_ | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.14.5 2018/12/07 |- RHEL7.6 | |- syslog tag refine | -|| | | | | -| `2.14.5 Release Notes `_ | | |- localdisk GPT partition support | -| | | | | -| | | |- goconserver v0.3.2 | -| | | | | -| | | |- xcat-inventory 0.1.6 | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.14.4 2018/10/19 |- UBT18.04.1 | | | -|| | | | | -| `2.14.4 Release Notes `_ | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.14.3 2018/8/24 |- SLES12.3 | |- OpenBMC rflash enhancement | -|| | | | | -| `2.14.3 Release Notes `_ | | |- goconserver v0.3.1 | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.14.2 2018/7/13 |- UBT 18.04 | | | -|| |- RHEL6.10 | | | -| `2.14.2 Release Notes `_ | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.14.1 |- RHV 4.2 + | |- OpenBMC in python enhancement: | -|| 2018/6/1 | RHEL7.5 + p8 | | | -|| | | | rinv enhance, issue #5176 | -| `2.14.1 Release Notes `_ | | | | -| | | |- Discover process enhancement | -| | | | | -| | | |- xcatprobe `xcatmn` enhancement | -| | | | | -| | | |- xcat-inventory enhancement(beta)| -| | | | | -| | | |- goconserver v0.2.2 | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.14 |- RHEL 7.5 | |- OpenBMC support in python: | -|| 2018/4/20 | | | | -|| | | | rspconfig,reventlog | -| `2.14 Release Notes `_ | | | | -+---------------------------------+---------------+-------------+----------------------------------+ +.. csv-table:: 2.14.x Release Information + :file: _files/2.14.x.csv + :header-rows: 1 + :class: longtable + :widths: 1 1 1 xCAT 2.13.x From 2f021c185e6c5a628229a6d4dee164f8104aabfc Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 15 Jul 2019 13:20:38 -0400 Subject: [PATCH 204/276] Improve the generic text about the release --- docs/source/overview/xcat2_release.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 5a37d133e..a82e1cdd5 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -1,7 +1,7 @@ xCAT2 Release Information ========================= -The following tables documents the xCAT release versions and release dates. For a more detailed list of functions and fixes, refer to the release notes. +The following tables documents the xCAT release versions and release dates. For more detailed information about new functions and bug fixes, refer to the specific release notes. .. tabularcolumns:: |p{1cm}|p{7cm}|p{7cm} From 52f753ed524ba9f2597a688b3e01c765b2335d6e Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 15 Jul 2019 13:23:19 -0400 Subject: [PATCH 205/276] Adding 2.15.x release information --- docs/source/overview/_files/2.15.x.csv | 2 ++ docs/source/overview/xcat2_release.rst | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 docs/source/overview/_files/2.15.x.csv diff --git a/docs/source/overview/_files/2.15.x.csv b/docs/source/overview/_files/2.15.x.csv new file mode 100644 index 000000000..5c9d94499 --- /dev/null +++ b/docs/source/overview/_files/2.15.x.csv @@ -0,0 +1,2 @@ +Version,Release Date,Release Notes +2.15.0,2019-07-31,`2.15.0 Release Notes `_ diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index a82e1cdd5..f94d0097c 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -3,8 +3,15 @@ xCAT2 Release Information The following tables documents the xCAT release versions and release dates. For more detailed information about new functions and bug fixes, refer to the specific release notes. + .. tabularcolumns:: |p{1cm}|p{7cm}|p{7cm} +.. csv-table:: 2.15.x Release Information + :file: _files/2.15.x.csv + :header-rows: 1 + :class: longtable + :widths: 1 1 1 + .. csv-table:: 2.14.x Release Information :file: _files/2.14.x.csv :header-rows: 1 From 1be499e6257aaba40e866497c39f8a7aa0205126 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 15 Jul 2019 13:31:10 -0400 Subject: [PATCH 206/276] Adding the 2.13.x release info to new format --- docs/source/overview/_files/2.13.x.csv | 13 ++ docs/source/overview/xcat2_release.rst | 178 +------------------------ 2 files changed, 19 insertions(+), 172 deletions(-) create mode 100644 docs/source/overview/_files/2.13.x.csv diff --git a/docs/source/overview/_files/2.13.x.csv b/docs/source/overview/_files/2.13.x.csv new file mode 100644 index 000000000..0802aa755 --- /dev/null +++ b/docs/source/overview/_files/2.13.x.csv @@ -0,0 +1,13 @@ +Version,Release Date,Release Notes +2.13.11,2018-03-09,`2.13.11 Release Notes `_ +2.13.10,2018-01-26,`2.13.10 Release Notes `_ +2.13.9,2017-12-18,`2.13.9 Release Notes `_ +2.13.8,2017-11-03,`2.13.8 Release Notes `_ +2.13.7,2017-09-22,`2.13.7 Release Notes `_ +2.13.6,2017-08-10,`2.13.6 Release Notes `_ +2.13.5,2017-06-30,`2.13.5 Release Notes `_ +2.13.4,2017-05-09,`2.13.4 Release Notes `_ +2.13.3,2017-04-14,`2.13.3 Release Notes `_ +2.13.2,2017-02-24,`2.13.2 Release Notes `_ +2.13.1,2017-01-13,`2.13.1 Release Notes `_ +2.13.0,2016-12-09,`2.13.0 Release Notes `_ diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index f94d0097c..44842d739 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -1,7 +1,7 @@ xCAT2 Release Information ========================= -The following tables documents the xCAT release versions and release dates. For more detailed information about new functions and bug fixes, refer to the specific release notes. +The following tables documents the xCAT release versions and release dates. For more detailed information about new functions, bug fixes, and download links, refer to the specific release notes. .. tabularcolumns:: |p{1cm}|p{7cm}|p{7cm} @@ -18,177 +18,11 @@ The following tables documents the xCAT release versions and release dates. For :class: longtable :widths: 1 1 1 - -xCAT 2.13.x ------------ - -+---------------------------------+---------------+-------------+----------------------------------+ -|xCAT |New OS |New |New Feature | -|Version | |Hardware | | -+=================================+===============+=============+==================================+ -|| xCAT 2.13.11 | | |- OpenBMC support in python: | -|| 2018/3/9 | | | | -|| | | | rpower,rbeacon,rsetboot | -| `2.13.11 Release Notes `_ | | |- goconserver enhancement | -| | | | | -| | | | makegocons -q, -C\|--cleanup | -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.10 | | |- OpenBMC support: | -|| 2018/1/26 | | | | -|| | | | rspconfig powersupplyredundancy,| -| `2.13.10 Release Notes `_ | | | | -| | | |- goconserver enhancement | -| | | | | -| | | | run goconserver on SN | -| | | | | -| | | | redirect console log | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.9 | | |- OpenBMC support: | -|| 2017/12/18 | | | | -|| | | | rflash -a/-u enhancement, add -d| -| `2.13.9 Release Notes `_ | | | | -| | | | rspconfig dump,hostname, | -| | | | ntpserver,admin_passwd | -| | | | | -| | | |- goconserver for OpenBMC | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.8 | | |- OpenBMC support: | -|| 2017/11/3 | | | | -|| | | | rflash/rpower run parallelly | -| `2.13.8 Release Notes `_ | | | | -| | | |- The document of MN HA | -| | | | | -| | | |- nodeset enhancement for | -| | | | multi-nodes | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.7 | | |- OpenBMC support: | -|| 2017/9/22 | | | | -|| | | | rflash for OpenBMC and Host | -| `2.13.7 Release Notes `_ | | | | -| | | |- xcatprobe clusterstatus | -| | | | enhancement | -| | | | | -| | | |- PDU support: discover, config | -| | | | | -| | | |- SRIOV support for VMs | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.6 |- RHEL 7.4 |- Boston |- OpenBMC support | -|| 2017/8/10 | | server | | -|| | | | rsetboot net/hd/def | -| `2.13.6 Release Notes `_ | | | /delete/check | -| | | | | -| | | | rspconfig retrieve OpenBMC ip/ | -| | | | netmask/gateway information | -| | | |- nodeset performance enhancement | -| | | | (Phase 3) | -| | | | | -| | | | Dispatch request to the | -| | | | specified service nodes with | -| | | | 'disjointdhcps' | -| | | | | -| | | | Enhance the output of nodeset | -| | | | in hierarchical cluster | -| | | | | -| | | |- network configuration interface:| -| | | | | -| | | | confignetwork is the only | -| | | | interface to configure network | -| | | | on SN/CN | -| | | | | -| | | |- For hardware discovery | -| | | | | -| | | | enhance bmcdiscover to use BMC | -| | | | MAC address to identify BMC with| -| | | | its host | -| | | | | -| | | | enhance "xcatprobe discovery" | -| | | | tool to do configuration check | -| | | | before starting hardware | -| | | | discovery | -| | | | | -| | | |- [xcat-deps] xcat-genesis-base | -| | | | package based on Fedora 26 ppc64| -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.5 | | |- OpenBMC support | -|| 2017/6/30 | | | | -|| | | | rinv | -| `2.13.5 Release Notes `_ | | |- Enhancements to self testing | -| | | | tool xcat-test | -| | | |- Service node pool support for | -| | | | rhels7 ppc64le diskless | -| | | |- Mellanox cumulus switch ZTP | -| | | | based discovery and | -| | | | auto-configuration | -| | | |- Performance enhancements | -| | | | | -| | | | makedhcp, makedns | -| | | | nodeset | -| | | |- [xcat-deps] ipmitool-xcat | -| | | | package updated to version | -| | | | 1.8.18 for | -| | | | | -| | | | RHEL7.x | -| | | | SLES12.x | -| | | | Ubuntu14.04.x | -| | | |- [xcat-deps] conserver-xcat | -| | | | package updated to version 8.2.1| -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.4 |- RHV 4.1 | |- OpenBMC support(experimental): | -|| 2017/5/19 | | | | -|| | | | rinv | -| `2.13.4 Release Notes `_ | | | | -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.3 |- RHEL 6.9 | |- OpenBMC support(experimental): | -|| 2017/4/14 | | | | -|| | | | rpower rcons | -| `2.13.3 Release Notes `_ | | | | -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.2 | | |- Refine ONIE switch support doc | -|| 2017/2/24 | | |- Add -p for xcatprobe osdeploy | -|| | | | to support performance calculate| -| `2.13.2 Release Notes `_ | | | | -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.1 | | |- ONIE switch support | -|| 2017/1/13 | | |- refine xcatprobe subcommand: | -|| | | | xcatmn, osdeploy | -| `2.13.1 Release Notes `_ | | | | -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13 |- SLES 12.2 | |- update drivers for genesis-base | -|| 2016/12/09 | | | mlx4-en 3.2-1.0.1.1 | -|| | | | i40e 1.5.16 | -| `2.13 Release Notes `_ | | |- statelite image create by copyds| -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ +.. csv-table:: 2.13.x Release Information + :file: _files/2.13.x.csv + :header-rows: 1 + :class: longtable + :widths: 1 1 1 xCAT 2.12.x ----------- From ff46c8dfcef14e33d8be207ac4fb0ef4b7730586 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 15 Jul 2019 13:32:36 -0400 Subject: [PATCH 207/276] reword the overview again --- docs/source/overview/xcat2_release.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 44842d739..34fca4b4b 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -1,7 +1,7 @@ xCAT2 Release Information ========================= -The following tables documents the xCAT release versions and release dates. For more detailed information about new functions, bug fixes, and download links, refer to the specific release notes. +The following tables documents the xCAT release versions and release dates. For more detailed information regarding new functions, supported OSs, bug fixes, and download links, refer to the specific release notes. .. tabularcolumns:: |p{1cm}|p{7cm}|p{7cm} From 6667145077c117228443898e1c444ca7b662c7da Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 15 Jul 2019 13:44:49 -0400 Subject: [PATCH 208/276] Add in the release info for 2.12, created column for OS --- docs/source/overview/_files/2.12.x.csv | 6 ++++++ docs/source/overview/xcat2_release.rst | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 docs/source/overview/_files/2.12.x.csv diff --git a/docs/source/overview/_files/2.12.x.csv b/docs/source/overview/_files/2.12.x.csv new file mode 100644 index 000000000..a99469877 --- /dev/null +++ b/docs/source/overview/_files/2.12.x.csv @@ -0,0 +1,6 @@ +Version,Release Date,New OS,Release Notes +2.12.4,2016-11-11,"RHEL 7.3 LE, RHEV 4.0",`2.12.4 Release Notes `_ +2.12.3,2016-09-30,,`2.12.3 Release Notes `_ +2.12.2,2016-08-19,Ubuntu 16.04.1,`2.12.2 Release Notes `_ +2.12.1,2016-07-08,,`2.12.1 Release Notes `_ +2.12.0,2016-05-20,"RHEL 6.8, Ubuntu 14.4.4 LE, Ubuntu 16.04",`2.12.0 Release Notes `_ diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 34fca4b4b..50a1fce5d 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -4,7 +4,7 @@ xCAT2 Release Information The following tables documents the xCAT release versions and release dates. For more detailed information regarding new functions, supported OSs, bug fixes, and download links, refer to the specific release notes. -.. tabularcolumns:: |p{1cm}|p{7cm}|p{7cm} +.. tabularcolumns:: |p{1cm}|p{4cm}|p{7cm}|p{7cm} .. csv-table:: 2.15.x Release Information :file: _files/2.15.x.csv @@ -24,6 +24,12 @@ The following tables documents the xCAT release versions and release dates. For :class: longtable :widths: 1 1 1 +.. csv-table:: 2.12.x Release Information + :file: _files/2.12.x.csv + :header-rows: 1 + :class: longtable + :widths: 1 1 1 1 + xCAT 2.12.x ----------- From 574e420b4b36d66ff95f07d1f8e822f460393bf3 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 15 Jul 2019 13:50:53 -0400 Subject: [PATCH 209/276] Add the supported OS information into the tables --- docs/source/overview/_files/2.12.x.csv | 2 +- docs/source/overview/_files/2.13.x.csv | 26 +++++++++++++------------- docs/source/overview/_files/2.14.x.csv | 16 ++++++++-------- docs/source/overview/_files/2.15.x.csv | 4 ++-- docs/source/overview/xcat2_release.rst | 6 +++--- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/source/overview/_files/2.12.x.csv b/docs/source/overview/_files/2.12.x.csv index a99469877..5974c01cc 100644 --- a/docs/source/overview/_files/2.12.x.csv +++ b/docs/source/overview/_files/2.12.x.csv @@ -1,4 +1,4 @@ -Version,Release Date,New OS,Release Notes +Version,Release Date,New OS Supported,Release Notes 2.12.4,2016-11-11,"RHEL 7.3 LE, RHEV 4.0",`2.12.4 Release Notes `_ 2.12.3,2016-09-30,,`2.12.3 Release Notes `_ 2.12.2,2016-08-19,Ubuntu 16.04.1,`2.12.2 Release Notes `_ diff --git a/docs/source/overview/_files/2.13.x.csv b/docs/source/overview/_files/2.13.x.csv index 0802aa755..677c15905 100644 --- a/docs/source/overview/_files/2.13.x.csv +++ b/docs/source/overview/_files/2.13.x.csv @@ -1,13 +1,13 @@ -Version,Release Date,Release Notes -2.13.11,2018-03-09,`2.13.11 Release Notes `_ -2.13.10,2018-01-26,`2.13.10 Release Notes `_ -2.13.9,2017-12-18,`2.13.9 Release Notes `_ -2.13.8,2017-11-03,`2.13.8 Release Notes `_ -2.13.7,2017-09-22,`2.13.7 Release Notes `_ -2.13.6,2017-08-10,`2.13.6 Release Notes `_ -2.13.5,2017-06-30,`2.13.5 Release Notes `_ -2.13.4,2017-05-09,`2.13.4 Release Notes `_ -2.13.3,2017-04-14,`2.13.3 Release Notes `_ -2.13.2,2017-02-24,`2.13.2 Release Notes `_ -2.13.1,2017-01-13,`2.13.1 Release Notes `_ -2.13.0,2016-12-09,`2.13.0 Release Notes `_ +Version,Release Date,New OS Supported,Release Notes +2.13.11,2018-03-09,,`2.13.11 Release Notes `_ +2.13.10,2018-01-26,,`2.13.10 Release Notes `_ +2.13.9,2017-12-18,,`2.13.9 Release Notes `_ +2.13.8,2017-11-03,,`2.13.8 Release Notes `_ +2.13.7,2017-09-22,,`2.13.7 Release Notes `_ +2.13.6,2017-08-10,"RHEL 7.4",`2.13.6 Release Notes `_ +2.13.5,2017-06-30,,`2.13.5 Release Notes `_ +2.13.4,2017-05-09,"RHV 4.1",`2.13.4 Release Notes `_ +2.13.3,2017-04-14,"RHEL 6.9",`2.13.3 Release Notes `_ +2.13.2,2017-02-24,,`2.13.2 Release Notes `_ +2.13.1,2017-01-13,,`2.13.1 Release Notes `_ +2.13.0,2016-12-09,"SLES 12.2",`2.13.0 Release Notes `_ diff --git a/docs/source/overview/_files/2.14.x.csv b/docs/source/overview/_files/2.14.x.csv index f9eb20dd2..3e338e359 100644 --- a/docs/source/overview/_files/2.14.x.csv +++ b/docs/source/overview/_files/2.14.x.csv @@ -1,8 +1,8 @@ -Version,Release Date,Release Notes -2.14.6,2019-03-29,`2.14.6 Release Notes `_ -2.14.5,2018-12-07,`2.14.5 Release Notes `_ -2.14.4,2018-10-19,`2.14.4 Release Notes `_ -2.14.3,2018-08-24,`2.14.3 Release Notes `_ -2.14.2,2018-07-13,`2.14.2 Release Notes `_ -2.14.1,2018-06-01,`2.14.1 Release Notes `_ -2.14.0,2018-04-20,`2.14.0 Release Notes `_ +Version,Release Date,New OS Supported,Release Notes +2.14.6,2019-03-29,,`2.14.6 Release Notes `_ +2.14.5,2018-12-07,"RHEL 7.6",`2.14.5 Release Notes `_ +2.14.4,2018-10-19,"Ubuntu 18.04.1",`2.14.4 Release Notes `_ +2.14.3,2018-08-24,"SLES 12.3",`2.14.3 Release Notes `_ +2.14.2,2018-07-13,"RHEL 6.10, Ubuntu 18.04",`2.14.2 Release Notes `_ +2.14.1,2018-06-01,"RHV 4.2, RHEL 7.5 (Power8)",`2.14.1 Release Notes `_ +2.14.0,2018-04-20,"RHEL 7.5",`2.14.0 Release Notes `_ diff --git a/docs/source/overview/_files/2.15.x.csv b/docs/source/overview/_files/2.15.x.csv index 5c9d94499..a2b0eba0f 100644 --- a/docs/source/overview/_files/2.15.x.csv +++ b/docs/source/overview/_files/2.15.x.csv @@ -1,2 +1,2 @@ -Version,Release Date,Release Notes -2.15.0,2019-07-31,`2.15.0 Release Notes `_ +Version,Release Date,New OS Supported,Release Notes +2.15.0,2019-07-31,,`2.15.0 Release Notes `_ diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 50a1fce5d..d39fb2a3d 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -10,19 +10,19 @@ The following tables documents the xCAT release versions and release dates. For :file: _files/2.15.x.csv :header-rows: 1 :class: longtable - :widths: 1 1 1 + :widths: 1 1 1 1 .. csv-table:: 2.14.x Release Information :file: _files/2.14.x.csv :header-rows: 1 :class: longtable - :widths: 1 1 1 + :widths: 1 1 1 1 .. csv-table:: 2.13.x Release Information :file: _files/2.13.x.csv :header-rows: 1 :class: longtable - :widths: 1 1 1 + :widths: 1 1 1 1 .. csv-table:: 2.12.x Release Information :file: _files/2.12.x.csv From dd127202dccf7d854f5bf7a479bf25cca82d3e09 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 15 Jul 2019 13:51:19 -0400 Subject: [PATCH 210/276] Remove the 2.12 old table from the release info page --- docs/source/overview/xcat2_release.rst | 50 -------------------------- 1 file changed, 50 deletions(-) diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index d39fb2a3d..10ef219f9 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -30,56 +30,6 @@ The following tables documents the xCAT release versions and release dates. For :class: longtable :widths: 1 1 1 1 -xCAT 2.12.x ------------ - -+---------------------------------+---------------+-------------+----------------------------------+ -|xCAT |New OS |New |New Feature | -|Version | |Hardware | | -+=================================+===============+=============+==================================+ -|| xCAT 2.12.4 |- RHEL 7.3 LE | |- `noboot` added to dhcpinterface | -|| 2016/11/11 |- RHEV 4.0 | |- new xcatprobe subcommand: | -|| | | | xcatmn, deploy and discover | -| `2.12.4 Release Notes `_ | | | | -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.12.3 | | |- GitHub Issues resolved | -|| 2016/09/30 | | |- rinv options for OpenPOWER | -|| | | |- switch based switch discovery | -| `2.12.3 Release Notes `_ | | |- mkdef takes file redirection | -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.12.2 |- UBT 16.04.1 | |- nodeset offline | -|| 2016/08/19 | | |- Enhance: node status update | -|| | | |- Support Bond for install nics | -| `2.12.2 Release Notes `_ | | | | -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.12.1 | | |- New xCAT install tool: go-xcat | -|| 2016/07/08 | | |- New opt: mkdef/lsdef --template | -|| | | |- Support rinstall for all OS/ARCH| -| `2.12.1 Release Notes `_ | | |- rscan | -| | | |- New: xcatprobe (experimental) | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.12 |- RHEL 6.8 | |- Docker: xCAT in Docker | -|| 2016/5/20 |- UBT 14.4.4 LE| |- Docker: container life cycle mgt| -|| |- UBT 16.04 | |- Docker: Set up Docker Registry | -| `2.12 Release Notes `_ | | |- Add site.xcatdebugmode | -| | | |- Add switchdiscover -s snmp | -| | | |- Disable auditlog by default | -| | | |- Add site.hierarchicalattrs | -+---------------------------------+---------------+-------------+----------------------------------+ - xCAT 2.11.x ----------- From 1d37138ee72956a9ddba5df92d16cdfbd61d0cf7 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 15 Jul 2019 14:10:25 -0400 Subject: [PATCH 211/276] Adding the sidebard headings --- docs/source/overview/xcat2_release.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 10ef219f9..5857e17ce 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -6,24 +6,36 @@ The following tables documents the xCAT release versions and release dates. For .. tabularcolumns:: |p{1cm}|p{4cm}|p{7cm}|p{7cm} +xCAT 2.15.x +----------- + .. csv-table:: 2.15.x Release Information :file: _files/2.15.x.csv :header-rows: 1 :class: longtable :widths: 1 1 1 1 +xCAT 2.14.x +----------- + .. csv-table:: 2.14.x Release Information :file: _files/2.14.x.csv :header-rows: 1 :class: longtable :widths: 1 1 1 1 +xCAT 2.13.x +----------- + .. csv-table:: 2.13.x Release Information :file: _files/2.13.x.csv :header-rows: 1 :class: longtable :widths: 1 1 1 1 +xCAT 2.12.x +----------- + .. csv-table:: 2.12.x Release Information :file: _files/2.12.x.csv :header-rows: 1 From 58c68c9b28a659238934b07337cb27b51358596d Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 15 Jul 2019 14:14:51 -0400 Subject: [PATCH 212/276] This file should be updated to the next release --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 6891ac194..715fa4035 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -59,7 +59,7 @@ author = u'IBM Corporation' # The short X.Y version. version = '2' # The full version, including alpha/beta/rc tags. -release = '2.14.6' +release = '2.15.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From bd0ad1ba43e71278addc0374aba8c4055e3bacfa Mon Sep 17 00:00:00 2001 From: Pythagoras Watson Date: Tue, 16 Jul 2019 10:06:58 -0700 Subject: [PATCH 213/276] Reduce maximum socket buffer size so select works The maximum socket receive buffer size (SO_RCVBUF) is set from the value in /proc/sys/net/core/rmem_max. When this value is close to INT_MAX, the select() system call used by IO::Select->can_read() never returns true. This causes packets to never be read. Therefore, reduce the maximum socket receive buffer size to a value which works. --- perl-xCAT/xCAT/SLP.pm | 5 +++++ xCAT-server/lib/perl/xCAT/IPMI.pm | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/perl-xCAT/xCAT/SLP.pm b/perl-xCAT/xCAT/SLP.pm index 446844071..698bc571c 100755 --- a/perl-xCAT/xCAT/SLP.pm +++ b/perl-xCAT/xCAT/SLP.pm @@ -64,6 +64,11 @@ sub dodiscover { my $sysctl; open($sysctl, "<", "/proc/sys/net/core/rmem_max"); my $maxrcvbuf = <$sysctl>; + # select() on a socket will never succeed if the buffer is too large (i.e. near INT_MAX) + my $cap_maxrcvbuf = 2047*1024*1024; + if ($maxrcvbuf > $cap_maxrcvbuf) { + $maxrcvbuf = $cap_maxrcvbuf; + } my $rcvbuf = $args{'socket'}->sockopt(SO_RCVBUF); if ($maxrcvbuf > $rcvbuf) { $args{'socket'}->sockopt(SO_RCVBUF, $maxrcvbuf / 2); diff --git a/xCAT-server/lib/perl/xCAT/IPMI.pm b/xCAT-server/lib/perl/xCAT/IPMI.pm index 95491cf00..76810de40 100644 --- a/xCAT-server/lib/perl/xCAT/IPMI.pm +++ b/xCAT-server/lib/perl/xCAT/IPMI.pm @@ -209,6 +209,11 @@ sub new { my $sysctl; open($sysctl, "<", "/proc/sys/net/core/rmem_max"); my $maxrcvbuf = <$sysctl>; + # select() on a socket will never succeed if the buffer is too large (i.e. near INT_MAX) + my $cap_maxrcvbuf = 2047*1024*1024; + if ($maxrcvbuf > $cap_maxrcvbuf) { + $maxrcvbuf = $cap_maxrcvbuf; + } my $rcvbuf = $socket->sockopt(SO_RCVBUF); if ($maxrcvbuf > $rcvbuf) { $socket->sockopt(SO_RCVBUF, $maxrcvbuf / 2); From ac3ae5630fd89633599e4664f4b2f4c327e91e97 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 22 Jul 2019 13:46:45 -0400 Subject: [PATCH 214/276] Remove kit links --- xCAT-client/debian/xcat-client.links | 8 -------- xCAT-client/xCAT-client.spec | 8 -------- 2 files changed, 16 deletions(-) diff --git a/xCAT-client/debian/xcat-client.links b/xCAT-client/debian/xcat-client.links index 0bf090cd8..cc310d33f 100644 --- a/xCAT-client/debian/xcat-client.links +++ b/xCAT-client/debian/xcat-client.links @@ -92,14 +92,6 @@ opt/xcat/bin/xcatclient opt/xcat/bin/lshwconn opt/xcat/bin/xcatclientnnr opt/xcat/sbin/makeroutes opt/xcat/bin/xcatclientnnr opt/xcat/sbin/snmove opt/xcat/bin/xcatclientnnr opt/xcat/bin/lsxcatd -opt/xcat/bin/xcatclientnnr opt/xcat/bin/lskit -opt/xcat/bin/xcatclientnnr opt/xcat/bin/addkit -opt/xcat/bin/xcatclientnnr opt/xcat/bin/rmkit -opt/xcat/bin/xcatclientnnr opt/xcat/bin/lskitcomp -opt/xcat/bin/xcatclientnnr opt/xcat/bin/addkitcomp -opt/xcat/bin/xcatclientnnr opt/xcat/bin/rmkitcomp -opt/xcat/bin/xcatclientnnr opt/xcat/bin/chkkitcomp -opt/xcat/bin/xcatclientnnr opt/xcat/bin/lskitdeployparam opt/xcat/bin/xcatclient opt/xcat/bin/postage opt/xcat/bin/xcatclient opt/xcat/bin/cfghost opt/xcat/bin/xcatclientnnr opt/xcat/bin/cfgve diff --git a/xCAT-client/xCAT-client.spec b/xCAT-client/xCAT-client.spec index 5b44dabcf..69b2c34d1 100644 --- a/xCAT-client/xCAT-client.spec +++ b/xCAT-client/xCAT-client.spec @@ -249,14 +249,6 @@ ln -sf ../bin/xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/cfghost ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/cfgve ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/lsve ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/rmosdistro -ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/lskit -ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/addkit -ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/rmkit -ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/lskitcomp -ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/addkitcomp -ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/rmkitcomp -ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/chkkitcomp -ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/lskitdeployparam ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/lskmodules ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/nodeimport ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/nodediscoverstart From 6e168ebe71481711085bbfa72bc882f6fc4ae9f8 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 22 Jul 2019 15:30:52 -0400 Subject: [PATCH 215/276] Remove buildkit file --- xCAT-buildkit/bin/buildkit | 4142 ------------------------------ xCAT-buildkit/xCAT-buildkit.spec | 14 - 2 files changed, 4156 deletions(-) delete mode 100755 xCAT-buildkit/bin/buildkit diff --git a/xCAT-buildkit/bin/buildkit b/xCAT-buildkit/bin/buildkit deleted file mode 100755 index eb119cde1..000000000 --- a/xCAT-buildkit/bin/buildkit +++ /dev/null @@ -1,4142 +0,0 @@ -#!/usr/bin/env perl -# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html -# - -#----------------------------------------------------------------------------- - -=head1 buildkit - - xCAT/PCM Kit Build utilities - -This script is designed to run on a non-xCAT system so that Kits can be -built on any product build machine. - -=cut - -BEGIN -{ - $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; - $::XCATDIR = $ENV{'XCATDIR'} ? $ENV{'XCATDIR'} : '/etc/xcat'; - $::XCATSHARE = $::XCATROOT . '/share/xcat'; -} - -if ($^O =~ /^aix/i) { - print "ERROR - the buildkit command is not supported on AIX \n"; - exit 1; -} - -use lib "$::XCATROOT/lib/perl"; -require xCAT::BuildKitUtils; -use Getopt::Long; -use strict; -use Cwd; -use Cwd 'abs_path'; -use File::Path; -use File::Basename; - -#----------------------------------------------------------------------------- -# Main - -$::progname = "buildkit"; -$::buildkit_conf = "buildkit.conf"; -$::kit_conf = "kit.conf"; -$::current_dir = cwd(); - -# this code will build a kit using framework 1. -$::KITFRAMEWORK = "2"; - -# this code is compatible with other kits that are at framework 0 or 1. -$::COMPATIBLE_KITFRAMEWORKS = "0,1,2"; - -%::buildkit_def = ( - kit => { basename => { - description => 'The kit base name (e.g., kit-lsf)', - value_desc => 'Must be: Generic Name String', - mandatory => 1, - cp_to_kitconfig => 1 }, - description => { - description => 'The kit description', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 1 }, - version => { - description => 'The kit version (e.g., 9.0)', - value_desc => 'Must be: Generic Name String', - mandatory => 1, - cp_to_kitconfig => 1 }, - release => { - description => 'The kit release (e.g., 1)', - value_desc => 'Must be: Generic Name String', - mandatory => 0, - cp_to_kitconfig => 1 }, - ostype => { - description => 'The kit OS type (e.g., Linux)', - value_desc => 'Must be: OS Type String', - mandatory => 1, - cp_to_kitconfig => 1 }, - osbasename => { - description => 'The kit OS basename', - value_desc => 'Must be: Generic Name String', - mandatory => 0, - cp_to_kitconfig => 0 }, - osmajorversion => { - description => 'The kit OS majorversion', - value_desc => 'Must be: Generic Name String', - mandatory => 0, - cp_to_kitconfig => 0 }, - osminorversion => { - description => 'The kit OS minorversion', - value_desc => 'Must be: Generic Name String', - mandatory => 0, - cp_to_kitconfig => 0 }, - osarch => { - description => 'The kit OS architecture', - value_desc => 'Must be: Generic Name String', - mandatory => 0, - cp_to_kitconfig => 0 }, - isinternal => { - description => 'Flag to say if this Kit is used for internal use only. It is only used for information purposes.', - value_desc => 'Must be: empty string or boolean string', - mandatory => 0, - cp_to_kitconfig => 1 }, - kitdeployparams => { - description => 'The path to the Kit Deployment Parameters file.', - value_desc => 'Must be: empty string or relative path string', - mandatory => 0, - base_dir => 'other_files', - cp_to_kitconfig => 2 }, # 2 = rename with KIT_KITNAME_ on cp - kitlicense => { - description => 'The Kit license string to be built into all kitcomponent packages.', - value_desc => 'any string', - mandatory => 1, - cp_to_kitconfig => 0 }, - kittarfilename => { - description => 'The filename to use for the generated kit.', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 }, - vendor => { - description => 'The Vendor value to use when building the rpms.', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 }, - packager => { - description => 'The Packager value to use when building the rpms.', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 }, - url => { - description => 'The URL value to use when building the rpms.', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 } }, - kitrepo => { kitrepoid => { - description => 'The Kit Package Repository ID. (e.g., rhels-6.2-x86_64)', - value_desc => 'Must be: Generic Name String, unique in kit', - mandatory => 1, - cp_to_kitconfig => 0 }, - osbasename => { - description => 'The OS distro base name (e.g., rhels)', - value_desc => 'Must be OS Name String', - mandatory => 1, - cp_to_kitconfig => 1 }, - osmajorversion => { - description => 'The OS distro major version (e.g., 6)', - value_desc => 'Must be Generic Number String', - mandatory => 1, - cp_to_kitconfig => 1 }, - osminorversion => { - description => 'The OS distro minor version (e.g., 3)', - value_desc => 'Must be Generic Number String', - mandatory => 0, - cp_to_kitconfig => 1 }, - osarch => { - description => 'The OS distro architecture (e.g., x86_64)', - value_desc => 'Must be OS Arch String', - mandatory => 1, - cp_to_kitconfig => 1 }, - compat_osbasenames => { - description => 'Comma-separated list of compatible OS base names. ', - value_desc => 'Must be Empty String or list of OS Name Strings', - mandatory => 0, - cp_to_kitconfig => 1 } }, - kitcomponent => { basename => { - description => 'The component name. It is used as the meta-package name.', - value_desc => 'any string', - mandatory => 1, - cp_to_kitconfig => 1 }, - description => { - description => 'The component description. The description is added to the meta-package.', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 1 }, - version => { - description => 'The component version (e.g., 9.0). It is used as the meta-package version.', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 1 }, - release => { - description => 'The component release number (e.g., 1). It is used as the meta-package release number.', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 1 }, - serverroles => { - description => 'tbd', - value_desc => 'any string', - mandatory => 1, - cp_to_kitconfig => 1 }, - kitrepoid => { - description => 'tbd', - value_desc => 'any string', - mandatory => 1, - cp_to_kitconfig => 0 }, - kitcompdeps => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 1 }, - ospkgdeps => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 }, - kitpkgdeps => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 1 }, - non_native_pkgs => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 }, - driverpacks => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 1 }, - exlist => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - base_dir => 'other_files', - cp_to_kitconfig => 2 }, - preinstall => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 }, - postinstall => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 }, - preuninstall => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 }, - postuninstall => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 }, - preupgrade => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 }, - postupgrade => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 }, - postbootscripts => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - base_dir => 'scripts', - cp_to_kitconfig => 2 }, - genimage_postinstall => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - base_dir => 'scripts', - cp_to_kitconfig => 2 } }, - kitpackage => { filename => { - description => 'tbd', - value_desc => 'any string', - mandatory => 1, - cp_to_kitconfig => 0 }, - kitrepoid => { - description => 'tbd', - value_desc => 'any string', - mandatory => 1, - cp_to_kitconfig => 0 }, - rpm_spec => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 }, - rpm_srcdir => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 }, - rpm_srctarball => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 }, - rpm_srpm => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 }, - rpm_prebuiltdir => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 }, - isexternalpkg => { - description => 'tbd', - value_desc => 'any string', - mandatory => 0, - cp_to_kitconfig => 0 } } -); - - -my $args = join ' ', @ARGV; -$::command = "$0 $args"; -Getopt::Long::Configure("bundling"); -$Getopt::Long::ignorecase = 0; - -# parse the options -if ( - !GetOptions( - 'h|help' => \$::HELP, - 'v|version' => \$::VERSION, - 'V|verbose' => \$::VERBOSE, - 'n|noprerequisite' => \$::PREREQUISITE, - 'p|pkgdir=s' => \$::PKGDIR, - 'k|kitversion=s' => \$::KITVERSION, - 'r|kitrelease=s' => \$::KITRELEASE, - 'l|kitloc=s' => \$::KITLOC, - 'for=s' => \$::FOROSVERSARCH, - ) - ) -{ - &usage; - exit(1); -} - -# display the usage if -h or --help is specified -if ($::HELP) -{ - &usage; - exit(0); -} - -my $debianflag = 0; -my $dpkg_flag = '-uc -us'; -my $tempstring = xCAT::BuildKitUtils->osver(); -if ($tempstring =~ /debian/ || $tempstring =~ /ubuntu/) { - $debianflag = 1; -} - -# This is an undocumented flag to support our local build team -# to allow building Ubuntu kits on our RH build machines. -# It requires RH rpms such as dep, fakeroot, perl-File-DesktopEntry, -# perl-File-BaseDir, and html2text to be installed on the build server -# for this to work. To use this flag: -# buildkit --for ubuntu buildrepo -# buildkit --for ubuntu buildtar -if ($::FOROSVERSARCH) { - if ($::FOROSVERSARCH =~ /debian/ || $::FOROSVERSARCH =~ /ubuntu/) { - $debianflag = 1; - $dpkg_flag .= ' -A -d'; - } -} - -# display the version statement if -v or --version is specified -if ($::VERSION) -{ - my $versioncmd = "rpm -q --qf \"%{NAME}: %{VERSION}-%{RELEASE} \n\" xCAT-buildkit"; - my $message = "Error quering xCAT-buildkit rpm. Version info is not available. \n"; - if ($debianflag) { - - $versioncmd = "dpkg-query --show -f='\${binary:Package}: \${Version}\n' xcat-buildkit"; - $message = "Error quering xcat-buildkit package. Version info is not available. \n"; - } - if (system($versioncmd)) { - - # non-zero return from system call - print $message; - exit 1; - } - - # add framework info to output - print "\tkitframework = $::KITFRAMEWORK\n"; - print "\tcompatible_frameworks = $::COMPATIBLE_KITFRAMEWORKS\n"; - - exit 0; -} - -my $arg = shift(@ARGV); -if (!$arg) { - &usage; - exit(0); -} - -# set kit location -if ($::KITLOC) { - $::workdir = $::KITLOC; - $::current_dir = $::workdir; -} else { - $::workdir = $::current_dir; -} - -$::full_buildkit_conf = $::workdir . "/" . $::buildkit_conf; -$::build_dir = $::workdir . "/build"; -$::deploy_dir = $::build_dir; #kitname appended by validate_bldkitconf routine -$::base_repodir = $::build_dir . "/kit_repodir"; - -while ($arg) { - my $command = $arg; - $command =~ tr/A-Z/a-z/; # convert to lowercase - if ($command eq 'create') { - $::KIT_CREATE = shift(@ARGV); - if ($::KITLOC) { - $::workdir = dirname($::KITLOC); - $::current_dir = $::workdir; - } - if (!$::KIT_CREATE) { - print "The Kit basename was not specified for the buildkit create command.\n"; - &usage; - exit 1; - } - } elsif ($command eq 'chkconfig') { - $::KIT_CHKCONFIG = 1; - } elsif ($command eq 'buildrepo') { - $::KIT_BUILDREPO = shift(@ARGV); - if (!$::KIT_BUILDREPO) { - print "The Kit package repository name was not specified for buildkit buildrepo command.\n"; - &usage; - exit 1; - } - } elsif ($command eq 'listrepo') { - $::KIT_LISTREPO = 1; - } elsif ($command eq 'cleanrepo') { - $::KIT_CLEANREPO = shift(@ARGV); - if (!$::KIT_CLEANREPO) { - print "kit package repository name not specified for buildkit cleanrepo command \n"; - &usage; - exit 1; - } - } elsif ($command eq 'buildtar') { - $::KIT_BUILDTAR = 1; - } elsif ($command eq 'cleantar') { - $::KIT_CLEANTAR = 1; - } elsif ($command eq 'cleanall') { - $::KIT_CLEANALL = 1; - } elsif ($command eq 'addpkgs') { - $::KIT_ADDPKGS = shift(@ARGV); - if (!($::KIT_ADDPKGS)) { - print "Missing parameter: the name must be specified when using the \'buildkit addpkgs\' command.\n"; - &usage; - exit(1); - } - if (!($::PKGDIR)) { - print "Missing option: the -p option must be specified with \'buildkit addpkgs\' command. \n"; - &usage; - exit(1); - } - } else { - print "The buildkit command $arg is not recognized.\n"; - &usage; - exit(1); - } - $arg = shift(@ARGV); -} - -my $rc = 0; -if ($::KIT_CREATE) { - $rc = &kit_create; -} -if ($::KIT_CHKCONFIG) { - unless ($rc = &kit_chkconfig) { - print "No errors were found in Kit Build File $::full_buildkit_conf. \n"; - } -} -if ($::KIT_LISTREPO) { - unless ($rc = &kit_chkconfig) { $rc = &kit_listrepo; } -} -if ($::KIT_BUILDREPO) { - unless ($rc = &kit_chkconfig) { $rc = &kit_buildrepo; } -} -if ($::KIT_CLEANREPO) { - unless ($rc = &kit_chkconfig) { $rc = &kit_cleanrepo; } -} -if ($::KIT_BUILDTAR) { - unless ($rc = &kit_chkconfig) { $rc = &kit_buildtar; } -} -if ($::KIT_CLEANTAR) { - unless ($rc = &kit_chkconfig) { $rc = &kit_cleantar; } -} -if ($::KIT_CLEANALL) { - unless ($rc = &kit_chkconfig) { $rc = &kit_cleanall; } -} -if ($::KIT_ADDPKGS) { $rc = &kit_addpkgs; } - -exit $rc; - -##################################### -# subroutines -##################################### - -#----------------------------------------------------------------------------- - -=head3 usage - - Displays message for -h option - -=cut - -#----------------------------------------------------------------------------- -sub usage -{ - print "Usage: - buildkit [-?│-h│--help] [-v│--version] - - To build a new Kit - - buildkit [-V│--verbose] [] [│all] - [-l│--kitloc ] - - To add packages to an existing Kit. - - buildkit [-V│--verbose] addpkgs [-p│--pkgdir ] [-k│--kitversion ] [-r│--kitrelease ] - - This tool is used to build and manage a Kit package. - The options are: - -h - Provide usage info. - -k - Kit version. - -l - Location of kit files. (Including kit name.) - -p - RPM package directory locations. - -r - Kit release. - -v - Provide the version info. - command - Several commands are supported. See the list below. - -V - Verbose mode. Outputs additional debug messages. - - Supported subcommands: - create - creates a new Kit with the specified basename - chkconfig - checks the Kit build file - listrepo - lists the Kit package repositories in the Kit - build file, and their build status - buildrepo - builds the specified Kit package repository - buildrepo all - builds all the Kit package repositories - cleanrepo - deletes the build files for the specified Kit - package repository - cleanrepo all - deletes the build files for all Kit package - repositories - buildtar - builds the Kit tarfile - cleantar - deletes the Kit deployment directory and Kit - tarfile - cleanall - equivalent to buildkit cleanrepo all and - buildkit cleantar - addpkgs -p - - add product package rpms to a shipped tarfile - named kitname.NEEDS_PRODUCT_PKGS.tar.bz2 - \n"; -} - -#----------------------------------------------------------------------------- - -=head3 kit_create - - buildkit create - -=cut - -#----------------------------------------------------------------------------- - -sub kit_create - -{ - # create Kit directory in pwd - my $kitname = $::KIT_CREATE; - my $kitdir; - if ($::KITLOC) { - $kitdir = $::KITLOC; - } else { - $kitdir = $::workdir . "/$kitname"; - } - - if (-d $kitdir) { - print "Another directory already exists with the name $kitdir. Not able to create new Kit. \n"; - exit 1; - } - if (!mkdir($kitdir)) { - print "Error creating Kit directory $kitdir. Verify that the current user has privileges to create the directory. \n"; - exit 1; - } - - # Recursive copy the shipped template directory to the Kit directory - if (system("cp -fRp $::XCATSHARE/kits/kit_template/* $kitdir")) { - - # non-zero return from system call - print "Error copying sample Kit template files from $::XCAT_SHARE/kits/kit_template to $kitdir \n"; - exit 1; - } - - if (&edit_bldkitconf($kitdir . "/" . $::buildkit_conf, $kitname)) { - exit 1; - } - - print "Kit template for $kitname created in $kitdir directory \n"; - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 kit_chkconfig - - buildkit chkconfig - -=cut - -#----------------------------------------------------------------------------- - -sub kit_chkconfig - -{ - if ($::CHKCONFIG_DONE) { return 0; } - my $bldkitconf = $::full_buildkit_conf; - - my $chkrc = &load_bldkitconf($bldkitconf); - if ($chkrc != 0) { return 1; } - - $chkrc = &validate_bldkitconf(); - if ($chkrc != 0) { return 1; } - - $::CHKCONFIG_DONE = 1; - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 kit_buildrepo - - buildkit buildrepo - -=cut - -#----------------------------------------------------------------------------- - -sub kit_buildrepo -{ - my $rc = 0; - my $repoid = $::KIT_BUILDREPO; - - if (!$debianflag) { - - # Check if createrepo exists or not. Fail at the beginning. - #- don't use specific path - may not be correct in build env - my $rcmd = "createrepo -h > /dev/null"; - if (system($rcmd )) { - print "Error: the createrepo command does not seem to be installed. Make sure createrepo is installed before running the buildkit command. \n"; - return 1; - } - } - - $repoid =~ s/\s+//g; - $repoid =~ tr/A-Z/a-z/; # convert to lowercase - if ($repoid ne 'all') { - return &kit_buildrepo1($::KIT_BUILDREPO); - } else { - foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { - if (&kit_buildrepo1($kr->{kitrepoid})) { return 1; } - } - } - return $rc; -} - -#----------------------------------------------------------------------------- - -=head3 kit_buildrepo1 - - - -=cut - -#----------------------------------------------------------------------------- -sub kit_buildrepo1 -{ - my $rc = 0; - my $repoid = shift; - $repoid =~ s/\s+//g; - my $repodir = $::base_repodir; - my $srcdir = $::workdir . "/source_packages/"; - my $basedir = $repodir; - my $repo; - - # find the repo - my $found = 0; - foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { - if ($kr->{kitrepoid} eq $repoid) { - $found = 1; - $repo = $kr; - if (&validate_os($kr)) { - print "The buildrepo operation will continue, but errors may occur. You may need to run this command on a host with the same OS.\n"; - } - $repodir .= "/$kr->{kitreponame}"; - last; - } - } - if (!$found) { - print "The specified Kit Package Repository \"$repoid\" does not exist in the Kit Build File. \n"; - return 1; - } - - # Create repo build directory - if ((!-d $repodir) && (!mkpath($repodir))) { - print "Error creating build repository directory $repodir.\n"; - return 1; - } - - # Build kitpackages first - my $kitrepohash; - foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { - $kitrepohash->{ $kr->{kitrepoid} } = $kr->{kitreponame}; - } - - foreach my $kp (@{ $::bldkit_config->{kitpackage}{entries} }) { - - # For this kitrepo? - my $found = 0; - foreach my $kprid (split(/,/, $kp->{kitrepoid})) { - $kprid =~ s/\s+//g; - if ($repoid eq $kprid) { - $found = 1; - last; - } - } - if (!$found) { next; } - - # is this package already built? - my $rpm = "$repodir/$kp->{filename}"; - if (-r $rpm) { next; } - - my $kprid; - my $rpm_built; - foreach $kprid (split(/,/, $kp->{kitrepoid})) { - if ($repoid eq $kprid) { - next; - } - if ((-d "$basedir/$kitrepohash->{$kprid}") and (-f "$basedir/$kitrepohash->{$kprid}/$kp->{filename}")) { - $rpm_built = $kitrepohash->{$kprid}; - last; - } - } - - - # determine build method - if ($kp->{isexternalpkg} eq 'yes') { - if ($::VERBOSE) { print "skipping build of external kitpackage $kp->{filename} \n"; } - next; - } else { - if ($::VERBOSE) { print "building kitpackage $kp->{filename} \n"; } - } - if (defined($kp->{rpm_prebuiltdir})) { - - # simply copy the file to the build directory - my $full_prebuiltrpm = $srcdir . $kp->{rpm_prebuiltdir} . "/" . $kp->{filename}; - - if ($rpm_built) { - if (system("cd $repodir;ln -sf ../$rpm_built/$kp->{filename} $kp->{filename}")) { - - # non-zero return from system call - print "Error create symlink for prebuilt rpm $kp->{filename} to Kit Build directory. \n"; - return; - } - } else { - if (system("cp -fp $full_prebuiltrpm $repodir")) { - - # non-zero return from system call - print "Error copying prebuilt rpm $kp->{filename} to Kit Build directory. \n"; - return 1; - } - } - } elsif (defined($kp->{rpm_srpm})) { - - # run rpmbuild --rebuild on the source rpm - print "SKIPPING BUILD FOR KIT PACKAGE $kp->{filename} \n"; - print "TBD - only buildrepo for prebuilt rpms is available at this time \n\n"; - } elsif (defined($kp->{rpm_srctarball}) && - defined($kp->{rpm_spec})) { - - # run rpmbuild - print "SKIPPING BUILD FOR KIT PACKAGE $kp->{filename} \n"; - print "TBD - only buildrepo for prebuilt rpms is available at this time \n\n"; - } elsif (defined($kp->{rpm_srcdir}) && - defined($kp->{rpm_spec})) { - - # build tarfile and run rpmbuild - print "SKIPPING BUILD FOR KIT PACKAGE $kp->{filename} \n"; - print "TBD - only buildrepo for prebuilt rpms is available at this time \n\n"; - } else { - print "Cannot determine build method for Kit Package $kp->{filename}. Verify that your Kit Build File is correct. \n"; - return 1; - } - } - - # Build kitcomponent preppackages and metapackages - if ($debianflag) { - foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { - if ($repoid ne $kc->{kitrepoid}) { next; } - my $debname = "$repodir/" . &comppkgname($kc); - if (-r $debname) { next; } - if ($::VERBOSE) { print "building kitcomponent package for $kc->{basename} \n"; } - if (&build_kitcomp_debian($kc)) { - print "Error building kitcomponent metapackage for $kc->{basename} \n"; - return 1; - } - } - - if (system("cd $repodir;dpkg-scanpackages . > Packages")) { - print "Error building the repository meta-data with the dpkg-scanpackages command \n"; - return 1; - } - } - else { - foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { - - # Check if this kitcomponent is in the requested repo - if ($repoid ne $kc->{kitrepoid}) { next; } - - # Check if already built - my $rpm = "$repodir/" . &comppkgname($kc); - if (-r $rpm) { next; } - - # Build it - if ($::VERBOSE) { print "building kitcomponent metapackage for $kc->{basename} \n"; } - if (&build_kitcomp($kc)) { - print "Error building kitcomponent metapackage for $kc->{basename} \n"; - return 1; - } - } - - # run createrepo - my $cr_opts = ''; - if (($repo->{osbasename} =~ m/rh|RH|centos|CentOS/) && - ($repo->{osmajorversion} eq '5')) { - $cr_opts = '-s md5'; - } - if (system("createrepo $cr_opts $repodir")) { - print "Error building the repository meta-data with the createrepo command \n"; - return 1; - } - } - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 kit_listrepo - - buildkit listrepo - -=cut - -#----------------------------------------------------------------------------- -sub kit_listrepo -{ - # print "Kit Repository: Status \n"; - foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { - my $rc = 0; - my $status = "NOT DONE"; - unless ($rc = &validate_repo($kr)) { $status = "DONE"; } - print "$kr->{kitrepoid}: $status \n"; - } - - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 kit_cleanrepo - - buildkit cleanrepo - -=cut - -#----------------------------------------------------------------------------- -sub kit_cleanrepo -{ - my $repoid = $::KIT_CLEANREPO; - my $tmp_repoid = $repoid; - $tmp_repoid =~ tr/A-Z/a-z/; # convert to lowercase - - if (($tmp_repoid eq 'all') && - -d $::base_repodir) { - if (system("rm -Rf $::base_repodir ")) { - print "Error removing contents of $::base_repodir \n"; - return 1; - } else { - print "Contents of $::base_repodir has been successfully removed. \n"; - } - } else { - my $got_one = 0; - foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { - if ($repoid eq $kr->{kitrepoid}) { - my $repodir = $::base_repodir . '/' . $kr->{kitreponame}; - if (-d $repodir) { - if (system("rm -Rf $repodir ")) { - print "Error removing directory $repodir \n"; - return 1; - } else { - print "Kit repository $kr->{kitrepoid} has been removed. \n"; - } - } else { - print "Kit repository $kr->{kitrepoid} directory $repodir does not exist. Nothing to remove for this repository. \n"; - } - $got_one = 1; - last; - } - } - if (!$got_one) { - print "Kit repository $repoid does not exist.\n"; - return 1; - } - } - if (-d "$::workdir/rpmbuild") { - system("rm -Rf $::workdir/rpmbuild "); - } - if (-d "$::workdir/tmp") { - system("rm -Rf $::workdir/tmp "); - } - if (-d "$::workdir/debbuild") { - system("rm -Rf $::workdir/debbuild"); - } - - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 kit_buildtar - - buildkit buildtar - -=cut - -#----------------------------------------------------------------------------- -sub kit_buildtar -{ - foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { - if (&validate_repo($kr)) { - print "Kit Repository $kr->{kitrepoid} not built. Run: \n"; - print " buildkit buildrepo $kr->{kitrepoid} \n"; - return 1; - } - } - - if (&create_kitconf) { - print "Error creating kit configuration file \n"; - return 1; - } - - if ($::HAVE_EXTERNAL_PKG or $::HAVE_NON_NATIVE_PKGS) { - if (&create_PARTIAL_builddir) { - print "Error creating PARTIAL kit build directory contents \n"; - return 1; - } - } else { - if (&create_builddir) { - print "Error creating kit build directory contents \n"; - return 1; - } - } - - if (!-d "$::deploy_dir/repos") { - symlink "$::build_dir/kit_repodir", "$::deploy_dir/repos"; - } - - # build the tarfile - my $extpkgs = ''; - if ($::HAVE_EXTERNAL_PKG or $::HAVE_NON_NATIVE_PKGS) { - $extpkgs = '.NEED_PRODUCT_PKGS'; - } - my $kitname = $::bldkit_config->{kit}{entries}[0]->{kitname}; - my $kitfilename = $kitname; - if (defined($::bldkit_config->{kit}{entries}[0]->{kittarfilename})) { - $kitfilename = $::bldkit_config->{kit}{entries}[0]->{kittarfilename}; - $kitfilename =~ s/tar\.bz2\s*$//; - } - $kitfilename = $kitfilename . $extpkgs . ".tar.bz2"; - - my $tarfile = $::deploy_dir . "/" . $kitfilename; - - my $dir = dirname($::deploy_dir); - my $bidir = "$dir/build_input"; - - #It is for partial kit. - if ($::HAVE_EXTERNAL_PKG or $::HAVE_NON_NATIVE_PKGS) { - if (-d "$bidir") { - if (system("cd $::deploy_dir; cd ..; cp -r build_input $kitname")) { - print "Error: Could not copy building tarfile $tarfile \n"; - return 1; - } - } - } else { - - #If it is complete kit and there is build_input directory in deploy_dir - #If there is tmp rpmbuild source_packages - #delete them from complete kit build_input - if (-d "$bidir") { - if (system("cd $::deploy_dir; cd ..; rm -fr build_input/tmp")) { - print "Error:Could not delete build_input/tmp \n"; - } - if (system("cd $::deploy_dir; cd ..; rm -fr build_input/rpmbuild")) { - print "Error:Could not delete build_input/tmp \n"; - } - if (system("cd $::deploy_dir; cd ..; rm -fr build_input/source_packages")) { - print "Error:Could not delete build_input/source_packages \n"; - } - if (system("cd $::deploy_dir; cd ..; cp -fr build_input $kitname")) { - print "Error: Could not copy building tarfile $tarfile \n"; - return 1; - } - } else { - - #If kit build dir is new created - #partial kit is never created before - #make sure there is build_input dir in complete kit dir - if (system("cd $::deploy_dir; mkdir -p build_input")) { - print "Error creating kit build directory contents \n"; - return 1; - } - if (system("cd $::deploy_dir; cp -fp $::workdir/buildkit.conf build_input")) { - print "Error creating kit build directory contents \n"; - return 1; - } - if (system("cd $::deploy_dir; cp -frp $::workdir/other_files build_input")) { - print "Error creating kit build directory contents \n"; - return 1; - } - if (system("cd $::deploy_dir; cp -frp $::workdir/plugins build_input")) { - print "Error creating kit build directory contents \n"; - return 1; - } - if (system("cd $::deploy_dir; cp -frp $::workdir/scripts build_input")) { - print "Error creating kit build directory contents \n"; - return 1; - } - } - } - - print "Creating tar file $::current_dir/$kitfilename.\n"; - - if (system("cd $::deploy_dir; cd ..; tar -cjhf $tarfile $kitname/*")) { - print "Error building tarfile $tarfile \n"; - return 1; - } - - system("mv $tarfile $::current_dir"); - print "Kit tar file $::current_dir/$kitfilename successfully built. \n"; - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 kit_cleantar - - buildkit cleantar - - Remove tar files from the kit location directory. - - This removes all tar files - not just the last one created! - - Also clean up several other files/dirs - -=cut - -#----------------------------------------------------------------------------- -sub kit_cleantar -{ - my $basename = $::bldkit_config->{kit}{entries}[0]->{basename}; - my $rmfiles = "$basename\*tar.bz2"; - - my $tarfile = "$::workdir/$rmfiles"; - - if ($rmfiles) { - if (system("rm -f $tarfile ")) { - print "Error removing kit tar files in $::workdir.\n"; - } else { - print "Kit tar files have been successfully removed from $::workdir.\n"; - } - } - - if (-d $::deploy_dir) { - if (system("rm -Rf $::deploy_dir ")) { - print "Error removing contents of $::deploy_dir \n"; - } else { - print "Removed $::deploy_dir.\n"; - } - } - if (-d "$::workdir/rpmbuild") { - if (system("rm -Rf $::workdir/rpmbuild ")) { - - # print "Error removing $::workdir/rpmbuild\n"; - } else { - print "Removed $::workdir/rpmbuild\n"; - } - } - if (-d "$::workdir/tmp") { - if (system("rm -Rf $::workdir/tmp ")) { - - # print "Error removing $::workdir/tmp \n"; - } else { - print "Removed $::workdir/tmp \n"; - } - } - if (-d "$::workdir/debbuild") { - if (system("rm -Rf $::workdir/debbuild")) { - - # print "Error removing $::workdir/debbuild.\n"; - } else { - print "Removed $::workdir/debbuild\n"; - } - } - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 kit_cleanall - - buildkit cleanall - -=cut - -#----------------------------------------------------------------------------- -sub kit_cleanall -{ - print "Running buildkit cleanall... \n"; - - &kit_cleantar; - - if (-d $::build_dir) { - if (system("rm -Rf $::build_dir/* ")) { - print "Error removing contents of $::build_dir \n"; - } else { - print "All $::build_dir contents have been successfully removed \n"; - } - } - if (-d "$::workdir/rpmbuild") { - system("rm -Rf $::workdir/rpmbuild "); - } - if (-d "$::workdir/tmp") { - system("rm -Rf $::workdir/tmp "); - } - if (-d "$::workdir/debbuild") { - system("rm -Rf $::workdir/debbuild"); - } - - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 edit_bldkitconf - - edit the shipped template buildkit.conf file to insert initial values - for the new kit -=cut - -#----------------------------------------------------------------------------- -sub edit_bldkitconf -{ - my $bldkitconf = shift; - my $kitname = shift; - - # read in the buildkit.conf file - my $CF; - unless (open($CF, "<", $bldkitconf)) { - print "The Kit build file $bldkitconf does not exist. \n"; - return 1; - } - if ($::VERBOSE) { - print "Reading kit configuration file $bldkitconf \n"; - } - my @lines = <$CF>; - close $CF; - - my $osinfo = xCAT::BuildKitUtils->osver(); - my $kitrepoid = $osinfo; - $kitrepoid =~ s/\,//; - my ($osbasename, $osmore) = split(/\,/, $osinfo); - my ($osmajorversion, $osminorversion) = split(/\./, $osmore); - my $osarch = `uname -p`; - chomp($osarch); - my $kitcomponent_basename = $kitname . "_compute"; - - if ($debianflag == 1) { - if ($osarch eq "ppc64le") { - $osarch = "ppc64el"; - } - $kitcomponent_basename = $kitname . "-compute"; - } - - for (@lines) { - s/<<>>/$kitname/; - s/<<>>/$kitrepoid/; - s/<<>>/$osbasename/; - s/<<>>/$osmajorversion/; - s/<<>>/$osminorversion/; - s/<<>>/$osarch/; - s/<<>>/$kitcomponent_basename/; - if ($debianflag) { - s/(filename=.*?)\-(.*)\.noarch\.rpm/$1_$2_all.deb/; - } - if ($osbasename =~ /rh/) { - s/.*<<>>/ compat_osbasenames=centos/; - } - } - - # Write the buildkit.conf back out - my $NCF; - unless (open($NCF, ">$bldkitconf")) { - return 1; - } - if ($::VERBOSE) { - print "Inserted initial values into $bldkitconf \n"; - } - print $NCF @lines; - close($NCF); - - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 load_bldkitconf - - load the kitbuild.conf file into a global data structure and - verify that the general syntax is correct. - -=cut - -#----------------------------------------------------------------------------- -sub load_bldkitconf -{ - my $bldkitconf = shift; - - # read in the buildkit.conf file - my $CF; - unless (open($CF, "<", $bldkitconf)) { - print "The Kit build file $bldkitconf does not exist in the current directory. \n"; - return 1; - } - if ($::VERBOSE) { - print "Reading kit configuration file $bldkitconf \n"; - } - my @lines = <$CF>; - close $CF; - - my $current_section = 'no section'; - my %current_entry; - my $syntax_error = ''; - my $bad_line = ''; - my $line_number = 0; - foreach my $l (@lines) { - $line_number++; - - # skip blank and comment lines - next if ($l =~ /^\s*$/ || $l =~ /^\s*#/); - - # process a real line - # new section? - if ($l =~ /^\s*(\w+)\s*:/) { - my $section = $1; - if (defined($::buildkit_def{$section})) { - if (($section eq 'kit') && - ($::bldkit_config->{$section}{'exists'})) { - $syntax_error = "More than one \"$section:\" section exists "; - $bad_line = $l; - last; - } - $::bldkit_config->{$section}{'exists'} = 1; - push(@{ $::bldkit_config->{$current_section}{'entries'} }, {%current_entry}); - $current_section = $section; - undef %current_entry; - next; - } - } - if ($l =~ /^\s*(\w+)\s*=\s*(.*)\s*/) { - my $attr = $1; - my $val = $2; - my $orig_attr = $attr; - my $orig_val = $val; - $attr =~ s/^\s*//; # Remove any leading whitespace - $attr =~ s/\s*$//; # Remove any trailing whitespace - $attr =~ tr/A-Z/a-z/; # Convert to lowercase - $val =~ s/^\s*//; - $val =~ s/\s*$//; - - if (defined($::buildkit_def{$current_section}{$attr})) { - if ($val ne '') { $current_entry{$attr} = $val; } - } else { - if ($current_section eq 'no section') { - $syntax_error = "No section specified for attribute $attr."; - } else { - my $valid_attrs = join(', ', (keys(%{ $::buildkit_def{$current_section} }))); - $syntax_error = "Attribute \"$attr\" is not valid for section \"$current_section\". Valid attributes are: $valid_attrs.\n"; - } - $bad_line = $l; - last; - } - - } else { - $syntax_error = "Invalid line format"; - $bad_line = $l; - last; - - } - } - - # Need at least one kit and one kitrepo section - if (!$syntax_error) { - if (!($::bldkit_config->{'kit'}{'exists'})) { - $syntax_error = "No \"kit:\" section found. At least one section required. "; - $bad_line = ''; - } elsif (!($::bldkit_config->{'kitrepo'}{'exists'})) { - $syntax_error = "No \"kitrepo:\" section found. At least one section required. "; - $bad_line = ''; - } else { - push(@{ $::bldkit_config->{$current_section}{'entries'} }, {%current_entry}); - } - } - - if ($syntax_error) { - print "Error processing file $bldkitconf \n"; - print "Syntax error found on line $line_number:\n"; - print "$bad_line \n"; - print "$syntax_error \n"; - print "\n"; - print "The Kit build file does not have the correct format. \n"; - print "The format should be: \n"; - print "
: \n"; - print " = \n"; - print " = \n"; - print " ... \n"; - print "
: \n"; - print " = \n"; - print " = \n"; - print " ... \n"; - print "The valid section names are: kit, kitrepo, kitcomponent, kitpackages. \n"; - print "There must be exactly one kit, and must be at least one kitrepo section. \n"; - return 1; - } - - # Check for mandatory attributes - foreach my $s (keys %{$::bldkit_config}) { - if (!defined($::buildkit_def{$s})) { next; } - foreach my $se (@{ $::bldkit_config->{$s}{entries} }) { - foreach my $a (keys %{ $::buildkit_def{$s} }) { - if (($::buildkit_def{$s}{$a}->{mandatory}) && - (!defined($se->{$a}))) { - print "The \"$a\" mandatory attribute must be defined in the \"$s\" section of the Kit build file \n"; - return 1; - } - } - } - } - - #use Data::Dumper; - #print Dumper($::bldkit_config); - - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 validate_bldkitconf - - validate the loaded buildkit configuration data - -=cut - -#----------------------------------------------------------------------------- -sub validate_bldkitconf -{ - my $kitname = $::bldkit_config->{kit}{entries}[0]->{basename}; - my $full_kitname = $kitname; - $full_kitname .= '-' . $::bldkit_config->{kit}{entries}[0]->{version}; - if (defined($::bldkit_config->{kit}{entries}[0]->{release})) { - $full_kitname .= '-' . $::bldkit_config->{kit}{entries}[0]->{release}; - } - my $short_kitname = $full_kitname; - if (defined($::bldkit_config->{kit}{entries}[0]->{osbasename})) { - $full_kitname .= '-' . $::bldkit_config->{kit}{entries}[0]->{osbasename}; - } - if (defined($::bldkit_config->{kit}{entries}[0]->{osmajorversion})) { - if (!defined($::bldkit_config->{kit}{entries}[0]->{osbasename})) { - print "Error: Kit osmajorversion attribute was specified but Kit osbasename was not set. \n"; - return 1; - } - $full_kitname .= '-' . $::bldkit_config->{kit}{entries}[0]->{osmajorversion}; - } - if (defined($::bldkit_config->{kit}{entries}[0]->{osminorversion})) { - my $kitminor = $::bldkit_config->{kit}{entries}[0]->{osminorversion}; - unless ($kitminor =~ /^\d/) { - $kitminor = split /<=|>=|==|<|>|=/, $::bldkit_config->{kit}{entries}[0]->{osminorversion}; - } - if ((!defined($::bldkit_config->{kit}{entries}[0]->{osbasename})) || - (!defined($::bldkit_config->{kit}{entries}[0]->{osmajorversion}))) { - print "Error: Kit osminorversion attribute was specified but either Kit osbasename or Kit osmajorversion were not set. \n"; - return 1; - } - $full_kitname .= '-' . $kitminor; - } - if (defined($::bldkit_config->{kit}{entries}[0]->{osarch})) { - $full_kitname .= '-' . $::bldkit_config->{kit}{entries}[0]->{osarch}; - } - $::bldkit_config->{kit}{entries}[0]->{kitname} = $full_kitname; - $::deploy_dir .= "/" . $full_kitname; - - # Make sure each kit kitdeployparams file exists - if (defined($::bldkit_config->{kit}{entries}[0]->{kitdeployparams})) { - my $kd_file = $::workdir . "/other_files/" . $::bldkit_config->{kit}{entries}[0]->{kitdeployparams}; - if (!-r $kd_file) { - print "Kit Deployment Parameters file $kd_file does not exist or is not readable\n"; - return 1; - } - if (&edit_deployparams($kd_file, 1)) { return 1; } - } - - # Make sure each kitrepo has unique distro info - my $kr_count = scalar @{ $::bldkit_config->{kitrepo}{entries} }; - if ($kr_count > 1) { - foreach my $kri (0 .. $kr_count - 2) { - foreach my $kri2 ($kri + 1 .. $kr_count - 1) { - my $kr = $::bldkit_config->{kitrepo}{entries}[$kri]; - my $kr2 = $::bldkit_config->{kitrepo}{entries}[$kri2]; - if ($kr->{kitrepoid} eq $kr2->{kitrepoid}) { - print "There are two or more kitrepo sections with the same kitrepoid \"$kr->{kitrepoid}\". \n"; - return 1; - } - if (($kr->{osbasename} eq $kr2->{osbasename}) && - ($kr->{osmajorversion} eq $kr2->{osmajorversion}) && - ($kr->{osarch} eq $kr2->{osarch})) { - if ((defined($kr->{osminorversion}) && - defined($kr2->{osminorversion}) && - ($kr->{osminorversion} eq $kr2->{osminorversion})) || - (!defined($kr->{osminorversion}) && - !defined($kr2->{osminorversion}))) { - print "There are two or more kitrepo sections which are defined with the same OS name, major/minor version, and architecture. \n"; - return 1; - } - } - } - } - } - - # Kitcomponent version/release are now optional - - # default to kit version/release - foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { - if (!defined($kc->{version})) { - $kc->{version} = $::bldkit_config->{kit}{entries}[0]->{version}; - } - if (!defined($kc->{release})) { - if (!defined($::bldkit_config->{kit}{entries}[0]->{release})) { - print "Kitcomponent $kc->{basename} does not have a release specified and there is no Kit release value set to use as a default. \n"; - return 1; - } else { - $kc->{release} = $::bldkit_config->{kit}{entries}[0]->{release}; - } - } - - } - - # Make sure each kitcomponent has unique basename/repoid - # If same basename, make sure version/release are same, too - my $kc_count = scalar @{ $::bldkit_config->{kitcomponent}{entries} }; - if ($kc_count > 1) { - foreach my $kci (0 .. $kc_count - 2) { - foreach my $kci2 ($kci + 1 .. $kc_count - 1) { - if ($::bldkit_config->{kitcomponent}{entries}[$kci]->{basename} - eq $::bldkit_config->{kitcomponent}{entries}[$kci2]->{basename}) { - if ($::bldkit_config->{kitcomponent}{entries}[$kci]->{kitrepoid} - eq $::bldkit_config->{kitcomponent}{entries}[$kci2]->{kitrepoid}) { - - print "Two or more kitcomponents are defined with the same basename \"$::bldkit_config->{kitcomponent}{entries}[$kci]->{basename}\" and the same repoid \"$::bldkit_config->{kitcomponent}{entries}[$kci]->{kitrepoid}\". \n"; - return 1; - } - if (($::bldkit_config->{kitcomponent}{entries}[$kci]->{version} - ne $::bldkit_config->{kitcomponent}{entries}[$kci2]->{version}) || - ($::bldkit_config->{kitcomponent}{entries}[$kci]->{release} - ne $::bldkit_config->{kitcomponent}{entries}[$kci2]->{release}) - ) { - print "Two or more kitcomponents are defined with the same basename \"$::bldkit_config->{kitcomponent}{entries}[$kci]->{basename}\" but with different version or release. \n"; - return 1; - } - } - } - } - } - - # Kitrepo checks - foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { - my $reponame = $short_kitname; - if ((defined($::bldkit_config->{kit}{entries}[0]->{osbasename})) && - ($::bldkit_config->{kit}{entries}[0]->{osbasename} ne - $kr->{osbasename})) { - print "Warning: Kit osbasename is set to \"$::bldkit_config->{kit}{entries}[0]->{osbasename}\", but this does not match kitrepo $kr->{kitrepoid} osbasename \"$kr->{osbasename}\". Processing will continue, but verify that you do not have an error in your buildkit configuration file. \n"; - } - $reponame .= '-' . $kr->{osbasename}; - if ((defined($::bldkit_config->{kit}{entries}[0]->{osmajorversion})) && - ($::bldkit_config->{kit}{entries}[0]->{osmajorversion} ne - $kr->{osmajorversion})) { - print "Warning: Kit osmajorversion is set to \"$::bldkit_config->{kit}{entries}[0]->{osmajorversion}\", but this does not match kitrepo $kr->{kitrepoid} osmajorversion \"$kr->{osmajorversion}\". Processing will continue, but verify that you do not have an error in your buildkit configuration file. \n"; - } - $reponame .= '-' . $kr->{osmajorversion}; - if (defined($kr->{osminorversion})) { - my $krminor = $kr->{osminorversion}; - unless ($krminor =~ /^\d/) { - $krminor = split /<=|>=|==|<|>|=/, $kr->{osminorversion}; - } - if ((defined($::bldkit_config->{kit}{entries}[0]->{osminorversion})) && - ($::bldkit_config->{kit}{entries}[0]->{osminorversion} ne - $kr->{osminorversion})) { - print "Warning: Kit osminorversion is set to \"$::bldkit_config->{kit}{entries}[0]->{osminorversion}\", but this does not match kitrepo $kr->{kitrepoid} osminorversion \"$kr->{osminorversion}\". Processing will continue, but verify that you do not have an error in your buildkit configuration file. \n"; - } - $reponame .= '.' . $krminor; - $::bldkit_config->{kit}{entries}[0]->{osminorversion} = $krminor; - } - if ((defined($::bldkit_config->{kit}{entries}[0]->{osarch})) && - ($::bldkit_config->{kit}{entries}[0]->{osarch} ne - $kr->{osarch})) { - print "Warning: Kit osarch is set to \"$::bldkit_config->{kit}{entries}[0]->{osarch}\", but this does not match kitrepo $kr->{kitrepoid} osarch \"$kr->{osarch}\". Processing will continue, but verify that you do not have an error in your buildkit configuration file. \n"; - } - $reponame .= '-' . $kr->{osarch}; - $kr->{kitreponame} = $reponame; - } - - # Kitcomponent checks - foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { - - # Make sure all kitcomponent kitrepoids are defined - my $found = 0; - my %repo; - if ($debianflag) { - if ($kc->{basename} =~ /_/) { - print "Kit Component basename can not contain underscore.\n"; - return 1; - } - } - foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { - if ($kc->{kitrepoid} eq $kr->{kitrepoid}) { - $found = 1; - %repo = %{$kr}; - $kc->{kitreponame} = $kr->{kitreponame}; - push(@{ $kr->{packages} }, &comppkgname($kc, $kr)); - last; - } - } - if (!$found) { - print "Kit Repository \"$kc->{kitrepoid}\" required by the Kit Component \"$kc->{basename}\" not defined in the Kit Build file.\n"; - return 1; - } - - # Create full kitcomponent name - my $compname = $kc->{basename}; - $compname .= '-' . $kc->{version}; - $compname .= '-' . $kc->{release}; - $compname .= '-' . $repo{osbasename}; - $compname .= '-' . $repo{osmajorversion}; - if (defined($repo{osminorversion})) { - my $minorversion = $repo{osminorversion}; - unless ($minorversion =~ /^\d/) { - $minorversion = split /<=|>=|==|<|>|=/, $repo{osminorversion}; - } - $compname .= '.' . $minorversion; - } - $compname .= '-' . $repo{osarch}; - $kc->{kitcompname} = $compname; - - # Make sure all kitcomponent kitpkgdeps are defined - if (defined($kc->{kitpkgdeps})) { - foreach my $d (split(/,/, $kc->{kitpkgdeps})) { - $d =~ s/\s+//g; - $d =~ s/^([\w\.\-]+)[<>=]*.*$/$1/; - my $found = 0; - foreach my $kp (@{ $::bldkit_config->{kitpackage}{entries} }) { - if ($kp->{filename} =~ /^$d[\.\-]?/) { - foreach my $kprid (split(/,/, $kp->{kitrepoid})) { - $kprid =~ s/\s+//g; - if ($kc->{kitrepoid} eq $kprid) { - $found = 1; - last; - } - } - } - if ($found) { last; } - } - if (!$found) { - print "Kit Package \"$d\" required by the Kit Component \"$kc->{basename}\" was not found in the Kit Component\'s repository \"$kc->{kitrepoid}\".\n"; - return 1; - } - } - } - - # Make sure all kitcomponent driverpacks are defined - if (defined($kc->{driverpacks})) { - my @drvs = split(/,/, $kc->{driverpacks}); - foreach my $d (@drvs) { - $d =~ s/\s+//g; - my $found = 0; - foreach my $kp (@{ $::bldkit_config->{kitpackage}{entries} }) { - if ($kp->{filename} eq $d) { - foreach my $kprid (split(/,/, $kp->{kitrepoid})) { - $kprid =~ s/\s+//g; - if ($kc->{kitrepoid} eq $kprid) { - $found = 1; - last; - } - } - } - if ($found) { last; } - } - if (!$found) { - print "Driver package \"$d\" required by the Kit Component \"$kc->{basename}\" was not found in the Kit Component\'s repository \"$kc->{kitrepoid}\".\n"; - return 1; - } - } - } - - # Make sure files exist - if (defined($kc->{exlist})) { - my $ck_file = $::workdir . "/other_files/" . $kc->{exlist}; - if (!-r $ck_file) { - print "Exclude List file $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; - return 1; - } - } - if (defined($kc->{preinstall})) { - my $ck_file = $::workdir . "/scripts/" . $kc->{preinstall}; - if (!-r $ck_file) { - print "Pre-Install script $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; - return 1; - } - } - if (defined($kc->{postinstall})) { - my $ck_file = $::workdir . "/scripts/" . $kc->{postinstall}; - if (!-r $ck_file) { - print "Post-Install script $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; - return 1; - } - } - if (defined($kc->{preuninstall})) { - my $ck_file = $::workdir . "/scripts/" . $kc->{preuninstall}; - if (!-r $ck_file) { - print "Pre-Uninstall script $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; - return 1; - } - } - if (defined($kc->{postuninstall})) { - my $ck_file = $::workdir . "/scripts/" . $kc->{postuninstall}; - if (!-r $ck_file) { - print "Post-Uninstall script $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; - return 1; - } - } - if (defined($kc->{preupgrade})) { - my $ck_file = $::workdir . "/scripts/" . $kc->{preupgrade}; - if (!-r $ck_file) { - print "Pre-Upgrade script $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; - return 1; - } - } - if (defined($kc->{postupgrade})) { - my $ck_file = $::workdir . "/scripts/" . $kc->{postupgrade}; - if (!-r $ck_file) { - print "Post-Upgrade script $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; - return 1; - } - } - if (defined($kc->{genimage_postinstall})) { - foreach my $script (split(/\,/, $kc->{genimage_postinstall})) { - $script =~ s/\s+//g; - my $ck_file = $::workdir . "/scripts/" . $script; - if (!-r $ck_file) { - print "genimage_postinstall script $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; - return 1; - } - } - } - if (defined($kc->{postbootscripts})) { - foreach my $script (split(/\,/, $kc->{postbootscripts})) { - $script =~ s/\s+//g; - my $ck_file = $::workdir . "/scripts/" . $script; - if (!-r $ck_file) { - print "Postboot script $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; - return 1; - } - } - } - if (defined($kc->{non_native_pkgs})) { - if ($kc->{non_native_pkgs} =~ /EXTERNALPKGS/) { - $::NON_NATIVE_PKGS->{ $kc->{kitcompname} } = 1; - $::HAVE_NON_NATIVE_PKGS = 1; - } - } - } - - # Kitpackage checks - foreach my $kp (@{ $::bldkit_config->{kitpackage}{entries} }) { - - # determine if valid build method - if ((defined($kp->{isexternalpkg})) || - (defined($kp->{rpm_prebuiltdir}))) { - if ((defined($kp->{rpm_srpm})) || - (defined($kp->{rpm_srctarball})) || - (defined($kp->{rpm_spec})) || - (defined($kp->{rpm_srcdir}))) { - print "Cannot determine build method for Kit Package $kp->{filename}. Conflicting attributes were specified.\n"; - return 1; - } - if (!(defined($kp->{isexternalpkg}))) { $kp->{isexternalpkg} = 'no'; } - my $orig_isext = $kp->{isexternalpkg}; - $kp->{isexternalpkg} =~ s/\s+//g; - $kp->{isexternalpkg} =~ tr/A-Z/a-z/; # convert to lowercase - if ($kp->{isexternalpkg} eq '0') { $kp->{isexternalpkg} = 'no'; } - if ($kp->{isexternalpkg} eq '1') { $kp->{isexternalpkg} = 'yes'; } - if (($kp->{isexternalpkg} ne 'yes') && - ($kp->{isexternalpkg} ne 'no')) { - print "Error in definition for Kit Package $kp->{filename}. Invalid attribute value \'isexternalpkg=$orig_isext\'. Valid values are \'no\'|\'0\' or \'yes\'|\'1\'.\n"; - return 1; - } - if (($kp->{isexternalpkg} eq 'yes')) { - $::HAVE_EXTERNAL_PKG = 1; - } - if (($kp->{isexternalpkg} eq 'yes') && - (defined($kp->{rpm_prebuiltdir}))) { - print "Error in definition for Kit Package $kp->{filename}. Do not specify \'isexternalpkg=$orig_isext\' with 'rpm_prebuiltdir'.\n"; - return 1; - } - } elsif (defined($kp->{rpm_srpm})) { - if ((defined($kp->{rpm_prebuiltdir})) || - (defined($kp->{rpm_srctarball})) || - (defined($kp->{rpm_spec})) || - (defined($kp->{rpm_srcdir}))) { - print "Cannot determine build method for Kit Package $kp->{filename}. Conflicting attributes were specified.\n"; - return 1; - } - } elsif (defined($kp->{rpm_srctarball}) && - defined($kp->{rpm_spec})) { - if ((defined($kp->{rpm_prebuiltdir})) || - (defined($kp->{rpm_srpm})) || - (defined($kp->{rpm_srcdir}))) { - print "Cannot determine build method for Kit Package $kp->{filename}. Conflicting attributes were specified.\n"; - return 1; - } - } elsif (defined($kp->{rpm_srcdir}) && - defined($kp->{rpm_spec})) { - if ((defined($kp->{rpm_prebuiltdir})) || - (defined($kp->{rpm_srpm})) || - (defined($kp->{rpm_srctarball}))) { - print "Cannot determine build method for Kit Package $kp->{filename}. Conflicting attributes were specified.\n"; - return 1; - } - } else { - print "Cannot determine build method for Kit Package $kp->{filename}. Verify that your Kit Build File is correct. \n"; - return 1; - } - - # Make sure all kitpackage kitrepoids are defined - foreach my $kprid (split(/,/, $kp->{kitrepoid})) { - my $found = 0; - $kprid =~ s/\s+//g; - foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { - if ($kprid eq $kr->{kitrepoid}) { - $found = 1; - $kp->{kitreponame} .= "," . $kr->{kitreponame}; - if (!($kp->{isexternalpkg} eq 'yes')) { - push(@{ $kr->{packages} }, $kp->{filename}); - } - last; - } - } - if (!$found) { - print "Kit Repository \"$kprid\" required by the Kit Package \"$kp->{filename}\" is not defined in the Kit Build file.\n"; - return 1; - } - } - $kp->{kitreponame} =~ s/^,//; - if (!$::NEW_PARTIAL_KIT) { - - # Make sure files exist - if (defined($kp->{rpm_spec})) { - my $ck_file = $::workdir . "/source_packages/" . $kp->{rpm_spec}; - if (!-r $ck_file) { - print "RPM spec file $ck_file defined in Kit Package \"$kp->{filename}\" does not exist or is not readable\n"; - return 1; - } - } - if (defined($kp->{rpm_srcdir})) { - my $ck_dir = $::workdir . "/source_packages/" . $kp->{rpm_srcdir}; - if (!-d $ck_dir) { - print "RPM source directory $ck_dir defined in Kit Package \"$kp->{filename}\" does not exist or is not readable\n"; - return 1; - } - } - if (defined($kp->{rpm_srctarball})) { - my $ck_file = $::workdir . "/source_packages/" . $kp->{rpm_srctarball}; - if (!-r $ck_file) { - print "RPM source tarfile $ck_file defined in Kit Package \"$kp->{filename}\" does not exist or is not readable\n"; - return 1; - } - } - if (defined($kp->{rpm_srpm})) { - my $ck_file = $::workdir . "/source_packages/" . $kp->{rpm_srpm}; - if (!-r $ck_file) { - print "Source RPM $ck_file defined in Kit Package \"$kp->{filename}\" does not exist or is not readable\n"; - return 1; - } - } - if (defined($kp->{rpm_prebuiltdir})) { - my $ck_dir = $::workdir . "/source_packages/" . $kp->{rpm_prebuiltdir}; - if (!-d $ck_dir) { - print "Pre-built RPM directory $ck_dir defined in Kit Package \"$kp->{filename}\" does not exist or is not readable\n"; - return 1; - } - my $ck_file = $ck_dir . "/" . $kp->{filename}; - if (system("ls $ck_file > /dev/null")) { - - # if (! -r $ck_file ) { - print "Pre-built rpm $ck_file defined in Kit Package \"$kp->{filename}\" does not exist or is not readable\n"; - return 1; - } - } - } - } - - #use Data::Dumper; - #print Dumper($::bldkit_config->{kitrepo}); - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 comppkgname - - build a metapkg rpm filename for this kitcomponent - input: kitcomponent hash - kitrepo hash that this kitcomponent belongs to - -=cut - -#----------------------------------------------------------------------------- -sub comppkgname -{ - my $comp = shift; - - my $pkgname = $comp->{basename}; - if ($debianflag) { - $pkgname .= '_' . $comp->{version}; - $pkgname .= '-' . $comp->{release}; - $pkgname .= '_all.deb'; - } - else { - $pkgname .= '-' . $comp->{version}; - $pkgname .= '-' . $comp->{release}; - $pkgname .= '.noarch.rpm'; - } - return $pkgname; -} - -#----------------------------------------------------------------------------- - -=head3 validate_repo - - validate whether a kit repo has been built - input: repo hash - returns rc: - 0 - repo status is DONE - 1 - repo status is NOT DONE - verbose mode displays message for first rpm not built - -=cut - -#----------------------------------------------------------------------------- -sub validate_repo -{ - my $repo = shift; - - my $repodir = $::base_repodir . "/" . $repo->{kitreponame}; - if (!-d $repodir) { - if ($::VERBOSE) { - print "\n$repodir does not exist. No rpms have been built for this kitrepo. \n"; - } - return 1; - } - - # Make sure each repo pkg exists - foreach my $pkg (@{ $repo->{packages} }) { - - # skip check for kit component meta rpm if it includes - # external non-native pkgs - my $skip_check = 0; - foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { - if ($repo->{kitrepoid} eq $kc->{kitrepoid}) { - my $kitpkgname = comppkgname($kc); - if (($kitpkgname eq $pkg) && - ($::NON_NATIVE_PKGS->{ $kc->{kitcompname} })) { - $skip_check = 1; - last; - } - } - } - if (!$skip_check) { - my $pkg_filename = $repodir . '/' . $pkg; - if (system("ls $pkg_filename > /dev/null")) { - if ($::VERBOSE) { - print "\nFile $pkg in directory $repodir does not exist or is not readable. \n"; - } - return 1; - } - } - } - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 validate_os - - validate whether a kit repo matches the current OS - input: repo hash - returns rc: - 0 - match - 1 - no match - verbose mode displays message for mismatch details - -=cut - -#----------------------------------------------------------------------------- -sub validate_os -{ - my $repo = shift; - - my $osinfo = xCAT::BuildKitUtils->osver(); - my ($osbasename, $osmore) = split(/\,/, $osinfo); - my ($osmajorversion, $osminorversion) = split(/\./, $osmore); - my $osarch = `uname -p`; - chomp($osarch); - - if ($debianflag == 1) { - if ($osarch eq "ppc64le") { - $osarch = "ppc64el"; - } - } - $osinfo =~ s/\,//; - my $repo_osinfo = "$repo->{osbasename}$repo->{osmajorversion}"; - my $minorversion; - if (defined($repo->{osminorversion})) { - $minorversion = $repo->{osminorversion}; - unless ($minorversion =~ /^\d/) { - $minorversion = split /<=|>=|==|<|>|=/, $repo->{osminorversion}; - } - $repo_osinfo .= ".$minorversion"; - } - $repo_osinfo .= "-$repo->{osarch} "; - my $mismatch_msg = "The local host is running $osinfo-$osarch. This does not match the Kit Repository \"$repo->{kitrepoid}\" data: $repo_osinfo"; - if (defined($repo->{compat_osbasenames})) { - $mismatch_msg .= " or the compatible OS distros: $repo->{compat_osbasenames} "; - } - - - my $compat_match = 0; - if ($repo->{osbasename} ne $osbasename) { - if (defined($repo->{compat_osbasenames})) { - foreach my $cos (split(/,/, $repo->{compat_osbasenames})) { - if ($cos eq $osbasename) { - $compat_match = 1; - last; - } - } - } - if (!$compat_match) { - print "$mismatch_msg \n"; - if ($::VERBOSE) { - print "\n Local OS basename $osbasename does not match repository.\n"; - } - return 1; - } - } - if (($repo->{osmajorversion} ne $osmajorversion) && - (!$compat_match)) { - print "$mismatch_msg \n"; - if ($::VERBOSE) { - print "\n Local OS major version $osmajorversion does not match repository.\n"; - } - return 1; - } - if (defined($repo->{osminorversion})) { - if (($minorversion ne $osminorversion) && - (!$compat_match)) { - print "$mismatch_msg \n"; - if ($::VERBOSE) { - print "\n Local OS minor version $osminorversion does not match repository.\n"; - } - return 1; - } - } - if ($repo->{osarch} ne $osarch) { - print "$mismatch_msg \n"; - if ($::VERBOSE) { - print "\n Local OS arch $osarch does not match repository.\n"; - } - return 1; - } - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 build_kitcomp - - build a metapkg rpm for this kitcomponent - input: kitcomponent hash - -=cut - -#----------------------------------------------------------------------------- -sub build_kitcomp -{ - my $comp = shift; - my %repo; - my $rpmbuild_dir = $::workdir . "/rpmbuild"; - my $tmpdir = $::workdir . "/tmp/$comp->{kitcompname}"; - my $kcmetaname = comppkgname($comp); - - # If this kitcomponent has external non-native pkgs, - # skip the meta rpm build - if (defined($::NON_NATIVE_PKGS) && - defined($::NON_NATIVE_PKGS->{ $comp->{kitcompname} }) && - $::NON_NATIVE_PKGS->{ $comp->{kitcompname} }) { - if ($::VERBOSE) { - print "Kit component $comp->{kitcompname} has external non-native packages. Skipping rpm build for $kcmetaname. \n"; - } - return 0; - } - - # find the kitrepo hash for this component - foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { - if ($comp->{kitrepoid} eq $kr->{kitrepoid}) { - %repo = %{$kr}; - last; - } - } - my $repodir = $::base_repodir . "/" . $repo{kitreponame}; - - # Fix the kitpkgdeps value for this kitcomponent - # For any kitpkgdep that has an rpm file in the repo, - # specifically reference it's version-release - if (&update_kitcomp_kitpkgdeps($comp, $repodir)) { return 1; } - - $::VALID_PRER_COMPONENT = 0; - - if (!$::PREREQUISITE) { - if ($comp->{ospkgdeps} || $comp->{preinstall} || $comp->{preupgrade}) { - if (&gen_kitcomp_spec($comp, \%repo, 'PREREQUISITE')) { return 1; } - - # run the rpmbuild command - my $curdir = $::workdir; - my $cmd = "rm -Rf $curdir/rpmbuild"; - system($cmd); - my $avoiderr = $rpmbuild_dir . "/BUILDROOT/prep_" . $comp->{basename}; - $avoiderr .= "-$comp->{version}-$comp->{release}.$repo{osarch}"; - mkpath($avoiderr); - $avoiderr = $rpmbuild_dir . "/BUILD/"; - mkpath($avoiderr); - $avoiderr = $rpmbuild_dir . "/SRPMS/"; - mkpath($avoiderr); - $avoiderr = $rpmbuild_dir . "/RPMS/noarch/"; - mkpath($avoiderr); - - # Read the kit component prerequisite rpm name - - my $specfile = $::workdir . "/tmp/$comp->{kitcompname}-prep.spec"; - my $rpmbuild_cmd = "rpmbuild --define \"_topdir $rpmbuild_dir\" -ba $specfile"; - - # don't want debug info - 3845 - # if (!$::VERBOSE) { - $rpmbuild_cmd .= ' --quiet '; - - # } - if (system($rpmbuild_cmd)) { - print "Error running rpmbuild command for kit component $comp->{kitcompname} meta package\n"; - return 1; - } - my @built_rpms = `find $rpmbuild_dir/RPMS -name "*.rpm"`; - foreach my $rpm (@built_rpms) { - chomp($rpm); - if (system("cp -fp $rpm $repodir")) { - print "Error copying rpm $rpm to build repo directory $repodir \n"; - return 1; - } - } - - $::VALID_PRER_COMPONENT = 1; - - } - - if (&gen_kitcomp_spec($comp, \%repo, 'METARPM')) { return 1; } - } else { - - # Create spec file for this kit component - if (&gen_kitcomp_spec($comp, \%repo, 'ALL')) { return 1; } - } - - # run the rpmbuild command - my $curdir = $::workdir; - my $cmd = "rm -Rf $curdir/rpmbuild"; - system($cmd); - my $avoiderr = $rpmbuild_dir . "/BUILDROOT/" . $comp->{basename}; - $avoiderr .= "-$comp->{version}-$comp->{release}.$repo{osarch}"; - mkpath($avoiderr); - $avoiderr = $rpmbuild_dir . "/BUILD/"; - mkpath($avoiderr); - $avoiderr = $rpmbuild_dir . "/SRPMS/"; - mkpath($avoiderr); - $avoiderr = $rpmbuild_dir . "/RPMS/noarch/"; - mkpath($avoiderr); - - # Read the kit component meta rpm name - - my $specfile = $::workdir . "/tmp/$comp->{kitcompname}.spec"; - my $rpmbuild_cmd = "rpmbuild --define \"_topdir $rpmbuild_dir\" -ba $specfile"; - - # Copy in any non-native packages - if (defined($comp->{non_native_pkgs})) { - mkpath($tmpdir); - mkpath("$rpmbuild_dir/SOURCES"); - my $sourcedir = $::workdir . "/source_packages"; - - foreach my $pkgfile (split(/,/, $comp->{non_native_pkgs})) { - my $pkg_file; - my ($key, $value) = split /:/, $pkgfile; - if ("$key" =~ /EXTERNALPKGS/) { - $pkg_file = $value; - } else { - $pkg_file = $key; - } - - $cmd = "cp -p $sourcedir/$pkg_file $tmpdir"; - if (system($cmd)) { - print "Error copying non-native package file $sourcedir/$pkg_file to $tmpdir\n"; - return 1; - } - } - $cmd = "cd $tmpdir/..;mv $comp->{kitcompname} $comp->{basename}; tar -czf $rpmbuild_dir/SOURCES/$comp->{basename}.tar.gz $comp->{basename};mv $comp->{basename} $comp->{kitcompname}"; - if (system($cmd)) { - print "Error creating tarfile $rpmbuild_dir/SOURCES/$comp->{kitreponame}-$comp->{kitcompname}.tar from $sourcedir/*"; - return 1; - } - } - - # - don't want debug info - 3845 - # if (!$::VERBOSE) { - $rpmbuild_cmd .= ' --quiet '; - - # } - - if (system($rpmbuild_cmd)) { - print "Error running rpmbuild command for kit component $comp->{kitcompname} meta package\n"; - return 1; - } - my @built_rpms = `find $rpmbuild_dir/RPMS -name "*.rpm"`; - foreach my $rpm (@built_rpms) { - chomp($rpm); - if (system("cp -fp $rpm $repodir")) { - print "Error copying rpm $rpm to build repo directory $repodir \n"; - return 1; - } - } - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 update_kitcomp_kitpkgdeps - - Update the kitcomponent kitpkgdeps string - For any kitpkgdep that does not explicitly specify a version-release - comparison string and for which an rpm exists in the repo, - query the rpm for its version-release info and set an explicit - comparison string. - Reason we need to do all this: We need to force yum/zypper to update - the product rpms. A simple package name in the kitcomponent meta rpm - REQUIRES entry will not cause the product to get updated if an older - version is already installed. Need to explicitly require this version - and release of the product package. - input: kitcomponent hash - kitrepo directory - -=cut - -#----------------------------------------------------------------------------- -sub update_kitcomp_kitpkgdeps -{ - my $comp = shift; - my $repodir = shift; - - if (defined($comp->{kitpkgdeps})) { - - # we have some rpms listed in buildkit.conf file - my $new_kitpkgdeps = ''; - foreach my $d (split(/,/, $comp->{kitpkgdeps})) { - $d =~ s/\s+//g; - my $d_short = $d; - - # strip off everything after ">=" - $d_short =~ s/^([\w\.\-]+)[<>=]*.*$/$1/; - - # if they are the same then there was no v/r info provided - if ($d_short eq $d) { - - # no version-release comparisons specified for this kitpkgdep - # do we have this rpm file? - # get a list of any matches - my $lscmd = "cd $repodir; /bin/ls $d-\[0-9\]\*.rpm 2>/dev/null"; - my @rpmlist = `$lscmd`; - - if (scalar(@rpmlist) == 0) { - next; - } - - # get the newest version there is - my $newestrpm = xCAT::BuildKitUtils->get_latest_version($repodir, \@rpmlist); - - if (!$newestrpm) { - print "Error: Could not determine the latest version of rpm $d contained in $repodir. \n"; - next; - } - - # get the Version and release values for this rpm - my $cmd = "rpm -q --qf \"%{NAME} >= %{VERSION}-%{RELEASE}\" -p $repodir/$newestrpm 2>/dev/null"; - if ($::VERBOSE) { - print "running rpm query to get version-release info: \n $cmd \n"; - } - - my $new_d = `$cmd`; - if (!$new_d) { - print "Error: Could not determine the latest version of rpm $d. \n"; - next; - } - - chomp($new_d); - if ($::VERBOSE) { - print "output: \n \'$new_d\' \n"; - } - if ($new_d ne '') { - $new_kitpkgdeps .= "$new_d,"; - } else { - $new_kitpkgdeps .= "$d,"; - } - } else { - $new_kitpkgdeps .= "$d,"; - } - } - - $new_kitpkgdeps =~ s/(\,)*$//; - $comp->{kitpkgdeps} = $new_kitpkgdeps; - } - - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 gen_kitcomp_spec - - generate the rpm spec file for the kitcomponent metapkg rpm - input: kitcomponent hash - kitrepo hash - -=cut - -#----------------------------------------------------------------------------- -sub gen_kitcomp_spec -{ - my $comp = shift; - my $repo = shift; - my $level = shift; - my $scriptdir = $::workdir . "/scripts/"; - my $tmpdir = $::workdir . "/tmp/"; - - # read in the template spec file - my $spec_template = $::XCATSHARE . "/kits/kitcomponent.spec.template"; - my $SF; - unless (open($SF, "<", $spec_template)) { - print "Error attempting to open the xCAT Kit Component template file $spec_template. \n"; - return 1; - } - if ($::VERBOSE) { - print "Reading the xCAT Kit Component template file $spec_template. \n"; - } - my @lines = <$SF>; - close $SF; - - my $kitname = $::bldkit_config->{kit}{entries}[0]->{basename}; - my $kitcompname = $comp->{kitcompname}; - - my ($prescript, $postscript, $preupscript, $postupscript, $preunscript, $postunscript, $nonnativepkgs, $sourcetar, $setup, $files) = ' '; - if ($level eq 'PREREQUISITE' || $level eq 'ALL') { - if (defined($comp->{preinstall})) { - $prescript = &load_script("$scriptdir$comp->{preinstall}"); - $prescript = "if [ \"\$1\" = \"1\" ] ; then\n" . $prescript . "\nfi"; } - if (defined($comp->{preupgrade})) { - $preupscript = &load_script("$scriptdir$comp->{preupgrade}"); - $preupscript = "if [ \"\$1\" = \"2\" ] ; then\n" . $preupscript . "\nfi"; } - } - if ($level eq 'METARPM' || $level eq 'ALL') { - if (defined($comp->{preuninstall})) { - $preunscript = &load_script("$scriptdir$comp->{preuninstall}"); } - if (defined($comp->{postinstall})) { - $postscript = &load_script("$scriptdir$comp->{postinstall}"); - $postscript = "if [ \"\$1\" = \"1\" ] ; then\n" . $postscript . "\nfi"; } - if (defined($comp->{postupgrade})) { - $postupscript = &load_script("$scriptdir$comp->{postupgrade}"); - $postupscript = "if [ \"\$1\" = \"2\" ] ; then\n" . $postupscript . "\nfi"; } - if (defined($comp->{postuninstall})) { - $postunscript = &load_script("$scriptdir$comp->{postuninstall}"); } - if (defined($comp->{non_native_pkgs})) { - $nonnativepkgs = "\n"; - $nonnativepkgs .= "mkdir -p \$RPM_BUILD_ROOT/opt/xcat/kits/$kitname/$kitcompname \n"; - $nonnativepkgs .= "cp -a * \$RPM_BUILD_ROOT/opt/xcat/kits/$kitname/$kitcompname \n"; - $sourcetar = "Source: $comp->{basename}.tar.gz"; - $setup = "\%setup -q -n $comp->{basename}"; - $files = "/opt/xcat/kits"; - } - } - - # remove lines that correspond to optional tags that have no values - # in this instance. Adding lines to the spec file that have - # no values will cause a build error. - my @newlines; - foreach my $l (@lines) { - chomp; - - # don't add vendor,packager,url to spec file unless we have a value - if ($l =~ /INSERT_vendor_HERE/) { - if (!$::bldkit_config->{kit}{entries}[0]->{vendor}) { - next; - } - } - if ($l =~ /INSERT_packager_HERE/) { - if (!$::bldkit_config->{kit}{entries}[0]->{packager}) { - next; - } - } - if ($l =~ /INSERT_url_HERE/) { - if (!$::bldkit_config->{kit}{entries}[0]->{url}) { - next; - } - } - push @newlines, $l; - } - @lines = @newlines; - - if ($level eq 'ALL') { - for (@lines) { - chomp; - s/<<>>/$kitname/; - s/<<>>/$comp->{basename}/; - s/<<>>/$comp->{version}/; - s/<<>>/$comp->{release}/; -s/<<>>/$::bldkit_config->{kit}{entries}[0]->{kitlicense}/; -s/<<>>/$::bldkit_config->{kit}{entries}[0]->{vendor}/; -s/<<>>/$::bldkit_config->{kit}{entries}[0]->{packager}/; - s/<<>>/$::bldkit_config->{kit}{entries}[0]->{url}/; - s/<<>>/$comp->{ospkgdeps}/; - s/<<>>/$comp->{kitpkgdeps}/; - s/<<>>/$comp->{kitcompdeps}/; - s/<<>>/$comp->{description}/; - s/<<>>/$nonnativepkgs/; - s/<<>>/$sourcetar/; - s/<<>>/$setup/; - s/<<>>/$files/; - s/<<>>/$prescript/; - s/<<>>/$postscript/; - s/<<>>/$preupscript/; - s/<<>>/$postupscript/; - s/<<>>/$preunscript/; -s/<<>>/$postunscript/; - } - } elsif ($level eq 'PREREQUISITE') { - for (@lines) { - chomp; - s/<<>>/$kitname/; - s/<<>>/prep_$comp->{basename}/; - s/<<>>/$comp->{version}/; - s/<<>>/$comp->{release}/; -s/<<>>/$::bldkit_config->{kit}{entries}[0]->{kitlicense}/; -s/<<>>/$::bldkit_config->{kit}{entries}[0]->{vendor}/; -s/<<>>/$::bldkit_config->{kit}{entries}[0]->{packager}/; - s/<<>>/$::bldkit_config->{kit}{entries}[0]->{url}/; - s/<<>>/$comp->{ospkgdeps}/; - s/<<>>//; - s/<<>>//; - s/<<>>/$comp->{description}/; - s/<<>>//; - s/<<>>//; - s/<<>>//; - s/<<>>//; - s/<<>>/$prescript/; - s/<<>>//; - s/<<>>/$preupscript/; - s/<<>>//; - s/<<>>/$preunscript/; - s/<<>>//; - } - - } elsif ($level eq 'METARPM') { - for (@lines) { - chomp; - s/<<>>/$kitname/; - s/<<>>/$comp->{basename}/; - s/<<>>/$comp->{version}/; - s/<<>>/$comp->{release}/; -s/<<>>/$::bldkit_config->{kit}{entries}[0]->{kitlicense}/; -s/<<>>/$::bldkit_config->{kit}{entries}[0]->{vendor}/; -s/<<>>/$::bldkit_config->{kit}{entries}[0]->{packager}/; - s/<<>>/$::bldkit_config->{kit}{entries}[0]->{url}/; - s/<<>>//; - s/<<>>/$comp->{kitpkgdeps}/; - - #Update kitcompdeps for prep_ - if ($::VALID_PRER_COMPONENT) { -s/<<>>/$comp->{kitcompdeps},prep_$comp->{basename}/; - } else { -s/<<>>/$comp->{kitcompdeps}/; - } - s/<<>>/$comp->{description}/; - s/<<>>/$nonnativepkgs/; - s/<<>>/$sourcetar/; - s/<<>>/$setup/; - s/<<>>/$files/; - s/<<>>//; - s/<<>>/$postscript/; - s/<<>>//; - s/<<>>/$postupscript/; - s/<<>>/$preunscript/; -s/<<>>/$postunscript/; - } - } - - # Write the generated spec file - mkpath($tmpdir); - - my $fn; - my $NSF; - if ($level eq 'PREREQUISITE') { - $fn = $comp->{kitcompname} . "-prep.spec" - } else { - $fn = $comp->{kitcompname} . ".spec" - } - unless (open($NSF, ">$tmpdir$fn")) { - return 1; - } - if ($::VERBOSE) { - print "Created kitcomponent spec file \'$tmpdir$fn\'\n"; - - } - foreach my $line (@lines) { - print $NSF $line, "\n"; - } - - close($NSF); - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 build_kitcomp_debian - - - -=cut - -#----------------------------------------------------------------------------- -sub build_kitcomp_debian { - my $comp = shift; - my %repo; - my $debbuilddir = $::workdir . "/debbuild/" . $comp->{kitcompname}; - my $kcmetaname = comppkgname($comp); - - #If this kitcomponent has external non-native pkgs, - #skip the meta package build - if (defined($::NON_NATIVE_PKGS) && - defined($::NON_NATIVE_PKGS->{ $comp->{kitcompname} }) && - $::NON_NATIVE_PKGS->{ $comp->{kitcompname} }) { - if ($::VERBOSE) { - print "Kit component $comp->{kitcompname} has external non-native packages. Skipping rpm build for $kcmetaname. \n"; - } - return 0; - } - - # find the kitrepo hash for this component - foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { - if ($comp->{kitrepoid} eq $kr->{kitrepoid}) { - %repo = %{$kr}; - last; - } - } - - - #run the dpkg-buildpackage command - my $curdir = $::workdir; - my $cmd = "rm -Rf $debbuilddir"; - system($cmd); - mkpath($debbuilddir); - - $::VALID_PREP_COMPONENT = 0; - - if (!$::PREREQUISITE) { - if ($comp->{ospkgdeps} || $comp->{preinstall} || $comp->{preupgrade} || $comp->{preuninstall}) { - - #Create debian directory for this kit component preppackage - - if (&gen_kitcomp_debdir_prep($comp, \%repo)) { return 1; } - $::VALID_PREP_COMPONENT = 1; - - # build prep deb - my $prep_compversion = $comp->{version} . "-" . $comp->{release}; - my $prep_buildstring = "Prep Kit component build package."; - my $prep_debbuilddir = $::workdir . "/debbuild/" . "prep-" . $comp->{kitcompname}; - my $prep_debianbuildcmd = "cd $prep_debbuilddir;debchange -v $prep_compversion -b -c debian/changelog $prep_buildstring;dpkg-buildpackage $dpkg_flag"; - - if (system($prep_debianbuildcmd)) { - print "Error running \"dpkg-buildpackage $dpkg_flag\" command for kit component prep-$comp->{kitcompname} meta package\n"; - return 1; - } - } - - #Create debian directory for this kit component metapackage - - if (&gen_kitcomp_debdir($comp, \%repo, 'METADEB')) { return 1; } - - } else { - - #Create debian directory for this kit component - - if (&gen_kitcomp_debdir($comp, \%repo, 'ALL')) { return 1; } - - } - - - - if (defined($comp->{non_native_pkgs})) { - my $sourcedir = $::workdir . "/source_packages"; - - foreach my $pkgfile (split(/,/, $comp->{non_native_pkgs})) { - my $pkg_file; - my ($key, $value) = split /:/, $pkgfile; - if ("$key" =~ /EXTERNALPKGS/) { - $pkg_file = $value; - } else { - $pkg_file = $key; - } - - $cmd = "cp -p $sourcedir/$pkg_file $debbuilddir"; - if (system($cmd)) { - print "Error copying non-native package file $sourcedir/$pkg_file to debbuilddir\n"; - return 1; - } - } - } - my $compversion = $comp->{version} . "-" . $comp->{release}; - my $buildstring = "\'Kit component build package.\'"; - my $debianbuildcmd = "cd $debbuilddir;debchange -v $compversion -b -c debian/changelog $buildstring;dpkg-buildpackage $dpkg_flag"; - if (!$::NON_NATIVE_PKGS->{ $comp->{kitcompname} }) { - if (system($debianbuildcmd)) { - print "Error running \"dpkg-buildpackage $dpkg_flag\" command for kit component $comp->{kitcompname} meta package\n"; - return 1; - } - my $repodir = $::base_repodir . "/" . $repo{kitreponame}; - my @builtdebs = `find $::workdir/debbuild -maxdepth 1 -name "*.deb"`; - foreach my $deb (@builtdebs) { - chomp($deb); - if (system("cp -fp $deb $repodir")) { - print "Error copying package $deb to build repo directory $repodir \n"; - return 1; - } - } - } - return 0; -} - - -#----------------------------------------------------------------------------- - -=head3 gen_kitcomp_debdir_prep - - - -=cut - -#----------------------------------------------------------------------------- -sub gen_kitcomp_debdir_prep { - my $comp = shift; - my $repo = shift; - my $scriptdir = $::workdir . "/scripts/"; - my $combuilddir = $::workdir . "/debbuild/" . "prep-" . $comp->{kitcompname}; - - #copy the debian dir template to the build path - mkpath("$combuilddir/debian"); - my $cmd = "cp -Rf " . $::XCATSHARE . "/kits/debian_template/* $combuilddir/debian/"; - system($cmd); - - my $kitname = $::bldkit_config->{kit}{entries}[0]->{basename}; - my $kitcompname = "prep-" . $comp->{kitcompname}; - my $upgradeflag = "pre-" . $comp->{basename} . ".tmp"; - - my ($prescript, $postscript, $preupscript, $postupscript, $preunscript, $postunscript, $nonnativepkgs) = ''; - if (defined($comp->{preinstall})) { - $prescript = &load_script("$scriptdir$comp->{preinstall}"); - } - if (defined($comp->{preupgrade})) { - $preupscript = &load_script("$scriptdir$comp->{preupgrade}"); - } - if (defined($comp->{preuninstall})) { - $preunscript = &load_script("$scriptdir$comp->{preuninstall}"); - } - - #replace all special sub string in all files under debian - unless (opendir(DH, "${combuilddir}/debian/")) { - print "Can not open the xCAT Kit Component debian dir: ${combuilddir}/debian/"; - return 1; - } - - foreach (readdir(DH)) { - my $file = "${combuilddir}/debian/$_"; - if (-d $file) { - next; - } - - unless (open(FH, "<", $file)) { - print "Error attempting to open the xCAT Kit Component ${kitcompname}'s debian template file $file.\n"; - close(DH); - return 1; - } - - if ($::VERBOSE) { - print "Reading the xCAT Kit Component ${kitcompname}'s debian template file $file. \n"; - } - my @lines = ; - close(FH); - my $prep_comp_name = "prep-" . $comp->{basename}; - for (@lines) { - chomp; - s/<<>>/$prep_comp_name/; - s/<<>>/$comp->{ospkgdeps}/; - s/<<>>//; - s/<<>>//; - s/<<>>/$comp->{description}/; - s/<<>>/$upgradeflag/; - s/<<>>/$prescript/; - s/<<>>//; - s/<<>>/$preupscript/; - s/<<>>//; - s/<<>>/$preunscript/; - s/<<>>//; - - } - my $joined_lines = join("\n", @lines); - @lines = split(/\\n/, $joined_lines); - - open(FH, ">", $file); - if ($::VERBOSE) { - print "Created kitcomponent ${kitcompname}'s build file under debian dir $file"; - } - print FH @lines; - close(FH); - } - closedir(DH); - - return 0; -} - - - -#----------------------------------------------------------------------------- - -=head3 gen_kitcomp_debdir - - - -=cut - -#----------------------------------------------------------------------------- -sub gen_kitcomp_debdir { - my $comp = shift; - my $repo = shift; - my $level = shift; - my $scriptdir = $::workdir . "/scripts/"; - my $combuilddir = $::workdir . "/debbuild/" . $comp->{kitcompname}; - - #copy the debian dir template to the build path - mkpath("$combuilddir/debian"); - my $cmd = "cp -Rf " . $::XCATSHARE . "/kits/debian_template/* $combuilddir/debian/"; - system($cmd); - - my $kitname = $::bldkit_config->{kit}{entries}[0]->{basename}; - my $kitcompname = $comp->{kitcompname}; - my $upgradeflag = $comp->{basename} . ".tmp"; - - my ($prescript, $postscript, $preupscript, $postupscript, $preunscript, $postunscript, $nonnativepkgs) = ''; - - if ($level eq 'METADEB' || $level eq 'ALL') - { - if (defined($comp->{postinstall})) { - $postscript = &load_script("$scriptdir$comp->{postinstall}"); - } - - if (defined($comp->{postupgrade})) { - $postupscript = &load_script("$scriptdir$comp->{postupgrade}"); - } - if (defined($comp->{postuninstall})) { - $postunscript = &load_script("$scriptdir$comp->{postuninstall}"); - } - if (defined($comp->{non_native_pkgs})) { - $nonnativepkgs = "\n"; - $nonnativepkgs .= "mkdir -p \$RPM_BUILD_ROOT/opt/xcat/kits/$kitname/$kitcompname \n"; - $nonnativepkgs .= "cp -a * \$RPM_BUILD_ROOT/opt/xcat/kits/$kitname/$kitcompname \n"; - } - } - if ($level eq 'ALL') - { - if (defined($comp->{preinstall})) { - $prescript = &load_script("$scriptdir$comp->{preinstall}"); - } - if (defined($comp->{preupgrade})) { - $preupscript = &load_script("$scriptdir$comp->{preupgrade}"); - } - if (defined($comp->{preuninstall})) { - $preunscript = &load_script("$scriptdir$comp->{preuninstall}"); - } - } - - - #replace all special sub string in all files under debian - unless (opendir(DH, "${combuilddir}/debian/")) { - print "Can not open the xCAT Kit Component debian dir: ${combuilddir}/debian/"; - return 1; - } - - foreach (readdir(DH)) { - my $file = "${combuilddir}/debian/$_"; - if (-d $file) { - next; - } - - unless (open(FH, "<", $file)) { - print "Error attempting to open the xCAT Kit Component ${kitcompname}'s debian template file $file.\n"; - close(DH); - return 1; - } - - if ($::VERBOSE) { - print "Reading the xCAT Kit Component ${kitcompname}'s debian template file $file. \n"; - } - my @lines = ; - close(FH); - my $prepcomp = "prep-" . $comp->{basename}; - for (@lines) { - chomp; - s/<<>>/$comp->{basename}/; - s/<<>>/$comp->{ospkgdeps}/; - s/<<>>/$comp->{kitpkgdeps}/; - if ($::VALID_PREP_COMPONENT) { -s/<<>>/$comp->{kitcompdeps},$prepcomp/; - } - else - { -s/<<>>/$comp->{kitcompdeps}/; - } - - s/<<>>/$comp->{description}/; - s/<<>>/$upgradeflag/; - s/<<>>/$prescript/; - s/<<>>/$postscript/; - s/<<>>/$preupscript/; - s/<<>>/$postupscript/; - s/<<>>/$preunscript/; -s/<<>>/$postunscript/; - } - my $joined_lines = join("\n", @lines); - @lines = split(/\\n/, $joined_lines); - - open(FH, ">", $file); - if ($::VERBOSE) { - print "Created kitcomponent ${kitcompname}'s build file under debian dir $file"; - } - print FH @lines; - close(FH); - } - closedir(DH); - - if (defined($comp->{non_native_pkgs})) { - unless (open(FH, ">", "${combuilddir}/debian/dir")) { - print "Error attempting to open the xCAT Kit Component ${kitcompname}'s debian file dir.\n"; - return 1; - } - print FH "opt/xcat/kits/$kitname/$kitcompname/"; - close(FH); - - unless (open(FH, ">", "${combuilddir}/debian/install")) { - print "Error attempting to open the xCAT Kit Component ${kitcompname}'s debian file dir.\n"; - return 1; - } - foreach my $pkgfile (split(/,/, $comp->{non_native_pkgs})) { - my $pkgname = ''; - my ($key, $value) = split /:/, $pkgfile; - if ("$key" =~ /EXTERNALPKGS/) { - $pkgname = $value; - } else { - $pkgname = $key; - } - print FH "$pkgname opt/xcat/kits/$kitname/$kitcompname/ \n"; - } - close(FH); - } - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 load_script - - load a kitcomponent script into a single return string - with imbedded newline chars - input: fullpath of scriptname - -=cut - -#----------------------------------------------------------------------------- -sub load_script -{ - my $scriptname = shift; - my $SF; - unless (open($SF, "<", $scriptname)) { - print "Error attempting to open the file $scriptname. \n"; - return; - } - if ($::VERBOSE) { - print "Reading the file $scriptname. \n"; - } - my @lines = <$SF>; - close $SF; - - my $script_contents = join('', @lines); - return $script_contents; -} - -#----------------------------------------------------------------------------- - -=head3 create_kitconf - - Create the kit configuration file to put into the kit tar file. - -=cut - -#----------------------------------------------------------------------------- -sub create_kitconf -{ - # Build kit config file entries from buildkit config input - my $kitname = $::bldkit_config->{kit}{entries}[0]->{kitname}; - foreach my $s (keys %{$::bldkit_config}) { - if (!defined($::buildkit_def{$s})) { next; } - if ($s eq 'kitpackage') { next; } - my $li = 0; - foreach my $se (@{ $::bldkit_config->{$s}{entries} }) { - $::kit_config->{$s}{entries}[$li]->{kitname} = $kitname; - - # copy all defined attrs over - foreach my $a (keys %{ $::buildkit_def{$s} }) { - if (($::buildkit_def{$s}{$a}->{cp_to_kitconfig} eq '1') && - (defined($se->{$a}))) { - if ($s eq 'kitcomponent') { - if ($a eq 'kitpkgdeps') { - my $value; - foreach my $d (split(/,/, $se->{$a})) { - $d =~ s/\s+//g; - $d =~ s/^([\w\.\-]+)[<>=]*.*$/$1/; - $value .= "$d,"; - } - $value =~ s/(\,)*$//; - $se->{$a} = $value; - } - } - $::kit_config->{$s}{entries}[$li]->{$a} = $se->{$a}; - } - - # cp_to_kitconfig=2 means copy the file to the new kit - # but only do the copy if this is a final kit build - if (($::buildkit_def{$s}{$a}->{cp_to_kitconfig} eq '2') && - (defined($se->{$a})) && - !$::HAVE_EXTERNAL_PKG && !$::HAVE_NON_NATIVE_PKGS) { - my $prefix = "$kitname"; - if ($s eq 'kitcomponent') { - $prefix = "$::bldkit_config->{$s}{entries}[$li]->{kitcompname}"; - if (($a eq 'postbootscripts') || - ($a eq 'genimage_postinstall')) { - $prefix = "KIT_" . $prefix; - } - if (!($::kit_config->{$s}{entries}[$li]->{$a} = - &cp_to_builddir($a, $se->{$a}, $::workdir . '/' . $::buildkit_def{$s}{$a}->{base_dir}, $prefix, $::bldkit_config->{$s}{entries}[$li]))) { - return 1; - } - } else { - if (!($::kit_config->{$s}{entries}[$li]->{$a} = - &cp_to_builddir($a, $se->{$a}, $::workdir . '/' . $::buildkit_def{$s}{$a}->{base_dir}, $prefix))) { - return 1; - } - } - } - } - - # Handle special attrs, these 3 attributes did not defined in the buildkit.conf, special cases. - if ($s eq 'kitrepo') { - $::kit_config->{$s}{entries}[$li]->{kitreponame} = - $se->{kitreponame}; - } elsif ($s eq 'kitcomponent') { - $::kit_config->{$s}{entries}[$li]->{kitcompname} = - $se->{kitcompname}; - $::kit_config->{$s}{entries}[$li]->{kitreponame} = - $se->{kitreponame}; - if (!$::PREREQUISITE and ($se->{ospkgdeps} || $se->{preinstall} || $se->{preupgrade} || $se->{preuninstall})) { - if ($debianflag) { - $::kit_config->{$s}{entries}[$li]->{prerequisite} = - "prep-" . $se->{basename}; - } else { - $::kit_config->{$s}{entries}[$li]->{prerequisite} = - "prep_" . $se->{basename}; - } - } - } - $li++; - } - } - - # Handle external packages - if ($::HAVE_EXTERNAL_PKG) { - foreach my $kp (@{ $::bldkit_config->{kitpackage}{entries} }) { - if ($kp->{isexternalpkg} eq 'yes') { - my %current_entry; - $current_entry{filename} = $kp->{filename}; - $current_entry{kitreponame} = $kp->{kitreponame}; - push(@{ $::kit_config->{EXTERNALPKG}{'entries'} }, {%current_entry}); - } - } - } - - - # Handle non_native_pkgs - foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { - if ($::NON_NATIVE_PKGS->{ $kc->{kitcompname} }) { - my @nativefiles; - foreach my $pkgfile (split(/,/, $kc->{non_native_pkgs})) { - my ($key, $value) = split /:/, $pkgfile; - if ("$key" =~ /EXTERNALPKGS/) { - push(@nativefiles, $value); - } - } - - my %current_entry; - $current_entry{filename} = join ',', @nativefiles; - $current_entry{kitcompname} = $kc->{kitcompname}; - $current_entry{basename} = $kc->{basename}; - $current_entry{kitreponame} = $kc->{kitreponame}; - push(@{ $::kit_config->{NONNATIVEPKGS}{'entries'} }, {%current_entry}); - } - } - - - # Write Kit Config File - my @lines; - my $li = 0; - $lines[ $li++ ] = "# Kit Configuration File for $kitname generated by buildkit\n"; - $lines[ $li++ ] = "kitbuildinfo: \n"; - my $xCAT_buildkit_version = ''; - if ($debianflag) { - $xCAT_buildkit_version = `dpkg-query --show -f='\${Version}' xcat-buildkit`; - } - else { - $xCAT_buildkit_version = `rpm -q --qf \"%{VERSION}-%{RELEASE}\" xCAT-buildkit`; - } - $lines[ $li++ ] = " xCAT_version = $xCAT_buildkit_version \n"; - $lines[ $li++ ] = " build_date = " . localtime() . "\n"; - $lines[ $li++ ] = " kitframework = $::KITFRAMEWORK \n"; - $lines[ $li++ ] = " compatible_kitframeworks = $::COMPATIBLE_KITFRAMEWORKS \n"; - - foreach my $s ('kit', 'kitrepo', 'kitcomponent', 'EXTERNALPKG', 'NONNATIVEPKGS') { - foreach my $se (@{ $::kit_config->{$s}{entries} }) { - $lines[ $li++ ] = "$s: \n"; - foreach my $a (keys %{$se}) { - $lines[ $li++ ] = " $a = $se->{$a} \n"; - } - } - } - - if ((!-d $::deploy_dir) && (!mkpath($::deploy_dir))) { - print "Error creating build directory $::deploy_dir.\n"; - return; - } - - my $full_kit_conf = $::deploy_dir . "/" . $::kit_conf; - my $NCF; - unless (open($NCF, ">$full_kit_conf")) { - return 1; - } - if ($::VERBOSE) { - print "Wrote new kit configuration file $full_kit_conf \n"; - } - print $NCF @lines; - close($NCF); - - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 cp_to_builddir - - Copy specified files into the build directory renaming as indicated - and substituting strings if needed - -=cut - -#----------------------------------------------------------------------------- -sub cp_to_builddir -{ - my $type = shift; - my $files = shift; - my $from_dir = shift; - my $prefix = shift; - my $kitcomp = shift; - - my $copied_files; - my $other_files = $::deploy_dir . "/other_files"; - if ((!-d $other_files) && (!mkpath($other_files))) { - print "Error creating build directory $other_files.\n"; - return; - } - foreach my $file (split(/\,/, $files)) { - $file =~ s/\s+//g; - my $from_file = $from_dir . "/" . $file; - my $from_file_base = basename($file); - my $to_file_base = $prefix . "_" . $from_file_base; - my $to_file = $other_files . "/" . $to_file_base; - - # Read in the file - my $FF; - unless (open($FF, "<", $from_file)) { - print "The Kit file $from_file could not be read. \n"; - return 1; - } - my @lines = <$FF>; - for (@lines) { -s/<<>>/$::bldkit_config->{kit}{entries}[0]->{kitname}/g; -s/<<>>/$::bldkit_config->{kit}{entries}[0]->{basename}/g; -s/<<>>/$::bldkit_config->{kit}{entries}[0]->{version}/g; -s/<<>>/$::bldkit_config->{kit}{entries}[0]->{release}/g; - if (defined($kitcomp)) { -s/<<>>/$kitcomp->{kitcompname}/g; -s/<<>>/$kitcomp->{basename}/g; -s/<<>>/$kitcomp->{version}/g; -s/<<>>/$kitcomp->{release}/g; - } - } - - # Write the file back out - my $TF; - unless (open($TF, ">$to_file")) { - print "Error copying file $from_file to build directory $other_files \n"; - return 1; - } - if ($::VERBOSE) { - print "Copied $from_file to $to_file replacing kit and kitcomponent strings as needed. \n"; - } - print $TF @lines; - close($TF); - - $copied_files .= ",$to_file_base"; - - if (($type eq 'postbootscripts') || - ($type eq 'genimage_postinstall')) { - system("chmod 755 $to_file"); - } - } - $copied_files =~ s/^\,//; - return $copied_files; -} - -#----------------------------------------------------------------------------- - -=head3 create_builddir - - Create the build directory and copy in all required files for building - the kit tar file. - -=cut - -#----------------------------------------------------------------------------- -sub create_builddir -{ - my $kitname = $::bldkit_config->{kit}{entries}[0]->{kitname}; - - # Note: - # - repos already created and validated - # - kit.conf file already created - # - exlists, postbootscripts, and deployparams already copied - - # copy plugins to build dir and edit to insert correct plugin and kit names - my $plugin_dir = $::deploy_dir . "/plugins"; - if (-d "$::workdir/plugins") { - if ((!-d $plugin_dir) && (!mkpath($plugin_dir))) { - print "Error creating build directory $plugin_dir.\n"; - return 1; - } - - foreach my $plugin (<$::workdir/plugins/*.pm>) { - my $plugin_base = basename($plugin); - my $mod_kitname = $kitname; - $mod_kitname =~ s/\-/\_/g; - $mod_kitname =~ s/\./\_/g; - my $to_plugin = $plugin_dir . "/" . $mod_kitname . "_" . $plugin_base; - - if (system("cp -fp $plugin $to_plugin")) { - - # non-zero return from system call - print "Error copying plugin file $plugin to build directory $plugin_dir \n"; - return 1; - } - if (&edit_plugin($to_plugin)) { return 1; } - } - } - - # copy docs to build dir - if (-d "$::workdir/docs") { - if (system("cp -fRp $::workdir/docs $::deploy_dir")) { - - # non-zero return from system call - print "Error copying doc files $::workdir/docs to build directory $::deploy_dir \n"; - return 1; - } - } - - # Edit deploy params file to make sure correct format for xCAT - if (defined($::kit_config->{kit}{entries}[0]->{kitdeployparams})) { - my $kd_file = $::deploy_dir . "/other_files/" . $::kit_config->{kit}{entries}[0]->{kitdeployparams}; - if (&edit_deployparams($kd_file)) { return 1; } - } - - if ($::HAVE_EXTERNAL_PKG or $::HAVE_NON_NATIVE_PKGS) { - - # Copy the kitcomponent meta rpm spec if there is external non_native_pkgs. - if ($debianflag) { - foreach my $comp (keys %{$::NON_NATIVE_PKGS}) { - my $kitrepo; - foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { - if ($comp eq $kc->{kitcompname}) { - $kitrepo = $kc->{kitreponame} - } - } - mkpath("$::deploy_dir/tmp/"); - my $cmd = "cp -fRP $::workdir/debbuild/$comp $::deploy_dir/tmp/$comp"; - if (system("$cmd")) { - print "Error copying kitcomponent meta debian build file $::workdir/debbuild/$comp to build directory $::deploy_dir \n"; - return 1; - } - } - } - - # Copy over the original buildkit.conf file and input files - # to help make addpkgs processing easier later - mkpath("$::deploy_dir/build_input/"); - if (system("cp -fp $::full_buildkit_conf $::deploy_dir/build_input")) { - - # non-zero return from system call - print "Error copying buildkit config file $::full_buildkit_conf to build directory $::deploy_dir/build_input \n"; - return 1; - } - } - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 create_PARTIAL_builddir - - Create the build directory for a PARTIAL kit (needs external pkgs) - and copy in all required files for building the kit tar file. - This includes most build input without editting files since - they will need to be generated at addpkgs time. - -=cut - -#----------------------------------------------------------------------------- -sub create_PARTIAL_builddir -{ - my $kitname = $::bldkit_config->{kit}{entries}[0]->{kitname}; - - # Note: - # - repos already created and validated - # - kit.conf file already created - # - exlists, postbootscripts, and deployparams already copied - - # copy docs to build dir - if (-d "$::workdir/docs") { - if (system("cp -fRp $::workdir/docs $::deploy_dir")) { - - # non-zero return from system call - print "Error copying doc files $::workdir/docs to build directory $::deploy_dir \n"; - return 1; - } - } - - # Copy over the original buildkit.conf file and input files - # to help make addpkgs processing easier later - mkpath("$::deploy_dir/build_input/"); - if (system("cp -fp $::full_buildkit_conf $::deploy_dir/build_input")) { - - # non-zero return from system call - print "Error copying buildkit config file $::full_buildkit_conf to build directory $::deploy_dir/build_input \n"; - return 1; - } - if (-d "$::workdir/other_files") { - if (system("cp -fpR $::workdir/other_files $::deploy_dir/build_input")) { - - # non-zero return from system call - print "Error copying $::workdir/otherfiles to build directory $::deploy_dir/build_input \n"; - return 1; - } - } - if (-d "$::workdir/plugins") { - if (system("cp -fpR $::workdir/plugins $::deploy_dir/build_input")) { - - # non-zero return from system call - print "Error copying $::workdir/plugins to build directory $::deploy_dir/build_input \n"; - return 1; - } - } - if (-d "$::workdir/scripts") { - if (system("cp -fpR $::workdir/scripts $::deploy_dir/build_input")) { - - # non-zero return from system call - print "Error copying $::workdir/scripts to build directory $::deploy_dir/build_input \n"; - return 1; - } - } - - # Copy over any provided non-native packages - my $to_source_dir = "$::deploy_dir/build_input/source_packages"; - mkpath("$to_source_dir"); - foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { - if (defined($kc->{non_native_pkgs})) { - my $sourcedir = $::workdir . "/source_packages"; - foreach my $pkgfile (split(/,/, $kc->{non_native_pkgs})) { - my $pkg_file; - my ($key, $value) = split /:/, $pkgfile; - if ("$key" =~ /EXTERNALPKGS/) { - next; - } else { - $pkg_file = $key; - } - - my $cmd = "cp -p $sourcedir/$pkg_file $to_source_dir"; - if (system($cmd)) { - print "Error copying non-native package file $sourcedir/$pkg_file to $to_source_dir \n"; - return 1; - } - } - } - } - - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 edit_deployparams - - Edit the kit deployment parameters to make sure it has correct - syntax for xCAT otherpkglist support - - -=cut - -#----------------------------------------------------------------------------- -sub edit_deployparams -{ - my $file = shift; - my $validate_only = shift; - - # read in the file - my $DF; - unless (open($DF, "<", $file)) { - print "The Kit deployment parameters file $file could not be read. \n"; - return 1; - } - my @lines = <$DF>; - close $DF; - - # Edit the files - my $changed = 0; - my @new_lines; - my $ln = 0; - foreach my $l (@lines) { - $ln++; - - # skip blank lines - if ($l =~ /^\s*$/) { - push(@new_lines, $l); - next; - } - - # #ENV lines - $l =~ s/^\s+//; # compress leading blanks - if ($l =~ /^\#ENV\:/) { - if (!($l =~ /\#\s*$/)) { - chomp $l; - $l .= "#\n"; - $changed = 1; - } - push(@new_lines, $l); - next; - } - - # skip all other comments - if ($l =~ /^\s*#/) { - push(@new_lines, $l); - next; - } - - # Add #ENV if not specified - if ($l =~ /^\w*\s*\=/) { - chomp $l; - $l = "#ENV: $l #"; - $changed = 1; - push(@new_lines, $l); - next; - } - - # Syntax error - print "Syntax error in kit deployment parameters file $file \n"; - print "line $ln: \n"; - print "$l \n"; - return 1; - } - - # Write the file back out - if ($changed && !$validate_only) { - my $NDF; - unless (open($NDF, ">$file")) { - return 1; - } - if ($::VERBOSE) { - print "Editted kit deployment parameters file $file \n"; - } - print $NDF @lines; - close($NDF); - } - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 edit_plugin - - Edit the kit plugin file to insert the full kit name - - -=cut - -#----------------------------------------------------------------------------- -sub edit_plugin -{ - my $file = shift; - my $kitname = $::bldkit_config->{kit}{entries}[0]->{kitname}; - - # convert dashes to underscore since the kitname is used as perl pkg names - # in the plugin and this causes perl syntax errors - my $mod_kitname = $kitname; - $mod_kitname =~ s/\-/\_/g; - $mod_kitname =~ s/\./\_/g; - - # read in the file - my $PF; - unless (open($PF, "<", $file)) { - print "The Kit plugin file $file could not be read. \n"; - return 1; - } - my @lines = <$PF>; - close $PF; - - for (@lines) { - s/<<>>/$kitname/g; - s/<<>>/$mod_kitname/g; - } - - # Write the plugin back out - my $NPF; - unless (open($NPF, ">$file")) { - return 1; - } - if ($::VERBOSE) { - print "Inserted kitname values into $file \n"; - } - print $NPF @lines; - close($NPF); - - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 kit_addpkgs - - buildkit addpkgs - -=cut - -#----------------------------------------------------------------------------- -sub kit_addpkgs -{ - # add RPM pkgs to an existing kit tarfile - my $kittarfile = $::KIT_ADDPKGS; - my $kitbfname = basename($kittarfile); - $kitbfname =~ s/.tar.bz2$//; - $kitbfname =~ s/.NEED_PRODUCT_PKGS$//; - my $tmpdir_base = "/tmp/$kitbfname"; - - # - could be list of pkgdir s - my @pkgdirlist = split(",", $::PKGDIR); - - print "$tmpdir_base\n"; - # Cleanup - should have been removed when last command ran - # - but just in case - system("rm -Rf $tmpdir_base"); - - # the tar file may not be in the current dir - $kittarfile = "$::workdir/$kittarfile"; - - if (!(-r $kittarfile)) { - print "The Kit tar file $kittarfile could not be read. \n"; - return 1; - } - $kittarfile = abs_path($kittarfile); - - foreach my $rpmdir (@pkgdirlist) { - if (!(-d $rpmdir)) { - print "The package directory $rpmdir could not be read. \n"; - return 1; - } - } - - # Create work directory - if ((!-d $tmpdir_base) && (!mkpath($tmpdir_base))) { - print "Error creating temporary work directory $tmpdir_base\n"; - return 1; - } - - print "Extracting tar file $kittarfile. Please wait.\n"; - - if (system("cd $tmpdir_base; tar -jxf $kittarfile ")) { - print "Error extracting tarfile $kittarfile \n"; - - # Cleanup - system("rm -Rf $tmpdir_base"); - return 1; - } - - my $tmp_kit_conf = `find $tmpdir_base -name kit.conf`; - chomp($tmp_kit_conf); - my $tmpdir = dirname($tmp_kit_conf); - - # read in the file - my $CKF; - unless (open($CKF, "<", $tmp_kit_conf)) { - print "The Kit configuration file $tmp_kit_conf could not be read or was not included in the kit tar file. \n"; - - # Cleanup - system("rm -Rf $tmpdir_base"); - return 1; - } - my @lines = <$CKF>; - close $CKF; - - $::PREREQUISITE = 1; - foreach my $l (@lines) { - - # skip blank and comment lines - if ($l =~ /^\s*$/ || $l =~ /^\s*#/) { - next; - } - if ($l =~ /prerequisite/) { - $::PREREQUISITE = 0; - } - } - - # - # check contents of kit.conf to make sure the framework - # is compatible with this codes framework - $::kitframework = &check_framework(\@lines); - if (!defined($::kitframework)) { - return 1; - } - - # if this in not a partial kit then the framework must be 2 or greater - my $kit_name = basename($kittarfile); - if ((!($kit_name =~ /NEED_PRODUCT_PKGS/)) && ($::kitframework < 2)) { - print "This kit cannot be updated. To update a complete kit the kit framework\n value must be greater than or equal to 2. You can use the\n\t\'lskit -F \' \ncommand to check the framework value of the kit.\n"; - return 1; - } - - ### Check if this is a new partial kit built with xCAT 2.8.1 or newer - if (-d "$tmpdir/build_input") { - system("mv $tmpdir/build_input $tmpdir_base"); - return &NEW_kit_addpkgs($tmpdir_base, $tmpdir); - } - - ### OLD KITS BUILT PRIOR TO xCAT 2.8.1 - ### this code will eventually become obsolete and should be removed - ### do not update - if (defined($::KITVERSION) || defined($::KITRELEASE)) { - print "kitversion and kitrelease substitution is not supported for this incomplete kit. Run \"buildkit addpkgs\" without the \"-k|--kitversion\" and \"-r| --kitrelease\" options. \n"; - exit 1; - } - - my $rpmdir = $::PKGDIR; - - my $ext_filename = ''; - my $ext_reponames = ''; - my $non_native_filename = ''; - my $non_native_kitcompname = ''; - my $non_native_basename = ''; - my $non_native_kitreponame = ''; - my %create_repodata_list; - my @new_lines; - my $section = ''; - my $kitname = ''; - my $kitbasename = ''; - my $kitversion = ''; - my $kitostype = ''; - - foreach my $l (@lines) { - - # skip blank and comment lines - if ($l =~ /^\s*$/ || $l =~ /^\s*#/) { - push(@new_lines, $l); - next; - } - - # new section? - if ($l =~ /^\s*(\w+)\s*:/) { - $section = $1; - if ($section eq 'EXTERNALPKG') { - $ext_filename = ''; - $ext_reponames = ''; - next; - } - if ($section eq 'NONNATIVEPKGS') { - $non_native_filename = ''; - $non_native_kitcompname = ''; - $non_native_basename = ''; - $non_native_kitreponame = ''; - next; - } - push(@new_lines, $l); - next; - } - if ($l =~ /^\s*(\w+)\s*=\s*(.*)\s*/) { - my $attr = $1; - my $val = $2; - my $orig_attr = $attr; - my $orig_val = $val; - $attr =~ s/^\s*//; # Remove any leading whitespace - $attr =~ s/\s*$//; # Remove any trailing whitespace - $attr =~ tr/A-Z/a-z/; # Convert to lowercase - $val =~ s/^\s*//; - $val =~ s/\s*$//; - - - if ($section eq 'kit') { - if ($attr eq 'basename') { $kitbasename = $val; } - if ($attr eq 'version') { $kitversion = $val; } - if ($attr eq 'ostype') { $kitostype = $val; } - if (($kitbasename ne '') && ($kitversion ne '') && - ($kitostype ne '')) { - $kitname = "$kitbasename-$kitversion-$kitostype"; - } - } - - if ($section eq 'EXTERNALPKG') { - if ($attr eq 'filename') { - $ext_filename = $val; - } elsif ($attr eq 'kitreponame') { - $ext_reponames = $val; - } else { - next; - } - if (($ext_filename ne '') && ($ext_reponames ne '')) { - my $fromfile = $rpmdir . "/" . $ext_filename; - if (system("ls $fromfile > /dev/null")) { - print "The product package file $ext_filename could not be read from the package directory $rpmdir. \n"; - - # Cleanup - system("rm -Rf $tmpdir_base"); - return 1; - } - foreach my $repo (split(/,/, $ext_reponames)) { - my $repodir = $tmpdir . "/repos/" . $repo; - if (!-d ($repodir) && (!mkpath($repodir))) { - print "Error creating repository directory $repodir\n"; - - # Cleanup - system("rm -Rf $tmpdir_base"); - return 1; - } - if (system("cp -fp $fromfile $repodir")) { - print "Error copying package file $fromfile to $repodir \n"; - - # Cleanup - system("rm -Rf $tmpdir_base"); - return 1; - } - $create_repodata_list{$repodir} = 1; - } - } - next; - } - - if ($section eq 'NONNATIVEPKGS') { - if ($attr eq 'filename') { - $non_native_filename = $val; - } elsif ($attr eq 'kitcompname') { - $non_native_kitcompname = $val; - } elsif ($attr eq 'basename') { - $non_native_basename = $val; - } elsif ($attr eq 'kitreponame') { - $non_native_kitreponame = $val; - } else { - next; - } - if (($non_native_filename ne '') - && ($non_native_kitcompname ne '') - && ($non_native_basename ne '') - && ($non_native_kitreponame ne '')) { - - #find out the useful dir - my $tdir = $tmpdir . "/tmp/"; - my $source_dir = "$tdir/$non_native_kitcompname"; - my $spec = "$tdir/$non_native_kitcompname.spec"; - if (!-d "$tdir" or !-d "$source_dir") { - print "Error open kitcomponent rpm build direcotry $tdir or $tdir/$non_native_kitcompname \n"; - - # Cleanup - system("rm -Rf $tmpdir_base"); - return 1; - } - - #copy the nan_native_pkgs to the source dir - foreach my $tepmfilename (split(/,/, $non_native_filename)) { - - #the $non_native_filename may contain several pkgs, can check and copy at the same time - my $fromfile = $rpmdir . "/" . $tepmfilename; - if (system("ls $fromfile > /dev/null")) { - print "The product package file $non_native_filename could not be read from the package directory $rpmdir. \n"; - system("rm -Rf $tmpdir_base"); - return 1; - } - if (system("cp -fp $fromfile $tdir/$non_native_kitcompname")) { - print "Error copying package file $fromfile to $tdir/$non_native_kitcompname \n"; - - # Cleanup - system("rm -Rf $tmpdir_base"); - return 1; - } - } - - #for debian/ubuntu - my $repodir = $tmpdir . "/repos/" . $non_native_kitreponame; - if ($debianflag) { - my $debbuildcmd = "cd $source_dir;dpkg-buildpackage $dpkg_flag"; - if (system($debbuildcmd)) { - print "error running debian build cmd for kit component $non_native_basename meta package.\n"; - return 1; - } - my @debs = `find $tdir -maxdepth 1 -name "*.deb"`; - foreach my $debname (@debs) { - chomp($debname); - if (system("mv -f $debname $repodir")) { - print "Error copying package $debname to build repo directory $repodir. \n"; - return 1; - } - } - } - else { - if (!-r "$spec") { - print "Error open kitcomponent rpm build spec $tdir/$non_native_kitcompname.spec \n"; - - # Cleanup - system("rm -Rf $tmpdir_base"); - return 1; - } - my $rpmbuild_dir = $tmpdir . "/rpmbuild"; - my $cmd = "rm -Rf $rpmbuild_dir"; - system($cmd); - - my $avoiderr = $rpmbuild_dir . "/BUILDROOT/"; - mkpath($avoiderr); - $avoiderr = $rpmbuild_dir . "/BUILD/"; - mkpath($avoiderr); - $avoiderr = $rpmbuild_dir . "/SRPMS/"; - mkpath($avoiderr); - $avoiderr = $rpmbuild_dir . "/RPMS/noarch/"; - mkpath($avoiderr); - - unless (open(SF, "<", $spec)) { - print "Error attempting to open spec $spec of kitcomponent $non_native_basename. \n"; - return 1; - } - - mkpath("$rpmbuild_dir/SOURCES"); - $cmd = "cd $source_dir/..;mv $non_native_kitcompname $non_native_basename; tar -czf $rpmbuild_dir/SOURCES/$non_native_basename.tar.gz $non_native_basename;mv $non_native_basename $non_native_kitcompname;"; - if (system($cmd)) { - print "Error creating tarfile $rpmbuild_dir/SOURCES/$non_native_basename.tar from $source_dir/*"; - return 1; - } - my $rpmbuild_cmd = "rpmbuild --define \"_topdir $rpmbuild_dir\" -ba $spec"; - if (!$::VERBOSE) { - $rpmbuild_cmd .= ' --quiet '; - } - if (system($rpmbuild_cmd)) { - print "Error running rpmbuild command for kit component $non_native_basename meta package\n"; - return 1; - } - - # Copy the built meta rpm to repo - my @built_rpms = `find $rpmbuild_dir/RPMS -name "*.rpm"`; - foreach my $rpm (@built_rpms) { - chomp($rpm); - if (system("cp -fp $rpm $repodir")) { - print "Error copying rpm $rpm to build repo directory $repodir \n"; - return 1; - } - } - } - $create_repodata_list{$repodir} = 1; - } - next; - } - - push(@new_lines, $l); - } - } - - # Re-write kit.conf with EXTERNALPKG and NONNATIVEPKGS sections removed - my $NCF; - unless (open($NCF, ">$tmp_kit_conf")) { - return 1; - } - print $NCF @new_lines; - close($NCF); - - # Clean up RPMBUILD and tmp in kit directory - my $cmd = "rm -Rf $tmpdir/tmp"; - system("$cmd"); - unless ($debianflag) { - $cmd = "rm -Rf $tmpdir/rpmbuild"; - system("$cmd"); - } - - # Run createrepo for each updated directory - foreach my $repo (keys(%create_repodata_list)) { - my $createrepocmd = ''; - if ($debianflag) { - $createrepocmd = "cd $repo;dpkg-scanpackages . > Packages"; - } - else { - $createrepocmd = "createrepo $repo"; - } - if (system($createrepocmd )) { - print "Error running $createrepocmd. \n"; - - # Cleanup - system("rm -Rf $tmpdir_base"); - return 1; - } - } - - # Create new tar file in current directory - my $new_tarfile = $::workdir . '/' . $kitbfname . '.tar.bz2'; - if (system("cd $tmpdir; cd ..; tar -cjhf $new_tarfile $kitname/*")) { - print "Error building tarfile $new_tarfile \n"; - - # Cleanup - system("rm -Rf $tmpdir_base"); - return 1; - } - print "Kit tar file $new_tarfile successfully built \n"; - - # Cleanup - system("rm -Rf $tmpdir_base"); - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 NEW_kit_addpkgs - - buildkit addpkgs - -=cut - -#----------------------------------------------------------------------------- -sub NEW_kit_addpkgs -{ - # add RPM pkgs to an existing kit tarfile - my $tmpdir_base = shift; - my $tmpdir = shift; - - # - could be list of pkgdir dirs - my @pkgdirlist = split(",", $::PKGDIR); - - $::NEW_PARTIAL_KIT = 1; - $::workdir = "$tmpdir_base/build_input"; - $::full_buildkit_conf = $::workdir . "/" . $::buildkit_conf; - $::deploy_dir = $tmpdir_base; #kitname appended by validate_bldkitconf routine - - my $tmp_buildkit_conf = `find $tmpdir_base -name $::buildkit_conf`; - - chomp($tmp_buildkit_conf); - if ($tmp_buildkit_conf ne $::full_buildkit_conf) { - print "$tmp_buildkit_conf should match $::full_buildkit_conf .... error??? \n"; - } - - my $loadrc = &load_bldkitconf($tmp_buildkit_conf); - if ($loadrc != 0) { - print "Error reading buildkit config file $tmp_buildkit_conf \n"; - return 1; - } - - if (defined($::KITVERSION)) { - $::bldkit_config->{kit}{entries}[0]->{version} = $::KITVERSION; - } - if (defined($::KITRELEASE)) { - $::bldkit_config->{kit}{entries}[0]->{release} = $::KITRELEASE; - } - - my $chkrc = &validate_bldkitconf(); - if ($chkrc != 0) { - print "Error validating buildkit config file $tmp_buildkit_conf \n"; - return 1; - } - - if ($tmpdir ne $::deploy_dir) { - if (system("mv $tmpdir $::deploy_dir ")) { - print "Error moving $tmpdir to $::deploy_dir \n"; - return 1; - } - } - $::build_dir = $::deploy_dir; - $::base_repodir = "$::deploy_dir/repos"; - my $kitname = $::bldkit_config->{kit}{entries}[0]->{kitname}; - - # Handle external packages - if ($::HAVE_EXTERNAL_PKG) { - foreach my $kp (@{ $::bldkit_config->{kitpackage}{entries} }) { - if ($kp->{isexternalpkg} eq 'yes') { - my $ext_filename = $kp->{filename}; - my $ext_reponames = $kp->{kitreponame}; - my $files; - if ($debianflag) { - $files = xCAT::BuildKitUtils->find_latest_pkg_deb(\@pkgdirlist, $ext_filename); - } - else { - $files = xCAT::BuildKitUtils->find_latest_pkg(\@pkgdirlist, $ext_filename); - } - if (!defined($files)) { - print "Error: The product package file $ext_filename was not found in the package directory(s) @pkgdirlist.\n"; - - # Cleanup - system("rm -Rf $tmpdir_base"); - return 1; - } - - my @fromfiles = @$files; - - foreach my $repo (split(/,/, $ext_reponames)) { - my $repodir = $::base_repodir . "/" . $repo; - if (!-d ($repodir) && (!mkpath($repodir))) { - print "Error creating repository directory $repodir\n"; - - # Cleanup - system("rm -Rf $tmpdir_base"); - return 1; - } - - foreach my $fromfile (@fromfiles) { - if (system("cp -fp $fromfile $repodir")) { - print "Error copying package file $fromfile to $repodir \n"; - - # Cleanup - system("rm -Rf $tmpdir_base"); - return 1; - } - } - if ($::VERBOSE) { - print "Copied @fromfiles\n to $repodir\n"; - } - } - } - } - } - - # Handle non_native_pkgs - # Comma-separated list of non-native package - # paths that will be included as files in this kit - # component. - # these are not RPMs! - my $to_source_dir = "$::workdir/source_packages"; - mkpath("$to_source_dir"); - foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { - if ($::NON_NATIVE_PKGS->{ $kc->{kitcompname} }) { - my @nativefiles; - foreach my $pkgfile (split(/,/, $kc->{non_native_pkgs})) { - my ($key, $value) = split /:/, $pkgfile; - if ("$key" =~ /EXTERNALPKGS/) { - - #the $non_native_filename may contain several pkgs, can check and copy at the same time - foreach my $nnpkg (split(/,/, $value)) { - my $found = 0; - foreach my $pdir (@pkgdirlist) { - my $fromfile = $pdir . "/" . $nnpkg; - if (system("ls $fromfile > /dev/null")) { - next; - } else { - $found++; - if (system("cp -fp $fromfile $to_source_dir")) { - print "Error copying package file $fromfile to $to_source_dir \n"; - - # Cleanup - system("rm -Rf $tmpdir_base"); - next; - } else { - if ($::VERBOSE) { - print "Copied $fromfile to $to_source_dir\n"; - } - } - } - } - if (!$found) { - print "Could not find $nnpkg.\n"; - } - } - } - } - } - } - - # Turn off external pkg flags and build the kit component meta pkgs - $::HAVE_EXTERNAL_PKG = ''; - $::HAVE_NON_NATIVE_PKGS = ''; - $::NON_NATIVE_PKGS = {}; - - foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { - my $rc = 0; - if ($debianflag) { - $rc = &build_kitcomp_debian($kc); - } - else { - $rc = &build_kitcomp($kc); - } - if ($rc) { - print "Error building kitcomponent metapackage for $kc->{basename} \n"; - return 1; - } - } - - # run createrepo - foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { - my $repodir = "$::base_repodir/$kr->{kitreponame}"; - if (-d $repodir) { - my $cr_opts = ''; - if (($kr->{osbasename} =~ m/rh|RH|centos|CentOS/) && - ($kr->{osmajorversion} eq '5')) { - $cr_opts = '-s md5'; - } - my $repocmd = ""; - if ($debianflag) { - $repocmd = "cd $repodir;dpkg-scanpackages . > Packages"; - } - else { - $repocmd = "createrepo $cr_opts $repodir"; - } - if (system($repocmd )) { - print "Error building the repository meta-data with the createrepo command \n"; - return 1; - } - } - } - - - #When using -k -r, there are useless repodir - #delete useless repo dir - my $kitrepodirby = $::base_repodir; - my $cmdby = "/bin/ls $kitrepodirby 2>/dev/null"; - my $outputby = `$cmdby`; - my @allrepolist = split(/\n/, $outputby); - my @dellist; - - foreach my $reponame (@allrepolist) - { - my $match = 0; - foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) - { - my $repodirname = "$kr->{kitreponame}"; - - if (${repodirname} eq ${reponame}) - { - ${match}++; - } - } - if (${match} == 0) - { - push(@dellist, $reponame); - } - } - - foreach my $del (@dellist) - { - my $delrepodir = $::base_repodir . "/" . $del; - if (-d $delrepodir) - { - my $delcmd = "rm -Rf $delrepodir"; - if (system($delcmd)) - { - print "Failed to delete useless repo directory \n"; - } - } - } - - - # Build the full kit tar file - my $buildtar_rc = &kit_buildtar; - - # clean out the tmp dir - system("rm -Rf $tmpdir_base"); - - if ($buildtar_rc) { - print "Error building full kit tarfile \n"; - return 1; - } - return 0; -} - -#----------------------------------------------------------------------------- - -=head3 check_framework - - Check the compatible frameworks of the kit to see if it is - compatible with the running code. - - If one of the compatible frameworks of the kit matches one of the - compatible frameworks of the running code then we're good. - - NOTE: compatible_kitframeworks are the kitframeworks that I can add - and kit frameworks that I can be added to. - - Returns: - 0 - kit framework value - undef - error - - Example: - my $kitframework = &check_framework(\@lines); - -=cut - -#----------------------------------------------------------------------------- -sub check_framework -{ - my $lines = shift; - - my @kitconflines = @$lines; - - my $kitbasename; - my $kitcompat; - my $kitframework; - my $section = ''; - foreach my $l (@kitconflines) { - - # skip blank and comment lines - if ($l =~ /^\s*$/ || $l =~ /^\s*#/) { - next; - } - - if ($l =~ /^\s*(\w+)\s*:/) { - $section = $1; - next; - } - - if ($l =~ /^\s*(\w+)\s*=\s*(.*)\s*/) { - my $attr = $1; - my $val = $2; - $attr =~ s/^\s*//; # Remove any leading whitespace - $attr =~ s/\s*$//; # Remove any trailing whitespace - $attr =~ tr/A-Z/a-z/; # Convert to lowercase - $val =~ s/^\s*//; - $val =~ s/\s*$//; - - if ($section eq 'kitbuildinfo') { - if ($attr eq 'compatible_kitframeworks') { - $kitcompat = $val; - } - if ($attr eq 'kitframework') { - $kitframework = $val; - } - } - if ($section eq 'kit') { - if ($attr eq 'basename') { $kitbasename = $val; } - } - } - } - - if (!$kitcompat) { - print "Warning: Could not determine the kit compatible framework values for \'$kitbasename\' from the kit.conf file. Continuing for now.\n"; - return 0; - } - - my @kit_compat_list = split(',', $kitcompat); - my @my_compat_list = split(',', $::COMPATIBLE_KITFRAMEWORKS); - - foreach my $myfw (@my_compat_list) { - chomp $myfw; - foreach my $kitfw (@kit_compat_list) { - chomp $kitfw; - - if ($myfw eq $kitfw) { - return $kitframework; - } - } - } - print "Error: The kit named \'$kitbasename\' is not compatible with this version of the buildkit command. \'$kitbasename\' is compatible with \'$kitcompat\' and the buildkit command is compatible with \'$::COMPATIBLE_KITFRAMEWORKS\'\n"; - return undef; -} diff --git a/xCAT-buildkit/xCAT-buildkit.spec b/xCAT-buildkit/xCAT-buildkit.spec index 8531dac38..2b7d550a4 100644 --- a/xCAT-buildkit/xCAT-buildkit.spec +++ b/xCAT-buildkit/xCAT-buildkit.spec @@ -35,8 +35,6 @@ xCAT-buildkit provides the buildkit tool and sample kit files to build an xCAT k # Convert pods to man pages and html pages mkdir -p share/man/man1 mkdir -p share/doc/man1 -pod2man pods/man1/buildkit.1.pod > share/man/man1/buildkit.1 -pod2html pods/man1/buildkit.1.pod > share/doc/man1/buildkit.1.html %install rm -rf $RPM_BUILD_ROOT @@ -46,30 +44,18 @@ mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man1 mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/man1 -# These were built dynamically in the build phase -cp share/man/man1/* $RPM_BUILD_ROOT/%{prefix}/share/man/man1 -chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man1/* -cp share/doc/man1/* $RPM_BUILD_ROOT/%{prefix}/share/doc/man1 -chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/man1/* - %ifos linux cp -aR share/xcat/kits/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits/ -#chmod -R 644 $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits/* find $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits -type d -exec chmod 755 {} \; find $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits -type f -exec chmod 644 {} \; cp -a lib/perl/xCAT/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT -#chmod -R 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/* find $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT -type d -exec chmod 755 {} \; find $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT -type f -exec chmod 644 {} \; -cp -a bin/* $RPM_BUILD_ROOT/%{prefix}/bin/ -chmod -R 755 $RPM_BUILD_ROOT/%{prefix}/bin/* %else cp -hpR share/xcat/kits/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits/ chmod -R 644 $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits/* cp -hpR lib/perl/xCAT/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/ chmod -R 755 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/* -cp -hpR bin/* $RPM_BUILD_ROOT/%{prefix}/bin/ -chmod -R 755 $RPM_BUILD_ROOT/%{prefix}/bin/* %endif mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-buildkit From 36116078ac40b282865f06246ee09ebffe475b8f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 22 Jul 2019 16:21:02 -0400 Subject: [PATCH 216/276] Remove man pages for kit related commands --- .../admin-guides/references/man1/addkit.1.rst | 137 ------- .../references/man1/addkitcomp.1.rst | 154 -------- .../references/man1/buildkit.1.rst | 372 ------------------ .../references/man1/chkkitcomp.1.rst | 106 ----- .../admin-guides/references/man1/lskit.1.rst | 250 ------------ .../references/man1/lskitcomp.1.rst | 247 ------------ .../references/man1/lskitdeployparam.1.rst | 162 -------- .../admin-guides/references/man1/rmkit.1.rst | 151 ------- .../references/man1/rmkitcomp.1.rst | 162 -------- xCAT-buildkit/pods/man1/buildkit.1.pod | 285 -------------- xCAT-client/pods/man1/addkit.1.pod | 79 ---- xCAT-client/pods/man1/addkitcomp.1.pod | 90 ----- xCAT-client/pods/man1/chkkitcomp.1.pod | 61 --- xCAT-client/pods/man1/lskit.1.pod | 168 -------- xCAT-client/pods/man1/lskitcomp.1.pod | 156 -------- xCAT-client/pods/man1/lskitdeployparam.1.pod | 107 ----- xCAT-client/pods/man1/rmkit.1.pod | 83 ---- xCAT-client/pods/man1/rmkitcomp.1.pod | 90 ----- 18 files changed, 2860 deletions(-) delete mode 100644 docs/source/guides/admin-guides/references/man1/addkit.1.rst delete mode 100644 docs/source/guides/admin-guides/references/man1/addkitcomp.1.rst delete mode 100644 docs/source/guides/admin-guides/references/man1/buildkit.1.rst delete mode 100644 docs/source/guides/admin-guides/references/man1/chkkitcomp.1.rst delete mode 100644 docs/source/guides/admin-guides/references/man1/lskit.1.rst delete mode 100644 docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst delete mode 100644 docs/source/guides/admin-guides/references/man1/lskitdeployparam.1.rst delete mode 100644 docs/source/guides/admin-guides/references/man1/rmkit.1.rst delete mode 100644 docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst delete mode 100644 xCAT-buildkit/pods/man1/buildkit.1.pod delete mode 100644 xCAT-client/pods/man1/addkit.1.pod delete mode 100644 xCAT-client/pods/man1/addkitcomp.1.pod delete mode 100644 xCAT-client/pods/man1/chkkitcomp.1.pod delete mode 100644 xCAT-client/pods/man1/lskit.1.pod delete mode 100644 xCAT-client/pods/man1/lskitcomp.1.pod delete mode 100644 xCAT-client/pods/man1/lskitdeployparam.1.pod delete mode 100644 xCAT-client/pods/man1/rmkit.1.pod delete mode 100644 xCAT-client/pods/man1/rmkitcomp.1.pod diff --git a/docs/source/guides/admin-guides/references/man1/addkit.1.rst b/docs/source/guides/admin-guides/references/man1/addkit.1.rst deleted file mode 100644 index 7c64c139e..000000000 --- a/docs/source/guides/admin-guides/references/man1/addkit.1.rst +++ /dev/null @@ -1,137 +0,0 @@ - -######## -addkit.1 -######## - -.. highlight:: perl - - -**** -NAME -**** - - -\ **addkit**\ - Adds product software Kits to an xCAT cluster environmnet. - - -******** -SYNOPSIS -******** - - -\ **addkit**\ [\ **-? | -h | -**\ **-help**\ ] [\ **-v | -**\ **-version**\ ] - -\ **addkit**\ [\ **-i | -**\ **-inspection**\ ] \ *kitlist*\ - -\ **addkit**\ [\ **-V | -**\ **-verbose**\ ] [\ **-p | -**\ **-path**\ \ *path*\ ] \ *kitlist*\ - - -*********** -DESCRIPTION -*********** - - -The \ **addkit**\ command installs a kit on the xCAT management node from a kit tarfile or directory. -It creates xCAT database definitions for the kit, kitrepo, and kitcomponent. - -\ **Note:**\ xCAT Kit support is ONLY available for Linux operating systems. - - -******* -OPTIONS -******* - - - -\ **-h|-**\ **-help**\ - - Display usage message. - - - -\ **-V|-**\ **-verbose**\ - - Verbose mode. - - - -\ **-v|-**\ **-version**\ - - Command version. - - - -\ **-i|-**\ **-inspection**\ - - Show the summary of the given kits - - - -\ **-p|-**\ **-path**\ \ *path*\ - - The destination directory to which the contents of the kit tarfiles and/or kit deploy directories will be copied. When this option is not specified, the default destination directory will be formed from the installdir site attribute with ./kits subdirectory. - - - -\ *kitlist*\ - - A comma delimited list of kit_tarball_files or kit_deploy_directories to be added to the xCAT environment. Each entry can be an absolute or relative path. See xCAT documentation for more information on building kits. - - - - -************ -RETURN VALUE -************ - - -0 The command completed successfully. - -1 An error has occurred. - - -******** -EXAMPLES -******** - - -1. To add kits from tarball files: - - -.. code-block:: perl - - addkit kit-test1.tar.bz2,kit-test2.tar.bz2 - - -2. To add kits from directories: - - -.. code-block:: perl - - addkit kit-test1,kit-test2 - - -3. To add kits from tarball \ *kit-test1.tar.bz2*\ to target path \ */install/test*\ : - - -.. code-block:: perl - - addkit -p /install/test kit-test1.tar.bz2 - - -4. To see general information about kit \ *kit-test1.tar.bz2*\ without adding the kit to xCAT: - - -.. code-block:: perl - - addkit -i kit-test1.tar.bz2 - - - -******** -SEE ALSO -******** - - -lskit(1)|lskit.1, rmkit(1)|rmkit.1, addkitcomp(1)|addkitcomp.1, rmkitcomp(1)|rmkitcomp.1, chkkitcomp(1)|chkkitcomp.1 - diff --git a/docs/source/guides/admin-guides/references/man1/addkitcomp.1.rst b/docs/source/guides/admin-guides/references/man1/addkitcomp.1.rst deleted file mode 100644 index 16a43358a..000000000 --- a/docs/source/guides/admin-guides/references/man1/addkitcomp.1.rst +++ /dev/null @@ -1,154 +0,0 @@ - -############ -addkitcomp.1 -############ - -.. highlight:: perl - - -**** -NAME -**** - - -\ **addkitcomp**\ - Assign Kit components to an xCAT osimage. - - -******** -SYNOPSIS -******** - - -\ **addkitcomp**\ [\ **-? | -h | -**\ **-help**\ ] [\ **-v | -**\ **-version**\ ] - -\ **addkitcomp**\ [\ **-V | -**\ **-verbose**\ ] [\ **-a | -**\ **-adddeps**\ ] [\ **-f | -**\ **-force**\ ] [\ **-n | -**\ **-noupgrade**\ ] [\ **-**\ **-noscripts**\ ] \ **-i**\ \ *osimage*\ \ *kitcompname_list*\ - - -*********** -DESCRIPTION -*********** - - -The \ **addkitcomp**\ command will assign kit components to an xCAT osimage. The kit component meta rpm, package rpm and deploy parameters will be added to osimage's otherpkg.pkglist and postbootscripts will be added to osimages's postbootscripts attribute. - -\ **Note:**\ xCAT Kit support is ONLY available for Linux operating systems. - - -******* -OPTIONS -******* - - - -\ **-a|-**\ **-adddeps**\ - - Assign kitcomponent dependencies to the osimage. - - - -\ **-h|-**\ **-help**\ - - Display usage message. - - - -\ **-V|-**\ **-verbose**\ - - Verbose mode. - - - -\ **-v|-**\ **-version**\ - - Command version. - - - -\ **-f|-**\ **-force**\ - - Add kit component to osimage even if there is a mismatch in OS, version, arch, serverrole, or kitcompdeps - - - -\ **-i**\ \ *osimage*\ - - The osimage name that the kit component is assigning to. - - - -\ **-n|-**\ **-noupgrade**\ - - 1. Allow multiple versions of kitcomponent to be installed into the osimage, instead of kitcomponent upgrade. - - 2. Kit components added by addkitcomp -n will be installed separately behind all other ones which have been added. - - - -\ **-**\ **-noscripts**\ - - Do not add kitcomponent's postbootscripts to osimage - - - -\ *kitcompname_list*\ - - A comma-delimited list of valid full kit component names or kit component basenames that are to be added to the osimage. - - - - -************ -RETURN VALUE -************ - - -0 The command completed successfully. - -1 An error has occurred. - - -******** -EXAMPLES -******** - - -1. To add a single kit component to osimage "rhels6.2-ppc64-netboot-compute": - - -.. code-block:: perl - - addkitcomp -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 - - -2. To add a kit component to osimage with dependencies, use the -a (addeps) option: - - -.. code-block:: perl - - addkitcomp -a -i rhels6.2-ppc64-netboot-compute comp-test2-1.0-1-rhels-6.2-ppc64 - - -3. To add a kit component to osimage with incompatable osarch, osversion or ostype, use the -f (force) option: - - -.. code-block:: perl - - addkitcomp -f -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 - - -4. To add a new version of kit component to osimage without upgrade, use the -n (noupgrade) option: - - -.. code-block:: perl - - addkitcomp -n -i rhels6.2-ppc64-netboot-compute comp-test2-1.0-1-rhels-6.2-ppc64 - - - -******** -SEE ALSO -******** - - -lskit(1)|lskit.1, addkit(1)|addkit.1, rmkit(1)|rmkit.1, rmkitcomp(1)|rmkitcomp.1, chkkitcomp(1)|chkkitcomp.1 - diff --git a/docs/source/guides/admin-guides/references/man1/buildkit.1.rst b/docs/source/guides/admin-guides/references/man1/buildkit.1.rst deleted file mode 100644 index 20dd710e6..000000000 --- a/docs/source/guides/admin-guides/references/man1/buildkit.1.rst +++ /dev/null @@ -1,372 +0,0 @@ - -########## -buildkit.1 -########## - -.. highlight:: perl - - -**** -NAME -**** - - -\ **buildkit**\ - Used to build a software product Kit which may be used to install software in an xCAT cluster. - - -******** -SYNOPSIS -******** - - -\ **buildkit**\ [\ **-? | -h | -**\ **-help**\ ] [\ **-v | -**\ **-version**\ ] - -To build a new Kit - -\ **buildkit**\ [\ **-V | -**\ **-verbose]**\ \ *subcommand*\ [\ *kit_name*\ ] [\ *repo_name*\ | \ **all**\ ] [\ **-l | -**\ **-kitloc**\ \ *kit_location*\ ] - -To add packages to an existing Kit. - -\ **buildkit**\ [\ **-V | -**\ **-verbose**\ ] \ *addpkgs*\ \ *kit_tarfile*\ [\ **-p | -**\ **-pkgdir**\ \ *package_directory_list*\ ] [\ **-k | -**\ **-kitversion**\ \ *version*\ ] [\ **-r | -**\ **-kitrelease**\ \ *release*\ ] [\ **-l | -**\ **-kitloc**\ \ *kit_location*\ ] - - -*********** -DESCRIPTION -*********** - - -The \ **buildkit**\ command provides a collection of utilities that may be used to package a software product as a Kit tarfile that can be used to install software on the nodes of an xCAT cluster. A Kit contains the product software packages, configuration and control information, and install and customization scripts. - -Note: The xCAT support for Kits is only available for Linux operating systems. - -You will need to run the \ **buildkit**\ command several times with different subcommands to step through the process of building a kit: - -By default the \ **buildkit**\ subcommands will operate in the current working directory, (ie. look for files, create directories etc.). You could specify a different location by using the "\ **-l | -**\ **-kitloc**\ \ *kit_location*\ " option. - -The \ *kit_location*\ is the full path name of the directory that contains the kit files. You would use the same location value for all the buildkit subcommands. - -For example, to create a new kit named "prodkit" in the directory /home/mykits/ \ *either*\ run: - - -1. - - If no location is provided then the command will create a subdirectory called "prodkit" in the current directory "/home/mykits" and the new kit files will be created there. - - \ **cd /home/mykits**\ - - \ **buildkit create prodkit**\ - - or - - - -2. - - If a location is provided then the Kit files will be created there. Note that the Kit name does not necessarily have to be the directory name where the kit files are located. - - \ **buidkit create prodkit -l /home/mykits/prodkit**\ - - - -In both cases the /home/mykits/prodkit directory is created and the inital files for the kit are created in that directory. - -The following example illustrates the basic process for building a new Kit. In this example we are building a Kit named "mytstkit". - - -1. - - Change to the directory where you wish to create the Kit. - - - -2. - - Create a template directory for your kit: - - \ **buildkit create mytstkit**\ - - - -3. - - Change directory to the new "mytstkit" subdirectory that was just created. - - \ **cd mytstkit**\ - - - -4. - - Edit the buildkit configuration file for your kit: - - \ **vi buildkit.conf**\ - - (See xCAT Kit documentation for details.) - - - -5. - - Create all required files, scripts, plugins, and packages for your kit. - - - -6. - - Validate your kit build configuration and fix any errors that are reported: - - \ **buildkit chkconfig**\ - - - -7. - - List the repos defined in your buildkit configuration file: - - \ **buildkit listrepo**\ - - - -8. - - For each repo name listed, build the repository. Note that if you need to build repositories for OS distributions, versions, or architectures that do not match the current system, you may need to copy your kit template directory to an appropriate server to build that repository, and then copy the results back to your main build server. For example, to build a repo named "rhels6.3" you would run the following command. - - \ **buildkit buildrepo rhels6.3**\ - - or, you can build all of the repos at one time if there are no OS or architecture dependencies for kitcomponent package builds or kitpackage builds: - - \ **buildkit buildrepo all**\ - - - -9. - - Build the kit tar file: - - \ **buildkit buildtar**\ - - - - -******* -OPTIONS -******* - - - -\ **-h |-**\ **-help**\ - - Display usage message. - - - -\ **-k|-**\ **-kitversion**\ \ *version*\ - - Product version. - - - -\ **-l|-**\ **-kitloc**\ \ *kit_location*\ - - The directory location of the Kit files. - - - -\ **-p|-**\ **-pkgdir**\ \ *package_directory_list*\ - - A comma-separated list of directory locations for product RPMs. - - - -\ **-r|-**\ **-kitrelease**\ \ *release*\ - - Product release. - - - -\ **-V |-**\ **-verbose**\ - - Verbose mode. - - - -\ **-v|-**\ **-version**\ - - Command version. - - - - -************ -SUB-COMMANDS -************ - - - -\ **create**\ \ *kit_basename*\ - - Creates a new kit build directory structure for kit \ *kit_basename*\ using the location specified on the command line or the current directory. The sample kit files from /opt/xcat/share/xcat/kits/kit_template are copied over, and the buildkit.conf file is modified for the specified \ *kit_basename*\ . - - - -\ **chkconfig**\ - - Reads the buildkit.conf file, verifies that the file syntax is correct and that all specified files exist. - - - -\ **listrepo**\ - - Reads the buildkit.conf file, lists all Kit package repositories listed in the file, and reports the build status for each repository. - - - -\ **buildrepo**\ {\ *repo_name*\ | \ **all**\ } - - Reads the buildkit.conf file, and builds the specified Kit package repository. The built packages are placed in the directory /build/kit_repodir/\ *repo_name*\ . If \ **all**\ is specified, all kit repositories are built. - - - -\ **cleanrepo**\ {\ *repo_name*\ | \ **all**\ } - - Reads the buildkit.conf file, and deletes all the package files and package meta data files from the /build/kit_repodir/\ *repo_name*\ directory. If \ **all**\ is specified, all kit repository files are deleted. - - - -\ **buildtar**\ - - Reads the buildkit.conf file, validates that all kit repositories have been built, and builds the Kit tar file /\ *kitname*\ .tar.bz2. - - - -\ **cleantar**\ - - Reads the /buildkit.conf file and \ *deletes*\ the following: - - - - Kit tar files matching /\ *kit_name\\*.tar.bz2*\ . - - - /build/\ *kit_name*\ - - - /rpmbuild - - - /tmp - - - /debbuild - - Caution: Make sure you back up any tar files you would like to keep before running this subcommand. - - - -\ **cleanall**\ - - Equivalent to running \ **buildkit cleanrepo all**\ and \ **buildkit cleantar**\ . - - - -\ **addpkgs**\ - - \ *kit_tarfile*\ {\ **-p**\ | \ **-**\ **-pkgdir**\ \ *package_directory_list*\ } [\ **-k**\ | \ **-**\ **-kitversion**\ \ *version*\ ] [\ **-r**\ | \ **-**\ **-kitrelease**\ \ *release*\ ] - - Add product package rpms to a previously built kit tar file. This is used for partial product kits that are built and shipped separately from the product packages, and are identified with a \ *kit_tarfile*\ name of \ *kitname*\ .\ **NEED_PRODUCT_PKGS.tar.bz2**\ . Optionally, change the kit release and version values when building the new kit tarfile. If kitcomponent version and/or release values are defaulted to the kit values, those will also be changed and new kitcomponent rpms will be built. If kit or kitcomponent scripts, plugins, or other files specify name, release, or version substitution strings, these will all be replaced with the new values when built into the new complete kit tarfile \ *kit_location*\ /\ *new_kitname*\ .\ **tar.bz2**\ . - - - - -************ -RETURN VALUE -************ - - - -0 - - The command completed successfully. - - - -1 - - An error has occurred. - - - - -******** -EXAMPLES -******** - - - -1. - - To create the sample kit shipped with the xCAT-buildkit rpm on a RHELS 6.3 server and naming it \ **mykit**\ , run the following commands: - - \ **cd /home/myuserid/kits**\ - - \ **buildkit create mykit**\ - - \ **cd mykit**\ - - \ **vi buildkit.conf**\ - - \ **buildkit chkconfig**\ - - \ **buildkit listrepo**\ - - \ **buildkit buildrepo all**\ - - \ **buildkit buildtar**\ - - - -2. - - To clean up a kit repository directory after build failures on a RHELS 6.3 server to prepare for a new kit repository build, run: - - \ **buildkit cleanrepo rhels6.3**\ - - - -3. - - To clean up all kit build files, including a previously built kit tar file, run - - \ **buildkit cleanall**\ - - - -4. - - To create a kit named "tstkit" located in /home/foobar/tstkit instead of the current working directory. - - \ **buildkit create tstkit -l /home/foobar/tstkit**\ - - - - -***** -FILES -***** - - -/opt/xcat/bin/buildkit - -/opt/xcat/share/xcat/kits/kit_template - -/opt/xcat/share/xcat/kits/kitcomponent.spec.template - -/buildkit.conf - -/build/\ *kitname*\ /kit.conf - -/\ *kitname*\ .tar.bz2 - - -******** -SEE ALSO -******** - - -addkit(1), lskit(1), rmkit(1), addkitcomp(1), rmkitcomp(1), chkkitcomp(1) - diff --git a/docs/source/guides/admin-guides/references/man1/chkkitcomp.1.rst b/docs/source/guides/admin-guides/references/man1/chkkitcomp.1.rst deleted file mode 100644 index ffb675f04..000000000 --- a/docs/source/guides/admin-guides/references/man1/chkkitcomp.1.rst +++ /dev/null @@ -1,106 +0,0 @@ - -############ -chkkitcomp.1 -############ - -.. highlight:: perl - - -**** -NAME -**** - - -\ **chkkitcomp**\ - Check if Kit components are compatible with an xCAT osimage. - - -******** -SYNOPSIS -******** - - -\ **chkkitcomp**\ [\ **-? | -h | -**\ **-help**\ ] [\ **-v | -**\ **-version**\ ] - -\ **chkkitcomp**\ [\ **-V | -**\ **-verbose**\ ] \ **-i**\ \ *osimage*\ \ *kitcompname_list*\ - - -*********** -DESCRIPTION -*********** - - -The \ **chkkitcomp**\ command will check if the kit components are compatible with the xCAT osimage. - -This command will ignore the current osimage.kitcomponents setting and check if the kitcompname_list is compatible with the osimage and kit component dependencies. - -\ **Note:**\ xCAT Kit support is ONLY available for Linux operating systems. - - -******* -OPTIONS -******* - - - -\ **-h|-**\ **-help**\ - - Display usage message. - - - -\ **-V|-**\ **-verbose**\ - - Verbose mode. - - - -\ **-v|-**\ **-version**\ - - Command version. - - - -\ **-i**\ \ *osimage*\ - - The name of the osimage to check against. - - - -\ *kitcompname_list*\ - - A comma-delimited list of valid full kit component names or kit component basenames that are to be checked against the osimage. - - - - -************ -RETURN VALUE -************ - - -0 The command completed successfully. - -1 An error has occurred. - - -******** -EXAMPLES -******** - - -1. To check if a kit component, \ *comp-test1-1.0-1-rhels-6.2-ppc64*\ can be added to osimage \ *rhels6.2-ppc64-netboot-compute*\ : - - -.. code-block:: perl - - chkkitcomp -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 - - - -******** -SEE ALSO -******** - - -lskit(1)|lskit.1, addkit(1)|addkit.1, rmkit(1)|rmkit.1, addkitcomp(1)|addkitcomp.1, rmkitcomp(1)|rmkitcomp.1 - diff --git a/docs/source/guides/admin-guides/references/man1/lskit.1.rst b/docs/source/guides/admin-guides/references/man1/lskit.1.rst deleted file mode 100644 index 07081e15d..000000000 --- a/docs/source/guides/admin-guides/references/man1/lskit.1.rst +++ /dev/null @@ -1,250 +0,0 @@ - -####### -lskit.1 -####### - -.. highlight:: perl - - -**** -NAME -**** - - -\ **lskit**\ - Lists information for one or more Kits. - - -******** -SYNOPSIS -******** - - -\ **lskit**\ [\ **-V**\ | \ **-**\ **-verbose**\ ] [\ **-F**\ | \ **-**\ **-framework**\ \ *kitattr_names*\ ] [\ **-x**\ | \ **-**\ **-xml**\ | \ **-**\ **-XML**\ ] [\ **-K**\ | \ **-**\ **-kitattr**\ \ *kitattr_names*\ ] [\ **-R**\ | \ **-**\ **-repoattr**\ \ *repoattr_names*\ ] [\ **-C**\ | \ **-**\ **-compattr**\ \ *compattr_names*\ ] [\ *kit_names*\ ] - -\ **lskit**\ [\ **-?**\ | \ **-h**\ | \ **-**\ **-help**\ | \ **-v**\ | \ **-**\ **-version**\ ] - -\ **lskit**\ [\ **-F**\ | \ **-**\ **-framework**\ \ *kit_path_name*\ ] - - -*********** -DESCRIPTION -*********** - - -The \ **lskit**\ command is used to list information for one or more kits. A kit is a special kind of package that is used to install a software product on one or more nodes in an xCAT cluster. - -Note: The xCAT support for Kits is only available for Linux operating systems. - -The \ **lskit**\ command outputs the following info for each kit: the kit's basic info, the kit's repositories, and the kit's components. The command outputs the info in two formats: human-readable format (default), and XML format. Use the -x option to view the info in XML format. - -Input to the command can specify any number or combination of the input options. - - -******* -OPTIONS -******* - - - -\ **-F|-**\ **-framework**\ \ *kit_path_name*\ - - Use this option to display the framework values of the specified Kit tarfile. This information is retreived directly from the tarfile and can be done before the Kit has been defined in the xCAT database. This option cannot be combined with other options. - - - -\ **-K|-**\ **-kitattr**\ \ *kitattr_names*\ - - Where \ *kitattr_names*\ is a comma-delimited list of kit attribute names. The names correspond to attribute names in the \ **kit**\ table. The \ **lskit**\ command will only display the specified kit attributes. - - - -\ **-R|-**\ **-repoattr**\ \ *repoattr_names*\ - - Where \ *repoattr_names*\ is a comma-delimited list of kit repository attribute names. The names correspond to attribute names in the \ **kitrepo**\ table. The \ **lskit**\ command will only display the specified kit repository attributes. - - - -\ **-C|-**\ **-compattr**\ \ *compattr_names*\ - - where \ *compattr_names*\ is a comma-delimited list of kit component attribute names. The names correspond to attribute names in the \ **kitcomponent**\ table. The \ **lskit**\ command will only display the specified kit component attributes. - - - -\ *kit_names*\ - - is a comma-delimited list of kit names. The \ **lskit**\ command will only display the kits matching these names. - - - -\ **-x|-**\ **-xml|-**\ **-XML**\ - - Need XCATXMLTRACE=1 env when using -x|--xml|--XML, for example: XCATXMLTRACE=1 lskit -x testkit-1.0.0 - Return the output with XML tags. The data is returned as: - - - .. code-block:: perl - - - - ... - - - ... - - - ... - - - - - Each tag contains info for one kit. The info inside is structured as follows: - - - .. code-block:: perl - - The sub-tag contains the kit's basic info. - The sub-tags store info about the kit's repositories. - The sub-tags store info about the kit's components. - - - The data inside is returned as: - - - .. code-block:: perl - - - - ... - - - - ... - - ... - - - ... - - ... - - - - - -\ **-V|-**\ **-verbose**\ - - Display additional progress and error messages. - - - -\ **-v|-**\ **-version**\ - - Command Version. - - - -\ **-?|-h|-**\ **-help**\ - - Display usage message. - - - - -************ -RETURN VALUE -************ - - - -0 The command completed successfully. - - - -1 An error has occurred. - - - - -******** -EXAMPLES -******** - - - -1. To list all kits, enter: - - - .. code-block:: perl - - lskit - - - - -2. To list the kit "kit-test1-1.0-Linux", enter: - - - .. code-block:: perl - - lskit kit-test1-1.0-Linux - - - - -3. To list the kit "kit-test1-1.0-Linux" for selected attributes, enter: - - - .. code-block:: perl - - lskit -K basename,description -R kitreponame -C kitcompname kit-test1-1.0-Linux - - - - -4. To list the framework value of a Kit tarfile. - - - .. code-block:: perl - - lskit -F /myhome/mykits/pperte-1.3.0.2-0-x86_64.tar.bz2 - - - Output is similar to: - - - .. code-block:: perl - - Extracting the kit.conf file from /myhome/mykits/pperte-1.3.0.2-0-x86_64.tar.bz2. Please wait. - - kitframework=2 - compatible_kitframeworks=0,1,2 - - - - -5. To list kit "testkit-1.0-1" with XML tags, enter: - - - .. code-block:: perl - - XCATXMLTRACE=1 lskit -x testkit-1.0-1 - - - - - -***** -FILES -***** - - -/opt/xcat/bin/lskit - - -******** -SEE ALSO -******** - - -lskitcomp(1)|lskitcomp.1, lskitdeployparam(1)|lskitdeployparam.1, addkit(1)|addkit.1, rmkit(1)|rmkit.1, addkitcomp(1)|addkitcomp.1, rmkitcomp(1)|rmkitcomp.1 - diff --git a/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst b/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst deleted file mode 100644 index 895a065e1..000000000 --- a/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst +++ /dev/null @@ -1,247 +0,0 @@ - -########### -lskitcomp.1 -########### - -.. highlight:: perl - - -**** -NAME -**** - - -\ **lskitcomp**\ - Used to list information for one or more kit components. - - -******** -SYNOPSIS -******** - - -\ **lskitcomp**\ [\ **-V**\ | \ **-**\ **-verbose**\ ] [\ **-x**\ | \ **-**\ **-xml**\ | \ **-**\ **-XML**\ ] [\ **-C**\ | \ **-**\ **-compattr**\ \ *compattr_names*\ ] [\ **-O**\ | \ **-**\ **-osdistro**\ \ *os_distro*\ ] [\ **-S**\ | \ **-**\ **-serverrole**\ \ *server_role*\ ] [\ *kitcomp_names*\ ] - -\ **lskitcomp**\ [\ **-?**\ | \ **-h**\ | \ **-**\ **-help**\ | \ **-v**\ | \ **-**\ **-version**\ ] - - -*********** -DESCRIPTION -*********** - - -The \ **lskitcomp**\ command is used to list information for one or more kit components. A kit is made up of one or more kit components. Each kit component is a meta package used to install a software product component on one or more nodes in an xCAT cluster. - -The \ **lskitcomp**\ command outputs the kit component info in two formats: human-readable format (default), and XML format. Use the -x option to view the info in XML format. - -Input to the command can specify any number or combination of the input options. - -Note: The xCAT support for Kits is only available for Linux operating systems. - - -******* -OPTIONS -******* - - - -\ **-C|-**\ **-compattr**\ \ *compattr_names*\ - - where \ *compattr_names*\ is a comma-delimited list of kit component attribute names. The names correspond to attribute names in the \ **kitcomponent**\ table. The \ **lskitcomp**\ command will only display the specified kit component attributes. - - - -\ **-O|-**\ **-osdistro**\ \ *os_distro*\ - - where \ *os_distro*\ is the name of an osdistro in \ **osdistro**\ table. The \ **lskitcomp**\ command will only display the kit components matching the specified osdistro. - - - -\ **-S|-**\ **-serverrole**\ \ *server_role*\ - - where \ *server_role*\ is the name of a server role. The typical server roles are: mgtnode, servicenode, computenode, loginnode, storagennode. The \ **lskitcomp**\ command will only display the kit components matching the specified server role. - - - -\ *kitcomp_names*\ - - is a comma-delimited list of kit component names. The \ **lskitcomp**\ command will only display the kit components matching the specified names. - - - -\ **-x|-**\ **-xml|-**\ **-XML**\ - - Need XCATXMLTRACE=1 env when using -x|--xml|--XML. - Return the output with XML tags. The data is returned as: - - - .. code-block:: perl - - - - ... - - - ... - - - ... - - - - - Each tag contains info for a group of kit components belonging to the same kit. The info inside is structured as follows: - - - .. code-block:: perl - - The sub-tag contains the kit's name. - The sub-tags store info about the kit's components. - - - The data inside is returned as: - - - .. code-block:: perl - - - - ... - - - - ... - - ... - - - - - -\ **-V|-**\ **-verbose**\ - - Display additional progress and error messages. - - - -\ **-v|-**\ **-version**\ - - Command Version. - - - -\ **-?|-h|-**\ **-help**\ - - Display usage message. - - - - -************ -RETURN VALUE -************ - - - -0 The command completed successfully. - - - -1 An error has occurred. - - - - -******** -EXAMPLES -******** - - - -1. - - To list all kit components, enter: - - - .. code-block:: perl - - lskitcomp - - - - -2. - - To list the kit component "comp-server-1.0-1-rhels-6-x86_64", enter: - - - .. code-block:: perl - - lskitcomp comp-server-1.0-1-rhels-6-x86_64 - - - - -3. - - To list the kit component "comp-server-1.0-1-rhels-6-x86_64" for selected kit component attributes, enter: - - - .. code-block:: perl - - lskitcomp -C kitcompname,desc comp-server-1.0-1-rhels-6-x86_64 - - - - -4. - - To list kit components compatible with "rhels-6.2-x86_64" osdistro, enter: - - - .. code-block:: perl - - lskitcomp -O rhels-6.2-x86_64 - - - - -5. - - To list kit components compatible with "rhels-6.2-x86_64" osdistro and "computenode" server role, enter: - - - .. code-block:: perl - - lskitcomp -O rhels-6.2-x86_64 -S computenode - - - - -6. - - To list the kit component "testkit-compute-1.0-1-ubuntu-14.04-ppc64el" with XML tags, enter: - - - .. code-block:: perl - - XCATXMLTRACE=1 lskitcomp -x testkit-compute-1.0-1-ubuntu-14.04-ppc64el - - - - - -***** -FILES -***** - - -/opt/xcat/bin/lskitcomp - - -******** -SEE ALSO -******** - - -lskit(1)|lskit.1, lskitdeployparam(1)|lskitdeployparam.1, addkit(1)|addkit.1, rmkit(1)|rmkit.1, addkitcomp(1)|addkitcomp.1, rmkitcomp(1)|rmkitcomp.1 - diff --git a/docs/source/guides/admin-guides/references/man1/lskitdeployparam.1.rst b/docs/source/guides/admin-guides/references/man1/lskitdeployparam.1.rst deleted file mode 100644 index 28cc34092..000000000 --- a/docs/source/guides/admin-guides/references/man1/lskitdeployparam.1.rst +++ /dev/null @@ -1,162 +0,0 @@ - -################## -lskitdeployparam.1 -################## - -.. highlight:: perl - - -**** -NAME -**** - - -\ **lskitdeployparam**\ - Lists the deployment parameters for one or more Kits or Kit components - - -******** -SYNOPSIS -******** - - -\ **lskitdeployparam**\ [\ **-V**\ | \ **-**\ **-verbose**\ ] [\ **-x**\ | \ **-**\ **-xml**\ | \ **-**\ **-XML**\ ] [\ **-k**\ | \ **-**\ **-kitname**\ \ *kit_names*\ ] [\ **-c**\ | \ **-**\ **-compname**\ \ *comp_names*\ ] - -\ **lskitdeployparam**\ [\ **-?**\ | \ **-h**\ | \ **-**\ **-help**\ | \ **-v**\ | \ **-**\ **-version**\ ] - - -*********** -DESCRIPTION -*********** - - -The \ **lskitdeployparam**\ command is used to list the kit deployment parameters for one or more kits, or one or more kit components. Kit deployment parameters are used to customize the installation or upgrade of kit components. - -The \ **lskitdeployparam**\ command outputs the kit component information in two formats: human-readable format (default), and XML format. Use the -x option to view the information in XML format. - -Input to the command can specify any combination of the input options. - -Note: The xCAT support for Kits is only available for Linux operating systems. - - -******* -OPTIONS -******* - - - -\ **-k|-**\ **-kitname**\ \ *kit_names*\ - - Where \ *kit_names*\ is a comma-delimited list of kit names. The \ **lskitdeployparam**\ command will only display the deployment parameters for the kits with the matching names. - - - -\ **-c|-**\ **-compname**\ \ *comp_names*\ - - Where \ *comp_names*\ is a comma-delimited list of kit component names. The \ **lskitdeployparam**\ command will only display the deployment parameters for the kit components with the matching names. - - - -\ **-x|-**\ **-xml|-**\ **-XML**\ - - Return the output with XML tags. The data is returned as: - - - .. code-block:: perl - - - - KIT_KIT1_PARAM1 - value11 - - - - - KIT_KIT1_PARAM2 - value12 - - - ... - - - - -\ **-V|-**\ **-verbose**\ - - Display additional progress and error messages. - - - -\ **-v|-**\ **-version**\ - - Command Version. - - - -\ **-?|-h|-**\ **-help**\ - - Display usage message. - - - - -************ -RETURN VALUE -************ - - - -0 The command completed successfully. - - - -1 An error has occurred. - - - - -******** -EXAMPLES -******** - - - -1. - - To list kit deployment parameters for kit "kit-test1-1.0-Linux", enter: - - - .. code-block:: perl - - lskitdeployparam -k kit-test1-1.0-Linux - - - - -2. - - To list kit deployment parameters for kit component "comp-server-1.0-1-rhels-6-x86_64", enter: - - - .. code-block:: perl - - lskitdeployparam -c comp-server-1.0-1-rhels-6-x86_64 - - - - - -***** -FILES -***** - - -/opt/xcat/bin/lskitdeployparam - - -******** -SEE ALSO -******** - - -lskit(1)|lskit.1, lskitcomp(1)|lskitcomp.1, addkit(1)|addkit.1, rmkit(1)|rmkit.1, addkitcomp(1)|addkitcomp.1, rmkitcomp(1)|rmkitcomp.1 - diff --git a/docs/source/guides/admin-guides/references/man1/rmkit.1.rst b/docs/source/guides/admin-guides/references/man1/rmkit.1.rst deleted file mode 100644 index d83ca67ce..000000000 --- a/docs/source/guides/admin-guides/references/man1/rmkit.1.rst +++ /dev/null @@ -1,151 +0,0 @@ - -####### -rmkit.1 -####### - -.. highlight:: perl - - -**** -NAME -**** - - -\ **rmkit**\ - Remove Kits from xCAT - - -******** -SYNOPSIS -******** - - -\ **rmkit**\ [\ **-? | -h | -**\ **-help**\ ] [\ **-v | -**\ **-version**\ ] - -\ **rmkit**\ [\ **-V | -**\ **-verbose**\ ] [\ **-f | -**\ **-force**\ ] [\ **-t | -**\ **-test**\ ] \ *kitlist*\ - - -*********** -DESCRIPTION -*********** - - -The \ **rmkit**\ command removes kits on the xCAT management node from kit names. - -Note: The xCAT support for Kits is only available for Linux operating systems. - - -******* -OPTIONS -******* - - - -\ **-h|-**\ **-help**\ - - Display usage message. - - - -\ **-V|-**\ **-verbose**\ - - Verbose mode. - - - -\ **-v|-**\ **-version**\ - - Command version. - - - -\ **-f|-**\ **-force**\ - - Remove this kit even there is any component in this kit is listed by osimage.kitcomponents. If this option is not specified, this kit will not be removed if any kit components listed in an osimage.kitcomponents - - - -\ **-t|-**\ **-test**\ - - Test if kitcomponents in this kit are used by osimage - - - -\ *kitlist*\ - - A comma delimited list of kits that are to be removed from the xCAT cluster. Each entry can be a kitname or kit basename. For kit basename, rmkit command will remove all the kits that have that kit basename. - - - - -************ -RETURN VALUE -************ - - -0 The command completed successfully. - -1 An error has occurred. - - -******** -EXAMPLES -******** - - -1. To remove two kits from tarball files. - - -.. code-block:: perl - - rmkit kit-test1,kit-test2 - - -Output is similar to: - - -.. code-block:: perl - - Kit kit-test1-1.0-Linux,kit-test2-1.0-Linux was successfully removed. - - -2. To remove two kits from tarball files even the kit components in them are still being used by osimages. - - -.. code-block:: perl - - rmkit kit-test1,kit-test2 --force - - -Output is similar to: - - -.. code-block:: perl - - Kit kit-test1-1.0-Linux,kit-test2-1.0-Linux was successfully removed. - - -3. To list kitcomponents in this kit used by osimage - - -.. code-block:: perl - - rmkit kit-test1,kit-test2 -t - - -Output is similar to: - - -.. code-block:: perl - - kit-test1-kitcomp-1.0-Linux is being used by osimage osimage-test - Following kitcomponents are in use: kit-test1-kitcomp-1.0-Linux - - - -******** -SEE ALSO -******** - - -lskit(1)|lskit.1, addkit(1)|addkit.1, addkitcomp(1)|addkitcomp.1, rmkitcomp(1)|rmkitcomp.1, chkkitcomp(1)|chkkitcomp.1 - diff --git a/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst b/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst deleted file mode 100644 index 183372691..000000000 --- a/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst +++ /dev/null @@ -1,162 +0,0 @@ - -########### -rmkitcomp.1 -########### - -.. highlight:: perl - - -**** -NAME -**** - - -\ **rmkitcomp**\ - Remove Kit components from an xCAT osimage. - - -******** -SYNOPSIS -******** - - -\ **rmkitcomp**\ [\ **-? | -h | -**\ **-help**\ ] [\ **-v | -**\ **-version**\ ] - -\ **rmkitcomp**\ [\ **-V | -**\ **-verbose**\ ] [\ **-u | -**\ **-uninstall**\ ] [\ **-f | -**\ **-force**\ ] [\ **-**\ **-noscripts**\ ] \ **-i**\ \ *osimage*\ \ *kitcompname_list*\ - - -*********** -DESCRIPTION -*********** - - -The \ **rmkitcomp**\ command removes kit components from an xCAT osimage. All the kit component attribute values that are contained in the osimage will be removed, and the kit component meta rpm and package rpm could be uninstalled by \ **-u|-**\ **-uninstall**\ option. - -Note: The xCAT support for Kits is only available for Linux operating systems. - - -******* -OPTIONS -******* - - - -\ **-u|-**\ **-uninstall**\ - - All the kit component meta rpms and package rpms in otherpkglist will be uninstalled during genimage for stateless image and updatenode for stateful nodes. - - - -\ **-h|-**\ **-help**\ - - Display usage message. - - - -\ **-V|-**\ **-verbose**\ - - Verbose mode. - - - -\ **-v|-**\ **-version**\ - - Command version. - - - -\ **-f|-**\ **-force**\ - - Remove this kit component from osimage no matter it is a dependency of other kit components. - - - -\ **-**\ **-noscripts**\ - - Do not remove kitcomponent's postbootscripts from osimage - - - -\ **-i**\ \ *osimage*\ - - osimage name that include this kit component. - - - -\ *kitcompname_list*\ - - A comma-delimited list of valid full kit component names or kit component basenames that are to be removed from the osimage. If a basename is specified, all kitcomponents matching that basename will be removed from the osimage. - - - - -************ -RETURN VALUE -************ - - -0 The command completed successfully. - -1 An error has occurred. - - -******** -EXAMPLES -******** - - -1. To remove a kit component from osimage - - -.. code-block:: perl - - rmkitcomp -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 - - -Output is similar to: - - -.. code-block:: perl - - kitcomponents comp-test1-1.0-1-rhels-6.2-ppc64 were removed from osimage rhels6.2-ppc64-netboot-compute successfully - - -2. To remove a kit component even it is still used as a dependency of other kit component. - - -.. code-block:: perl - - rmkitcomp -f -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 - - -Output is similar to: - - -.. code-block:: perl - - kitcomponents comp-test1-1.0-1-rhels-6.2-ppc64 were removed from osimage rhels6.2-ppc64-netboot-compute successfully - - -3. To remove a kit component from osimage and also remove the kit component meta RPM and package RPM. So in next genimage for statelss image and updatenode for stateful nodes, the kit component meta RPM and package RPM will be uninstalled. - - -.. code-block:: perl - - rmkitcomp -u -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 - - -Output is similar to: - - -.. code-block:: perl - - kitcomponents comp-test1-1.0-1-rhels-6.2-ppc64 were removed from osimage rhels6.2-ppc64-netboot-compute successfully - - - -******** -SEE ALSO -******** - - -lskit(1)|lskit.1, addkit(1)|addkit.1, rmkit(1)|rmkit.1, addkitcomp(1)|addkitcomp.1, chkkitcomp(1)|chkkitcomp.1 - diff --git a/xCAT-buildkit/pods/man1/buildkit.1.pod b/xCAT-buildkit/pods/man1/buildkit.1.pod deleted file mode 100644 index 7d9c49756..000000000 --- a/xCAT-buildkit/pods/man1/buildkit.1.pod +++ /dev/null @@ -1,285 +0,0 @@ -=head1 NAME - -B - Used to build a software product Kit which may be used to install software in an xCAT cluster. - -=head1 SYNOPSIS - -B [B<-?>|B<-h>|B<--help>] [B<-v>|B<--version>] - -To build a new Kit - -B [B<-V>|B<--verbose]> I [I] [I | B] [B<-l>|B<--kitloc> I] - -To add packages to an existing Kit. - -B [B<-V>|B<--verbose>] I I [B<-p>|B<--pkgdir> I] [B<-k>|B<--kitversion> I] [B<-r>|B<--kitrelease> I] [B<-l>|B<--kitloc> I] - -=head1 DESCRIPTION - -The B command provides a collection of utilities that may be used to package a software product as a Kit tarfile that can be used to install software on the nodes of an xCAT cluster. A Kit contains the product software packages, configuration and control information, and install and customization scripts. - -Note: The xCAT support for Kits is only available for Linux operating systems. - -You will need to run the B command several times with different subcommands to step through the process of building a kit: - -By default the B subcommands will operate in the current working directory, (ie. look for files, create directories etc.). You could specify a different location by using the "B<-l | --kitloc> I" option. - -The I is the full path name of the directory that contains the kit files. You would use the same location value for all the buildkit subcommands. - -For example, to create a new kit named "prodkit" in the directory /home/mykits/ I run: - -=over 4 - -=item 1. - -If no location is provided then the command will create a subdirectory called "prodkit" in the current directory "/home/mykits" and the new kit files will be created there. - -B - -B - -or - -=item 2. - -If a location is provided then the Kit files will be created there. Note that the Kit name does not necessarily have to be the directory name where the kit files are located. - -B - -=back - -In both cases the /home/mykits/prodkit directory is created and the inital files for the kit are created in that directory. - -The following example illustrates the basic process for building a new Kit. In this example we are building a Kit named "mytstkit". - -=over 4 - -=item 1. - -Change to the directory where you wish to create the Kit. - -=item 2. - -Create a template directory for your kit: - -B - -=item 3. - -Change directory to the new "mytstkit" subdirectory that was just created. - -B - -=item 4. - -Edit the buildkit configuration file for your kit: - -B - -(See xCAT Kit documentation for details.) - -=item 5. - -Create all required files, scripts, plugins, and packages for your kit. - -=item 6. - -Validate your kit build configuration and fix any errors that are reported: - -B - -=item 7. - -List the repos defined in your buildkit configuration file: - -B - -=item 8. - -For each repo name listed, build the repository. Note that if you need to build repositories for OS distributions, versions, or architectures that do not match the current system, you may need to copy your kit template directory to an appropriate server to build that repository, and then copy the results back to your main build server. For example, to build a repo named "rhels6.3" you would run the following command. - -B - -or, you can build all of the repos at one time if there are no OS or architecture dependencies for kitcomponent package builds or kitpackage builds: - -B - -=item 9. - -Build the kit tar file: - -B - -=back - -=head1 OPTIONS - -=over 10 - -=item B<-h |--help> - -Display usage message. - -=item B<-k|--kitversion> I - -Product version. - -=item B<-l|--kitloc> I - -The directory location of the Kit files. - -=item B<-p|--pkgdir> I - -A comma-separated list of directory locations for product RPMs. - -=item B<-r|--kitrelease> I - -Product release. - -=item B<-V |--verbose> - -Verbose mode. - -=item B<-v|--version> - -Command version. - -=back - -=head1 SUB-COMMANDS - -=over 10 - -=item B I - -Creates a new kit build directory structure for kit I using the location specified on the command line or the current directory. The sample kit files from /opt/xcat/share/xcat/kits/kit_template are copied over, and the buildkit.conf file is modified for the specified I. - -=item B - -Reads the buildkit.conf file, verifies that the file syntax is correct and that all specified files exist. - -=item B - -Reads the buildkit.conf file, lists all Kit package repositories listed in the file, and reports the build status for each repository. - -=item B {I | B} - -Reads the buildkit.conf file, and builds the specified Kit package repository. The built packages are placed in the directory /build/kit_repodir/I. If B is specified, all kit repositories are built. - -=item B {I | B} - -Reads the buildkit.conf file, and deletes all the package files and package meta data files from the /build/kit_repodir/I directory. If B is specified, all kit repository files are deleted. - -=item B - -Reads the buildkit.conf file, validates that all kit repositories have been built, and builds the Kit tar file /I.tar.bz2. - -=item B - -Reads the /buildkit.conf file and I the following: - -=over 4 - -- Kit tar files matching /I. - -- /build/I - -- /rpmbuild - -- /tmp - -- /debbuild - -=back - -Caution: Make sure you back up any tar files you would like to keep before running this subcommand. - -=item B - -Equivalent to running B and B. - -=item B - -I {B<-p> | B<--pkgdir> I} [B<-k> | B<--kitversion> I] [B<-r> | B<--kitrelease> I] - -Add product package rpms to a previously built kit tar file. This is used for partial product kits that are built and shipped separately from the product packages, and are identified with a I name of I.B. Optionally, change the kit release and version values when building the new kit tarfile. If kitcomponent version and/or release values are defaulted to the kit values, those will also be changed and new kitcomponent rpms will be built. If kit or kitcomponent scripts, plugins, or other files specify name, release, or version substitution strings, these will all be replaced with the new values when built into the new complete kit tarfile I/I.B. - -=back - -=head1 RETURN VALUE - -=over 3 - -=item 0 - -The command completed successfully. - -=item 1 - -An error has occurred. - -=back - -=head1 EXAMPLES - -=over 3 - -=item 1. - -To create the sample kit shipped with the xCAT-buildkit rpm on a RHELS 6.3 server and naming it B, run the following commands: - -B - -B - -B - -B - -B - -B - -B - -B - -=item 2. - -To clean up a kit repository directory after build failures on a RHELS 6.3 server to prepare for a new kit repository build, run: - -B - -=item 3. - -To clean up all kit build files, including a previously built kit tar file, run - -B - -=item 4. - -To create a kit named "tstkit" located in /home/foobar/tstkit instead of the current working directory. - -B - -=back - -=head1 FILES - -/opt/xcat/bin/buildkit - -/opt/xcat/share/xcat/kits/kit_template - -/opt/xcat/share/xcat/kits/kitcomponent.spec.template - -/buildkit.conf - -/build/I/kit.conf - -/I.tar.bz2 - - -=head1 SEE ALSO - -addkit(1), lskit(1), rmkit(1), addkitcomp(1), rmkitcomp(1), chkkitcomp(1) - diff --git a/xCAT-client/pods/man1/addkit.1.pod b/xCAT-client/pods/man1/addkit.1.pod deleted file mode 100644 index f07bddf3c..000000000 --- a/xCAT-client/pods/man1/addkit.1.pod +++ /dev/null @@ -1,79 +0,0 @@ -=head1 NAME - -B - Adds product software Kits to an xCAT cluster environmnet. - -=head1 SYNOPSIS - -B [B<-?>|B<-h>|B<--help>] [B<-v>|B<--version>] - -B [B<-i>|B<--inspection>] I - -B [B<-V>|B<--verbose>] [B<-p>|B<--path> I] I - -=head1 DESCRIPTION - -The B command installs a kit on the xCAT management node from a kit tarfile or directory. -It creates xCAT database definitions for the kit, kitrepo, and kitcomponent. - -B xCAT Kit support is ONLY available for Linux operating systems. - -=head1 OPTIONS - -=over 10 - -=item B<-h|--help> - -Display usage message. - -=item B<-V|--verbose> - -Verbose mode. - -=item B<-v|--version> - -Command version. - -=item B<-i|--inspection> - -Show the summary of the given kits - -=item B<-p|--path> I - -The destination directory to which the contents of the kit tarfiles and/or kit deploy directories will be copied. When this option is not specified, the default destination directory will be formed from the installdir site attribute with ./kits subdirectory. - -=item I - -A comma delimited list of kit_tarball_files or kit_deploy_directories to be added to the xCAT environment. Each entry can be an absolute or relative path. See xCAT documentation for more information on building kits. - -=back - -=head1 RETURN VALUE - -0 The command completed successfully. - -1 An error has occurred. - -=head1 EXAMPLES - -1. To add kits from tarball files: - - addkit kit-test1.tar.bz2,kit-test2.tar.bz2 - -2. To add kits from directories: - - addkit kit-test1,kit-test2 - -3. To add kits from tarball I to target path I: - - addkit -p /install/test kit-test1.tar.bz2 - -4. To see general information about kit I without adding the kit to xCAT: - - addkit -i kit-test1.tar.bz2 - - -=head1 SEE ALSO - -L, L, L, L, L - - diff --git a/xCAT-client/pods/man1/addkitcomp.1.pod b/xCAT-client/pods/man1/addkitcomp.1.pod deleted file mode 100644 index 99b138700..000000000 --- a/xCAT-client/pods/man1/addkitcomp.1.pod +++ /dev/null @@ -1,90 +0,0 @@ -=head1 NAME - -B - Assign Kit components to an xCAT osimage. - -=head1 SYNOPSIS - -B [B<-?>|B<-h>|B<--help>] [B<-v>|B<--version>] - -B [B<-V>|B<--verbose>] [B<-a>|B<--adddeps>] [B<-f>|B<--force>] [B<-n>|B<--noupgrade>] [B<--noscripts>] B<-i> I I - -=head1 DESCRIPTION - -The B command will assign kit components to an xCAT osimage. The kit component meta rpm, package rpm and deploy parameters will be added to osimage's otherpkg.pkglist and postbootscripts will be added to osimages's postbootscripts attribute. - -B xCAT Kit support is ONLY available for Linux operating systems. - -=head1 OPTIONS - -=over 10 - -=item B<-a|--adddeps> - -Assign kitcomponent dependencies to the osimage. - -=item B<-h|--help> - -Display usage message. - -=item B<-V|--verbose> - -Verbose mode. - -=item B<-v|--version> - -Command version. - -=item B<-f|--force> - -Add kit component to osimage even if there is a mismatch in OS, version, arch, serverrole, or kitcompdeps - -=item B<-i> I - -The osimage name that the kit component is assigning to. - -=item B<-n|--noupgrade> - -1. Allow multiple versions of kitcomponent to be installed into the osimage, instead of kitcomponent upgrade. - -2. Kit components added by addkitcomp -n will be installed separately behind all other ones which have been added. - -=item B<--noscripts> - -Do not add kitcomponent's postbootscripts to osimage - -=item I - -A comma-delimited list of valid full kit component names or kit component basenames that are to be added to the osimage. - -=back - -=head1 RETURN VALUE - -0 The command completed successfully. - -1 An error has occurred. - -=head1 EXAMPLES - -1. To add a single kit component to osimage "rhels6.2-ppc64-netboot-compute": - - addkitcomp -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 - -2. To add a kit component to osimage with dependencies, use the -a (addeps) option: - - addkitcomp -a -i rhels6.2-ppc64-netboot-compute comp-test2-1.0-1-rhels-6.2-ppc64 - -3. To add a kit component to osimage with incompatable osarch, osversion or ostype, use the -f (force) option: - - addkitcomp -f -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 - -4. To add a new version of kit component to osimage without upgrade, use the -n (noupgrade) option: - - addkitcomp -n -i rhels6.2-ppc64-netboot-compute comp-test2-1.0-1-rhels-6.2-ppc64 - - -=head1 SEE ALSO - -L, L, L, L, L - - diff --git a/xCAT-client/pods/man1/chkkitcomp.1.pod b/xCAT-client/pods/man1/chkkitcomp.1.pod deleted file mode 100644 index 8df706a6e..000000000 --- a/xCAT-client/pods/man1/chkkitcomp.1.pod +++ /dev/null @@ -1,61 +0,0 @@ -=head1 NAME - -B - Check if Kit components are compatible with an xCAT osimage. - -=head1 SYNOPSIS - -B [B<-?>|B<-h>|B<--help>] [B<-v>|B<--version>] - -B [B<-V>|B<--verbose>] B<-i> I I - -=head1 DESCRIPTION - -The B command will check if the kit components are compatible with the xCAT osimage. - -This command will ignore the current osimage.kitcomponents setting and check if the kitcompname_list is compatible with the osimage and kit component dependencies. - -B xCAT Kit support is ONLY available for Linux operating systems. - -=head1 OPTIONS - -=over 10 - -=item B<-h|--help> - -Display usage message. - -=item B<-V|--verbose> - -Verbose mode. - -=item B<-v|--version> - -Command version. - -=item B<-i> I - -The name of the osimage to check against. - -=item I - -A comma-delimited list of valid full kit component names or kit component basenames that are to be checked against the osimage. - -=back - -=head1 RETURN VALUE - -0 The command completed successfully. - -1 An error has occurred. - -=head1 EXAMPLES - -1. To check if a kit component, I can be added to osimage I: - - chkkitcomp -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 - - - -=head1 SEE ALSO - -L, L, L, L, L diff --git a/xCAT-client/pods/man1/lskit.1.pod b/xCAT-client/pods/man1/lskit.1.pod deleted file mode 100644 index fe450efc4..000000000 --- a/xCAT-client/pods/man1/lskit.1.pod +++ /dev/null @@ -1,168 +0,0 @@ -=head1 NAME - -B - Lists information for one or more Kits. - - -=head1 SYNOPSIS - -B [B<-V> | B<--verbose>] [B<-F> | B<--framework> I] [B<-x> | B<--xml> | B<--XML>] [B<-K> | B<--kitattr> I] [B<-R> | B<--repoattr> I] [B<-C> | B<--compattr> I] [I] - -B [B<-?> | B<-h> | B<--help> | B<-v> | B<--version>] - -B [B<-F> | B<--framework> I] - - -=head1 DESCRIPTION - -The B command is used to list information for one or more kits. A kit is a special kind of package that is used to install a software product on one or more nodes in an xCAT cluster. - -Note: The xCAT support for Kits is only available for Linux operating systems. - -The B command outputs the following info for each kit: the kit's basic info, the kit's repositories, and the kit's components. The command outputs the info in two formats: human-readable format (default), and XML format. Use the -x option to view the info in XML format. - -Input to the command can specify any number or combination of the input options. - -=head1 OPTIONS - -=over 10 - -=item B<-F|--framework> I - -Use this option to display the framework values of the specified Kit tarfile. This information is retreived directly from the tarfile and can be done before the Kit has been defined in the xCAT database. This option cannot be combined with other options. - -=item B<-K|--kitattr> I - -Where I is a comma-delimited list of kit attribute names. The names correspond to attribute names in the B table. The B command will only display the specified kit attributes. - - -=item B<-R|--repoattr> I - -Where I is a comma-delimited list of kit repository attribute names. The names correspond to attribute names in the B table. The B command will only display the specified kit repository attributes. - - -=item B<-C|--compattr> I - -where I is a comma-delimited list of kit component attribute names. The names correspond to attribute names in the B table. The B command will only display the specified kit component attributes. - - -=item I - -is a comma-delimited list of kit names. The B command will only display the kits matching these names. - - -=item B<-x|--xml|--XML> - -Need XCATXMLTRACE=1 env when using -x|--xml|--XML, for example: XCATXMLTRACE=1 lskit -x testkit-1.0.0 -Return the output with XML tags. The data is returned as: - - - - ... - - - ... - - - ... - - - -Each tag contains info for one kit. The info inside is structured as follows: - - The sub-tag contains the kit's basic info. - The sub-tags store info about the kit's repositories. - The sub-tags store info about the kit's components. - -The data inside is returned as: - - - - ... - - - - ... - - ... - - - ... - - ... - - - -=item B<-V|--verbose> - -Display additional progress and error messages. - -=item B<-v|--version> - -Command Version. - -=item B<-?|-h|--help> - -Display usage message. - -=back - -=head1 RETURN VALUE - -=over 3 - -=item 0 -The command completed successfully. - -=item 1 -An error has occurred. - -=back - - -=head1 EXAMPLES - -=over 3 - -=item 1. -To list all kits, enter: - - lskit - -=item 2. -To list the kit "kit-test1-1.0-Linux", enter: - - lskit kit-test1-1.0-Linux - -=item 3. -To list the kit "kit-test1-1.0-Linux" for selected attributes, enter: - - lskit -K basename,description -R kitreponame -C kitcompname kit-test1-1.0-Linux - -=item 4. -To list the framework value of a Kit tarfile. - - lskit -F /myhome/mykits/pperte-1.3.0.2-0-x86_64.tar.bz2 - -Output is similar to: - - Extracting the kit.conf file from /myhome/mykits/pperte-1.3.0.2-0-x86_64.tar.bz2. Please wait. - - kitframework=2 - compatible_kitframeworks=0,1,2 - -=item 5. -To list kit "testkit-1.0-1" with XML tags, enter: - - XCATXMLTRACE=1 lskit -x testkit-1.0-1 - -=back - - -=head1 FILES - -/opt/xcat/bin/lskit - -=head1 SEE ALSO - -L, L, L, L, L, L - diff --git a/xCAT-client/pods/man1/lskitcomp.1.pod b/xCAT-client/pods/man1/lskitcomp.1.pod deleted file mode 100644 index 46a90fa3d..000000000 --- a/xCAT-client/pods/man1/lskitcomp.1.pod +++ /dev/null @@ -1,156 +0,0 @@ -=head1 NAME - -B - Used to list information for one or more kit components. - - -=head1 SYNOPSIS - -B [B<-V> | B<--verbose>] [B<-x> | B<--xml> | B<--XML>] [B<-C> | B<--compattr> I] [B<-O> | B<--osdistro> I] [B<-S> | B<--serverrole> I] [I] - -B [B<-?> | B<-h> | B<--help> | B<-v> | B<--version>] - - -=head1 DESCRIPTION - -The B command is used to list information for one or more kit components. A kit is made up of one or more kit components. Each kit component is a meta package used to install a software product component on one or more nodes in an xCAT cluster. - -The B command outputs the kit component info in two formats: human-readable format (default), and XML format. Use the -x option to view the info in XML format. - -Input to the command can specify any number or combination of the input options. - -Note: The xCAT support for Kits is only available for Linux operating systems. - -=head1 OPTIONS - -=over 10 - -=item B<-C|--compattr> I - -where I is a comma-delimited list of kit component attribute names. The names correspond to attribute names in the B table. The B command will only display the specified kit component attributes. - -=item B<-O|--osdistro> I - -where I is the name of an osdistro in B table. The B command will only display the kit components matching the specified osdistro. - -=item B<-S|--serverrole> I - -where I is the name of a server role. The typical server roles are: mgtnode, servicenode, computenode, loginnode, storagennode. The B command will only display the kit components matching the specified server role. - -=item I - -is a comma-delimited list of kit component names. The B command will only display the kit components matching the specified names. - -=item B<-x|--xml|--XML> - -Need XCATXMLTRACE=1 env when using -x|--xml|--XML. -Return the output with XML tags. The data is returned as: - - - - ... - - - ... - - - ... - - - -Each tag contains info for a group of kit components belonging to the same kit. The info inside is structured as follows: - - The sub-tag contains the kit's name. - The sub-tags store info about the kit's components. - -The data inside is returned as: - - - - ... - - - - ... - - ... - - - -=item B<-V|--verbose> - -Display additional progress and error messages. - -=item B<-v|--version> - -Command Version. - -=item B<-?|-h|--help> - -Display usage message. - -=back - -=head1 RETURN VALUE - -=over 3 - -=item 0 -The command completed successfully. - -=item 1 -An error has occurred. - -=back - - -=head1 EXAMPLES - -=over 3 - -=item 1. - -To list all kit components, enter: - - lskitcomp - -=item 2. - -To list the kit component "comp-server-1.0-1-rhels-6-x86_64", enter: - - lskitcomp comp-server-1.0-1-rhels-6-x86_64 - -=item 3. - -To list the kit component "comp-server-1.0-1-rhels-6-x86_64" for selected kit component attributes, enter: - - lskitcomp -C kitcompname,desc comp-server-1.0-1-rhels-6-x86_64 - -=item 4. - -To list kit components compatible with "rhels-6.2-x86_64" osdistro, enter: - - lskitcomp -O rhels-6.2-x86_64 - -=item 5. - -To list kit components compatible with "rhels-6.2-x86_64" osdistro and "computenode" server role, enter: - - lskitcomp -O rhels-6.2-x86_64 -S computenode - -=item 6. - -To list the kit component "testkit-compute-1.0-1-ubuntu-14.04-ppc64el" with XML tags, enter: - - XCATXMLTRACE=1 lskitcomp -x testkit-compute-1.0-1-ubuntu-14.04-ppc64el - -=back - - -=head1 FILES - -/opt/xcat/bin/lskitcomp - -=head1 SEE ALSO - -L, L, L, L, L, L - diff --git a/xCAT-client/pods/man1/lskitdeployparam.1.pod b/xCAT-client/pods/man1/lskitdeployparam.1.pod deleted file mode 100644 index 1ce466a5c..000000000 --- a/xCAT-client/pods/man1/lskitdeployparam.1.pod +++ /dev/null @@ -1,107 +0,0 @@ -=head1 NAME - -B - Lists the deployment parameters for one or more Kits or Kit components - - -=head1 SYNOPSIS - -B [B<-V> | B<--verbose>] [B<-x> | B<--xml> | B<--XML>] [B<-k> | B<--kitname> I] [B<-c> | B<--compname> I] - -B [B<-?> | B<-h> | B<--help> | B<-v> | B<--version>] - - -=head1 DESCRIPTION - -The B command is used to list the kit deployment parameters for one or more kits, or one or more kit components. Kit deployment parameters are used to customize the installation or upgrade of kit components. - -The B command outputs the kit component information in two formats: human-readable format (default), and XML format. Use the -x option to view the information in XML format. - -Input to the command can specify any combination of the input options. - -Note: The xCAT support for Kits is only available for Linux operating systems. - -=head1 OPTIONS - -=over 10 - -=item B<-k|--kitname> I - -Where I is a comma-delimited list of kit names. The B command will only display the deployment parameters for the kits with the matching names. - -=item B<-c|--compname> I - -Where I is a comma-delimited list of kit component names. The B command will only display the deployment parameters for the kit components with the matching names. - -=item B<-x|--xml|--XML> - -Return the output with XML tags. The data is returned as: - - - - KIT_KIT1_PARAM1 - value11 - - - - - KIT_KIT1_PARAM2 - value12 - - - ... - -=item B<-V|--verbose> - -Display additional progress and error messages. - -=item B<-v|--version> - -Command Version. - -=item B<-?|-h|--help> - -Display usage message. - -=back - - -=head1 RETURN VALUE - -=over 3 - -=item 0 -The command completed successfully. - -=item 1 -An error has occurred. - -=back - - -=head1 EXAMPLES - -=over 3 - -=item 1. - -To list kit deployment parameters for kit "kit-test1-1.0-Linux", enter: - - lskitdeployparam -k kit-test1-1.0-Linux - -=item 2. - -To list kit deployment parameters for kit component "comp-server-1.0-1-rhels-6-x86_64", enter: - - lskitdeployparam -c comp-server-1.0-1-rhels-6-x86_64 - -=back - - -=head1 FILES - -/opt/xcat/bin/lskitdeployparam - -=head1 SEE ALSO - -L, L, L, L, L, L - diff --git a/xCAT-client/pods/man1/rmkit.1.pod b/xCAT-client/pods/man1/rmkit.1.pod deleted file mode 100644 index c9d8cb4a8..000000000 --- a/xCAT-client/pods/man1/rmkit.1.pod +++ /dev/null @@ -1,83 +0,0 @@ -=head1 NAME - -B - Remove Kits from xCAT - -=head1 SYNOPSIS - -B [B<-?>|B<-h>|B<--help>] [B<-v>|B<--version>] - -B [B<-V>|B<--verbose>] [B<-f>|B<--force>] [B<-t>|B<--test>] I - -=head1 DESCRIPTION - -The B command removes kits on the xCAT management node from kit names. - -Note: The xCAT support for Kits is only available for Linux operating systems. - -=head1 OPTIONS - -=over 10 - -=item B<-h|--help> - -Display usage message. - -=item B<-V|--verbose> - -Verbose mode. - -=item B<-v|--version> - -Command version. - -=item B<-f|--force> - -Remove this kit even there is any component in this kit is listed by osimage.kitcomponents. If this option is not specified, this kit will not be removed if any kit components listed in an osimage.kitcomponents - -=item B<-t|--test> - -Test if kitcomponents in this kit are used by osimage - -=item I - -A comma delimited list of kits that are to be removed from the xCAT cluster. Each entry can be a kitname or kit basename. For kit basename, rmkit command will remove all the kits that have that kit basename. - -=back - -=head1 RETURN VALUE - -0 The command completed successfully. - -1 An error has occurred. - -=head1 EXAMPLES - -1. To remove two kits from tarball files. - - rmkit kit-test1,kit-test2 - -Output is similar to: - - Kit kit-test1-1.0-Linux,kit-test2-1.0-Linux was successfully removed. - -2. To remove two kits from tarball files even the kit components in them are still being used by osimages. - - rmkit kit-test1,kit-test2 --force - -Output is similar to: - - Kit kit-test1-1.0-Linux,kit-test2-1.0-Linux was successfully removed. - -3. To list kitcomponents in this kit used by osimage - - rmkit kit-test1,kit-test2 -t - -Output is similar to: - - kit-test1-kitcomp-1.0-Linux is being used by osimage osimage-test - Following kitcomponents are in use: kit-test1-kitcomp-1.0-Linux - -=head1 SEE ALSO - -L, L, L, L, L - diff --git a/xCAT-client/pods/man1/rmkitcomp.1.pod b/xCAT-client/pods/man1/rmkitcomp.1.pod deleted file mode 100644 index 5484300dc..000000000 --- a/xCAT-client/pods/man1/rmkitcomp.1.pod +++ /dev/null @@ -1,90 +0,0 @@ -=head1 NAME - -B - Remove Kit components from an xCAT osimage. - -=head1 SYNOPSIS - -B [B<-?>|B<-h>|B<--help>] [B<-v>|B<--version>] - -B [B<-V>|B<--verbose>] [B<-u>|B<--uninstall>] [B<-f>|B<--force>] [B<--noscripts>] B<-i> I I - -=head1 DESCRIPTION - -The B command removes kit components from an xCAT osimage. All the kit component attribute values that are contained in the osimage will be removed, and the kit component meta rpm and package rpm could be uninstalled by B<-u|--uninstall> option. - -Note: The xCAT support for Kits is only available for Linux operating systems. - -=head1 OPTIONS - -=over 10 - -=item B<-u|--uninstall> - -All the kit component meta rpms and package rpms in otherpkglist will be uninstalled during genimage for stateless image and updatenode for stateful nodes. - -=item B<-h|--help> - -Display usage message. - -=item B<-V|--verbose> - -Verbose mode. - -=item B<-v|--version> - -Command version. - -=item B<-f|--force> - -Remove this kit component from osimage no matter it is a dependency of other kit components. - -=item B<--noscripts> - -Do not remove kitcomponent's postbootscripts from osimage - -=item B<-i> I - -osimage name that include this kit component. - -=item I - -A comma-delimited list of valid full kit component names or kit component basenames that are to be removed from the osimage. If a basename is specified, all kitcomponents matching that basename will be removed from the osimage. - -=back - -=head1 RETURN VALUE - -0 The command completed successfully. - -1 An error has occurred. - -=head1 EXAMPLES - -1. To remove a kit component from osimage - - rmkitcomp -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 - -Output is similar to: - - kitcomponents comp-test1-1.0-1-rhels-6.2-ppc64 were removed from osimage rhels6.2-ppc64-netboot-compute successfully - -2. To remove a kit component even it is still used as a dependency of other kit component. - - rmkitcomp -f -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 - -Output is similar to: - - kitcomponents comp-test1-1.0-1-rhels-6.2-ppc64 were removed from osimage rhels6.2-ppc64-netboot-compute successfully - -3. To remove a kit component from osimage and also remove the kit component meta RPM and package RPM. So in next genimage for statelss image and updatenode for stateful nodes, the kit component meta RPM and package RPM will be uninstalled. - - rmkitcomp -u -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 - -Output is similar to: - - kitcomponents comp-test1-1.0-1-rhels-6.2-ppc64 were removed from osimage rhels6.2-ppc64-netboot-compute successfully - - -=head1 SEE ALSO - -L, L, L, L, L From 7c9d6a56f00d744752ae3ec4d2eac5515e1ef490 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 24 Jul 2019 16:42:26 -0400 Subject: [PATCH 217/276] Remove kits from Ubuntu and go-xcat --- xCAT-server/share/xcat/tools/go-xcat | 6 +++--- xCAT/debian/control | 2 +- xCATsn/debian/control | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 75b15ea98..b519ca876 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -161,13 +161,13 @@ GO_XCAT_CORE_PACKAGE_LIST=() GO_XCAT_DEP_PACKAGE_LIST=() # The package list of all the packages should be installed -GO_XCAT_INSTALL_LIST=(perl-xCAT xCAT xCAT-buildkit xCAT-client +GO_XCAT_INSTALL_LIST=(perl-xCAT xCAT xCAT-client xCAT-genesis-scripts-ppc64 xCAT-genesis-scripts-x86_64 xCAT-server elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat xCAT-genesis-base-ppc64 xCAT-genesis-base-x86_64 xnba-undi yaboot-xcat) -# For Debian/Ubuntu, it will need a sight different package list +# For Debian/Ubuntu, it will need a sightly different package list type dpkg >/dev/null 2>&1 && -GO_XCAT_INSTALL_LIST=(perl-xcat xcat xcat-buildkit xcat-client +GO_XCAT_INSTALL_LIST=(perl-xcat xcat xcat-client xcat-genesis-scripts-amd64 xcat-genesis-scripts-ppc64 xcat-server elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat xcat-genesis-base-amd64 xcat-genesis-base-ppc64 xnba-undi) diff --git a/xCAT/debian/control b/xCAT/debian/control index 4b3fedcc3..fe5b7c758 100644 --- a/xCAT/debian/control +++ b/xCAT/debian/control @@ -10,7 +10,7 @@ Homepage: https://xcat.org/ Package: xcat Architecture: amd64 ppc64el Depends: ${perl:Depends}, goconserver, xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, isc-dhcp-server, apache2, nfs-kernel-server, libxml-parser-perl, rsync, tftpd-hpa, libnet-telnet-perl, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) -Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000) +Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-probe (>= 2.13-snap000000000000) Suggests: yaboot-xcat Description: Metapackage for a common, default xCAT setup xCAT is Extreme Cluster/Cloud Administration Toolkit. xCAT offers complete diff --git a/xCATsn/debian/control b/xCATsn/debian/control index 3476c39c0..eaca013f9 100644 --- a/xCATsn/debian/control +++ b/xCATsn/debian/control @@ -9,7 +9,7 @@ Homepage: https://xcat.org/ Package: xcatsn Architecture: amd64 ppc64el Depends: ${perl:Depends}, goconserver, xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, libxml-parser-perl, tftpd-hpa, libnet-telnet-perl, isc-dhcp-server, apache2, nfs-kernel-server, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) -Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000) +Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-probe (>= 2.13-snap000000000000) Suggests: yaboot-xcat Description: Metapackage for a common, default xCAT service node setup xCATsn is a service node management package intended for at-scale From 2eb57b1db5fabe836860e1c18afeeb0c5d03f207 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 24 Jul 2019 17:00:25 -0400 Subject: [PATCH 218/276] Update version and changelog for go-xcat --- xCAT-server/share/xcat/tools/go-xcat | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index b519ca876..50fbbe26d 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,7 +2,7 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.40 +# Version 1.0.41 # # Copyright (C) 2016 - 2019 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) @@ -23,6 +23,8 @@ # - xCAT uninstallation # 2019-03-22 GONG Jie # - Better debug log when reading repository failed +# 2019-07-24 Mark Gurevich +# - Removed references to buildkit # function usage() From 328aafee2de45d4927017ce9b6ef927709aa9ba4 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 1 Aug 2019 16:22:23 -0400 Subject: [PATCH 219/276] Modify pkgdir for ubuntu16.04.5 x86 testcase --- .../testcase/installation/reg_linux_diskless_installation_flat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index b048d547a..59aaa36b0 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -34,7 +34,7 @@ cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi cmd:mount |sort > /tmp/mountoutput/file.org cmd:cat /tmp/mountoutput/file.org cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu18.04.2" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ ppc64(el|le) ]] && [[ "__GETNODEATTR($$CN,mgt)__" =~ "kvm" ]] ; then mkdir -p /install/custom/netboot/ubuntu; sed -e 's@linux-image-generic-hwe-18.04@linux-image-generic@g' /install/custom/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist; chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute pkglist=/install/custom/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist; fi -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 From da5c7512116021cd1f3d314c59b145045418a0bc Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 2 Aug 2019 11:05:21 -0400 Subject: [PATCH 220/276] Modify pkgdir for ubuntu16.04.5 x86 testcase (2) --- ...nux_diskless_installation_flat_postscripts_failed | 2 +- .../reg_linux_diskless_installation_hierarchy | 2 +- xCAT-test/autotest/testcase/packimg/cases0 | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed index 41391a68f..7b1bae418 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed @@ -37,7 +37,7 @@ check:rc==0 cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi cmd:mount |sort > /tmp/mountoutput/file.org cmd:cat /tmp/mountoutput/file.org -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index bd8fe4876..478cfe9c5 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -37,7 +37,7 @@ check:rc==0 cmd:if [[ -f /test.synclist ]] ;then mv -f /test.synclist /test.synclist.bak;fi; cmd:echo "/test.synclist -> /test.synclist" > /test.synclist;chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/test.synclist check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 diff --git a/xCAT-test/autotest/testcase/packimg/cases0 b/xCAT-test/autotest/testcase/packimg/cases0 index d04d92940..0d7347087 100644 --- a/xCAT-test/autotest/testcase/packimg/cases0 +++ b/xCAT-test/autotest/testcase/packimg/cases0 @@ -64,7 +64,7 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $ check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz /rootimg.cpio.gz.bak;fi -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 @@ -109,7 +109,7 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $ check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz /rootimg.cpio.gz.bak;fi -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 @@ -158,7 +158,7 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $ check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.xz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.xz /rootimg.cpio.xz.bak;fi -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 @@ -203,7 +203,7 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $ check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz /rootimg.tar.gz.bak;fi -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 @@ -263,7 +263,7 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $ check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz /rootimg.tar.gz.bak;fi -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 @@ -319,7 +319,7 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $ check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.xz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.xz /rootimg.tar.xz.bak;fi -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 From ab86aa44025430bf751fec2e70b76a3d7771f152 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 12 Aug 2019 14:38:45 -0400 Subject: [PATCH 221/276] Add xCAT-buildkit to go-xcat uninstall list --- xCAT-server/share/xcat/tools/go-xcat | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 50fbbe26d..e3d107630 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,7 +2,7 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.41 +# Version 1.0.42 # # Copyright (C) 2016 - 2019 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) @@ -25,6 +25,8 @@ # - Better debug log when reading repository failed # 2019-07-24 Mark Gurevich # - Removed references to buildkit +# 2019-08-12 Mark Gurevich +# - Added xCAT-buildkit to uninstall list # function usage() @@ -176,11 +178,13 @@ GO_XCAT_INSTALL_LIST=(perl-xcat xcat xcat-client # The package list of all the packages should be installed GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}" goconserver xCAT-SoftLayer xCAT-confluent xCAT-csm xCAT-genesis-builder - xCAT-openbmc-py xCAT-probe xCAT-test xCAT-vlan xCATsn xCAT-UI-deps) + xCAT-openbmc-py xCAT-probe xCAT-test xCAT-vlan xCATsn xCAT-UI-deps + xCAT-buildkit) # For Debian/Ubuntu, it will need a sight different package list type dpkg >/dev/null 2>&1 && GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}" - goconserver xcat-confluent xcat-probe xcat-test xcat-vlan xcatsn) + goconserver xcat-confluent xcat-probe xcat-test xcat-vlan xcatsn + xcat-buildkit) PATH="/usr/sbin:/usr/bin:/sbin:/bin" export PATH From aab82ca6335a2ee44b7915ebc93b027bf8be9df4 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 15 Aug 2019 10:19:13 -0400 Subject: [PATCH 222/276] Remove conserver-xcat during uninstall --- xCAT-server/share/xcat/tools/go-xcat | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index e3d107630..4d128fe88 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,7 +2,7 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.42 +# Version 1.0.43 # # Copyright (C) 2016 - 2019 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) @@ -27,6 +27,8 @@ # - Removed references to buildkit # 2019-08-12 Mark Gurevich # - Added xCAT-buildkit to uninstall list +# 2019-08-15 Mark Gurevich +# - Added conserver-xcat to uninstall list # function usage() @@ -179,12 +181,12 @@ GO_XCAT_INSTALL_LIST=(perl-xcat xcat xcat-client GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}" goconserver xCAT-SoftLayer xCAT-confluent xCAT-csm xCAT-genesis-builder xCAT-openbmc-py xCAT-probe xCAT-test xCAT-vlan xCATsn xCAT-UI-deps - xCAT-buildkit) + xCAT-buildkit conserver-xcat) # For Debian/Ubuntu, it will need a sight different package list type dpkg >/dev/null 2>&1 && GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}" goconserver xcat-confluent xcat-probe xcat-test xcat-vlan xcatsn - xcat-buildkit) + xcat-buildkit conserver-xcat) PATH="/usr/sbin:/usr/bin:/sbin:/bin" export PATH From f6bea60852cee1d9aad3ac5a51cb81162a3972ae Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 21 Aug 2019 16:57:00 -0400 Subject: [PATCH 223/276] Make repodata files readable by all --- builddep.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builddep.sh b/builddep.sh index 97090a5a2..ee5b0e5b4 100755 --- a/builddep.sh +++ b/builddep.sh @@ -277,6 +277,10 @@ fi chgrp -R -h $SYSGRP * chmod -R g+w * +# Change permission on all repodata files to be readable by all +chmod a+r */*/repodata/*.gz +chmod a+r */*/repodata/*.bz2 + TARBALL_WORKING_DIR="${XCATCOREDIR}/${DESTDIR}" echo "===> Building the tarball at: ${TARBALL_WORKING_DIR} ..." # From b678ec0aa21b3c99990ae3832b46dea47c7d03ca Mon Sep 17 00:00:00 2001 From: jose_d Date: Mon, 26 Aug 2019 19:23:04 +0200 Subject: [PATCH 224/276] increase memory in kvm guide with current CentOS, download of kickstart file will fail when 1G memory is used. I believe it's related to this RHEL bug, https://bugzilla.redhat.com/show_bug.cgi?id=1595369, "Bug 1595369 - rhel 7.5 installation fails with 1GB ram ". --- .../admin-guides/manage_clusters/common/kvm/manage_vm.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst b/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst index a40b77e1f..e4a511b35 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst @@ -39,7 +39,7 @@ After the VM object is created, several key attributes need to be specified with 4. the virtual memory size, with the unit "Megabit". Specify 1GB memory to "vm1" here: :: - chdef vm1 vmmemory=1024 + chdef vm1 vmmemory=2048 **Note**: For diskless node, the **vmmemory** should be at least 2048 MB, otherwise the node cannot boot up. From 8f1e64c1cd8cabab47478e7c58bebd6d47167eb3 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 27 Aug 2019 14:39:07 -0400 Subject: [PATCH 225/276] Testcase kdump increase sleep --- xCAT-test/autotest/testcase/kdump/linux_diskless_kdump | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index f5ed9e44a..0e0ba3104 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -71,8 +71,9 @@ check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN "echo 'echo 1 > /proc/sys/kernel/sysrq; echo c > /proc/sysrq-trigger' > /tmp/kdump.trigger" cmd:xdsh $$CN "chmod 755 /tmp/kdump.trigger" cmd:xdsh $$CN "service atd start" +cmd:sleep 30 cmd:xdsh $$CN "at now +1 minutes <<< /tmp/kdump.trigger" -cmd:sleep 300 +cmd:sleep 600 cmd:vmcorefile=`find /opt/xcat/share/xcat/tools/autotest/kdumpdir/ -name vmcore`;if [[ -s $vmcorefile ]]; then echo "this file is not empty";else echo "this file is empty"; fi check:output=~not empty From 9fb1cbe86a056a8aa1c9596c91d6a039b88d51bf Mon Sep 17 00:00:00 2001 From: jose_d Date: Wed, 28 Aug 2019 17:15:26 +0200 Subject: [PATCH 226/276] documentation: kvm: simplify wording --- .../admin-guides/manage_clusters/common/kvm/manage_vm.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst b/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst index e4a511b35..de9392756 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst @@ -37,7 +37,7 @@ After the VM object is created, several key attributes need to be specified with chdef vm1 vmhost=kvmhost1 -4. the virtual memory size, with the unit "Megabit". Specify 1GB memory to "vm1" here: :: +4. the virtual memory size (in Megabytes): :: chdef vm1 vmmemory=2048 From 910261fb62268d7c94c6ff6b62ed166fa76cbaf4 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 29 Aug 2019 09:48:27 -0400 Subject: [PATCH 227/276] Fix spelling and formatting in manage_vm doc --- .../manage_clusters/common/kvm/manage_vm.rst | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst b/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst index de9392756..69a8a5ee6 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst @@ -1,5 +1,5 @@ Manage Virtual Machine (VM) -============================ +=========================== Now the PowerKVM hypervisor "kvmhost1" is ready, this section introduces the VM management in xCAT, including examples on how to create, remove and clone VMs. @@ -41,8 +41,6 @@ After the VM object is created, several key attributes need to be specified with chdef vm1 vmmemory=2048 -**Note**: For diskless node, the **vmmemory** should be at least 2048 MB, otherwise the node cannot boot up. - 5. Define the virtual network card, it should be set to the bridge "br0" which has been created in the hypervisor. If no bridge is specified, no network device will be created for the VM node "vm1": :: chdef vm1 vmnics=br0 @@ -62,27 +60,27 @@ After the VM object is created, several key attributes need to be specified with B. Create storage on a device of hypervisor - The format is 'phy:/dev/sdb1': :: + The format is ``phy:/dev/sdb1``: :: chdef vm1 vmstorage=phy:/dev/sdb1 C. Create storage on a directory of hypervisor - The format is 'dir:///var/lib/libvirt/images': :: + The format is ``dir:///var/lib/libvirt/images``: :: chdef vm1 vmstorage=dir:///var/lib/libvirt/images - **Note**: The attribute **vmstorage** is only valid for diskful VM node. +.. note:: The attribute **vmstorage** is only valid for diskful VM node. 8. Define the **console** attributes for VM: :: chdef vm1 serialport=0 serialspeed=115200 -9. (optional)For monitoring and access the VM with vnc client, set **vidpassword** value: :: +9. (Optional) For monitoring and access the VM with vnc client, set **vidpassword** value: :: chtab node=vm1 vm.vidpassword=abc123 -10. (optional)For assigning PCI devices to the VM, set **othersettings** value: :: +10. (Optional) For assigning PCI devices to the VM, set **othersettings** value: :: chtab node=vm1 vm.othersettings="devpassthrough:0000:01:00.2" @@ -133,7 +131,7 @@ When "vm1" is created successfully, a VM hard disk file with a name like "vm1.sd lsdef vm1 -i mac -Now a VM "vm1" is created, it can be provisioned like any other nodes in xCAT. The VM node can be powered on by: :: +Once a VM "vm1" is created, it can be provisioned like any other node in xCAT. The VM node can be powered on by: :: rpower vm1 on @@ -164,9 +162,9 @@ When the VM has been created and powered on, choose one of the following methods makegocons vm1 rcons vm1 -* Connect to virtual machine through vnc console +* Connect to virtual machine through ``vnc`` console - In order to connect the virtual machine's vnc server, a new set of credentials need to be generated by running: :: + In order to connect the virtual machine's ``vnc`` server, a new set of credentials need to be generated by running: :: xcatclient getrvidparms vm1 vm1: method: kvm @@ -176,10 +174,10 @@ When the VM has been created and powered on, choose one of the following methods vm1: server: kvmhost1 vm1: vidport: 5900 - **Note**: Now just pick a favorite vnc client to connect the hypervisor, with the password generated by ``getrvidparms``. If the vnc client complains "the password is not valid", the reason might be that the hypervisor and headnode clocks are out of sync! Please try to sync them by running ``ntpdate `` on both the hypervisor and the headnode. +.. note:: Now just pick a favorite ``vnc`` client to connect the hypervisor, with the password generated by ``getrvidparms``. If the ``vnc`` client complains "the password is not valid", the reason might be that the hypervisor and headnode clocks are out of sync! Please try to sync them by running ``ntpdate `` on both the hypervisor and the headnode. -* Use wvid on management node +* Use ``wvid`` on management node Make sure **firewalld** service is stopped, disable it if not: :: @@ -214,7 +212,7 @@ Clone the virtual machine **Clone** is an operation that creating a VM from an existed one by inheriting most of its attributes and data. -The general step of **clone** a VM is like this: first creating a **VM master** , then creating a VM with the newly created **VM master** in **attaching** or **detaching** mode. +Steps to **clone** a VM: first create a **VM master** , then create a VM with the newly created **VM master** in **attaching** or **detaching** mode. **In attaching mode** From 3c2fbbc61746d28fa2b75e840011dd36f5e62a98 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 3 Sep 2019 11:27:33 -0400 Subject: [PATCH 228/276] Health check xcat-dep files before building tar and remove AIX support --- builddep.sh | 284 +++++++++++++++++++++++++--------------------------- 1 file changed, 135 insertions(+), 149 deletions(-) diff --git a/builddep.sh b/builddep.sh index ee5b0e5b4..2cb1357b0 100755 --- a/builddep.sh +++ b/builddep.sh @@ -17,6 +17,11 @@ # UP=0 or UP=1 - override the default upload behavior # FRSYUM=0 - put the directory of individual rpms in the project web area instead # of the FRS area. +# CHECK=0 or 1 - verify proper file location and links. Default is to check. +# Verifies all noarch files in ..../// are links +# Verifies no broken link files in ..../// +# Verifies there are no multiple, real (non-link) files with the same name +# Verifies all real (non-link) files have a link to it # VERBOSE=1 - Set to 1 to see more VERBOSE output # This script should only be run on RPM based machines @@ -30,10 +35,14 @@ fi USER=xcat TARGET_MACHINE=xcat.org +BASE_GSA=/gsa/pokgsa/projects/x/xcat/build +GSA=$BASE_GSA/linux/xcat-dep + FRS=/var/www/xcat.org/files/xcat OSNAME=$(uname) UP=0 +CHECK=1 # Process cmd line variable assignments, assigning each attr=val pair to a variable of same name for i in $*; do # upper case the variable name @@ -41,13 +50,7 @@ for i in $*; do export $varstring done -if [ "$OSNAME" == "AIX" ]; then - DFNAME=dep-aix-`date +%Y%m%d%H%M`.tar.gz - GSA=/gsa/pokgsa/projects/x/xcat/build/aix/xcat-dep -else - DFNAME=xcat-dep-`date +%Y%m%d%H%M`.tar.bz2 - GSA=/gsa/pokgsa/projects/x/xcat/build/linux/xcat-dep -fi +DFNAME=xcat-dep-`date +%Y%m%d%H%M`.tar.bz2 if [ ! -d $GSA ]; then echo "ERROR: This script is intended to be used by xCAT development..." @@ -117,6 +120,81 @@ function checkrc { fi } +# Verify files in $GSA +if [[ ${CHECK} -eq 1 ]]; then + ERROR=0 + LINKED_TO_FILES_ARRAY=[] + counter=0 + OSes=`find $GSA -maxdepth 1 -mindepth 1 -type d` + for os in $OSes; do + ARCHes=`find $os -maxdepth 1 -mindepth 1 -type d` + for arch in $ARCHes; do + + # Find regular noarch.rpm files in / directory + for file in `find $arch -type f -name "*noarch.rpm"`; do + ERROR=1 + echo -e "\nError: Regular 'noarch' file $file found in 'arch' directory. Expected a link." + done + + # Find broken links file + for file in `find $arch -xtype l -name "*noarch.rpm"`; do + ERROR=1 + echo -e "\nError: Broken link file $file" + done + + # Save a link of everything being linked to for later use + for link_file in `find $arch -type l -name "*.rpm"`; do + LINKED_TO_FILE=`realpath --relative-to=$GSA $link_file` + LINKED_TO_FILES_ARRAY[$counter]=$LINKED_TO_FILE + counter=$counter+1 + done + + + done + done + + # Find identical files in $GSA and $GSA/ directory + for short_file in $GSA/*.rpm; do + basename=$(basename -- "$short_file") + DUP_FILES=`find $GSA/*/ -type f -name $basename` + if [[ ! -z $DUP_FILES ]]; then + ERROR=1 + echo -e "\nError: Multiple real files with the same name found ($basename):" + for dup_file in `find $GSA -type f -name $basename`; do + ls -l $dup_file + done + fi + done + + if [ -n "$VERBOSEMODE" ]; then + # In verbose mode print contents of array containing all the files someone links to from / + for var in "${LINKED_TO_FILES_ARRAY[@]}"; do + echo "Symlink detected to file: ${var} " + done + fi + + echo " " + # Find all files no one links to + REAL_FILES=`find $GSA/* -maxdepth 1 -type f -name "*.rpm" | cut -d / -f 10,11 --output-delimiter="/"` + for file in $REAL_FILES; do + FOUND=0 + for used_link in "${LINKED_TO_FILES_ARRAY[@]}"; do + if [[ $file == $used_link ]]; then + FOUND=1 + break + fi + done + if [[ ${FOUND} -eq 0 ]]; then + echo "Warning: No symlinks to file: $GSA/$file" + fi + done + + if [[ ${ERROR} -eq 1 ]]; then + echo -e "\nErrors found verifying files. Rerun this script with CHECK=0 to skip file verification." + exit 1 + fi +fi + WORKING_TARGET_DIR="${DESTDIR}/xcat-dep" # Sync from the GSA master copy of the dep rpms mkdir -p ${WORKING_TARGET_DIR} @@ -132,148 +210,63 @@ cd ${WORKING_TARGET_DIR} # add a comment to indicate the latest xcat-dep tar ball name sed -i -e "s#REPLACE_LATEST_SNAP_LINE#The latest xcat-dep tar ball is ${DFNAME}#g" README -if [ "$OSNAME" != "AIX" ]; then - # Get gpg keys in place - mkdir -p ${GNU_KEYDIR} - checkrc - for i in pubring.gpg secring.gpg trustdb.gpg; do - if [ ! -f ${GNU_KEYDIR}/$i ] || [ `wc -c ${GNU_KEYDIR}/$i|cut -f 1 -d' '` == 0 ]; then - rm -f ${GNU_KEYDIR}/$i - cp $GSA/../keys/$i ${GNU_KEYDIR} - chmod 600 ${GNU_KEYDIR}/$i - fi - done - - # Tell rpm to use gpg to sign - if ! $GREP -q '%_signature gpg' $MACROS 2>/dev/null; then - echo '%_signature gpg' >> $MACROS +# Get gpg keys in place +mkdir -p ${GNU_KEYDIR} +checkrc +for i in pubring.gpg secring.gpg trustdb.gpg; do + if [ ! -f ${GNU_KEYDIR}/$i ] || [ `wc -c ${GNU_KEYDIR}/$i|cut -f 1 -d' '` == 0 ]; then + rm -f ${GNU_KEYDIR}/$i + cp $GSA/../keys/$i ${GNU_KEYDIR} + chmod 600 ${GNU_KEYDIR}/$i fi - if ! $GREP -q '%_gpg_name' $MACROS 2>/dev/null; then - echo '%_gpg_name xCAT Automatic Signing Key' >> $MACROS - fi - - # Sign the rpms that are not already signed. The "standard input reopened" warnings are normal. - echo "===> Signing RPMs..." - $XCATCOREDIR/build-utils/rpmsign.exp `find . -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)' - - # Create the repodata dirs - echo "===> Creating repodata directories..." - for i in `find -mindepth 2 -maxdepth 2 -type d `; do - if [ -n "$VERBOSEMODE" ]; then - createrepo $i # specifying checksum so the repo will work on rhel5 - else - createrepo $i >/dev/null - fi - rm -f $i/repodata/repomd.xml.asc - gpg -a --detach-sign --default-key 5619700D $i/repodata/repomd.xml - if [ ! -f $i/repodata/repomd.xml.key ]; then - cp $GSA/../keys/repomd.xml.key $i/repodata - fi - done - - # Modify xcat-dep.repo files to point to the correct place - echo "===> Modifying the xcat-dep.repo files to point to the correct location..." - - echo "===> Making sure that the mklocalrepo.sh file contains execute permission ..." - ls -ltr ${XCATCOREDIR}/${WORKING_TARGET_DIR}/mklocalrepo.sh - if [[ ! -x "${XCATCOREDIR}/${WORKING_TARGET_DIR}/mklocalrepo.sh" ]]; then - echo "===> --- found not execute, changing +x ..." - chmod +x ${XCATCOREDIR}/${WORKING_TARGET_DIR}/mklocalrepo.sh - fi - - echo "===> Checking if 'replacelinks' is in the xcat-deps, removing if there ..." - if [[ -f ${XCATCOREDIR}/${WORKING_TARGET_DIR}/replacelinks ]]; then - rm -f ${XCATCOREDIR}/${WORKING_TARGET_DIR}/replacelinks - fi -fi - -if [ "$OSNAME" == "AIX" ]; then - # Build the instoss file ------------------------------------------ - - cat >instoss << 'EOF' -#!/bin/ksh -# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html -# xCAT on AIX - prerequisite install script -cd `dirname $0` -PERLVER=`perl -v|grep 'This is perl'|cut -d' ' -f 4` -if [ "$PERLVER" == "v5.8.2" ]; then - OSVER='5.3' -elif [ "$PERLVER" == "v5.8.8" ]; then - OSVER='6.1' - aixver=`lslpp -lc|grep 'bos.rte:'|head -1|cut -d: -f3` - if [[ $aixver < '6.1.9.0' ]]; then - AIX61Y=0 - else - AIX61Y=1 - fi -elif [ "$PERLVER" == "v5.10.1" ]; then - OSVER='7.1' - aixver=`lslpp -lc|grep 'bos.rte:'|head -1|cut -d: -f3` - if [[ $aixver < '7.1.3.0' ]]; then - AIX71L=0 - else - AIX71L=1 - fi - -else - echo "Error: the perl version of '$PERLVER' is not one that instoss understands. Exiting..." - exit 2 -fi -cd $OSVER -# Have to install rpms 1 at a time, since some may be already installed. -# The only interdependency between the dep rpms so far is that net-snmp requires bash, and -# pyodbc requires unixODBC. (The bash dependency is taken care of automatically because it -# comes earlier in the alphabet.) - -# first run /usr/sbin/updtvpkg to make sure any installp software is -# registered with RPM. -echo "Running updtvpkg. This could take a few minutes." -/usr/sbin/updtvpkg -echo "updtvpkg has completed." - -# unixODBC is required by pyodbc, so install it first -rpm -Uvh unixODBC* -# Now install the bulk of the rpms, one at a time, in case some are already installed -for i in `ls *.rpm|grep -v -E '^tcl-|^tk-|^expect-|^unixODBC-|^xCAT-UI-deps|^perl-DBD-DB2Lite|^net-snmp'`; do - if [ "$i" == "perl-Net-DNS-0.66-1.aix5.3.ppc.rpm" ]; then - opts="--nodeps" - else - opts="" - fi - - # On 7.1L and 6.1Y we need a newer version of perl-Net_SSLeay.pm - if [[ $AIX71L -eq 1 || $AIX61Y -eq 1 ]]; then - if [[ $i == perl-Net_SSLeay.pm-1.30-* ]]; then continue; fi # skip the old rpm - else - if [[ $i == perl-Net_SSLeay.pm-1.55-* ]]; then continue; fi # skip the new rpm - fi - - echo rpm -Uvh $opts $i - rpm -Uvh $opts $i done -# Have to upgrade all of the net-snmp rpms together because they depend on each other. -# Also, they require bash, so do it after the loop, rather than before -rpm -Uvh net-snmp* -EOF -# end of instoss file content --------------------------------------------- +# Tell rpm to use gpg to sign +if ! $GREP -q '%_signature gpg' $MACROS 2>/dev/null; then + echo '%_signature gpg' >> $MACROS +fi +if ! $GREP -q '%_gpg_name' $MACROS 2>/dev/null; then + echo '%_gpg_name xCAT Automatic Signing Key' >> $MACROS +fi +# Sign the rpms that are not already signed. The "standard input reopened" warnings are normal. +echo "===> Signing RPMs..." +$XCATCOREDIR/build-utils/rpmsign.exp `find . -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)' - chmod +x instoss +# Create the repodata dirs +echo "===> Creating repodata directories..." +for i in `find -mindepth 2 -maxdepth 2 -type d `; do + if [ -n "$VERBOSEMODE" ]; then + createrepo $i # specifying checksum so the repo will work on rhel5 + else + createrepo $i >/dev/null + fi + rm -f $i/repodata/repomd.xml.asc + gpg -a --detach-sign --default-key 5619700D $i/repodata/repomd.xml + if [ ! -f $i/repodata/repomd.xml.key ]; then + cp $GSA/../keys/repomd.xml.key $i/repodata + fi +done + +# Modify xcat-dep.repo files to point to the correct place +echo "===> Modifying the xcat-dep.repo files to point to the correct location..." + +echo "===> Making sure that the mklocalrepo.sh file contains execute permission ..." +ls -ltr ${XCATCOREDIR}/${WORKING_TARGET_DIR}/mklocalrepo.sh +if [[ ! -x "${XCATCOREDIR}/${WORKING_TARGET_DIR}/mklocalrepo.sh" ]]; then + echo "===> --- found not execute, changing +x ..." + chmod +x ${XCATCOREDIR}/${WORKING_TARGET_DIR}/mklocalrepo.sh +fi + +echo "===> Checking if 'replacelinks' is in the xcat-deps, removing if there ..." +if [[ -f ${XCATCOREDIR}/${WORKING_TARGET_DIR}/replacelinks ]]; then + rm -f ${XCATCOREDIR}/${WORKING_TARGET_DIR}/replacelinks fi # Get the permissions and group correct -if [ "$OSNAME" == "AIX" ]; then - # AIX - SYSGRP=system - YUM=aix - FRSDIR='2.x_AIX' -else - # Linux - SYSGRP=root - YUM=yum/devel - FRSDIR='2.x_Linux' -fi +SYSGRP=root +YUM=yum/devel +FRSDIR='2.x_Linux' chgrp -R -h $SYSGRP * chmod -R g+w * @@ -298,14 +291,7 @@ if [ -n "$VERBOSEMODE" ]; then fi echo "===> Creating $DFNAME ..." -if [ "$OSNAME" == "AIX" ]; then - tar $verbosetar -cf ${DFNAME%.gz} xcat-dep - rm -f $DFNAME - gzip ${DFNAME%.gz} -else - # Linux - tar $verbosetar -jcf $DFNAME xcat-dep -fi +tar $verbosetar -jcf $DFNAME xcat-dep if [[ ${UP} -eq 0 ]]; then echo "Upload not being done, set UP=1 to upload to xcat.org" From 7fd2b54dce2c44cd5c58b81ebb9a38542bfc1411 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 5 Sep 2019 11:14:59 -0400 Subject: [PATCH 229/276] Make xcat-dep tar file readable by all --- builddep.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/builddep.sh b/builddep.sh index 2cb1357b0..3344c2aa5 100755 --- a/builddep.sh +++ b/builddep.sh @@ -292,6 +292,7 @@ fi echo "===> Creating $DFNAME ..." tar $verbosetar -jcf $DFNAME xcat-dep +chmod a+r $DFNAME if [[ ${UP} -eq 0 ]]; then echo "Upload not being done, set UP=1 to upload to xcat.org" From 5dbe9f202601a2a272363d5f904bf6c7e976af27 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 12 Sep 2019 14:38:21 -0400 Subject: [PATCH 230/276] Openbmc hardware control with OP940 --- xCAT-server/lib/perl/xCAT/OPENBMC.pm | 10 ++++++++++ xCAT-server/lib/xcat/plugins/openbmc.pm | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/OPENBMC.pm b/xCAT-server/lib/perl/xCAT/OPENBMC.pm index 9a4ab02ec..85188c14b 100644 --- a/xCAT-server/lib/perl/xCAT/OPENBMC.pm +++ b/xCAT-server/lib/perl/xCAT/OPENBMC.pm @@ -25,6 +25,8 @@ use xCAT::TableUtils; my $PYTHON_AGENT_FILE = "/opt/xcat/lib/python/agent/agent.py"; my $header = HTTP::Headers->new('Content-Type' => 'application/json'); +# Currently not used, example of header to use for authorization +#my $header = HTTP::Headers->new('X-Auth-Token' => 'xfMHrrxdMgbiITnX0TlN'); sub new { my $async = shift; @@ -44,8 +46,16 @@ sub send_request { my $method = shift; my $url = shift; my $content = shift; + my $username = shift; + my $password = shift; my $request = HTTP::Request->new( $method, $url, $header, $content ); + if (defined $username and defined $password) { + # If username and password were passed in use authorization_basic() + # This is required to connect to BMC with OP940 level, ignored for + # lower OP levels + $request->authorization_basic($username, $password); + } my $id = $async->add_with_opts($request, {}); return $id; } diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 952922b76..4b902c9c1 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -2452,7 +2452,7 @@ sub gen_send_request { } process_debug_info($node, $debug_info); } - my $handle_id = xCAT::OPENBMC->send_request($async, $method, $request_url, $content); + my $handle_id = xCAT::OPENBMC->send_request($async, $method, $request_url, $content, $node_info{$node}{username}, $node_info{$node}{password}); $handle_id_node{$handle_id} = $node; $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; @@ -4212,7 +4212,7 @@ sub rspconfig_dump_response { sub dump_download_process { my $node = shift; - my $request_url = "$http_protocol://" . $node_info{$node}{bmc}; + my $request_url = "$http_protocol://" . $node_info{$node}{username} . ":" . $node_info{$node}{password} . "@" . $node_info{$node}{bmc}; my $content_login = '{ "data": [ "' . $node_info{$node}{username} .'", "' . $node_info{$node}{password} . '" ] }'; my $content_logout = '{ "data": [ ] }'; my $cjar_id = "/tmp/_xcat_cjar.$node"; @@ -4876,7 +4876,7 @@ sub rflash_response { sub rflash_upload { my ($node, $callback) = @_; - my $request_url = "$http_protocol://" . $node_info{$node}{bmc}; + my $request_url = "$http_protocol://" . $node_info{$node}{username} . ":" . $node_info{$node}{password} . "@" . $node_info{$node}{bmc}; my $content_login = '{ "data": [ "' . $node_info{$node}{username} .'", "' . $node_info{$node}{password} . '" ] }'; my $content_logout = '{ "data": [ ] }'; my $cjar_id = "/tmp/_xcat_cjar.$node"; From 1204fc0550f05937ecf1b978fd6739c4d2f3c0e1 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 17 Sep 2019 15:02:21 -0400 Subject: [PATCH 231/276] Ubuntu dependency build --- build-ubunturepo | 69 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 53 insertions(+), 16 deletions(-) diff --git a/build-ubunturepo b/build-ubunturepo index 76d981c21..94afcaff9 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -24,6 +24,10 @@ # prep for a release. # GPGSIGN=0 - Do not sign the repo in the end of the build. The repo will be signed by default # +# LOCAL_KEY=1 Use local keys to sign repo instead of WGET from GSA. By default use GSA. +# +# SETUP=1 Setup environment for build. By default do not setup environment. +# # LOG= - provide an LOG file option to redirect some output into log file # # DEST= - provide a directory to contains the build result @@ -48,16 +52,8 @@ if [[ ! -f /etc/lsb-release ]]; then fi . /etc/lsb-release -# Check the necessary packages before starting the build -declare -a packages=( "reprepro" "devscripts" "debhelper" "libsoap-lite-perl" "libdbi-perl" "quilt" "git") +export HOME=/root -for package in ${packages[@]}; do - RC=`dpkg -l | grep $package >> /dev/null 2>&1; echo $?` - if [[ ${RC} != 0 ]]; then - echo "ERROR: Could not find $package, install using 'apt-get install $package' to continue" - exit 1 - fi -done # Process cmd line variable assignments, assigning each attr=val pair to a variable of same name for i in $*; do @@ -70,6 +66,44 @@ for i in $*; do export $varstring done +#Setup environment so the xcat-deps can be built on a FVT test machine +if [ "$SETUP" = "1" ];then + #Mount GSA + POKGSA="/gsa/pokgsa" + POKGSA2="/gsa/pokgsa-p2" + POKGSAIBM="pokgsa.ibm.com" + if [ ! -d $POKGSA ];then + mkdir -p $POKGSA + mount ${POKGSAIBM}:${POKGSA} ${POKGSA} + fi + if [ ! -d $POKGSA2 ];then + mkdir -p $POKGSA2 + mount ${POKGSAIBM}:${POKGSA2} ${POKGSA2} + fi + + # Verify needed packages installed + REPREPO="reprepro" + DEVSCRIPTS="devscripts" + DEBHELPER="debhelper" + QUILT="quilt" + + apt-get -y install $REPREPO $DEVSCRIPTS $DEBHELPER $QUILT + + echo "Finised setup for xcat-dep build. Rerun this script with SETUP=0 LOCAL_KEY=1 flags" + exit 1 +fi + +# Check the necessary packages before starting the build +declare -a packages=( "reprepro" "devscripts" "debhelper" "libsoap-lite-perl" "libdbi-perl" "quilt" "git") + +for package in ${packages[@]}; do + RC=`dpkg -l | grep $package >> /dev/null 2>&1; echo $?` + if [[ ${RC} != 0 ]]; then + echo "ERROR: Could not find $package, install using 'apt-get install $package' to continue" + exit 1 + fi +done + # Supported distributions dists="saucy trusty utopic xenial bionic" @@ -136,8 +170,6 @@ function setbranch { fi } -export HOME=/root - WGET_CMD="wget" if [ ! -z ${LOG} ]; then WGET_CMD="wget -o ${LOG}" @@ -150,10 +182,16 @@ else gsa_url=http://pokgsa.ibm.com/projects/x/xcat/build/linux mkdir -p $HOME/.gnupg for key_name in pubring.gpg secring.gpg trustdb.gpg; do - if [ ! -f $HOME/.gnupg/$key_name ] || [ `wc -c $HOME/.gnupg/$key_name|cut -f 1 -d' '` == 0 ]; then - rm -f $HOME/.gnupg/$key_name - ${WGET_CMD} -P $HOME/.gnupg $gsa_url/keys/$key_name + if [ "$LOCAL_KEY" = "1" ];then + # Keys are already in the local $HOME/.gnupg directory chmod 600 $HOME/.gnupg/$key_name + else + # Need to download keys from GSA + if [ ! -f $HOME/.gnupg/$key_name ] || [ `wc -c $HOME/.gnupg/$key_name|cut -f 1 -d' '` == 0 ]; then + rm -f $HOME/.gnupg/$key_name + ${WGET_CMD} -P $HOME/.gnupg $gsa_url/keys/$key_name + chmod 600 $HOME/.gnupg/$key_name + fi fi done fi @@ -424,9 +462,8 @@ then #the path of ubuntu xcat-dep deb packages on GSA GSA="/gsa/pokgsa/projects/x/xcat/build/ubuntu/xcat-dep" - if [ ! -d $GSA ]; then - echo "build-ubunturepo: It appears that you do not have gsa installed to access the xcat-dep pkgs." + echo "build-ubunturepo: It appears that you do not have GSA to access the xcat-dep pkgs." exit 1; fi From 5b6570bd4e5ebc87a3eaa1ecf5a8757b03144c0e Mon Sep 17 00:00:00 2001 From: cxhong Date: Thu, 19 Sep 2019 09:40:31 -0400 Subject: [PATCH 232/276] Handle the bad return code if rinstall only run on one node and failed on nodeset --- xCAT-server/lib/xcat/plugins/rinstall.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index 52fcc4e27..2eed25a01 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -387,6 +387,16 @@ sub rinstall { xCAT::MsgUtils->message("I", $rsp, $callback); } + # if only provision one node and failed nodeset, will exit the command + # instead of continue with rnetboot/rsetboot, rpower. + if (scalar(@nodes) == 1) { + $rsp->{error}->[0] = "Failed to run 'nodeset' against the node: @nodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + return 1; + } + + foreach my $node (@failurenodes) { delete $nodes{$node}; } From afdf1f56af47a7122c2994cd731a288dd22b67b0 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 19 Sep 2019 13:25:48 -0400 Subject: [PATCH 233/276] Mask password in logs and console output --- xCAT-server/lib/xcat/plugins/openbmc.pm | 73 +++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 4b902c9c1..4ea9c859c 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -2621,6 +2621,66 @@ sub deal_with_response { #------------------------------------------------------- +=head3 mask_password2 + + return a string with masked password + + This function is usefull when password is easily known + and can be passed into this function + Input: + $string: string containing password the needs masking + $password: password to mask + +=cut + +#------------------------------------------------------- +sub mask_password2 { + + my $string = shift; + my $password = shift; + + # Replace all occurences of password string with "xxxxxx" + $string =~ s/$password/xxxxxx/g; + + return $string; +} + +#------------------------------------------------------- + +=head3 mask_password + + return a string with masked password + + This function is usefull when password is not easily known + and is only expected to be part of URL like "https://:@...." + Input: + $string: string containing password the needs masking + +=cut + +#------------------------------------------------------- +sub mask_password { + + my $string = shift; + # Replace password string with "xxxxxx", if part of URL + # Password is between ":" and "@" found in the string after "https://" + # + my $url_start = index($string,"https://"); + if ($url_start > 0) { + my $colon_index = index($string, ":", $url_start+length("https://")); + if ($colon_index > 0) { + my $at_index = index($string, "@", $colon_index); + if ($at_index > 0) { + # Replace string beteen ":" and "@" with "xxxxxx" to mask password + substr($string, $colon_index+1, $at_index-$colon_index-1) = "xxxxxx"; + } + } + } + return $string; +} + +#------------------------------------------------------- + =head3 process_debug_info print debug info and add to log @@ -2639,6 +2699,7 @@ sub process_debug_info { $debug_msg = ""; } + $debug_msg = mask_password($debug_msg); xCAT::SvrUtils::sendmsg("$flag_debug $debug_msg", $callback, $ts_node); xCAT::MsgUtils->trace(0, "D", "$flag_debug $node $debug_msg"); } @@ -4235,12 +4296,12 @@ sub dump_download_process { my $curl_login_result = `$curl_login_cmd -s`; my $h; if (!$curl_login_result) { - xCAT::SvrUtils::sendmsg([1, "Did not receive response from OpenBMC after running command '$curl_login_cmd'"], $callback, $node); + xCAT::SvrUtils::sendmsg([1, "Did not receive response from OpenBMC after running command '" . mask_password2($curl_login_cmd, $node_info{$node}{password}) . "'"], $callback, $node); return 1; } eval { $h = from_json($curl_login_result) }; if ($@) { - xCAT::SvrUtils::sendmsg([1, "Received wrong format response for command '$curl_login_cmd': $curl_login_result)"], $callback, $node); + xCAT::SvrUtils::sendmsg([1, "Received wrong format response for command '" . mask_password2($curl_login_cmd, $node_info{$node}{password}) . "': $curl_login_result)"], $callback, $node); return 1; } if ($h->{message} eq $::RESPONSE_OK) { @@ -4900,7 +4961,7 @@ sub rflash_upload { my $curl_login_result = `$curl_login_cmd -s`; my $h; if (!$curl_login_result) { - my $curl_error = "$::FAILED_UPLOAD_MSG. Did not receive response from OpenBMC after running command '$curl_login_cmd'"; + my $curl_error = "$::FAILED_UPLOAD_MSG. Did not receive response from OpenBMC after running command '" . mask_password2($curl_login_cmd, $node_info{$node}{password}) . "'"; xCAT::SvrUtils::sendmsg([1, "$curl_error"], $callback, $node); print RFLASH_LOG_FILE_HANDLE "$curl_error\n"; $node_info{$node}{rst} = "$curl_error"; @@ -4908,7 +4969,7 @@ sub rflash_upload { } eval { $h = from_json($curl_login_result) }; # convert command output to hash if ($@) { - my $curl_error = "$::FAILED_UPLOAD_MSG. Received wrong format response for command '$curl_login_cmd': $curl_login_result"; + my $curl_error = "$::FAILED_UPLOAD_MSG. Received wrong format response for command '" . mask_password2($curl_login_cmd, $node_info{$node}{password}) . "': $curl_login_result"; xCAT::SvrUtils::sendmsg([1, "$curl_error"], $callback, $node); # Before writing error to log, make it a single line $curl_error =~ tr{\n}{ }; @@ -4944,7 +5005,7 @@ sub rflash_upload { } my $curl_upload_result = `$upload_cmd`; if (!$curl_upload_result) { - my $curl_error = "$::FAILED_UPLOAD_MSG. Did not receive response from OpenBMC after running command '$upload_cmd'"; + my $curl_error = "$::FAILED_UPLOAD_MSG. Did not receive response from OpenBMC after running command '" . mask_password($upload_cmd) . "'"; xCAT::SvrUtils::sendmsg([1, "$curl_error"], $callback, $node); print RFLASH_LOG_FILE_HANDLE "$curl_error\n"; $node_info{$node}{rst} = "$curl_error"; @@ -4952,7 +5013,7 @@ sub rflash_upload { } eval { $h = from_json($curl_upload_result) }; # convert command output to hash if ($@) { - my $curl_error = "$::FAILED_UPLOAD_MSG. Received wrong format response from command '$upload_cmd': $curl_upload_result"; + my $curl_error = "$::FAILED_UPLOAD_MSG. Received wrong format response from command '" . mask_password($upload_cmd) ."': $curl_upload_result"; xCAT::SvrUtils::sendmsg([1, "$curl_error"], $callback, $node); # Before writing error to log, make it a single line $curl_error =~ tr{\n}{ }; From b79cd2dde7f0f773c63914e41636ffa82b0d6ce7 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 23 Sep 2019 17:07:17 -0400 Subject: [PATCH 234/276] Remove snapshot build info from docs --- docs/source/guides/install-guides/common_sections.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/source/guides/install-guides/common_sections.rst b/docs/source/guides/install-guides/common_sections.rst index f803deea1..4341f22f4 100644 --- a/docs/source/guides/install-guides/common_sections.rst +++ b/docs/source/guides/install-guides/common_sections.rst @@ -39,10 +39,6 @@ xCAT consists of two software packages: ``xcat-core`` and ``xcat-dep`` *This is the latest GA (Generally Availability) build that has been tested thoroughly* - * **Latest Snapshot Builds** - - *This is the latest snapshot of the GA version build that may contain bug fixes but has not yet been tested thoroughly* - * **Development Builds** *This is the snapshot builds of the new version of xCAT in development. This version has not been released yet, use as your own risk* From ef93f188b4d9ab8c8d21003762a9dd9cf67060d7 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 26 Sep 2019 10:34:43 -0400 Subject: [PATCH 235/276] OpenBMC fixes for OP940 changes --- xCAT-server/lib/xcat/plugins/openbmc.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 4ea9c859c..d406cbed9 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -205,7 +205,7 @@ my %status_info = ( }, REVENTLOG_CLEAR_REQUEST => { method => "POST", - init_url => "$openbmc_project_url/logging/action/deleteAll", + init_url => "$openbmc_project_url/logging/action/DeleteAll", data => "[]", }, REVENTLOG_CLEAR_RESPONSE => { @@ -269,7 +269,7 @@ my %status_info = ( RFLASH_SET_PRIORITY_REQUEST => { method => "PUT", init_url => "$openbmc_project_url/software", - data => "false", # Priority state of 0 sets image to active + data => "0", # Priority state of 0 sets image to active }, RFLASH_SET_PRIORITY_RESPONSE => { process => \&rflash_response, @@ -2576,9 +2576,9 @@ sub deal_with_response { # Set attribute call returned with 404, display an error $error = "$::RESPONSE_NOT_FOUND - Requested endpoint does not exist or may indicate function is not supported on this OpenBMC firmware."; } elsif ($node_info{$node}{cur_status} eq "RSPCONFIG_API_CONFIG_QUERY_RESPONSE") { - # Query attribute call came back with 404. If this is for Power Supply Redundency, + # Query attribute call came back with 404. If this is for PowerSupplyRedundancy, # send request with a new path RSPCONFIG_GET_PSR_REQUEST, response processing will print the value - if ($response_info->{'data'}->{'description'} =~ /PowerSupplyRedundancy/) { + if ($::RSPCONFIG_CONFIGURED_API_KEY eq "RSPCONFIG_POWERSUPPLY_REDUNDANCY") { $node_info{$node}{cur_status} = "RSPCONFIG_GET_PSR_REQUEST"; $next_status{RSPCONFIG_GET_PSR_REQUEST} = "RSPCONFIG_GET_PSR_RESPONSE"; gen_send_request($node); @@ -3846,7 +3846,7 @@ sub rspconfig_response { if ($node_info{$node}{cur_status} eq "RSPCONFIG_PASSWD_VERIFY") { if ($status_info{RSPCONFIG_PASSWD_VERIFY}{argv} ne $node_info{$node}{password}) { - xCAT::SvrUtils::sendmsg("Current BMC password is incorrect, cannot set the new password.", $callback, $node); + xCAT::SvrUtils::sendmsg([1, "Current BMC password is incorrect, cannot set the new password."], $callback, $node); $wait_node_num--; return; } From 6946808cad17f370303e3d5875c0bee226c0cf24 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 26 Sep 2019 15:52:13 -0400 Subject: [PATCH 236/276] OpenBMC rspconfig automated testcases --- .../testcase/UT_openbmc/rspconfig_cases0 | 169 +++++++++++++++++- 1 file changed, 165 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 b/xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 index d6cac63f8..a2ab9f4d9 100644 --- a/xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 +++ b/xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 @@ -1,13 +1,13 @@ start:rspconfig_record_firmware_level -description: Record the firmware level for the start of each testcase +description: Record the firmware level for the start of each testcase to display in the output hcp:openbmc label:cn_bmc_ready,hctrl_openbmc cmd: rinv $$CN firm check:rc==0 end -start:rspconfig_get_all -description: Check that we can get all the attributes from the BMC +start:rspconfig_get_all_network +description: Check that we can get all the network related attributes from the BMC os:Linux hcp:openbmc label:cn_bmc_ready,hctrl_openbmc @@ -70,7 +70,168 @@ check:output=~$$CN: BMC Setting BMC Hostname... cmd:rspconfig $$CN hostname check:rc==0 check:output=~$$CN: BMC Hostname: -cmd:rm /tmp/xcattest.rspconfig.hostname + AutoReboot check:rc==0 end +start:rspconfig_admin_passwd_error +description: Check the error handling for changing of BMC password +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN admin_passwd=abc +check:rc==1 +check:output=~$$CN: Error: Invalid parameter for option admin_passwd: abc +cmd: rspconfig $$CN admin_passwd=abc,xyz +check:rc==1 +check:output=~Current BMC password is incorrect, cannot set the new password. +end + +start:rspconfig_admin_passwd +description: Check the setting of BMC password to the same value +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN admin_passwd=0penBmc,0penBmc +check:rc==0 +check:output=~$$CN: BMC Setting Password +end + +start:rspconfig_autoreboot +description: Check the getting and setting of autoreboot attribute +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN autoreboot +check:rc==0 +check:output=~$$CN: BMC AutoReboot +cmd: rspconfig $$CN autoreboot=0 +check:rc==0 +check:output=~$$CN: BMC Setting BMC AutoReboot +cmd: rspconfig $$CN autoreboot=1 +check:rc==0 +check:output=~$$CN: BMC Setting BMC AutoReboot +cmd: rspconfig $$CN autoreboot= +check:rc==1 +check:output=~$$CN: Error: Invalid value '' for 'autoreboot', Valid values: 0,1 +cmd: rspconfig $$CN autoreboot=2 +check:rc==1 +check:output=~$$CN: Error: Invalid value '2' for 'autoreboot', Valid values: 0,1 +end + +start:rspconfig_bootmode +description: Check the getting and setting of bootmode attribute +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN bootmode=safe +check:rc==0 +check:output=~$$CN: BMC Setting BMC BootMode +cmd: rspconfig $$CN bootmode +check:rc==0 +check:output=~$$CN: BMC BootMode: Safe +cmd: rspconfig $$CN bootmode=regular +check:rc==0 +check:output=~$$CN: BMC Setting BMC BootMode +cmd: rspconfig $$CN bootmode=abc +check:rc==1 +check:output=~$$CN: Error: Invalid value 'abc' for 'bootmode', Valid values: regular,safe,setup +end + +start:rspconfig_dump +description: Check dump generation, download and removal +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +#Clear old dumps for this node +cmd: rm -f /var/log/xcat/dump/*_$$CN_dump_* +#Generate new dump +cmd: rspconfig $$CN dump +check:rc==0 +check:output=~Capturing BMC Diagnostic information, this will take some time +check:output=~$$CN Dump requested. Target ID is +check:output=~Downloading dump +#Verify dump was downloaded to proper directory +cmd: ls -l /var/log/xcat/dump/*_$$CN_dump_* +check:rc==0 +#Remove last generated dump +cmd: rspconfig mid05tor12cn03 dump -l | tail -1 | cut -d ' ' -f2 | tr -d "[]" | xargs -i{} rspconfig $$CN dump -c {} +check:rc==0 +check:output=clear +end + +start:rspconfig_ntpservers +description: Check the getting and setting of ntpservers attribute +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN ntpservers +check:rc==0 +check:output=~$$CN: BMC NTP Servers +cmd: rspconfig $$CN ntpservers=1.1.1.1 +check:rc==0 +check:output=~$$CN: BMC NTP Servers: 1.1.1.1 +cmd: rspconfig $$CN ntpservers= +check:rc==0 +check:output=~$$CN: BMC NTP Servers: None +end + +start:rspconfig_powerrestorepolicy +description: Check the getting and setting of powerrestorepolicy attribute +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN powerrestorepolicy +check:rc==0 +check:output=~$$CN: BMC PowerRestorePolicy +cmd: rspconfig $$CN powerrestorepolicy=always_on +check:rc==0 +check:output=~$$CN: BMC Setting BMC PowerRestorePolicy +cmd: rspconfig $$CN powerrestorepolicy=always_off +check:rc==0 +check:output=~$$CN: BMC Setting BMC PowerRestorePolicy +cmd: rspconfig $$CN powerrestorepolicy=restore +check:rc==0 +check:output=~$$CN: BMC Setting BMC PowerRestorePolicy +cmd: rspconfig $$CN powerrestorepolicy +check:rc==0 +check:output=~$$CN: BMC PowerRestorePolicy: Restore +cmd: rspconfig $$CN powerrestorepolicy= +check:rc==1 +check:output=~$$CN: Error: Invalid value '' for 'powerrestorepolicy', Valid values: always_off,always_on,restore +cmd: rspconfig $$CN powerrestorepolicy=abc +check:rc==1 +check:output=~$$CN: Error: Invalid value 'abc' for 'powerrestorepolicy', Valid values: always_off,always_on,restore +end + +start:rspconfig_powersupplyredundancy +description: Check the getting and setting of powersupplyredundancy attribute +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN powersupplyredundancy=disabled +check:rc==1 +check:output=~Error: 404 Not Found - Requested endpoint does not exist or may indicate function is not supported on this OpenBMC firmware. +cmd: rspconfig $$CN powersupplyredundancy +check:rc==0 +check:output=~$$CN: BMC PowerSupplyRedundancy: Disabled +end + +start:rspconfig_sshcfg +description: Check the copying of ssh keys to the BMC +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN sshcfg +check:rc==0 +check:output=~$$CN: ssh keys copied to +end + +start:rspconfig_timesyncmethod +description: Check the getting and setting of timesyncmethod attribute +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN timesyncmethod=manual +check:rc==0 +check:output=~$$CN: BMC Setting BMC TimeSyncMethod +cmd: rspconfig $$CN timesyncmethod +check:rc==0 +check:output=~$$CN: BMC TimeSyncMethod: Manual +cmd: rspconfig $$CN timesyncmethod=ntp +check:rc==0 +check:output=~$$CN: BMC Setting BMC TimeSyncMethod +cmd: rspconfig $$CN timesyncmethod=abc +check:rc==1 +check:output=~$$CN: Error: Invalid value 'abc' for 'timesyncmethod', Valid values: manual,ntp +end From 35d0728550814c51532649b1c10aefbe19f7fec8 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 26 Sep 2019 16:06:46 -0400 Subject: [PATCH 237/276] Remove old debug statements --- xCAT-server/lib/xcat/plugins/kvm.pm | 9 --------- 1 file changed, 9 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index c46d0553a..02fb6e385 100755 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -49,7 +49,6 @@ if (Sys::Virt->VERSION =~ /^0\.[10]\./) { use XML::Simple; $XML::Simple::PREFERRED_PARSER = 'XML::Parser'; -use Data::Dumper; use POSIX "WNOHANG"; use Storable qw(freeze thaw store_fd fd_retrieve); use IO::Select; @@ -3887,20 +3886,12 @@ sub process_request { $confdata = {}; unless ($command eq 'rscan') { xCAT::VMCommon::grab_table_data($noderange, $confdata, $callback); - # Add debug info for issue 1958, the rmvm issue - my $test_file_fd; - open($test_file_fd, ">> $::XCATROOT//share/xcat/tools/autotest/result/$command.$$.rec"); - print $test_file_fd "====================start==========================\n"; my $kvmdatatab = xCAT::Table->new("kvm_nodedata", -create => 0); #grab any pertinent pre-existing xml if ($kvmdatatab) { $confdata->{kvmnodedata} = $kvmdatatab->getNodesAttribs($noderange, [qw/xml/]); - print $test_file_fd Dumper($confdata->{kvmnodedata}); } else { $confdata->{kvmnodedata} = {}; - print $test_file_fd "***Error: Can not open kvm_nodedata table==\n"; } - print $test_file_fd "====================end==========================\n"; - close $test_file_fd; } if ($command eq 'mkvm' or ($command eq 'clonevm' and (grep { "$_" eq '-b' } @exargs)) or ($command eq 'rpower' and (grep { "$_" eq "on" or $_ eq "boot" or $_ eq "reset" } @exargs))) { xCAT::VMCommon::requestMacAddresses($confdata, $noderange); From 796104ac209172724b58addd344e20738efb7f41 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 27 Sep 2019 12:13:31 -0400 Subject: [PATCH 238/276] Fix rspconfig dump testcase --- xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 b/xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 index a2ab9f4d9..9f7fc6ef1 100644 --- a/xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 +++ b/xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 @@ -139,15 +139,15 @@ description: Check dump generation, download and removal hcp: openbmc label:cn_bmc_ready,hctrl_openbmc #Clear old dumps for this node -cmd: rm -f /var/log/xcat/dump/*_$$CN_dump_* +cmd: rm -f /var/log/xcat/dump/*$$CN* #Generate new dump cmd: rspconfig $$CN dump check:rc==0 check:output=~Capturing BMC Diagnostic information, this will take some time -check:output=~$$CN Dump requested. Target ID is +check:output=~$$CN: Dump requested. Target ID is check:output=~Downloading dump #Verify dump was downloaded to proper directory -cmd: ls -l /var/log/xcat/dump/*_$$CN_dump_* +cmd: ls -l /var/log/xcat/dump/*$$CN* check:rc==0 #Remove last generated dump cmd: rspconfig mid05tor12cn03 dump -l | tail -1 | cut -d ' ' -f2 | tr -d "[]" | xargs -i{} rspconfig $$CN dump -c {} From 7cdd187fb0636e7efc9529c542252dd82bf51dc2 Mon Sep 17 00:00:00 2001 From: Oriol Mula-Valls Date: Thu, 3 Oct 2019 09:18:11 +0200 Subject: [PATCH 239/276] Replace init.d calls with systemd ones --- xCAT-server/lib/xcat/monitoring/gangliamon.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/monitoring/gangliamon.pm b/xCAT-server/lib/xcat/monitoring/gangliamon.pm index fef33ff13..dd350d794 100755 --- a/xCAT-server/lib/xcat/monitoring/gangliamon.pm +++ b/xCAT-server/lib/xcat/monitoring/gangliamon.pm @@ -65,7 +65,7 @@ sub start { if ($OS =~ /AIX/) { $res_gmond = `/etc/rc.d/init.d/gmond restart 2>&1`; } else { - $res_gmond = `/etc/init.d/gmond restart 2>&1`; + $res_gmond = `systemctl restart gmond 2>&1`; } my $tmp; @@ -90,9 +90,9 @@ sub start { $res_gmetad = `/etc/rc.d/init.d/gmetad restart 2>&1`; } } else { - $tmp = `/etc/init.d/gmetad status | grep running`; + $tmp = `systemctl status gmetad| grep running`; if (!$tmp) { - $res_gmetad = `/etc/init.d/gmetad restart 2>&1`; + $res_gmetad = `systemctl restart gmetad 2>&1`; } } @@ -166,7 +166,7 @@ sub start { $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/rc.d/init.d/gmond restart 2>&1`; } else { - $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/init.d/gmond restart 2>&1`; + $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec systemctl restart gmond 2>&1`; } } @@ -787,7 +787,7 @@ sub stop { if ($OS =~ /AIX/) { $res_gmond = `/etc/rc.d/init.d/gmond stop 2>&1`; } else { - $res_gmond = `/etc/init.d/gmond stop 2>&1`; + $res_gmond = `systemctl stop gmond 2>&1`; } if ($?) { if ($callback) { @@ -805,7 +805,7 @@ sub stop { if ($OS =~ /AIX/) { $res_gmetad = `/etc/rc.d/init.d/gmetad stop 2>&1`; } else { - $res_gmetad = `/etc/init.d/gmetad stop 2>&1`; + $res_gmetad = `systemctl stop gmetad 2>&1`; } if ($?) { @@ -867,7 +867,7 @@ sub stop { if ($OS =~ /AIX/) { $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/rc.d/init.d/gmond stop 2>&1`; } else { - $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/init.d/gmond stop 2>&1`; + $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec systemctl stop gmond 2>&1`; } } From 3ab23a6d86ed6a8f86e1f817f210607dcdd4789c Mon Sep 17 00:00:00 2001 From: Oriol Mula-Valls Date: Thu, 3 Oct 2019 09:21:02 +0200 Subject: [PATCH 240/276] Fix indent, automatic generation of default configuration, simplified code --- xCAT/postscripts/confGang | 140 +++++++++----------------------------- 1 file changed, 32 insertions(+), 108 deletions(-) diff --git a/xCAT/postscripts/confGang b/xCAT/postscripts/confGang index 13ce7cfe4..5be4e780f 100755 --- a/xCAT/postscripts/confGang +++ b/xCAT/postscripts/confGang @@ -1,24 +1,24 @@ #!/bin/sh #get IP address of MS -OS=`uname` +OS=$(uname) echo "the OS is $OS" logger -t xcat -p local4.info "the OS is $OS" ms_ip=$MONMASTER echo "MS IP is $ms_ip" logger -t xcat -p local4.info "the MS is $ms_ip" -result=`ping -c1 $MONMASTER 2>&1` - if [ $? -eq 0 ]; then - index1=`expr index "$result" "\("` - index2=`expr index "$result" "\)"` - #ms_ip=${result:$index1+1:$index2-$index1-2} - pos=`expr $index1 + 1` - length=`expr $index2 - $index1` - length=`expr $length - 1` - ms_ip=`expr substr "$result" $pos $length` - echo final is $ms_ip - else - logger -t xcat -p local4.info "Gangliamon setup" - fi +result=$(ping -c1 $MONMASTER 2>&1) +if [ $? -eq 0 ]; then + index1=$(expr index "$result" "\(") + index2=$(expr index "$result" "\)") + #ms_ip=${result:$index1+1:$index2-$index1-2} + pos=$(expr $index1 + 1) + length=$(expr $index2 - $index1) + length=$(expr $length - 1) + ms_ip=$(expr substr "$result" $pos $length) + echo final is $ms_ip +else + logger -t xcat -p local4.info "Gangliamon setup" +fi CLUSTER=\"$MONSERVER\" echo "cluster is $CLUSTER" @@ -26,102 +26,26 @@ logger -t xcat -p local4.info "cluster is $CLUSTER" MASTER=$ms_ip #echo "The new IP is: $NEW_IP" #echo "I will replace now.... -gmond_conf="/etc/ganglia/gmond.conf" -gmond_conf_old="/etc/gmond.conf" +gmond_conf=$(gmond --help|grep -Eo "[a-z/]+/gmond.conf") +gmond_version=$(gmond -V|cut -d" " -f2) - if [ $OS == "AIX" ]; then - echo "into AIX loop" - logger -t xcat -p local4.info "into AIX loop" - if [ -f $gmond_conf_old ]; then - echo "ganglia version 3.0.7" - logger -t xcat -p local4.info "ganglia version 3.0.7" - grep "xCAT gmond settings done" $gmond_conf_old - if [ $? -gt 0 ]; then - /bin/cp -f $gmond_conf_old /etc/gmond.conf.orig - sed -e "s/setuid = yes/setuid = no/1" $gmond_conf_old > /etc/gmond.conf1 - sed -e 's/name = "unspecified"/name='$CLUSTER'/1' /etc/gmond.conf1 > /etc/gmond.conf2 - sed -e "1,40s/mcast_join = .*/host = $MASTER/" /etc/gmond.conf2 > /etc/gmond.conf3 - sed -e 's/mcast_join/#/g' /etc/gmond.conf3 > /etc/gmond.conf4 - sed -e "s/bind/#/g" /etc/gmond.conf4 > /etc/gmond.conf5 - /bin/cp -f /etc/gmond.conf5 $gmond_conf_old - rm -f /etc/gmond.conf1 /etc/gmond.conf2 /etc/gmond.conf3 /etc/gmond.conf4 /etc/gmond.conf5 - echo "# xCAT gmond settings done sh" >> $gmond_conf_old - fi - fi - fi - - - if [ $OS == "AIX" ]; then - echo "into AIX new loop" - logger -t xcat -p local4.info "into AIX new loop" - if [ -f $gmond_conf ]; then - echo "ganglia version v3.10" - logger -t xcat -p local4.info "ganglia version v3.10" - grep "xCAT gmond settings done" $gmond_conf - if [ $? -gt 0 ]; then - /bin/cp -f $gmond_conf /etc/ganglia/gmond.conf.orig - sed -e "s/setuid = yes/setuid = no/1" $gmond_conf > /etc/ganglia/gmond.conf1 - sed -e 's/name = "unspecified"/name='$CLUSTER'/1' /etc/ganglia/gmond.conf1 > /etc/ganglia/gmond.conf2 - sed -e "1,40s/mcast_join = .*/host = $MASTER/" /etc/ganglia/gmond.conf2 > /etc/ganglia/gmond.conf3 - sed -e 's/mcast_join/#/g' /etc/ganglia/gmond.conf3 > /etc/ganglia/gmond.conf4 - sed -e "s/bind/#/g" /etc/ganglia/gmond.conf4 > /etc/ganglia/gmond.conf5 - /bin/cp -f /etc/ganglia/gmond.conf5 $gmond_conf - rm -f /etc/ganglia/gmond.conf1 /etc/ganglia/gmond.conf2 /etc/ganglia/gmond.conf3 /etc/ganglia/gmond.conf4 /etc/ganglia/gmond.conf5 - echo "# xCAT gmond settings done sh" >> $gmond_conf - fi - fi - fi - - - - - - if [ $OS != "AIX" ]; then - echo "not AIX" - logger -t xcat -p local4.info "not AIX" - if [ -f $gmond_conf ]; then - grep "xCAT gmond settings done" $gmond_conf - if [ $? -gt 0 ]; then - /bin/cp -f $gmond_conf /etc/ganglia/gmond.conf.orig - sed -i 's/setuid = yes/setuid = no/1' $gmond_conf - sed -i 's/name = "unspecified"/name='$CLUSTER'/1' $gmond_conf - sed -e "1,50s/^ *mcast_join = .*/host = $MASTER/" $gmond_conf > /etc/temp.conf - /bin/cp -f /etc/temp.conf $gmond_conf - sed -i 's/^ *mcast_join/#mcast_join/g' $gmond_conf - sed -i 's/^ *bind/#bind/g' $gmond_conf - echo "# xCAT gmond settings done sh" >> $gmond_conf - fi - fi - fi - - - if [ $OS != "AIX" ]; then - echo "not AIX" - logger -t xcat -p local4.info "not AIX" - - if [ -f $gmond_conf_old ]; then - grep "xCAT gmond settings done" $gmond_conf_old - if [ $? -gt 0 ]; then - /bin/cp -f $gmond_conf_old /etc/gmond.conf.orig - sed -i 's/setuid = yes/setuid = no/1' $gmond_conf_old - sed -i 's/name = "unspecified"/name='$CLUSTER'/1' $gmond_conf_old - sed -e "1,40s/mcast_join = .*/host = $MASTER/" $gmond_conf_old > /etc/temp.conf - /bin/cp -f /etc/temp.conf $gmond_conf_old - sed -i 's/mcast_join/#/g' $gmond_conf_old - sed -i 's/bind/#/g' $gmond_conf_old - echo "# xCAT gmond settings done sh_old" >> $gmond_conf_old - fi - fi +if [ ! -f $gmond_conf ]; then + # echo "file not found" + logger -t xcat -p local4.warning "gmond configuration file not found. Generating a default one" + gmond -t > ${gmond_conf} fi - if [ ! -f $gmond_conf ]; then - # echo "file not found" - logger -t xcat -p local4.warning "gmond configuration file not found" - fi - - if [ ! -f $gmond_conf_old ]; then - # echo "file not found" - logger -t xcat -p local4.warning "gmond configuration file not found" - fi +echo "ganglia version ${gmond_version}" +logger -t xcat -p local4.info "ganglia version ${gmond_version}" +grep "xCAT gmond settings done" $gmond_conf +if [ $? -gt 0 ]; then + /bin/cp -f $gmond_conf /etc/ganglia/gmond.conf.orig + sed -i -e "s/setuid = yes/setuid = no/1" ${gmond_conf} + sed -i -e 's/name = "unspecified"/name='$CLUSTER'/1' ${gmond_conf} + sed -i -e "1,40s/mcast_join = .*/host = $MASTER/" ${gmond_conf} + sed -i -e '/mcast_join/d' ${gmond_conf} + sed -i -e "/\s\+bind/d" ${gmond_conf} + echo "# xCAT gmond settings done sh" >> $gmond_conf +fi exit 0 From 806feb006a3c439cd561520598f324a240ce05eb Mon Sep 17 00:00:00 2001 From: Oriol Mula-Valls Date: Thu, 3 Oct 2019 09:18:11 +0200 Subject: [PATCH 241/276] Replace init.d calls with systemd ones --- xCAT-server/lib/xcat/monitoring/gangliamon.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/monitoring/gangliamon.pm b/xCAT-server/lib/xcat/monitoring/gangliamon.pm index fef33ff13..dd350d794 100755 --- a/xCAT-server/lib/xcat/monitoring/gangliamon.pm +++ b/xCAT-server/lib/xcat/monitoring/gangliamon.pm @@ -65,7 +65,7 @@ sub start { if ($OS =~ /AIX/) { $res_gmond = `/etc/rc.d/init.d/gmond restart 2>&1`; } else { - $res_gmond = `/etc/init.d/gmond restart 2>&1`; + $res_gmond = `systemctl restart gmond 2>&1`; } my $tmp; @@ -90,9 +90,9 @@ sub start { $res_gmetad = `/etc/rc.d/init.d/gmetad restart 2>&1`; } } else { - $tmp = `/etc/init.d/gmetad status | grep running`; + $tmp = `systemctl status gmetad| grep running`; if (!$tmp) { - $res_gmetad = `/etc/init.d/gmetad restart 2>&1`; + $res_gmetad = `systemctl restart gmetad 2>&1`; } } @@ -166,7 +166,7 @@ sub start { $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/rc.d/init.d/gmond restart 2>&1`; } else { - $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/init.d/gmond restart 2>&1`; + $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec systemctl restart gmond 2>&1`; } } @@ -787,7 +787,7 @@ sub stop { if ($OS =~ /AIX/) { $res_gmond = `/etc/rc.d/init.d/gmond stop 2>&1`; } else { - $res_gmond = `/etc/init.d/gmond stop 2>&1`; + $res_gmond = `systemctl stop gmond 2>&1`; } if ($?) { if ($callback) { @@ -805,7 +805,7 @@ sub stop { if ($OS =~ /AIX/) { $res_gmetad = `/etc/rc.d/init.d/gmetad stop 2>&1`; } else { - $res_gmetad = `/etc/init.d/gmetad stop 2>&1`; + $res_gmetad = `systemctl stop gmetad 2>&1`; } if ($?) { @@ -867,7 +867,7 @@ sub stop { if ($OS =~ /AIX/) { $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/rc.d/init.d/gmond stop 2>&1`; } else { - $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/init.d/gmond stop 2>&1`; + $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec systemctl stop gmond 2>&1`; } } From 5506a9e79b323e83a7272ff0497ef72b74d49496 Mon Sep 17 00:00:00 2001 From: Oriol Mula-Valls Date: Thu, 3 Oct 2019 09:21:02 +0200 Subject: [PATCH 242/276] Fix indent, automatic generation of default configuration, simplified code --- xCAT/postscripts/confGang | 140 +++++++++----------------------------- 1 file changed, 32 insertions(+), 108 deletions(-) diff --git a/xCAT/postscripts/confGang b/xCAT/postscripts/confGang index 13ce7cfe4..5be4e780f 100755 --- a/xCAT/postscripts/confGang +++ b/xCAT/postscripts/confGang @@ -1,24 +1,24 @@ #!/bin/sh #get IP address of MS -OS=`uname` +OS=$(uname) echo "the OS is $OS" logger -t xcat -p local4.info "the OS is $OS" ms_ip=$MONMASTER echo "MS IP is $ms_ip" logger -t xcat -p local4.info "the MS is $ms_ip" -result=`ping -c1 $MONMASTER 2>&1` - if [ $? -eq 0 ]; then - index1=`expr index "$result" "\("` - index2=`expr index "$result" "\)"` - #ms_ip=${result:$index1+1:$index2-$index1-2} - pos=`expr $index1 + 1` - length=`expr $index2 - $index1` - length=`expr $length - 1` - ms_ip=`expr substr "$result" $pos $length` - echo final is $ms_ip - else - logger -t xcat -p local4.info "Gangliamon setup" - fi +result=$(ping -c1 $MONMASTER 2>&1) +if [ $? -eq 0 ]; then + index1=$(expr index "$result" "\(") + index2=$(expr index "$result" "\)") + #ms_ip=${result:$index1+1:$index2-$index1-2} + pos=$(expr $index1 + 1) + length=$(expr $index2 - $index1) + length=$(expr $length - 1) + ms_ip=$(expr substr "$result" $pos $length) + echo final is $ms_ip +else + logger -t xcat -p local4.info "Gangliamon setup" +fi CLUSTER=\"$MONSERVER\" echo "cluster is $CLUSTER" @@ -26,102 +26,26 @@ logger -t xcat -p local4.info "cluster is $CLUSTER" MASTER=$ms_ip #echo "The new IP is: $NEW_IP" #echo "I will replace now.... -gmond_conf="/etc/ganglia/gmond.conf" -gmond_conf_old="/etc/gmond.conf" +gmond_conf=$(gmond --help|grep -Eo "[a-z/]+/gmond.conf") +gmond_version=$(gmond -V|cut -d" " -f2) - if [ $OS == "AIX" ]; then - echo "into AIX loop" - logger -t xcat -p local4.info "into AIX loop" - if [ -f $gmond_conf_old ]; then - echo "ganglia version 3.0.7" - logger -t xcat -p local4.info "ganglia version 3.0.7" - grep "xCAT gmond settings done" $gmond_conf_old - if [ $? -gt 0 ]; then - /bin/cp -f $gmond_conf_old /etc/gmond.conf.orig - sed -e "s/setuid = yes/setuid = no/1" $gmond_conf_old > /etc/gmond.conf1 - sed -e 's/name = "unspecified"/name='$CLUSTER'/1' /etc/gmond.conf1 > /etc/gmond.conf2 - sed -e "1,40s/mcast_join = .*/host = $MASTER/" /etc/gmond.conf2 > /etc/gmond.conf3 - sed -e 's/mcast_join/#/g' /etc/gmond.conf3 > /etc/gmond.conf4 - sed -e "s/bind/#/g" /etc/gmond.conf4 > /etc/gmond.conf5 - /bin/cp -f /etc/gmond.conf5 $gmond_conf_old - rm -f /etc/gmond.conf1 /etc/gmond.conf2 /etc/gmond.conf3 /etc/gmond.conf4 /etc/gmond.conf5 - echo "# xCAT gmond settings done sh" >> $gmond_conf_old - fi - fi - fi - - - if [ $OS == "AIX" ]; then - echo "into AIX new loop" - logger -t xcat -p local4.info "into AIX new loop" - if [ -f $gmond_conf ]; then - echo "ganglia version v3.10" - logger -t xcat -p local4.info "ganglia version v3.10" - grep "xCAT gmond settings done" $gmond_conf - if [ $? -gt 0 ]; then - /bin/cp -f $gmond_conf /etc/ganglia/gmond.conf.orig - sed -e "s/setuid = yes/setuid = no/1" $gmond_conf > /etc/ganglia/gmond.conf1 - sed -e 's/name = "unspecified"/name='$CLUSTER'/1' /etc/ganglia/gmond.conf1 > /etc/ganglia/gmond.conf2 - sed -e "1,40s/mcast_join = .*/host = $MASTER/" /etc/ganglia/gmond.conf2 > /etc/ganglia/gmond.conf3 - sed -e 's/mcast_join/#/g' /etc/ganglia/gmond.conf3 > /etc/ganglia/gmond.conf4 - sed -e "s/bind/#/g" /etc/ganglia/gmond.conf4 > /etc/ganglia/gmond.conf5 - /bin/cp -f /etc/ganglia/gmond.conf5 $gmond_conf - rm -f /etc/ganglia/gmond.conf1 /etc/ganglia/gmond.conf2 /etc/ganglia/gmond.conf3 /etc/ganglia/gmond.conf4 /etc/ganglia/gmond.conf5 - echo "# xCAT gmond settings done sh" >> $gmond_conf - fi - fi - fi - - - - - - if [ $OS != "AIX" ]; then - echo "not AIX" - logger -t xcat -p local4.info "not AIX" - if [ -f $gmond_conf ]; then - grep "xCAT gmond settings done" $gmond_conf - if [ $? -gt 0 ]; then - /bin/cp -f $gmond_conf /etc/ganglia/gmond.conf.orig - sed -i 's/setuid = yes/setuid = no/1' $gmond_conf - sed -i 's/name = "unspecified"/name='$CLUSTER'/1' $gmond_conf - sed -e "1,50s/^ *mcast_join = .*/host = $MASTER/" $gmond_conf > /etc/temp.conf - /bin/cp -f /etc/temp.conf $gmond_conf - sed -i 's/^ *mcast_join/#mcast_join/g' $gmond_conf - sed -i 's/^ *bind/#bind/g' $gmond_conf - echo "# xCAT gmond settings done sh" >> $gmond_conf - fi - fi - fi - - - if [ $OS != "AIX" ]; then - echo "not AIX" - logger -t xcat -p local4.info "not AIX" - - if [ -f $gmond_conf_old ]; then - grep "xCAT gmond settings done" $gmond_conf_old - if [ $? -gt 0 ]; then - /bin/cp -f $gmond_conf_old /etc/gmond.conf.orig - sed -i 's/setuid = yes/setuid = no/1' $gmond_conf_old - sed -i 's/name = "unspecified"/name='$CLUSTER'/1' $gmond_conf_old - sed -e "1,40s/mcast_join = .*/host = $MASTER/" $gmond_conf_old > /etc/temp.conf - /bin/cp -f /etc/temp.conf $gmond_conf_old - sed -i 's/mcast_join/#/g' $gmond_conf_old - sed -i 's/bind/#/g' $gmond_conf_old - echo "# xCAT gmond settings done sh_old" >> $gmond_conf_old - fi - fi +if [ ! -f $gmond_conf ]; then + # echo "file not found" + logger -t xcat -p local4.warning "gmond configuration file not found. Generating a default one" + gmond -t > ${gmond_conf} fi - if [ ! -f $gmond_conf ]; then - # echo "file not found" - logger -t xcat -p local4.warning "gmond configuration file not found" - fi - - if [ ! -f $gmond_conf_old ]; then - # echo "file not found" - logger -t xcat -p local4.warning "gmond configuration file not found" - fi +echo "ganglia version ${gmond_version}" +logger -t xcat -p local4.info "ganglia version ${gmond_version}" +grep "xCAT gmond settings done" $gmond_conf +if [ $? -gt 0 ]; then + /bin/cp -f $gmond_conf /etc/ganglia/gmond.conf.orig + sed -i -e "s/setuid = yes/setuid = no/1" ${gmond_conf} + sed -i -e 's/name = "unspecified"/name='$CLUSTER'/1' ${gmond_conf} + sed -i -e "1,40s/mcast_join = .*/host = $MASTER/" ${gmond_conf} + sed -i -e '/mcast_join/d' ${gmond_conf} + sed -i -e "/\s\+bind/d" ${gmond_conf} + echo "# xCAT gmond settings done sh" >> $gmond_conf +fi exit 0 From 4eef7d6987ada430d7a8d0c226005771f124f560 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 3 Oct 2019 11:28:51 -0400 Subject: [PATCH 243/276] Revert "Remove kits from Ubuntu and go-xcat" This reverts commit 7c9d6a56f00d744752ae3ec4d2eac5515e1ef490. --- xCAT-server/share/xcat/tools/go-xcat | 6 +++--- xCAT/debian/control | 2 +- xCATsn/debian/control | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 4d128fe88..290916800 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -167,13 +167,13 @@ GO_XCAT_CORE_PACKAGE_LIST=() GO_XCAT_DEP_PACKAGE_LIST=() # The package list of all the packages should be installed -GO_XCAT_INSTALL_LIST=(perl-xCAT xCAT xCAT-client +GO_XCAT_INSTALL_LIST=(perl-xCAT xCAT xCAT-buildkit xCAT-client xCAT-genesis-scripts-ppc64 xCAT-genesis-scripts-x86_64 xCAT-server elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat xCAT-genesis-base-ppc64 xCAT-genesis-base-x86_64 xnba-undi yaboot-xcat) -# For Debian/Ubuntu, it will need a sightly different package list +# For Debian/Ubuntu, it will need a sight different package list type dpkg >/dev/null 2>&1 && -GO_XCAT_INSTALL_LIST=(perl-xcat xcat xcat-client +GO_XCAT_INSTALL_LIST=(perl-xcat xcat xcat-buildkit xcat-client xcat-genesis-scripts-amd64 xcat-genesis-scripts-ppc64 xcat-server elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat xcat-genesis-base-amd64 xcat-genesis-base-ppc64 xnba-undi) diff --git a/xCAT/debian/control b/xCAT/debian/control index fe5b7c758..4b3fedcc3 100644 --- a/xCAT/debian/control +++ b/xCAT/debian/control @@ -10,7 +10,7 @@ Homepage: https://xcat.org/ Package: xcat Architecture: amd64 ppc64el Depends: ${perl:Depends}, goconserver, xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, isc-dhcp-server, apache2, nfs-kernel-server, libxml-parser-perl, rsync, tftpd-hpa, libnet-telnet-perl, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) -Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-probe (>= 2.13-snap000000000000) +Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000) Suggests: yaboot-xcat Description: Metapackage for a common, default xCAT setup xCAT is Extreme Cluster/Cloud Administration Toolkit. xCAT offers complete diff --git a/xCATsn/debian/control b/xCATsn/debian/control index eaca013f9..3476c39c0 100644 --- a/xCATsn/debian/control +++ b/xCATsn/debian/control @@ -9,7 +9,7 @@ Homepage: https://xcat.org/ Package: xcatsn Architecture: amd64 ppc64el Depends: ${perl:Depends}, goconserver, xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, libxml-parser-perl, tftpd-hpa, libnet-telnet-perl, isc-dhcp-server, apache2, nfs-kernel-server, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) -Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-probe (>= 2.13-snap000000000000) +Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000) Suggests: yaboot-xcat Description: Metapackage for a common, default xCAT service node setup xCATsn is a service node management package intended for at-scale From 7346de78c6b421e8fb3365550f945d18baa9b49f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 3 Oct 2019 11:45:18 -0400 Subject: [PATCH 244/276] Revert "Remove man pages for kit related commands" This reverts commit 36116078ac40b282865f06246ee09ebffe475b8f. --- .../admin-guides/references/man1/addkit.1.rst | 137 +++++++ .../references/man1/addkitcomp.1.rst | 154 ++++++++ .../references/man1/buildkit.1.rst | 372 ++++++++++++++++++ .../references/man1/chkkitcomp.1.rst | 106 +++++ .../admin-guides/references/man1/lskit.1.rst | 250 ++++++++++++ .../references/man1/lskitcomp.1.rst | 247 ++++++++++++ .../references/man1/lskitdeployparam.1.rst | 162 ++++++++ .../admin-guides/references/man1/rmkit.1.rst | 151 +++++++ .../references/man1/rmkitcomp.1.rst | 162 ++++++++ xCAT-buildkit/pods/man1/buildkit.1.pod | 285 ++++++++++++++ xCAT-client/pods/man1/addkit.1.pod | 79 ++++ xCAT-client/pods/man1/addkitcomp.1.pod | 90 +++++ xCAT-client/pods/man1/chkkitcomp.1.pod | 61 +++ xCAT-client/pods/man1/lskit.1.pod | 168 ++++++++ xCAT-client/pods/man1/lskitcomp.1.pod | 156 ++++++++ xCAT-client/pods/man1/lskitdeployparam.1.pod | 107 +++++ xCAT-client/pods/man1/rmkit.1.pod | 83 ++++ xCAT-client/pods/man1/rmkitcomp.1.pod | 90 +++++ 18 files changed, 2860 insertions(+) create mode 100644 docs/source/guides/admin-guides/references/man1/addkit.1.rst create mode 100644 docs/source/guides/admin-guides/references/man1/addkitcomp.1.rst create mode 100644 docs/source/guides/admin-guides/references/man1/buildkit.1.rst create mode 100644 docs/source/guides/admin-guides/references/man1/chkkitcomp.1.rst create mode 100644 docs/source/guides/admin-guides/references/man1/lskit.1.rst create mode 100644 docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst create mode 100644 docs/source/guides/admin-guides/references/man1/lskitdeployparam.1.rst create mode 100644 docs/source/guides/admin-guides/references/man1/rmkit.1.rst create mode 100644 docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst create mode 100644 xCAT-buildkit/pods/man1/buildkit.1.pod create mode 100644 xCAT-client/pods/man1/addkit.1.pod create mode 100644 xCAT-client/pods/man1/addkitcomp.1.pod create mode 100644 xCAT-client/pods/man1/chkkitcomp.1.pod create mode 100644 xCAT-client/pods/man1/lskit.1.pod create mode 100644 xCAT-client/pods/man1/lskitcomp.1.pod create mode 100644 xCAT-client/pods/man1/lskitdeployparam.1.pod create mode 100644 xCAT-client/pods/man1/rmkit.1.pod create mode 100644 xCAT-client/pods/man1/rmkitcomp.1.pod diff --git a/docs/source/guides/admin-guides/references/man1/addkit.1.rst b/docs/source/guides/admin-guides/references/man1/addkit.1.rst new file mode 100644 index 000000000..7c64c139e --- /dev/null +++ b/docs/source/guides/admin-guides/references/man1/addkit.1.rst @@ -0,0 +1,137 @@ + +######## +addkit.1 +######## + +.. highlight:: perl + + +**** +NAME +**** + + +\ **addkit**\ - Adds product software Kits to an xCAT cluster environmnet. + + +******** +SYNOPSIS +******** + + +\ **addkit**\ [\ **-? | -h | -**\ **-help**\ ] [\ **-v | -**\ **-version**\ ] + +\ **addkit**\ [\ **-i | -**\ **-inspection**\ ] \ *kitlist*\ + +\ **addkit**\ [\ **-V | -**\ **-verbose**\ ] [\ **-p | -**\ **-path**\ \ *path*\ ] \ *kitlist*\ + + +*********** +DESCRIPTION +*********** + + +The \ **addkit**\ command installs a kit on the xCAT management node from a kit tarfile or directory. +It creates xCAT database definitions for the kit, kitrepo, and kitcomponent. + +\ **Note:**\ xCAT Kit support is ONLY available for Linux operating systems. + + +******* +OPTIONS +******* + + + +\ **-h|-**\ **-help**\ + + Display usage message. + + + +\ **-V|-**\ **-verbose**\ + + Verbose mode. + + + +\ **-v|-**\ **-version**\ + + Command version. + + + +\ **-i|-**\ **-inspection**\ + + Show the summary of the given kits + + + +\ **-p|-**\ **-path**\ \ *path*\ + + The destination directory to which the contents of the kit tarfiles and/or kit deploy directories will be copied. When this option is not specified, the default destination directory will be formed from the installdir site attribute with ./kits subdirectory. + + + +\ *kitlist*\ + + A comma delimited list of kit_tarball_files or kit_deploy_directories to be added to the xCAT environment. Each entry can be an absolute or relative path. See xCAT documentation for more information on building kits. + + + + +************ +RETURN VALUE +************ + + +0 The command completed successfully. + +1 An error has occurred. + + +******** +EXAMPLES +******** + + +1. To add kits from tarball files: + + +.. code-block:: perl + + addkit kit-test1.tar.bz2,kit-test2.tar.bz2 + + +2. To add kits from directories: + + +.. code-block:: perl + + addkit kit-test1,kit-test2 + + +3. To add kits from tarball \ *kit-test1.tar.bz2*\ to target path \ */install/test*\ : + + +.. code-block:: perl + + addkit -p /install/test kit-test1.tar.bz2 + + +4. To see general information about kit \ *kit-test1.tar.bz2*\ without adding the kit to xCAT: + + +.. code-block:: perl + + addkit -i kit-test1.tar.bz2 + + + +******** +SEE ALSO +******** + + +lskit(1)|lskit.1, rmkit(1)|rmkit.1, addkitcomp(1)|addkitcomp.1, rmkitcomp(1)|rmkitcomp.1, chkkitcomp(1)|chkkitcomp.1 + diff --git a/docs/source/guides/admin-guides/references/man1/addkitcomp.1.rst b/docs/source/guides/admin-guides/references/man1/addkitcomp.1.rst new file mode 100644 index 000000000..16a43358a --- /dev/null +++ b/docs/source/guides/admin-guides/references/man1/addkitcomp.1.rst @@ -0,0 +1,154 @@ + +############ +addkitcomp.1 +############ + +.. highlight:: perl + + +**** +NAME +**** + + +\ **addkitcomp**\ - Assign Kit components to an xCAT osimage. + + +******** +SYNOPSIS +******** + + +\ **addkitcomp**\ [\ **-? | -h | -**\ **-help**\ ] [\ **-v | -**\ **-version**\ ] + +\ **addkitcomp**\ [\ **-V | -**\ **-verbose**\ ] [\ **-a | -**\ **-adddeps**\ ] [\ **-f | -**\ **-force**\ ] [\ **-n | -**\ **-noupgrade**\ ] [\ **-**\ **-noscripts**\ ] \ **-i**\ \ *osimage*\ \ *kitcompname_list*\ + + +*********** +DESCRIPTION +*********** + + +The \ **addkitcomp**\ command will assign kit components to an xCAT osimage. The kit component meta rpm, package rpm and deploy parameters will be added to osimage's otherpkg.pkglist and postbootscripts will be added to osimages's postbootscripts attribute. + +\ **Note:**\ xCAT Kit support is ONLY available for Linux operating systems. + + +******* +OPTIONS +******* + + + +\ **-a|-**\ **-adddeps**\ + + Assign kitcomponent dependencies to the osimage. + + + +\ **-h|-**\ **-help**\ + + Display usage message. + + + +\ **-V|-**\ **-verbose**\ + + Verbose mode. + + + +\ **-v|-**\ **-version**\ + + Command version. + + + +\ **-f|-**\ **-force**\ + + Add kit component to osimage even if there is a mismatch in OS, version, arch, serverrole, or kitcompdeps + + + +\ **-i**\ \ *osimage*\ + + The osimage name that the kit component is assigning to. + + + +\ **-n|-**\ **-noupgrade**\ + + 1. Allow multiple versions of kitcomponent to be installed into the osimage, instead of kitcomponent upgrade. + + 2. Kit components added by addkitcomp -n will be installed separately behind all other ones which have been added. + + + +\ **-**\ **-noscripts**\ + + Do not add kitcomponent's postbootscripts to osimage + + + +\ *kitcompname_list*\ + + A comma-delimited list of valid full kit component names or kit component basenames that are to be added to the osimage. + + + + +************ +RETURN VALUE +************ + + +0 The command completed successfully. + +1 An error has occurred. + + +******** +EXAMPLES +******** + + +1. To add a single kit component to osimage "rhels6.2-ppc64-netboot-compute": + + +.. code-block:: perl + + addkitcomp -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 + + +2. To add a kit component to osimage with dependencies, use the -a (addeps) option: + + +.. code-block:: perl + + addkitcomp -a -i rhels6.2-ppc64-netboot-compute comp-test2-1.0-1-rhels-6.2-ppc64 + + +3. To add a kit component to osimage with incompatable osarch, osversion or ostype, use the -f (force) option: + + +.. code-block:: perl + + addkitcomp -f -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 + + +4. To add a new version of kit component to osimage without upgrade, use the -n (noupgrade) option: + + +.. code-block:: perl + + addkitcomp -n -i rhels6.2-ppc64-netboot-compute comp-test2-1.0-1-rhels-6.2-ppc64 + + + +******** +SEE ALSO +******** + + +lskit(1)|lskit.1, addkit(1)|addkit.1, rmkit(1)|rmkit.1, rmkitcomp(1)|rmkitcomp.1, chkkitcomp(1)|chkkitcomp.1 + diff --git a/docs/source/guides/admin-guides/references/man1/buildkit.1.rst b/docs/source/guides/admin-guides/references/man1/buildkit.1.rst new file mode 100644 index 000000000..20dd710e6 --- /dev/null +++ b/docs/source/guides/admin-guides/references/man1/buildkit.1.rst @@ -0,0 +1,372 @@ + +########## +buildkit.1 +########## + +.. highlight:: perl + + +**** +NAME +**** + + +\ **buildkit**\ - Used to build a software product Kit which may be used to install software in an xCAT cluster. + + +******** +SYNOPSIS +******** + + +\ **buildkit**\ [\ **-? | -h | -**\ **-help**\ ] [\ **-v | -**\ **-version**\ ] + +To build a new Kit + +\ **buildkit**\ [\ **-V | -**\ **-verbose]**\ \ *subcommand*\ [\ *kit_name*\ ] [\ *repo_name*\ | \ **all**\ ] [\ **-l | -**\ **-kitloc**\ \ *kit_location*\ ] + +To add packages to an existing Kit. + +\ **buildkit**\ [\ **-V | -**\ **-verbose**\ ] \ *addpkgs*\ \ *kit_tarfile*\ [\ **-p | -**\ **-pkgdir**\ \ *package_directory_list*\ ] [\ **-k | -**\ **-kitversion**\ \ *version*\ ] [\ **-r | -**\ **-kitrelease**\ \ *release*\ ] [\ **-l | -**\ **-kitloc**\ \ *kit_location*\ ] + + +*********** +DESCRIPTION +*********** + + +The \ **buildkit**\ command provides a collection of utilities that may be used to package a software product as a Kit tarfile that can be used to install software on the nodes of an xCAT cluster. A Kit contains the product software packages, configuration and control information, and install and customization scripts. + +Note: The xCAT support for Kits is only available for Linux operating systems. + +You will need to run the \ **buildkit**\ command several times with different subcommands to step through the process of building a kit: + +By default the \ **buildkit**\ subcommands will operate in the current working directory, (ie. look for files, create directories etc.). You could specify a different location by using the "\ **-l | -**\ **-kitloc**\ \ *kit_location*\ " option. + +The \ *kit_location*\ is the full path name of the directory that contains the kit files. You would use the same location value for all the buildkit subcommands. + +For example, to create a new kit named "prodkit" in the directory /home/mykits/ \ *either*\ run: + + +1. + + If no location is provided then the command will create a subdirectory called "prodkit" in the current directory "/home/mykits" and the new kit files will be created there. + + \ **cd /home/mykits**\ + + \ **buildkit create prodkit**\ + + or + + + +2. + + If a location is provided then the Kit files will be created there. Note that the Kit name does not necessarily have to be the directory name where the kit files are located. + + \ **buidkit create prodkit -l /home/mykits/prodkit**\ + + + +In both cases the /home/mykits/prodkit directory is created and the inital files for the kit are created in that directory. + +The following example illustrates the basic process for building a new Kit. In this example we are building a Kit named "mytstkit". + + +1. + + Change to the directory where you wish to create the Kit. + + + +2. + + Create a template directory for your kit: + + \ **buildkit create mytstkit**\ + + + +3. + + Change directory to the new "mytstkit" subdirectory that was just created. + + \ **cd mytstkit**\ + + + +4. + + Edit the buildkit configuration file for your kit: + + \ **vi buildkit.conf**\ + + (See xCAT Kit documentation for details.) + + + +5. + + Create all required files, scripts, plugins, and packages for your kit. + + + +6. + + Validate your kit build configuration and fix any errors that are reported: + + \ **buildkit chkconfig**\ + + + +7. + + List the repos defined in your buildkit configuration file: + + \ **buildkit listrepo**\ + + + +8. + + For each repo name listed, build the repository. Note that if you need to build repositories for OS distributions, versions, or architectures that do not match the current system, you may need to copy your kit template directory to an appropriate server to build that repository, and then copy the results back to your main build server. For example, to build a repo named "rhels6.3" you would run the following command. + + \ **buildkit buildrepo rhels6.3**\ + + or, you can build all of the repos at one time if there are no OS or architecture dependencies for kitcomponent package builds or kitpackage builds: + + \ **buildkit buildrepo all**\ + + + +9. + + Build the kit tar file: + + \ **buildkit buildtar**\ + + + + +******* +OPTIONS +******* + + + +\ **-h |-**\ **-help**\ + + Display usage message. + + + +\ **-k|-**\ **-kitversion**\ \ *version*\ + + Product version. + + + +\ **-l|-**\ **-kitloc**\ \ *kit_location*\ + + The directory location of the Kit files. + + + +\ **-p|-**\ **-pkgdir**\ \ *package_directory_list*\ + + A comma-separated list of directory locations for product RPMs. + + + +\ **-r|-**\ **-kitrelease**\ \ *release*\ + + Product release. + + + +\ **-V |-**\ **-verbose**\ + + Verbose mode. + + + +\ **-v|-**\ **-version**\ + + Command version. + + + + +************ +SUB-COMMANDS +************ + + + +\ **create**\ \ *kit_basename*\ + + Creates a new kit build directory structure for kit \ *kit_basename*\ using the location specified on the command line or the current directory. The sample kit files from /opt/xcat/share/xcat/kits/kit_template are copied over, and the buildkit.conf file is modified for the specified \ *kit_basename*\ . + + + +\ **chkconfig**\ + + Reads the buildkit.conf file, verifies that the file syntax is correct and that all specified files exist. + + + +\ **listrepo**\ + + Reads the buildkit.conf file, lists all Kit package repositories listed in the file, and reports the build status for each repository. + + + +\ **buildrepo**\ {\ *repo_name*\ | \ **all**\ } + + Reads the buildkit.conf file, and builds the specified Kit package repository. The built packages are placed in the directory /build/kit_repodir/\ *repo_name*\ . If \ **all**\ is specified, all kit repositories are built. + + + +\ **cleanrepo**\ {\ *repo_name*\ | \ **all**\ } + + Reads the buildkit.conf file, and deletes all the package files and package meta data files from the /build/kit_repodir/\ *repo_name*\ directory. If \ **all**\ is specified, all kit repository files are deleted. + + + +\ **buildtar**\ + + Reads the buildkit.conf file, validates that all kit repositories have been built, and builds the Kit tar file /\ *kitname*\ .tar.bz2. + + + +\ **cleantar**\ + + Reads the /buildkit.conf file and \ *deletes*\ the following: + + + - Kit tar files matching /\ *kit_name\\*.tar.bz2*\ . + + - /build/\ *kit_name*\ + + - /rpmbuild + + - /tmp + + - /debbuild + + Caution: Make sure you back up any tar files you would like to keep before running this subcommand. + + + +\ **cleanall**\ + + Equivalent to running \ **buildkit cleanrepo all**\ and \ **buildkit cleantar**\ . + + + +\ **addpkgs**\ + + \ *kit_tarfile*\ {\ **-p**\ | \ **-**\ **-pkgdir**\ \ *package_directory_list*\ } [\ **-k**\ | \ **-**\ **-kitversion**\ \ *version*\ ] [\ **-r**\ | \ **-**\ **-kitrelease**\ \ *release*\ ] + + Add product package rpms to a previously built kit tar file. This is used for partial product kits that are built and shipped separately from the product packages, and are identified with a \ *kit_tarfile*\ name of \ *kitname*\ .\ **NEED_PRODUCT_PKGS.tar.bz2**\ . Optionally, change the kit release and version values when building the new kit tarfile. If kitcomponent version and/or release values are defaulted to the kit values, those will also be changed and new kitcomponent rpms will be built. If kit or kitcomponent scripts, plugins, or other files specify name, release, or version substitution strings, these will all be replaced with the new values when built into the new complete kit tarfile \ *kit_location*\ /\ *new_kitname*\ .\ **tar.bz2**\ . + + + + +************ +RETURN VALUE +************ + + + +0 + + The command completed successfully. + + + +1 + + An error has occurred. + + + + +******** +EXAMPLES +******** + + + +1. + + To create the sample kit shipped with the xCAT-buildkit rpm on a RHELS 6.3 server and naming it \ **mykit**\ , run the following commands: + + \ **cd /home/myuserid/kits**\ + + \ **buildkit create mykit**\ + + \ **cd mykit**\ + + \ **vi buildkit.conf**\ + + \ **buildkit chkconfig**\ + + \ **buildkit listrepo**\ + + \ **buildkit buildrepo all**\ + + \ **buildkit buildtar**\ + + + +2. + + To clean up a kit repository directory after build failures on a RHELS 6.3 server to prepare for a new kit repository build, run: + + \ **buildkit cleanrepo rhels6.3**\ + + + +3. + + To clean up all kit build files, including a previously built kit tar file, run + + \ **buildkit cleanall**\ + + + +4. + + To create a kit named "tstkit" located in /home/foobar/tstkit instead of the current working directory. + + \ **buildkit create tstkit -l /home/foobar/tstkit**\ + + + + +***** +FILES +***** + + +/opt/xcat/bin/buildkit + +/opt/xcat/share/xcat/kits/kit_template + +/opt/xcat/share/xcat/kits/kitcomponent.spec.template + +/buildkit.conf + +/build/\ *kitname*\ /kit.conf + +/\ *kitname*\ .tar.bz2 + + +******** +SEE ALSO +******** + + +addkit(1), lskit(1), rmkit(1), addkitcomp(1), rmkitcomp(1), chkkitcomp(1) + diff --git a/docs/source/guides/admin-guides/references/man1/chkkitcomp.1.rst b/docs/source/guides/admin-guides/references/man1/chkkitcomp.1.rst new file mode 100644 index 000000000..ffb675f04 --- /dev/null +++ b/docs/source/guides/admin-guides/references/man1/chkkitcomp.1.rst @@ -0,0 +1,106 @@ + +############ +chkkitcomp.1 +############ + +.. highlight:: perl + + +**** +NAME +**** + + +\ **chkkitcomp**\ - Check if Kit components are compatible with an xCAT osimage. + + +******** +SYNOPSIS +******** + + +\ **chkkitcomp**\ [\ **-? | -h | -**\ **-help**\ ] [\ **-v | -**\ **-version**\ ] + +\ **chkkitcomp**\ [\ **-V | -**\ **-verbose**\ ] \ **-i**\ \ *osimage*\ \ *kitcompname_list*\ + + +*********** +DESCRIPTION +*********** + + +The \ **chkkitcomp**\ command will check if the kit components are compatible with the xCAT osimage. + +This command will ignore the current osimage.kitcomponents setting and check if the kitcompname_list is compatible with the osimage and kit component dependencies. + +\ **Note:**\ xCAT Kit support is ONLY available for Linux operating systems. + + +******* +OPTIONS +******* + + + +\ **-h|-**\ **-help**\ + + Display usage message. + + + +\ **-V|-**\ **-verbose**\ + + Verbose mode. + + + +\ **-v|-**\ **-version**\ + + Command version. + + + +\ **-i**\ \ *osimage*\ + + The name of the osimage to check against. + + + +\ *kitcompname_list*\ + + A comma-delimited list of valid full kit component names or kit component basenames that are to be checked against the osimage. + + + + +************ +RETURN VALUE +************ + + +0 The command completed successfully. + +1 An error has occurred. + + +******** +EXAMPLES +******** + + +1. To check if a kit component, \ *comp-test1-1.0-1-rhels-6.2-ppc64*\ can be added to osimage \ *rhels6.2-ppc64-netboot-compute*\ : + + +.. code-block:: perl + + chkkitcomp -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 + + + +******** +SEE ALSO +******** + + +lskit(1)|lskit.1, addkit(1)|addkit.1, rmkit(1)|rmkit.1, addkitcomp(1)|addkitcomp.1, rmkitcomp(1)|rmkitcomp.1 + diff --git a/docs/source/guides/admin-guides/references/man1/lskit.1.rst b/docs/source/guides/admin-guides/references/man1/lskit.1.rst new file mode 100644 index 000000000..07081e15d --- /dev/null +++ b/docs/source/guides/admin-guides/references/man1/lskit.1.rst @@ -0,0 +1,250 @@ + +####### +lskit.1 +####### + +.. highlight:: perl + + +**** +NAME +**** + + +\ **lskit**\ - Lists information for one or more Kits. + + +******** +SYNOPSIS +******** + + +\ **lskit**\ [\ **-V**\ | \ **-**\ **-verbose**\ ] [\ **-F**\ | \ **-**\ **-framework**\ \ *kitattr_names*\ ] [\ **-x**\ | \ **-**\ **-xml**\ | \ **-**\ **-XML**\ ] [\ **-K**\ | \ **-**\ **-kitattr**\ \ *kitattr_names*\ ] [\ **-R**\ | \ **-**\ **-repoattr**\ \ *repoattr_names*\ ] [\ **-C**\ | \ **-**\ **-compattr**\ \ *compattr_names*\ ] [\ *kit_names*\ ] + +\ **lskit**\ [\ **-?**\ | \ **-h**\ | \ **-**\ **-help**\ | \ **-v**\ | \ **-**\ **-version**\ ] + +\ **lskit**\ [\ **-F**\ | \ **-**\ **-framework**\ \ *kit_path_name*\ ] + + +*********** +DESCRIPTION +*********** + + +The \ **lskit**\ command is used to list information for one or more kits. A kit is a special kind of package that is used to install a software product on one or more nodes in an xCAT cluster. + +Note: The xCAT support for Kits is only available for Linux operating systems. + +The \ **lskit**\ command outputs the following info for each kit: the kit's basic info, the kit's repositories, and the kit's components. The command outputs the info in two formats: human-readable format (default), and XML format. Use the -x option to view the info in XML format. + +Input to the command can specify any number or combination of the input options. + + +******* +OPTIONS +******* + + + +\ **-F|-**\ **-framework**\ \ *kit_path_name*\ + + Use this option to display the framework values of the specified Kit tarfile. This information is retreived directly from the tarfile and can be done before the Kit has been defined in the xCAT database. This option cannot be combined with other options. + + + +\ **-K|-**\ **-kitattr**\ \ *kitattr_names*\ + + Where \ *kitattr_names*\ is a comma-delimited list of kit attribute names. The names correspond to attribute names in the \ **kit**\ table. The \ **lskit**\ command will only display the specified kit attributes. + + + +\ **-R|-**\ **-repoattr**\ \ *repoattr_names*\ + + Where \ *repoattr_names*\ is a comma-delimited list of kit repository attribute names. The names correspond to attribute names in the \ **kitrepo**\ table. The \ **lskit**\ command will only display the specified kit repository attributes. + + + +\ **-C|-**\ **-compattr**\ \ *compattr_names*\ + + where \ *compattr_names*\ is a comma-delimited list of kit component attribute names. The names correspond to attribute names in the \ **kitcomponent**\ table. The \ **lskit**\ command will only display the specified kit component attributes. + + + +\ *kit_names*\ + + is a comma-delimited list of kit names. The \ **lskit**\ command will only display the kits matching these names. + + + +\ **-x|-**\ **-xml|-**\ **-XML**\ + + Need XCATXMLTRACE=1 env when using -x|--xml|--XML, for example: XCATXMLTRACE=1 lskit -x testkit-1.0.0 + Return the output with XML tags. The data is returned as: + + + .. code-block:: perl + + + + ... + + + ... + + + ... + + + + + Each tag contains info for one kit. The info inside is structured as follows: + + + .. code-block:: perl + + The sub-tag contains the kit's basic info. + The sub-tags store info about the kit's repositories. + The sub-tags store info about the kit's components. + + + The data inside is returned as: + + + .. code-block:: perl + + + + ... + + + + ... + + ... + + + ... + + ... + + + + + +\ **-V|-**\ **-verbose**\ + + Display additional progress and error messages. + + + +\ **-v|-**\ **-version**\ + + Command Version. + + + +\ **-?|-h|-**\ **-help**\ + + Display usage message. + + + + +************ +RETURN VALUE +************ + + + +0 The command completed successfully. + + + +1 An error has occurred. + + + + +******** +EXAMPLES +******** + + + +1. To list all kits, enter: + + + .. code-block:: perl + + lskit + + + + +2. To list the kit "kit-test1-1.0-Linux", enter: + + + .. code-block:: perl + + lskit kit-test1-1.0-Linux + + + + +3. To list the kit "kit-test1-1.0-Linux" for selected attributes, enter: + + + .. code-block:: perl + + lskit -K basename,description -R kitreponame -C kitcompname kit-test1-1.0-Linux + + + + +4. To list the framework value of a Kit tarfile. + + + .. code-block:: perl + + lskit -F /myhome/mykits/pperte-1.3.0.2-0-x86_64.tar.bz2 + + + Output is similar to: + + + .. code-block:: perl + + Extracting the kit.conf file from /myhome/mykits/pperte-1.3.0.2-0-x86_64.tar.bz2. Please wait. + + kitframework=2 + compatible_kitframeworks=0,1,2 + + + + +5. To list kit "testkit-1.0-1" with XML tags, enter: + + + .. code-block:: perl + + XCATXMLTRACE=1 lskit -x testkit-1.0-1 + + + + + +***** +FILES +***** + + +/opt/xcat/bin/lskit + + +******** +SEE ALSO +******** + + +lskitcomp(1)|lskitcomp.1, lskitdeployparam(1)|lskitdeployparam.1, addkit(1)|addkit.1, rmkit(1)|rmkit.1, addkitcomp(1)|addkitcomp.1, rmkitcomp(1)|rmkitcomp.1 + diff --git a/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst b/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst new file mode 100644 index 000000000..895a065e1 --- /dev/null +++ b/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst @@ -0,0 +1,247 @@ + +########### +lskitcomp.1 +########### + +.. highlight:: perl + + +**** +NAME +**** + + +\ **lskitcomp**\ - Used to list information for one or more kit components. + + +******** +SYNOPSIS +******** + + +\ **lskitcomp**\ [\ **-V**\ | \ **-**\ **-verbose**\ ] [\ **-x**\ | \ **-**\ **-xml**\ | \ **-**\ **-XML**\ ] [\ **-C**\ | \ **-**\ **-compattr**\ \ *compattr_names*\ ] [\ **-O**\ | \ **-**\ **-osdistro**\ \ *os_distro*\ ] [\ **-S**\ | \ **-**\ **-serverrole**\ \ *server_role*\ ] [\ *kitcomp_names*\ ] + +\ **lskitcomp**\ [\ **-?**\ | \ **-h**\ | \ **-**\ **-help**\ | \ **-v**\ | \ **-**\ **-version**\ ] + + +*********** +DESCRIPTION +*********** + + +The \ **lskitcomp**\ command is used to list information for one or more kit components. A kit is made up of one or more kit components. Each kit component is a meta package used to install a software product component on one or more nodes in an xCAT cluster. + +The \ **lskitcomp**\ command outputs the kit component info in two formats: human-readable format (default), and XML format. Use the -x option to view the info in XML format. + +Input to the command can specify any number or combination of the input options. + +Note: The xCAT support for Kits is only available for Linux operating systems. + + +******* +OPTIONS +******* + + + +\ **-C|-**\ **-compattr**\ \ *compattr_names*\ + + where \ *compattr_names*\ is a comma-delimited list of kit component attribute names. The names correspond to attribute names in the \ **kitcomponent**\ table. The \ **lskitcomp**\ command will only display the specified kit component attributes. + + + +\ **-O|-**\ **-osdistro**\ \ *os_distro*\ + + where \ *os_distro*\ is the name of an osdistro in \ **osdistro**\ table. The \ **lskitcomp**\ command will only display the kit components matching the specified osdistro. + + + +\ **-S|-**\ **-serverrole**\ \ *server_role*\ + + where \ *server_role*\ is the name of a server role. The typical server roles are: mgtnode, servicenode, computenode, loginnode, storagennode. The \ **lskitcomp**\ command will only display the kit components matching the specified server role. + + + +\ *kitcomp_names*\ + + is a comma-delimited list of kit component names. The \ **lskitcomp**\ command will only display the kit components matching the specified names. + + + +\ **-x|-**\ **-xml|-**\ **-XML**\ + + Need XCATXMLTRACE=1 env when using -x|--xml|--XML. + Return the output with XML tags. The data is returned as: + + + .. code-block:: perl + + + + ... + + + ... + + + ... + + + + + Each tag contains info for a group of kit components belonging to the same kit. The info inside is structured as follows: + + + .. code-block:: perl + + The sub-tag contains the kit's name. + The sub-tags store info about the kit's components. + + + The data inside is returned as: + + + .. code-block:: perl + + + + ... + + + + ... + + ... + + + + + +\ **-V|-**\ **-verbose**\ + + Display additional progress and error messages. + + + +\ **-v|-**\ **-version**\ + + Command Version. + + + +\ **-?|-h|-**\ **-help**\ + + Display usage message. + + + + +************ +RETURN VALUE +************ + + + +0 The command completed successfully. + + + +1 An error has occurred. + + + + +******** +EXAMPLES +******** + + + +1. + + To list all kit components, enter: + + + .. code-block:: perl + + lskitcomp + + + + +2. + + To list the kit component "comp-server-1.0-1-rhels-6-x86_64", enter: + + + .. code-block:: perl + + lskitcomp comp-server-1.0-1-rhels-6-x86_64 + + + + +3. + + To list the kit component "comp-server-1.0-1-rhels-6-x86_64" for selected kit component attributes, enter: + + + .. code-block:: perl + + lskitcomp -C kitcompname,desc comp-server-1.0-1-rhels-6-x86_64 + + + + +4. + + To list kit components compatible with "rhels-6.2-x86_64" osdistro, enter: + + + .. code-block:: perl + + lskitcomp -O rhels-6.2-x86_64 + + + + +5. + + To list kit components compatible with "rhels-6.2-x86_64" osdistro and "computenode" server role, enter: + + + .. code-block:: perl + + lskitcomp -O rhels-6.2-x86_64 -S computenode + + + + +6. + + To list the kit component "testkit-compute-1.0-1-ubuntu-14.04-ppc64el" with XML tags, enter: + + + .. code-block:: perl + + XCATXMLTRACE=1 lskitcomp -x testkit-compute-1.0-1-ubuntu-14.04-ppc64el + + + + + +***** +FILES +***** + + +/opt/xcat/bin/lskitcomp + + +******** +SEE ALSO +******** + + +lskit(1)|lskit.1, lskitdeployparam(1)|lskitdeployparam.1, addkit(1)|addkit.1, rmkit(1)|rmkit.1, addkitcomp(1)|addkitcomp.1, rmkitcomp(1)|rmkitcomp.1 + diff --git a/docs/source/guides/admin-guides/references/man1/lskitdeployparam.1.rst b/docs/source/guides/admin-guides/references/man1/lskitdeployparam.1.rst new file mode 100644 index 000000000..28cc34092 --- /dev/null +++ b/docs/source/guides/admin-guides/references/man1/lskitdeployparam.1.rst @@ -0,0 +1,162 @@ + +################## +lskitdeployparam.1 +################## + +.. highlight:: perl + + +**** +NAME +**** + + +\ **lskitdeployparam**\ - Lists the deployment parameters for one or more Kits or Kit components + + +******** +SYNOPSIS +******** + + +\ **lskitdeployparam**\ [\ **-V**\ | \ **-**\ **-verbose**\ ] [\ **-x**\ | \ **-**\ **-xml**\ | \ **-**\ **-XML**\ ] [\ **-k**\ | \ **-**\ **-kitname**\ \ *kit_names*\ ] [\ **-c**\ | \ **-**\ **-compname**\ \ *comp_names*\ ] + +\ **lskitdeployparam**\ [\ **-?**\ | \ **-h**\ | \ **-**\ **-help**\ | \ **-v**\ | \ **-**\ **-version**\ ] + + +*********** +DESCRIPTION +*********** + + +The \ **lskitdeployparam**\ command is used to list the kit deployment parameters for one or more kits, or one or more kit components. Kit deployment parameters are used to customize the installation or upgrade of kit components. + +The \ **lskitdeployparam**\ command outputs the kit component information in two formats: human-readable format (default), and XML format. Use the -x option to view the information in XML format. + +Input to the command can specify any combination of the input options. + +Note: The xCAT support for Kits is only available for Linux operating systems. + + +******* +OPTIONS +******* + + + +\ **-k|-**\ **-kitname**\ \ *kit_names*\ + + Where \ *kit_names*\ is a comma-delimited list of kit names. The \ **lskitdeployparam**\ command will only display the deployment parameters for the kits with the matching names. + + + +\ **-c|-**\ **-compname**\ \ *comp_names*\ + + Where \ *comp_names*\ is a comma-delimited list of kit component names. The \ **lskitdeployparam**\ command will only display the deployment parameters for the kit components with the matching names. + + + +\ **-x|-**\ **-xml|-**\ **-XML**\ + + Return the output with XML tags. The data is returned as: + + + .. code-block:: perl + + + + KIT_KIT1_PARAM1 + value11 + + + + + KIT_KIT1_PARAM2 + value12 + + + ... + + + + +\ **-V|-**\ **-verbose**\ + + Display additional progress and error messages. + + + +\ **-v|-**\ **-version**\ + + Command Version. + + + +\ **-?|-h|-**\ **-help**\ + + Display usage message. + + + + +************ +RETURN VALUE +************ + + + +0 The command completed successfully. + + + +1 An error has occurred. + + + + +******** +EXAMPLES +******** + + + +1. + + To list kit deployment parameters for kit "kit-test1-1.0-Linux", enter: + + + .. code-block:: perl + + lskitdeployparam -k kit-test1-1.0-Linux + + + + +2. + + To list kit deployment parameters for kit component "comp-server-1.0-1-rhels-6-x86_64", enter: + + + .. code-block:: perl + + lskitdeployparam -c comp-server-1.0-1-rhels-6-x86_64 + + + + + +***** +FILES +***** + + +/opt/xcat/bin/lskitdeployparam + + +******** +SEE ALSO +******** + + +lskit(1)|lskit.1, lskitcomp(1)|lskitcomp.1, addkit(1)|addkit.1, rmkit(1)|rmkit.1, addkitcomp(1)|addkitcomp.1, rmkitcomp(1)|rmkitcomp.1 + diff --git a/docs/source/guides/admin-guides/references/man1/rmkit.1.rst b/docs/source/guides/admin-guides/references/man1/rmkit.1.rst new file mode 100644 index 000000000..d83ca67ce --- /dev/null +++ b/docs/source/guides/admin-guides/references/man1/rmkit.1.rst @@ -0,0 +1,151 @@ + +####### +rmkit.1 +####### + +.. highlight:: perl + + +**** +NAME +**** + + +\ **rmkit**\ - Remove Kits from xCAT + + +******** +SYNOPSIS +******** + + +\ **rmkit**\ [\ **-? | -h | -**\ **-help**\ ] [\ **-v | -**\ **-version**\ ] + +\ **rmkit**\ [\ **-V | -**\ **-verbose**\ ] [\ **-f | -**\ **-force**\ ] [\ **-t | -**\ **-test**\ ] \ *kitlist*\ + + +*********** +DESCRIPTION +*********** + + +The \ **rmkit**\ command removes kits on the xCAT management node from kit names. + +Note: The xCAT support for Kits is only available for Linux operating systems. + + +******* +OPTIONS +******* + + + +\ **-h|-**\ **-help**\ + + Display usage message. + + + +\ **-V|-**\ **-verbose**\ + + Verbose mode. + + + +\ **-v|-**\ **-version**\ + + Command version. + + + +\ **-f|-**\ **-force**\ + + Remove this kit even there is any component in this kit is listed by osimage.kitcomponents. If this option is not specified, this kit will not be removed if any kit components listed in an osimage.kitcomponents + + + +\ **-t|-**\ **-test**\ + + Test if kitcomponents in this kit are used by osimage + + + +\ *kitlist*\ + + A comma delimited list of kits that are to be removed from the xCAT cluster. Each entry can be a kitname or kit basename. For kit basename, rmkit command will remove all the kits that have that kit basename. + + + + +************ +RETURN VALUE +************ + + +0 The command completed successfully. + +1 An error has occurred. + + +******** +EXAMPLES +******** + + +1. To remove two kits from tarball files. + + +.. code-block:: perl + + rmkit kit-test1,kit-test2 + + +Output is similar to: + + +.. code-block:: perl + + Kit kit-test1-1.0-Linux,kit-test2-1.0-Linux was successfully removed. + + +2. To remove two kits from tarball files even the kit components in them are still being used by osimages. + + +.. code-block:: perl + + rmkit kit-test1,kit-test2 --force + + +Output is similar to: + + +.. code-block:: perl + + Kit kit-test1-1.0-Linux,kit-test2-1.0-Linux was successfully removed. + + +3. To list kitcomponents in this kit used by osimage + + +.. code-block:: perl + + rmkit kit-test1,kit-test2 -t + + +Output is similar to: + + +.. code-block:: perl + + kit-test1-kitcomp-1.0-Linux is being used by osimage osimage-test + Following kitcomponents are in use: kit-test1-kitcomp-1.0-Linux + + + +******** +SEE ALSO +******** + + +lskit(1)|lskit.1, addkit(1)|addkit.1, addkitcomp(1)|addkitcomp.1, rmkitcomp(1)|rmkitcomp.1, chkkitcomp(1)|chkkitcomp.1 + diff --git a/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst b/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst new file mode 100644 index 000000000..183372691 --- /dev/null +++ b/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst @@ -0,0 +1,162 @@ + +########### +rmkitcomp.1 +########### + +.. highlight:: perl + + +**** +NAME +**** + + +\ **rmkitcomp**\ - Remove Kit components from an xCAT osimage. + + +******** +SYNOPSIS +******** + + +\ **rmkitcomp**\ [\ **-? | -h | -**\ **-help**\ ] [\ **-v | -**\ **-version**\ ] + +\ **rmkitcomp**\ [\ **-V | -**\ **-verbose**\ ] [\ **-u | -**\ **-uninstall**\ ] [\ **-f | -**\ **-force**\ ] [\ **-**\ **-noscripts**\ ] \ **-i**\ \ *osimage*\ \ *kitcompname_list*\ + + +*********** +DESCRIPTION +*********** + + +The \ **rmkitcomp**\ command removes kit components from an xCAT osimage. All the kit component attribute values that are contained in the osimage will be removed, and the kit component meta rpm and package rpm could be uninstalled by \ **-u|-**\ **-uninstall**\ option. + +Note: The xCAT support for Kits is only available for Linux operating systems. + + +******* +OPTIONS +******* + + + +\ **-u|-**\ **-uninstall**\ + + All the kit component meta rpms and package rpms in otherpkglist will be uninstalled during genimage for stateless image and updatenode for stateful nodes. + + + +\ **-h|-**\ **-help**\ + + Display usage message. + + + +\ **-V|-**\ **-verbose**\ + + Verbose mode. + + + +\ **-v|-**\ **-version**\ + + Command version. + + + +\ **-f|-**\ **-force**\ + + Remove this kit component from osimage no matter it is a dependency of other kit components. + + + +\ **-**\ **-noscripts**\ + + Do not remove kitcomponent's postbootscripts from osimage + + + +\ **-i**\ \ *osimage*\ + + osimage name that include this kit component. + + + +\ *kitcompname_list*\ + + A comma-delimited list of valid full kit component names or kit component basenames that are to be removed from the osimage. If a basename is specified, all kitcomponents matching that basename will be removed from the osimage. + + + + +************ +RETURN VALUE +************ + + +0 The command completed successfully. + +1 An error has occurred. + + +******** +EXAMPLES +******** + + +1. To remove a kit component from osimage + + +.. code-block:: perl + + rmkitcomp -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 + + +Output is similar to: + + +.. code-block:: perl + + kitcomponents comp-test1-1.0-1-rhels-6.2-ppc64 were removed from osimage rhels6.2-ppc64-netboot-compute successfully + + +2. To remove a kit component even it is still used as a dependency of other kit component. + + +.. code-block:: perl + + rmkitcomp -f -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 + + +Output is similar to: + + +.. code-block:: perl + + kitcomponents comp-test1-1.0-1-rhels-6.2-ppc64 were removed from osimage rhels6.2-ppc64-netboot-compute successfully + + +3. To remove a kit component from osimage and also remove the kit component meta RPM and package RPM. So in next genimage for statelss image and updatenode for stateful nodes, the kit component meta RPM and package RPM will be uninstalled. + + +.. code-block:: perl + + rmkitcomp -u -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 + + +Output is similar to: + + +.. code-block:: perl + + kitcomponents comp-test1-1.0-1-rhels-6.2-ppc64 were removed from osimage rhels6.2-ppc64-netboot-compute successfully + + + +******** +SEE ALSO +******** + + +lskit(1)|lskit.1, addkit(1)|addkit.1, rmkit(1)|rmkit.1, addkitcomp(1)|addkitcomp.1, chkkitcomp(1)|chkkitcomp.1 + diff --git a/xCAT-buildkit/pods/man1/buildkit.1.pod b/xCAT-buildkit/pods/man1/buildkit.1.pod new file mode 100644 index 000000000..7d9c49756 --- /dev/null +++ b/xCAT-buildkit/pods/man1/buildkit.1.pod @@ -0,0 +1,285 @@ +=head1 NAME + +B - Used to build a software product Kit which may be used to install software in an xCAT cluster. + +=head1 SYNOPSIS + +B [B<-?>|B<-h>|B<--help>] [B<-v>|B<--version>] + +To build a new Kit + +B [B<-V>|B<--verbose]> I [I] [I | B] [B<-l>|B<--kitloc> I] + +To add packages to an existing Kit. + +B [B<-V>|B<--verbose>] I I [B<-p>|B<--pkgdir> I] [B<-k>|B<--kitversion> I] [B<-r>|B<--kitrelease> I] [B<-l>|B<--kitloc> I] + +=head1 DESCRIPTION + +The B command provides a collection of utilities that may be used to package a software product as a Kit tarfile that can be used to install software on the nodes of an xCAT cluster. A Kit contains the product software packages, configuration and control information, and install and customization scripts. + +Note: The xCAT support for Kits is only available for Linux operating systems. + +You will need to run the B command several times with different subcommands to step through the process of building a kit: + +By default the B subcommands will operate in the current working directory, (ie. look for files, create directories etc.). You could specify a different location by using the "B<-l | --kitloc> I" option. + +The I is the full path name of the directory that contains the kit files. You would use the same location value for all the buildkit subcommands. + +For example, to create a new kit named "prodkit" in the directory /home/mykits/ I run: + +=over 4 + +=item 1. + +If no location is provided then the command will create a subdirectory called "prodkit" in the current directory "/home/mykits" and the new kit files will be created there. + +B + +B + +or + +=item 2. + +If a location is provided then the Kit files will be created there. Note that the Kit name does not necessarily have to be the directory name where the kit files are located. + +B + +=back + +In both cases the /home/mykits/prodkit directory is created and the inital files for the kit are created in that directory. + +The following example illustrates the basic process for building a new Kit. In this example we are building a Kit named "mytstkit". + +=over 4 + +=item 1. + +Change to the directory where you wish to create the Kit. + +=item 2. + +Create a template directory for your kit: + +B + +=item 3. + +Change directory to the new "mytstkit" subdirectory that was just created. + +B + +=item 4. + +Edit the buildkit configuration file for your kit: + +B + +(See xCAT Kit documentation for details.) + +=item 5. + +Create all required files, scripts, plugins, and packages for your kit. + +=item 6. + +Validate your kit build configuration and fix any errors that are reported: + +B + +=item 7. + +List the repos defined in your buildkit configuration file: + +B + +=item 8. + +For each repo name listed, build the repository. Note that if you need to build repositories for OS distributions, versions, or architectures that do not match the current system, you may need to copy your kit template directory to an appropriate server to build that repository, and then copy the results back to your main build server. For example, to build a repo named "rhels6.3" you would run the following command. + +B + +or, you can build all of the repos at one time if there are no OS or architecture dependencies for kitcomponent package builds or kitpackage builds: + +B + +=item 9. + +Build the kit tar file: + +B + +=back + +=head1 OPTIONS + +=over 10 + +=item B<-h |--help> + +Display usage message. + +=item B<-k|--kitversion> I + +Product version. + +=item B<-l|--kitloc> I + +The directory location of the Kit files. + +=item B<-p|--pkgdir> I + +A comma-separated list of directory locations for product RPMs. + +=item B<-r|--kitrelease> I + +Product release. + +=item B<-V |--verbose> + +Verbose mode. + +=item B<-v|--version> + +Command version. + +=back + +=head1 SUB-COMMANDS + +=over 10 + +=item B I + +Creates a new kit build directory structure for kit I using the location specified on the command line or the current directory. The sample kit files from /opt/xcat/share/xcat/kits/kit_template are copied over, and the buildkit.conf file is modified for the specified I. + +=item B + +Reads the buildkit.conf file, verifies that the file syntax is correct and that all specified files exist. + +=item B + +Reads the buildkit.conf file, lists all Kit package repositories listed in the file, and reports the build status for each repository. + +=item B {I | B} + +Reads the buildkit.conf file, and builds the specified Kit package repository. The built packages are placed in the directory /build/kit_repodir/I. If B is specified, all kit repositories are built. + +=item B {I | B} + +Reads the buildkit.conf file, and deletes all the package files and package meta data files from the /build/kit_repodir/I directory. If B is specified, all kit repository files are deleted. + +=item B + +Reads the buildkit.conf file, validates that all kit repositories have been built, and builds the Kit tar file /I.tar.bz2. + +=item B + +Reads the /buildkit.conf file and I the following: + +=over 4 + +- Kit tar files matching /I. + +- /build/I + +- /rpmbuild + +- /tmp + +- /debbuild + +=back + +Caution: Make sure you back up any tar files you would like to keep before running this subcommand. + +=item B + +Equivalent to running B and B. + +=item B + +I {B<-p> | B<--pkgdir> I} [B<-k> | B<--kitversion> I] [B<-r> | B<--kitrelease> I] + +Add product package rpms to a previously built kit tar file. This is used for partial product kits that are built and shipped separately from the product packages, and are identified with a I name of I.B. Optionally, change the kit release and version values when building the new kit tarfile. If kitcomponent version and/or release values are defaulted to the kit values, those will also be changed and new kitcomponent rpms will be built. If kit or kitcomponent scripts, plugins, or other files specify name, release, or version substitution strings, these will all be replaced with the new values when built into the new complete kit tarfile I/I.B. + +=back + +=head1 RETURN VALUE + +=over 3 + +=item 0 + +The command completed successfully. + +=item 1 + +An error has occurred. + +=back + +=head1 EXAMPLES + +=over 3 + +=item 1. + +To create the sample kit shipped with the xCAT-buildkit rpm on a RHELS 6.3 server and naming it B, run the following commands: + +B + +B + +B + +B + +B + +B + +B + +B + +=item 2. + +To clean up a kit repository directory after build failures on a RHELS 6.3 server to prepare for a new kit repository build, run: + +B + +=item 3. + +To clean up all kit build files, including a previously built kit tar file, run + +B + +=item 4. + +To create a kit named "tstkit" located in /home/foobar/tstkit instead of the current working directory. + +B + +=back + +=head1 FILES + +/opt/xcat/bin/buildkit + +/opt/xcat/share/xcat/kits/kit_template + +/opt/xcat/share/xcat/kits/kitcomponent.spec.template + +/buildkit.conf + +/build/I/kit.conf + +/I.tar.bz2 + + +=head1 SEE ALSO + +addkit(1), lskit(1), rmkit(1), addkitcomp(1), rmkitcomp(1), chkkitcomp(1) + diff --git a/xCAT-client/pods/man1/addkit.1.pod b/xCAT-client/pods/man1/addkit.1.pod new file mode 100644 index 000000000..f07bddf3c --- /dev/null +++ b/xCAT-client/pods/man1/addkit.1.pod @@ -0,0 +1,79 @@ +=head1 NAME + +B - Adds product software Kits to an xCAT cluster environmnet. + +=head1 SYNOPSIS + +B [B<-?>|B<-h>|B<--help>] [B<-v>|B<--version>] + +B [B<-i>|B<--inspection>] I + +B [B<-V>|B<--verbose>] [B<-p>|B<--path> I] I + +=head1 DESCRIPTION + +The B command installs a kit on the xCAT management node from a kit tarfile or directory. +It creates xCAT database definitions for the kit, kitrepo, and kitcomponent. + +B xCAT Kit support is ONLY available for Linux operating systems. + +=head1 OPTIONS + +=over 10 + +=item B<-h|--help> + +Display usage message. + +=item B<-V|--verbose> + +Verbose mode. + +=item B<-v|--version> + +Command version. + +=item B<-i|--inspection> + +Show the summary of the given kits + +=item B<-p|--path> I + +The destination directory to which the contents of the kit tarfiles and/or kit deploy directories will be copied. When this option is not specified, the default destination directory will be formed from the installdir site attribute with ./kits subdirectory. + +=item I + +A comma delimited list of kit_tarball_files or kit_deploy_directories to be added to the xCAT environment. Each entry can be an absolute or relative path. See xCAT documentation for more information on building kits. + +=back + +=head1 RETURN VALUE + +0 The command completed successfully. + +1 An error has occurred. + +=head1 EXAMPLES + +1. To add kits from tarball files: + + addkit kit-test1.tar.bz2,kit-test2.tar.bz2 + +2. To add kits from directories: + + addkit kit-test1,kit-test2 + +3. To add kits from tarball I to target path I: + + addkit -p /install/test kit-test1.tar.bz2 + +4. To see general information about kit I without adding the kit to xCAT: + + addkit -i kit-test1.tar.bz2 + + +=head1 SEE ALSO + +L, L, L, L, L + + diff --git a/xCAT-client/pods/man1/addkitcomp.1.pod b/xCAT-client/pods/man1/addkitcomp.1.pod new file mode 100644 index 000000000..99b138700 --- /dev/null +++ b/xCAT-client/pods/man1/addkitcomp.1.pod @@ -0,0 +1,90 @@ +=head1 NAME + +B - Assign Kit components to an xCAT osimage. + +=head1 SYNOPSIS + +B [B<-?>|B<-h>|B<--help>] [B<-v>|B<--version>] + +B [B<-V>|B<--verbose>] [B<-a>|B<--adddeps>] [B<-f>|B<--force>] [B<-n>|B<--noupgrade>] [B<--noscripts>] B<-i> I I + +=head1 DESCRIPTION + +The B command will assign kit components to an xCAT osimage. The kit component meta rpm, package rpm and deploy parameters will be added to osimage's otherpkg.pkglist and postbootscripts will be added to osimages's postbootscripts attribute. + +B xCAT Kit support is ONLY available for Linux operating systems. + +=head1 OPTIONS + +=over 10 + +=item B<-a|--adddeps> + +Assign kitcomponent dependencies to the osimage. + +=item B<-h|--help> + +Display usage message. + +=item B<-V|--verbose> + +Verbose mode. + +=item B<-v|--version> + +Command version. + +=item B<-f|--force> + +Add kit component to osimage even if there is a mismatch in OS, version, arch, serverrole, or kitcompdeps + +=item B<-i> I + +The osimage name that the kit component is assigning to. + +=item B<-n|--noupgrade> + +1. Allow multiple versions of kitcomponent to be installed into the osimage, instead of kitcomponent upgrade. + +2. Kit components added by addkitcomp -n will be installed separately behind all other ones which have been added. + +=item B<--noscripts> + +Do not add kitcomponent's postbootscripts to osimage + +=item I + +A comma-delimited list of valid full kit component names or kit component basenames that are to be added to the osimage. + +=back + +=head1 RETURN VALUE + +0 The command completed successfully. + +1 An error has occurred. + +=head1 EXAMPLES + +1. To add a single kit component to osimage "rhels6.2-ppc64-netboot-compute": + + addkitcomp -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 + +2. To add a kit component to osimage with dependencies, use the -a (addeps) option: + + addkitcomp -a -i rhels6.2-ppc64-netboot-compute comp-test2-1.0-1-rhels-6.2-ppc64 + +3. To add a kit component to osimage with incompatable osarch, osversion or ostype, use the -f (force) option: + + addkitcomp -f -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 + +4. To add a new version of kit component to osimage without upgrade, use the -n (noupgrade) option: + + addkitcomp -n -i rhels6.2-ppc64-netboot-compute comp-test2-1.0-1-rhels-6.2-ppc64 + + +=head1 SEE ALSO + +L, L, L, L, L + + diff --git a/xCAT-client/pods/man1/chkkitcomp.1.pod b/xCAT-client/pods/man1/chkkitcomp.1.pod new file mode 100644 index 000000000..8df706a6e --- /dev/null +++ b/xCAT-client/pods/man1/chkkitcomp.1.pod @@ -0,0 +1,61 @@ +=head1 NAME + +B - Check if Kit components are compatible with an xCAT osimage. + +=head1 SYNOPSIS + +B [B<-?>|B<-h>|B<--help>] [B<-v>|B<--version>] + +B [B<-V>|B<--verbose>] B<-i> I I + +=head1 DESCRIPTION + +The B command will check if the kit components are compatible with the xCAT osimage. + +This command will ignore the current osimage.kitcomponents setting and check if the kitcompname_list is compatible with the osimage and kit component dependencies. + +B xCAT Kit support is ONLY available for Linux operating systems. + +=head1 OPTIONS + +=over 10 + +=item B<-h|--help> + +Display usage message. + +=item B<-V|--verbose> + +Verbose mode. + +=item B<-v|--version> + +Command version. + +=item B<-i> I + +The name of the osimage to check against. + +=item I + +A comma-delimited list of valid full kit component names or kit component basenames that are to be checked against the osimage. + +=back + +=head1 RETURN VALUE + +0 The command completed successfully. + +1 An error has occurred. + +=head1 EXAMPLES + +1. To check if a kit component, I can be added to osimage I: + + chkkitcomp -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 + + + +=head1 SEE ALSO + +L, L, L, L, L diff --git a/xCAT-client/pods/man1/lskit.1.pod b/xCAT-client/pods/man1/lskit.1.pod new file mode 100644 index 000000000..fe450efc4 --- /dev/null +++ b/xCAT-client/pods/man1/lskit.1.pod @@ -0,0 +1,168 @@ +=head1 NAME + +B - Lists information for one or more Kits. + + +=head1 SYNOPSIS + +B [B<-V> | B<--verbose>] [B<-F> | B<--framework> I] [B<-x> | B<--xml> | B<--XML>] [B<-K> | B<--kitattr> I] [B<-R> | B<--repoattr> I] [B<-C> | B<--compattr> I] [I] + +B [B<-?> | B<-h> | B<--help> | B<-v> | B<--version>] + +B [B<-F> | B<--framework> I] + + +=head1 DESCRIPTION + +The B command is used to list information for one or more kits. A kit is a special kind of package that is used to install a software product on one or more nodes in an xCAT cluster. + +Note: The xCAT support for Kits is only available for Linux operating systems. + +The B command outputs the following info for each kit: the kit's basic info, the kit's repositories, and the kit's components. The command outputs the info in two formats: human-readable format (default), and XML format. Use the -x option to view the info in XML format. + +Input to the command can specify any number or combination of the input options. + +=head1 OPTIONS + +=over 10 + +=item B<-F|--framework> I + +Use this option to display the framework values of the specified Kit tarfile. This information is retreived directly from the tarfile and can be done before the Kit has been defined in the xCAT database. This option cannot be combined with other options. + +=item B<-K|--kitattr> I + +Where I is a comma-delimited list of kit attribute names. The names correspond to attribute names in the B table. The B command will only display the specified kit attributes. + + +=item B<-R|--repoattr> I + +Where I is a comma-delimited list of kit repository attribute names. The names correspond to attribute names in the B table. The B command will only display the specified kit repository attributes. + + +=item B<-C|--compattr> I + +where I is a comma-delimited list of kit component attribute names. The names correspond to attribute names in the B table. The B command will only display the specified kit component attributes. + + +=item I + +is a comma-delimited list of kit names. The B command will only display the kits matching these names. + + +=item B<-x|--xml|--XML> + +Need XCATXMLTRACE=1 env when using -x|--xml|--XML, for example: XCATXMLTRACE=1 lskit -x testkit-1.0.0 +Return the output with XML tags. The data is returned as: + + + + ... + + + ... + + + ... + + + +Each tag contains info for one kit. The info inside is structured as follows: + + The sub-tag contains the kit's basic info. + The sub-tags store info about the kit's repositories. + The sub-tags store info about the kit's components. + +The data inside is returned as: + + + + ... + + + + ... + + ... + + + ... + + ... + + + +=item B<-V|--verbose> + +Display additional progress and error messages. + +=item B<-v|--version> + +Command Version. + +=item B<-?|-h|--help> + +Display usage message. + +=back + +=head1 RETURN VALUE + +=over 3 + +=item 0 +The command completed successfully. + +=item 1 +An error has occurred. + +=back + + +=head1 EXAMPLES + +=over 3 + +=item 1. +To list all kits, enter: + + lskit + +=item 2. +To list the kit "kit-test1-1.0-Linux", enter: + + lskit kit-test1-1.0-Linux + +=item 3. +To list the kit "kit-test1-1.0-Linux" for selected attributes, enter: + + lskit -K basename,description -R kitreponame -C kitcompname kit-test1-1.0-Linux + +=item 4. +To list the framework value of a Kit tarfile. + + lskit -F /myhome/mykits/pperte-1.3.0.2-0-x86_64.tar.bz2 + +Output is similar to: + + Extracting the kit.conf file from /myhome/mykits/pperte-1.3.0.2-0-x86_64.tar.bz2. Please wait. + + kitframework=2 + compatible_kitframeworks=0,1,2 + +=item 5. +To list kit "testkit-1.0-1" with XML tags, enter: + + XCATXMLTRACE=1 lskit -x testkit-1.0-1 + +=back + + +=head1 FILES + +/opt/xcat/bin/lskit + +=head1 SEE ALSO + +L, L, L, L, L, L + diff --git a/xCAT-client/pods/man1/lskitcomp.1.pod b/xCAT-client/pods/man1/lskitcomp.1.pod new file mode 100644 index 000000000..46a90fa3d --- /dev/null +++ b/xCAT-client/pods/man1/lskitcomp.1.pod @@ -0,0 +1,156 @@ +=head1 NAME + +B - Used to list information for one or more kit components. + + +=head1 SYNOPSIS + +B [B<-V> | B<--verbose>] [B<-x> | B<--xml> | B<--XML>] [B<-C> | B<--compattr> I] [B<-O> | B<--osdistro> I] [B<-S> | B<--serverrole> I] [I] + +B [B<-?> | B<-h> | B<--help> | B<-v> | B<--version>] + + +=head1 DESCRIPTION + +The B command is used to list information for one or more kit components. A kit is made up of one or more kit components. Each kit component is a meta package used to install a software product component on one or more nodes in an xCAT cluster. + +The B command outputs the kit component info in two formats: human-readable format (default), and XML format. Use the -x option to view the info in XML format. + +Input to the command can specify any number or combination of the input options. + +Note: The xCAT support for Kits is only available for Linux operating systems. + +=head1 OPTIONS + +=over 10 + +=item B<-C|--compattr> I + +where I is a comma-delimited list of kit component attribute names. The names correspond to attribute names in the B table. The B command will only display the specified kit component attributes. + +=item B<-O|--osdistro> I + +where I is the name of an osdistro in B table. The B command will only display the kit components matching the specified osdistro. + +=item B<-S|--serverrole> I + +where I is the name of a server role. The typical server roles are: mgtnode, servicenode, computenode, loginnode, storagennode. The B command will only display the kit components matching the specified server role. + +=item I + +is a comma-delimited list of kit component names. The B command will only display the kit components matching the specified names. + +=item B<-x|--xml|--XML> + +Need XCATXMLTRACE=1 env when using -x|--xml|--XML. +Return the output with XML tags. The data is returned as: + + + + ... + + + ... + + + ... + + + +Each tag contains info for a group of kit components belonging to the same kit. The info inside is structured as follows: + + The sub-tag contains the kit's name. + The sub-tags store info about the kit's components. + +The data inside is returned as: + + + + ... + + + + ... + + ... + + + +=item B<-V|--verbose> + +Display additional progress and error messages. + +=item B<-v|--version> + +Command Version. + +=item B<-?|-h|--help> + +Display usage message. + +=back + +=head1 RETURN VALUE + +=over 3 + +=item 0 +The command completed successfully. + +=item 1 +An error has occurred. + +=back + + +=head1 EXAMPLES + +=over 3 + +=item 1. + +To list all kit components, enter: + + lskitcomp + +=item 2. + +To list the kit component "comp-server-1.0-1-rhels-6-x86_64", enter: + + lskitcomp comp-server-1.0-1-rhels-6-x86_64 + +=item 3. + +To list the kit component "comp-server-1.0-1-rhels-6-x86_64" for selected kit component attributes, enter: + + lskitcomp -C kitcompname,desc comp-server-1.0-1-rhels-6-x86_64 + +=item 4. + +To list kit components compatible with "rhels-6.2-x86_64" osdistro, enter: + + lskitcomp -O rhels-6.2-x86_64 + +=item 5. + +To list kit components compatible with "rhels-6.2-x86_64" osdistro and "computenode" server role, enter: + + lskitcomp -O rhels-6.2-x86_64 -S computenode + +=item 6. + +To list the kit component "testkit-compute-1.0-1-ubuntu-14.04-ppc64el" with XML tags, enter: + + XCATXMLTRACE=1 lskitcomp -x testkit-compute-1.0-1-ubuntu-14.04-ppc64el + +=back + + +=head1 FILES + +/opt/xcat/bin/lskitcomp + +=head1 SEE ALSO + +L, L, L, L, L, L + diff --git a/xCAT-client/pods/man1/lskitdeployparam.1.pod b/xCAT-client/pods/man1/lskitdeployparam.1.pod new file mode 100644 index 000000000..1ce466a5c --- /dev/null +++ b/xCAT-client/pods/man1/lskitdeployparam.1.pod @@ -0,0 +1,107 @@ +=head1 NAME + +B - Lists the deployment parameters for one or more Kits or Kit components + + +=head1 SYNOPSIS + +B [B<-V> | B<--verbose>] [B<-x> | B<--xml> | B<--XML>] [B<-k> | B<--kitname> I] [B<-c> | B<--compname> I] + +B [B<-?> | B<-h> | B<--help> | B<-v> | B<--version>] + + +=head1 DESCRIPTION + +The B command is used to list the kit deployment parameters for one or more kits, or one or more kit components. Kit deployment parameters are used to customize the installation or upgrade of kit components. + +The B command outputs the kit component information in two formats: human-readable format (default), and XML format. Use the -x option to view the information in XML format. + +Input to the command can specify any combination of the input options. + +Note: The xCAT support for Kits is only available for Linux operating systems. + +=head1 OPTIONS + +=over 10 + +=item B<-k|--kitname> I + +Where I is a comma-delimited list of kit names. The B command will only display the deployment parameters for the kits with the matching names. + +=item B<-c|--compname> I + +Where I is a comma-delimited list of kit component names. The B command will only display the deployment parameters for the kit components with the matching names. + +=item B<-x|--xml|--XML> + +Return the output with XML tags. The data is returned as: + + + + KIT_KIT1_PARAM1 + value11 + + + + + KIT_KIT1_PARAM2 + value12 + + + ... + +=item B<-V|--verbose> + +Display additional progress and error messages. + +=item B<-v|--version> + +Command Version. + +=item B<-?|-h|--help> + +Display usage message. + +=back + + +=head1 RETURN VALUE + +=over 3 + +=item 0 +The command completed successfully. + +=item 1 +An error has occurred. + +=back + + +=head1 EXAMPLES + +=over 3 + +=item 1. + +To list kit deployment parameters for kit "kit-test1-1.0-Linux", enter: + + lskitdeployparam -k kit-test1-1.0-Linux + +=item 2. + +To list kit deployment parameters for kit component "comp-server-1.0-1-rhels-6-x86_64", enter: + + lskitdeployparam -c comp-server-1.0-1-rhels-6-x86_64 + +=back + + +=head1 FILES + +/opt/xcat/bin/lskitdeployparam + +=head1 SEE ALSO + +L, L, L, L, L, L + diff --git a/xCAT-client/pods/man1/rmkit.1.pod b/xCAT-client/pods/man1/rmkit.1.pod new file mode 100644 index 000000000..c9d8cb4a8 --- /dev/null +++ b/xCAT-client/pods/man1/rmkit.1.pod @@ -0,0 +1,83 @@ +=head1 NAME + +B - Remove Kits from xCAT + +=head1 SYNOPSIS + +B [B<-?>|B<-h>|B<--help>] [B<-v>|B<--version>] + +B [B<-V>|B<--verbose>] [B<-f>|B<--force>] [B<-t>|B<--test>] I + +=head1 DESCRIPTION + +The B command removes kits on the xCAT management node from kit names. + +Note: The xCAT support for Kits is only available for Linux operating systems. + +=head1 OPTIONS + +=over 10 + +=item B<-h|--help> + +Display usage message. + +=item B<-V|--verbose> + +Verbose mode. + +=item B<-v|--version> + +Command version. + +=item B<-f|--force> + +Remove this kit even there is any component in this kit is listed by osimage.kitcomponents. If this option is not specified, this kit will not be removed if any kit components listed in an osimage.kitcomponents + +=item B<-t|--test> + +Test if kitcomponents in this kit are used by osimage + +=item I + +A comma delimited list of kits that are to be removed from the xCAT cluster. Each entry can be a kitname or kit basename. For kit basename, rmkit command will remove all the kits that have that kit basename. + +=back + +=head1 RETURN VALUE + +0 The command completed successfully. + +1 An error has occurred. + +=head1 EXAMPLES + +1. To remove two kits from tarball files. + + rmkit kit-test1,kit-test2 + +Output is similar to: + + Kit kit-test1-1.0-Linux,kit-test2-1.0-Linux was successfully removed. + +2. To remove two kits from tarball files even the kit components in them are still being used by osimages. + + rmkit kit-test1,kit-test2 --force + +Output is similar to: + + Kit kit-test1-1.0-Linux,kit-test2-1.0-Linux was successfully removed. + +3. To list kitcomponents in this kit used by osimage + + rmkit kit-test1,kit-test2 -t + +Output is similar to: + + kit-test1-kitcomp-1.0-Linux is being used by osimage osimage-test + Following kitcomponents are in use: kit-test1-kitcomp-1.0-Linux + +=head1 SEE ALSO + +L, L, L, L, L + diff --git a/xCAT-client/pods/man1/rmkitcomp.1.pod b/xCAT-client/pods/man1/rmkitcomp.1.pod new file mode 100644 index 000000000..5484300dc --- /dev/null +++ b/xCAT-client/pods/man1/rmkitcomp.1.pod @@ -0,0 +1,90 @@ +=head1 NAME + +B - Remove Kit components from an xCAT osimage. + +=head1 SYNOPSIS + +B [B<-?>|B<-h>|B<--help>] [B<-v>|B<--version>] + +B [B<-V>|B<--verbose>] [B<-u>|B<--uninstall>] [B<-f>|B<--force>] [B<--noscripts>] B<-i> I I + +=head1 DESCRIPTION + +The B command removes kit components from an xCAT osimage. All the kit component attribute values that are contained in the osimage will be removed, and the kit component meta rpm and package rpm could be uninstalled by B<-u|--uninstall> option. + +Note: The xCAT support for Kits is only available for Linux operating systems. + +=head1 OPTIONS + +=over 10 + +=item B<-u|--uninstall> + +All the kit component meta rpms and package rpms in otherpkglist will be uninstalled during genimage for stateless image and updatenode for stateful nodes. + +=item B<-h|--help> + +Display usage message. + +=item B<-V|--verbose> + +Verbose mode. + +=item B<-v|--version> + +Command version. + +=item B<-f|--force> + +Remove this kit component from osimage no matter it is a dependency of other kit components. + +=item B<--noscripts> + +Do not remove kitcomponent's postbootscripts from osimage + +=item B<-i> I + +osimage name that include this kit component. + +=item I + +A comma-delimited list of valid full kit component names or kit component basenames that are to be removed from the osimage. If a basename is specified, all kitcomponents matching that basename will be removed from the osimage. + +=back + +=head1 RETURN VALUE + +0 The command completed successfully. + +1 An error has occurred. + +=head1 EXAMPLES + +1. To remove a kit component from osimage + + rmkitcomp -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 + +Output is similar to: + + kitcomponents comp-test1-1.0-1-rhels-6.2-ppc64 were removed from osimage rhels6.2-ppc64-netboot-compute successfully + +2. To remove a kit component even it is still used as a dependency of other kit component. + + rmkitcomp -f -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 + +Output is similar to: + + kitcomponents comp-test1-1.0-1-rhels-6.2-ppc64 were removed from osimage rhels6.2-ppc64-netboot-compute successfully + +3. To remove a kit component from osimage and also remove the kit component meta RPM and package RPM. So in next genimage for statelss image and updatenode for stateful nodes, the kit component meta RPM and package RPM will be uninstalled. + + rmkitcomp -u -i rhels6.2-ppc64-netboot-compute comp-test1-1.0-1-rhels-6.2-ppc64 + +Output is similar to: + + kitcomponents comp-test1-1.0-1-rhels-6.2-ppc64 were removed from osimage rhels6.2-ppc64-netboot-compute successfully + + +=head1 SEE ALSO + +L, L, L, L, L From 1ae5c2f0e6df991108094f6c3e44b77c2ab74f75 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 3 Oct 2019 11:46:20 -0400 Subject: [PATCH 245/276] Revert "Remove buildkit file" This reverts commit 6e168ebe71481711085bbfa72bc882f6fc4ae9f8. --- xCAT-buildkit/bin/buildkit | 4142 ++++++++++++++++++++++++++++++ xCAT-buildkit/xCAT-buildkit.spec | 14 + 2 files changed, 4156 insertions(+) create mode 100755 xCAT-buildkit/bin/buildkit diff --git a/xCAT-buildkit/bin/buildkit b/xCAT-buildkit/bin/buildkit new file mode 100755 index 000000000..eb119cde1 --- /dev/null +++ b/xCAT-buildkit/bin/buildkit @@ -0,0 +1,4142 @@ +#!/usr/bin/env perl +# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html +# + +#----------------------------------------------------------------------------- + +=head1 buildkit + + xCAT/PCM Kit Build utilities + +This script is designed to run on a non-xCAT system so that Kits can be +built on any product build machine. + +=cut + +BEGIN +{ + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; + $::XCATDIR = $ENV{'XCATDIR'} ? $ENV{'XCATDIR'} : '/etc/xcat'; + $::XCATSHARE = $::XCATROOT . '/share/xcat'; +} + +if ($^O =~ /^aix/i) { + print "ERROR - the buildkit command is not supported on AIX \n"; + exit 1; +} + +use lib "$::XCATROOT/lib/perl"; +require xCAT::BuildKitUtils; +use Getopt::Long; +use strict; +use Cwd; +use Cwd 'abs_path'; +use File::Path; +use File::Basename; + +#----------------------------------------------------------------------------- +# Main + +$::progname = "buildkit"; +$::buildkit_conf = "buildkit.conf"; +$::kit_conf = "kit.conf"; +$::current_dir = cwd(); + +# this code will build a kit using framework 1. +$::KITFRAMEWORK = "2"; + +# this code is compatible with other kits that are at framework 0 or 1. +$::COMPATIBLE_KITFRAMEWORKS = "0,1,2"; + +%::buildkit_def = ( + kit => { basename => { + description => 'The kit base name (e.g., kit-lsf)', + value_desc => 'Must be: Generic Name String', + mandatory => 1, + cp_to_kitconfig => 1 }, + description => { + description => 'The kit description', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 1 }, + version => { + description => 'The kit version (e.g., 9.0)', + value_desc => 'Must be: Generic Name String', + mandatory => 1, + cp_to_kitconfig => 1 }, + release => { + description => 'The kit release (e.g., 1)', + value_desc => 'Must be: Generic Name String', + mandatory => 0, + cp_to_kitconfig => 1 }, + ostype => { + description => 'The kit OS type (e.g., Linux)', + value_desc => 'Must be: OS Type String', + mandatory => 1, + cp_to_kitconfig => 1 }, + osbasename => { + description => 'The kit OS basename', + value_desc => 'Must be: Generic Name String', + mandatory => 0, + cp_to_kitconfig => 0 }, + osmajorversion => { + description => 'The kit OS majorversion', + value_desc => 'Must be: Generic Name String', + mandatory => 0, + cp_to_kitconfig => 0 }, + osminorversion => { + description => 'The kit OS minorversion', + value_desc => 'Must be: Generic Name String', + mandatory => 0, + cp_to_kitconfig => 0 }, + osarch => { + description => 'The kit OS architecture', + value_desc => 'Must be: Generic Name String', + mandatory => 0, + cp_to_kitconfig => 0 }, + isinternal => { + description => 'Flag to say if this Kit is used for internal use only. It is only used for information purposes.', + value_desc => 'Must be: empty string or boolean string', + mandatory => 0, + cp_to_kitconfig => 1 }, + kitdeployparams => { + description => 'The path to the Kit Deployment Parameters file.', + value_desc => 'Must be: empty string or relative path string', + mandatory => 0, + base_dir => 'other_files', + cp_to_kitconfig => 2 }, # 2 = rename with KIT_KITNAME_ on cp + kitlicense => { + description => 'The Kit license string to be built into all kitcomponent packages.', + value_desc => 'any string', + mandatory => 1, + cp_to_kitconfig => 0 }, + kittarfilename => { + description => 'The filename to use for the generated kit.', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 }, + vendor => { + description => 'The Vendor value to use when building the rpms.', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 }, + packager => { + description => 'The Packager value to use when building the rpms.', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 }, + url => { + description => 'The URL value to use when building the rpms.', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 } }, + kitrepo => { kitrepoid => { + description => 'The Kit Package Repository ID. (e.g., rhels-6.2-x86_64)', + value_desc => 'Must be: Generic Name String, unique in kit', + mandatory => 1, + cp_to_kitconfig => 0 }, + osbasename => { + description => 'The OS distro base name (e.g., rhels)', + value_desc => 'Must be OS Name String', + mandatory => 1, + cp_to_kitconfig => 1 }, + osmajorversion => { + description => 'The OS distro major version (e.g., 6)', + value_desc => 'Must be Generic Number String', + mandatory => 1, + cp_to_kitconfig => 1 }, + osminorversion => { + description => 'The OS distro minor version (e.g., 3)', + value_desc => 'Must be Generic Number String', + mandatory => 0, + cp_to_kitconfig => 1 }, + osarch => { + description => 'The OS distro architecture (e.g., x86_64)', + value_desc => 'Must be OS Arch String', + mandatory => 1, + cp_to_kitconfig => 1 }, + compat_osbasenames => { + description => 'Comma-separated list of compatible OS base names. ', + value_desc => 'Must be Empty String or list of OS Name Strings', + mandatory => 0, + cp_to_kitconfig => 1 } }, + kitcomponent => { basename => { + description => 'The component name. It is used as the meta-package name.', + value_desc => 'any string', + mandatory => 1, + cp_to_kitconfig => 1 }, + description => { + description => 'The component description. The description is added to the meta-package.', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 1 }, + version => { + description => 'The component version (e.g., 9.0). It is used as the meta-package version.', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 1 }, + release => { + description => 'The component release number (e.g., 1). It is used as the meta-package release number.', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 1 }, + serverroles => { + description => 'tbd', + value_desc => 'any string', + mandatory => 1, + cp_to_kitconfig => 1 }, + kitrepoid => { + description => 'tbd', + value_desc => 'any string', + mandatory => 1, + cp_to_kitconfig => 0 }, + kitcompdeps => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 1 }, + ospkgdeps => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 }, + kitpkgdeps => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 1 }, + non_native_pkgs => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 }, + driverpacks => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 1 }, + exlist => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + base_dir => 'other_files', + cp_to_kitconfig => 2 }, + preinstall => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 }, + postinstall => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 }, + preuninstall => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 }, + postuninstall => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 }, + preupgrade => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 }, + postupgrade => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 }, + postbootscripts => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + base_dir => 'scripts', + cp_to_kitconfig => 2 }, + genimage_postinstall => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + base_dir => 'scripts', + cp_to_kitconfig => 2 } }, + kitpackage => { filename => { + description => 'tbd', + value_desc => 'any string', + mandatory => 1, + cp_to_kitconfig => 0 }, + kitrepoid => { + description => 'tbd', + value_desc => 'any string', + mandatory => 1, + cp_to_kitconfig => 0 }, + rpm_spec => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 }, + rpm_srcdir => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 }, + rpm_srctarball => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 }, + rpm_srpm => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 }, + rpm_prebuiltdir => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 }, + isexternalpkg => { + description => 'tbd', + value_desc => 'any string', + mandatory => 0, + cp_to_kitconfig => 0 } } +); + + +my $args = join ' ', @ARGV; +$::command = "$0 $args"; +Getopt::Long::Configure("bundling"); +$Getopt::Long::ignorecase = 0; + +# parse the options +if ( + !GetOptions( + 'h|help' => \$::HELP, + 'v|version' => \$::VERSION, + 'V|verbose' => \$::VERBOSE, + 'n|noprerequisite' => \$::PREREQUISITE, + 'p|pkgdir=s' => \$::PKGDIR, + 'k|kitversion=s' => \$::KITVERSION, + 'r|kitrelease=s' => \$::KITRELEASE, + 'l|kitloc=s' => \$::KITLOC, + 'for=s' => \$::FOROSVERSARCH, + ) + ) +{ + &usage; + exit(1); +} + +# display the usage if -h or --help is specified +if ($::HELP) +{ + &usage; + exit(0); +} + +my $debianflag = 0; +my $dpkg_flag = '-uc -us'; +my $tempstring = xCAT::BuildKitUtils->osver(); +if ($tempstring =~ /debian/ || $tempstring =~ /ubuntu/) { + $debianflag = 1; +} + +# This is an undocumented flag to support our local build team +# to allow building Ubuntu kits on our RH build machines. +# It requires RH rpms such as dep, fakeroot, perl-File-DesktopEntry, +# perl-File-BaseDir, and html2text to be installed on the build server +# for this to work. To use this flag: +# buildkit --for ubuntu buildrepo +# buildkit --for ubuntu buildtar +if ($::FOROSVERSARCH) { + if ($::FOROSVERSARCH =~ /debian/ || $::FOROSVERSARCH =~ /ubuntu/) { + $debianflag = 1; + $dpkg_flag .= ' -A -d'; + } +} + +# display the version statement if -v or --version is specified +if ($::VERSION) +{ + my $versioncmd = "rpm -q --qf \"%{NAME}: %{VERSION}-%{RELEASE} \n\" xCAT-buildkit"; + my $message = "Error quering xCAT-buildkit rpm. Version info is not available. \n"; + if ($debianflag) { + + $versioncmd = "dpkg-query --show -f='\${binary:Package}: \${Version}\n' xcat-buildkit"; + $message = "Error quering xcat-buildkit package. Version info is not available. \n"; + } + if (system($versioncmd)) { + + # non-zero return from system call + print $message; + exit 1; + } + + # add framework info to output + print "\tkitframework = $::KITFRAMEWORK\n"; + print "\tcompatible_frameworks = $::COMPATIBLE_KITFRAMEWORKS\n"; + + exit 0; +} + +my $arg = shift(@ARGV); +if (!$arg) { + &usage; + exit(0); +} + +# set kit location +if ($::KITLOC) { + $::workdir = $::KITLOC; + $::current_dir = $::workdir; +} else { + $::workdir = $::current_dir; +} + +$::full_buildkit_conf = $::workdir . "/" . $::buildkit_conf; +$::build_dir = $::workdir . "/build"; +$::deploy_dir = $::build_dir; #kitname appended by validate_bldkitconf routine +$::base_repodir = $::build_dir . "/kit_repodir"; + +while ($arg) { + my $command = $arg; + $command =~ tr/A-Z/a-z/; # convert to lowercase + if ($command eq 'create') { + $::KIT_CREATE = shift(@ARGV); + if ($::KITLOC) { + $::workdir = dirname($::KITLOC); + $::current_dir = $::workdir; + } + if (!$::KIT_CREATE) { + print "The Kit basename was not specified for the buildkit create command.\n"; + &usage; + exit 1; + } + } elsif ($command eq 'chkconfig') { + $::KIT_CHKCONFIG = 1; + } elsif ($command eq 'buildrepo') { + $::KIT_BUILDREPO = shift(@ARGV); + if (!$::KIT_BUILDREPO) { + print "The Kit package repository name was not specified for buildkit buildrepo command.\n"; + &usage; + exit 1; + } + } elsif ($command eq 'listrepo') { + $::KIT_LISTREPO = 1; + } elsif ($command eq 'cleanrepo') { + $::KIT_CLEANREPO = shift(@ARGV); + if (!$::KIT_CLEANREPO) { + print "kit package repository name not specified for buildkit cleanrepo command \n"; + &usage; + exit 1; + } + } elsif ($command eq 'buildtar') { + $::KIT_BUILDTAR = 1; + } elsif ($command eq 'cleantar') { + $::KIT_CLEANTAR = 1; + } elsif ($command eq 'cleanall') { + $::KIT_CLEANALL = 1; + } elsif ($command eq 'addpkgs') { + $::KIT_ADDPKGS = shift(@ARGV); + if (!($::KIT_ADDPKGS)) { + print "Missing parameter: the name must be specified when using the \'buildkit addpkgs\' command.\n"; + &usage; + exit(1); + } + if (!($::PKGDIR)) { + print "Missing option: the -p option must be specified with \'buildkit addpkgs\' command. \n"; + &usage; + exit(1); + } + } else { + print "The buildkit command $arg is not recognized.\n"; + &usage; + exit(1); + } + $arg = shift(@ARGV); +} + +my $rc = 0; +if ($::KIT_CREATE) { + $rc = &kit_create; +} +if ($::KIT_CHKCONFIG) { + unless ($rc = &kit_chkconfig) { + print "No errors were found in Kit Build File $::full_buildkit_conf. \n"; + } +} +if ($::KIT_LISTREPO) { + unless ($rc = &kit_chkconfig) { $rc = &kit_listrepo; } +} +if ($::KIT_BUILDREPO) { + unless ($rc = &kit_chkconfig) { $rc = &kit_buildrepo; } +} +if ($::KIT_CLEANREPO) { + unless ($rc = &kit_chkconfig) { $rc = &kit_cleanrepo; } +} +if ($::KIT_BUILDTAR) { + unless ($rc = &kit_chkconfig) { $rc = &kit_buildtar; } +} +if ($::KIT_CLEANTAR) { + unless ($rc = &kit_chkconfig) { $rc = &kit_cleantar; } +} +if ($::KIT_CLEANALL) { + unless ($rc = &kit_chkconfig) { $rc = &kit_cleanall; } +} +if ($::KIT_ADDPKGS) { $rc = &kit_addpkgs; } + +exit $rc; + +##################################### +# subroutines +##################################### + +#----------------------------------------------------------------------------- + +=head3 usage + + Displays message for -h option + +=cut + +#----------------------------------------------------------------------------- +sub usage +{ + print "Usage: + buildkit [-?│-h│--help] [-v│--version] + + To build a new Kit + + buildkit [-V│--verbose] [] [│all] + [-l│--kitloc ] + + To add packages to an existing Kit. + + buildkit [-V│--verbose] addpkgs [-p│--pkgdir ] [-k│--kitversion ] [-r│--kitrelease ] + + This tool is used to build and manage a Kit package. + The options are: + -h - Provide usage info. + -k - Kit version. + -l - Location of kit files. (Including kit name.) + -p - RPM package directory locations. + -r - Kit release. + -v - Provide the version info. + command - Several commands are supported. See the list below. + -V - Verbose mode. Outputs additional debug messages. + + Supported subcommands: + create - creates a new Kit with the specified basename + chkconfig - checks the Kit build file + listrepo - lists the Kit package repositories in the Kit + build file, and their build status + buildrepo - builds the specified Kit package repository + buildrepo all - builds all the Kit package repositories + cleanrepo - deletes the build files for the specified Kit + package repository + cleanrepo all - deletes the build files for all Kit package + repositories + buildtar - builds the Kit tarfile + cleantar - deletes the Kit deployment directory and Kit + tarfile + cleanall - equivalent to buildkit cleanrepo all and + buildkit cleantar + addpkgs -p + - add product package rpms to a shipped tarfile + named kitname.NEEDS_PRODUCT_PKGS.tar.bz2 + \n"; +} + +#----------------------------------------------------------------------------- + +=head3 kit_create + + buildkit create + +=cut + +#----------------------------------------------------------------------------- + +sub kit_create + +{ + # create Kit directory in pwd + my $kitname = $::KIT_CREATE; + my $kitdir; + if ($::KITLOC) { + $kitdir = $::KITLOC; + } else { + $kitdir = $::workdir . "/$kitname"; + } + + if (-d $kitdir) { + print "Another directory already exists with the name $kitdir. Not able to create new Kit. \n"; + exit 1; + } + if (!mkdir($kitdir)) { + print "Error creating Kit directory $kitdir. Verify that the current user has privileges to create the directory. \n"; + exit 1; + } + + # Recursive copy the shipped template directory to the Kit directory + if (system("cp -fRp $::XCATSHARE/kits/kit_template/* $kitdir")) { + + # non-zero return from system call + print "Error copying sample Kit template files from $::XCAT_SHARE/kits/kit_template to $kitdir \n"; + exit 1; + } + + if (&edit_bldkitconf($kitdir . "/" . $::buildkit_conf, $kitname)) { + exit 1; + } + + print "Kit template for $kitname created in $kitdir directory \n"; + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 kit_chkconfig + + buildkit chkconfig + +=cut + +#----------------------------------------------------------------------------- + +sub kit_chkconfig + +{ + if ($::CHKCONFIG_DONE) { return 0; } + my $bldkitconf = $::full_buildkit_conf; + + my $chkrc = &load_bldkitconf($bldkitconf); + if ($chkrc != 0) { return 1; } + + $chkrc = &validate_bldkitconf(); + if ($chkrc != 0) { return 1; } + + $::CHKCONFIG_DONE = 1; + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 kit_buildrepo + + buildkit buildrepo + +=cut + +#----------------------------------------------------------------------------- + +sub kit_buildrepo +{ + my $rc = 0; + my $repoid = $::KIT_BUILDREPO; + + if (!$debianflag) { + + # Check if createrepo exists or not. Fail at the beginning. + #- don't use specific path - may not be correct in build env + my $rcmd = "createrepo -h > /dev/null"; + if (system($rcmd )) { + print "Error: the createrepo command does not seem to be installed. Make sure createrepo is installed before running the buildkit command. \n"; + return 1; + } + } + + $repoid =~ s/\s+//g; + $repoid =~ tr/A-Z/a-z/; # convert to lowercase + if ($repoid ne 'all') { + return &kit_buildrepo1($::KIT_BUILDREPO); + } else { + foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { + if (&kit_buildrepo1($kr->{kitrepoid})) { return 1; } + } + } + return $rc; +} + +#----------------------------------------------------------------------------- + +=head3 kit_buildrepo1 + + + +=cut + +#----------------------------------------------------------------------------- +sub kit_buildrepo1 +{ + my $rc = 0; + my $repoid = shift; + $repoid =~ s/\s+//g; + my $repodir = $::base_repodir; + my $srcdir = $::workdir . "/source_packages/"; + my $basedir = $repodir; + my $repo; + + # find the repo + my $found = 0; + foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { + if ($kr->{kitrepoid} eq $repoid) { + $found = 1; + $repo = $kr; + if (&validate_os($kr)) { + print "The buildrepo operation will continue, but errors may occur. You may need to run this command on a host with the same OS.\n"; + } + $repodir .= "/$kr->{kitreponame}"; + last; + } + } + if (!$found) { + print "The specified Kit Package Repository \"$repoid\" does not exist in the Kit Build File. \n"; + return 1; + } + + # Create repo build directory + if ((!-d $repodir) && (!mkpath($repodir))) { + print "Error creating build repository directory $repodir.\n"; + return 1; + } + + # Build kitpackages first + my $kitrepohash; + foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { + $kitrepohash->{ $kr->{kitrepoid} } = $kr->{kitreponame}; + } + + foreach my $kp (@{ $::bldkit_config->{kitpackage}{entries} }) { + + # For this kitrepo? + my $found = 0; + foreach my $kprid (split(/,/, $kp->{kitrepoid})) { + $kprid =~ s/\s+//g; + if ($repoid eq $kprid) { + $found = 1; + last; + } + } + if (!$found) { next; } + + # is this package already built? + my $rpm = "$repodir/$kp->{filename}"; + if (-r $rpm) { next; } + + my $kprid; + my $rpm_built; + foreach $kprid (split(/,/, $kp->{kitrepoid})) { + if ($repoid eq $kprid) { + next; + } + if ((-d "$basedir/$kitrepohash->{$kprid}") and (-f "$basedir/$kitrepohash->{$kprid}/$kp->{filename}")) { + $rpm_built = $kitrepohash->{$kprid}; + last; + } + } + + + # determine build method + if ($kp->{isexternalpkg} eq 'yes') { + if ($::VERBOSE) { print "skipping build of external kitpackage $kp->{filename} \n"; } + next; + } else { + if ($::VERBOSE) { print "building kitpackage $kp->{filename} \n"; } + } + if (defined($kp->{rpm_prebuiltdir})) { + + # simply copy the file to the build directory + my $full_prebuiltrpm = $srcdir . $kp->{rpm_prebuiltdir} . "/" . $kp->{filename}; + + if ($rpm_built) { + if (system("cd $repodir;ln -sf ../$rpm_built/$kp->{filename} $kp->{filename}")) { + + # non-zero return from system call + print "Error create symlink for prebuilt rpm $kp->{filename} to Kit Build directory. \n"; + return; + } + } else { + if (system("cp -fp $full_prebuiltrpm $repodir")) { + + # non-zero return from system call + print "Error copying prebuilt rpm $kp->{filename} to Kit Build directory. \n"; + return 1; + } + } + } elsif (defined($kp->{rpm_srpm})) { + + # run rpmbuild --rebuild on the source rpm + print "SKIPPING BUILD FOR KIT PACKAGE $kp->{filename} \n"; + print "TBD - only buildrepo for prebuilt rpms is available at this time \n\n"; + } elsif (defined($kp->{rpm_srctarball}) && + defined($kp->{rpm_spec})) { + + # run rpmbuild + print "SKIPPING BUILD FOR KIT PACKAGE $kp->{filename} \n"; + print "TBD - only buildrepo for prebuilt rpms is available at this time \n\n"; + } elsif (defined($kp->{rpm_srcdir}) && + defined($kp->{rpm_spec})) { + + # build tarfile and run rpmbuild + print "SKIPPING BUILD FOR KIT PACKAGE $kp->{filename} \n"; + print "TBD - only buildrepo for prebuilt rpms is available at this time \n\n"; + } else { + print "Cannot determine build method for Kit Package $kp->{filename}. Verify that your Kit Build File is correct. \n"; + return 1; + } + } + + # Build kitcomponent preppackages and metapackages + if ($debianflag) { + foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { + if ($repoid ne $kc->{kitrepoid}) { next; } + my $debname = "$repodir/" . &comppkgname($kc); + if (-r $debname) { next; } + if ($::VERBOSE) { print "building kitcomponent package for $kc->{basename} \n"; } + if (&build_kitcomp_debian($kc)) { + print "Error building kitcomponent metapackage for $kc->{basename} \n"; + return 1; + } + } + + if (system("cd $repodir;dpkg-scanpackages . > Packages")) { + print "Error building the repository meta-data with the dpkg-scanpackages command \n"; + return 1; + } + } + else { + foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { + + # Check if this kitcomponent is in the requested repo + if ($repoid ne $kc->{kitrepoid}) { next; } + + # Check if already built + my $rpm = "$repodir/" . &comppkgname($kc); + if (-r $rpm) { next; } + + # Build it + if ($::VERBOSE) { print "building kitcomponent metapackage for $kc->{basename} \n"; } + if (&build_kitcomp($kc)) { + print "Error building kitcomponent metapackage for $kc->{basename} \n"; + return 1; + } + } + + # run createrepo + my $cr_opts = ''; + if (($repo->{osbasename} =~ m/rh|RH|centos|CentOS/) && + ($repo->{osmajorversion} eq '5')) { + $cr_opts = '-s md5'; + } + if (system("createrepo $cr_opts $repodir")) { + print "Error building the repository meta-data with the createrepo command \n"; + return 1; + } + } + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 kit_listrepo + + buildkit listrepo + +=cut + +#----------------------------------------------------------------------------- +sub kit_listrepo +{ + # print "Kit Repository: Status \n"; + foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { + my $rc = 0; + my $status = "NOT DONE"; + unless ($rc = &validate_repo($kr)) { $status = "DONE"; } + print "$kr->{kitrepoid}: $status \n"; + } + + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 kit_cleanrepo + + buildkit cleanrepo + +=cut + +#----------------------------------------------------------------------------- +sub kit_cleanrepo +{ + my $repoid = $::KIT_CLEANREPO; + my $tmp_repoid = $repoid; + $tmp_repoid =~ tr/A-Z/a-z/; # convert to lowercase + + if (($tmp_repoid eq 'all') && + -d $::base_repodir) { + if (system("rm -Rf $::base_repodir ")) { + print "Error removing contents of $::base_repodir \n"; + return 1; + } else { + print "Contents of $::base_repodir has been successfully removed. \n"; + } + } else { + my $got_one = 0; + foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { + if ($repoid eq $kr->{kitrepoid}) { + my $repodir = $::base_repodir . '/' . $kr->{kitreponame}; + if (-d $repodir) { + if (system("rm -Rf $repodir ")) { + print "Error removing directory $repodir \n"; + return 1; + } else { + print "Kit repository $kr->{kitrepoid} has been removed. \n"; + } + } else { + print "Kit repository $kr->{kitrepoid} directory $repodir does not exist. Nothing to remove for this repository. \n"; + } + $got_one = 1; + last; + } + } + if (!$got_one) { + print "Kit repository $repoid does not exist.\n"; + return 1; + } + } + if (-d "$::workdir/rpmbuild") { + system("rm -Rf $::workdir/rpmbuild "); + } + if (-d "$::workdir/tmp") { + system("rm -Rf $::workdir/tmp "); + } + if (-d "$::workdir/debbuild") { + system("rm -Rf $::workdir/debbuild"); + } + + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 kit_buildtar + + buildkit buildtar + +=cut + +#----------------------------------------------------------------------------- +sub kit_buildtar +{ + foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { + if (&validate_repo($kr)) { + print "Kit Repository $kr->{kitrepoid} not built. Run: \n"; + print " buildkit buildrepo $kr->{kitrepoid} \n"; + return 1; + } + } + + if (&create_kitconf) { + print "Error creating kit configuration file \n"; + return 1; + } + + if ($::HAVE_EXTERNAL_PKG or $::HAVE_NON_NATIVE_PKGS) { + if (&create_PARTIAL_builddir) { + print "Error creating PARTIAL kit build directory contents \n"; + return 1; + } + } else { + if (&create_builddir) { + print "Error creating kit build directory contents \n"; + return 1; + } + } + + if (!-d "$::deploy_dir/repos") { + symlink "$::build_dir/kit_repodir", "$::deploy_dir/repos"; + } + + # build the tarfile + my $extpkgs = ''; + if ($::HAVE_EXTERNAL_PKG or $::HAVE_NON_NATIVE_PKGS) { + $extpkgs = '.NEED_PRODUCT_PKGS'; + } + my $kitname = $::bldkit_config->{kit}{entries}[0]->{kitname}; + my $kitfilename = $kitname; + if (defined($::bldkit_config->{kit}{entries}[0]->{kittarfilename})) { + $kitfilename = $::bldkit_config->{kit}{entries}[0]->{kittarfilename}; + $kitfilename =~ s/tar\.bz2\s*$//; + } + $kitfilename = $kitfilename . $extpkgs . ".tar.bz2"; + + my $tarfile = $::deploy_dir . "/" . $kitfilename; + + my $dir = dirname($::deploy_dir); + my $bidir = "$dir/build_input"; + + #It is for partial kit. + if ($::HAVE_EXTERNAL_PKG or $::HAVE_NON_NATIVE_PKGS) { + if (-d "$bidir") { + if (system("cd $::deploy_dir; cd ..; cp -r build_input $kitname")) { + print "Error: Could not copy building tarfile $tarfile \n"; + return 1; + } + } + } else { + + #If it is complete kit and there is build_input directory in deploy_dir + #If there is tmp rpmbuild source_packages + #delete them from complete kit build_input + if (-d "$bidir") { + if (system("cd $::deploy_dir; cd ..; rm -fr build_input/tmp")) { + print "Error:Could not delete build_input/tmp \n"; + } + if (system("cd $::deploy_dir; cd ..; rm -fr build_input/rpmbuild")) { + print "Error:Could not delete build_input/tmp \n"; + } + if (system("cd $::deploy_dir; cd ..; rm -fr build_input/source_packages")) { + print "Error:Could not delete build_input/source_packages \n"; + } + if (system("cd $::deploy_dir; cd ..; cp -fr build_input $kitname")) { + print "Error: Could not copy building tarfile $tarfile \n"; + return 1; + } + } else { + + #If kit build dir is new created + #partial kit is never created before + #make sure there is build_input dir in complete kit dir + if (system("cd $::deploy_dir; mkdir -p build_input")) { + print "Error creating kit build directory contents \n"; + return 1; + } + if (system("cd $::deploy_dir; cp -fp $::workdir/buildkit.conf build_input")) { + print "Error creating kit build directory contents \n"; + return 1; + } + if (system("cd $::deploy_dir; cp -frp $::workdir/other_files build_input")) { + print "Error creating kit build directory contents \n"; + return 1; + } + if (system("cd $::deploy_dir; cp -frp $::workdir/plugins build_input")) { + print "Error creating kit build directory contents \n"; + return 1; + } + if (system("cd $::deploy_dir; cp -frp $::workdir/scripts build_input")) { + print "Error creating kit build directory contents \n"; + return 1; + } + } + } + + print "Creating tar file $::current_dir/$kitfilename.\n"; + + if (system("cd $::deploy_dir; cd ..; tar -cjhf $tarfile $kitname/*")) { + print "Error building tarfile $tarfile \n"; + return 1; + } + + system("mv $tarfile $::current_dir"); + print "Kit tar file $::current_dir/$kitfilename successfully built. \n"; + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 kit_cleantar + + buildkit cleantar + + Remove tar files from the kit location directory. + + This removes all tar files - not just the last one created! + + Also clean up several other files/dirs + +=cut + +#----------------------------------------------------------------------------- +sub kit_cleantar +{ + my $basename = $::bldkit_config->{kit}{entries}[0]->{basename}; + my $rmfiles = "$basename\*tar.bz2"; + + my $tarfile = "$::workdir/$rmfiles"; + + if ($rmfiles) { + if (system("rm -f $tarfile ")) { + print "Error removing kit tar files in $::workdir.\n"; + } else { + print "Kit tar files have been successfully removed from $::workdir.\n"; + } + } + + if (-d $::deploy_dir) { + if (system("rm -Rf $::deploy_dir ")) { + print "Error removing contents of $::deploy_dir \n"; + } else { + print "Removed $::deploy_dir.\n"; + } + } + if (-d "$::workdir/rpmbuild") { + if (system("rm -Rf $::workdir/rpmbuild ")) { + + # print "Error removing $::workdir/rpmbuild\n"; + } else { + print "Removed $::workdir/rpmbuild\n"; + } + } + if (-d "$::workdir/tmp") { + if (system("rm -Rf $::workdir/tmp ")) { + + # print "Error removing $::workdir/tmp \n"; + } else { + print "Removed $::workdir/tmp \n"; + } + } + if (-d "$::workdir/debbuild") { + if (system("rm -Rf $::workdir/debbuild")) { + + # print "Error removing $::workdir/debbuild.\n"; + } else { + print "Removed $::workdir/debbuild\n"; + } + } + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 kit_cleanall + + buildkit cleanall + +=cut + +#----------------------------------------------------------------------------- +sub kit_cleanall +{ + print "Running buildkit cleanall... \n"; + + &kit_cleantar; + + if (-d $::build_dir) { + if (system("rm -Rf $::build_dir/* ")) { + print "Error removing contents of $::build_dir \n"; + } else { + print "All $::build_dir contents have been successfully removed \n"; + } + } + if (-d "$::workdir/rpmbuild") { + system("rm -Rf $::workdir/rpmbuild "); + } + if (-d "$::workdir/tmp") { + system("rm -Rf $::workdir/tmp "); + } + if (-d "$::workdir/debbuild") { + system("rm -Rf $::workdir/debbuild"); + } + + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 edit_bldkitconf + + edit the shipped template buildkit.conf file to insert initial values + for the new kit +=cut + +#----------------------------------------------------------------------------- +sub edit_bldkitconf +{ + my $bldkitconf = shift; + my $kitname = shift; + + # read in the buildkit.conf file + my $CF; + unless (open($CF, "<", $bldkitconf)) { + print "The Kit build file $bldkitconf does not exist. \n"; + return 1; + } + if ($::VERBOSE) { + print "Reading kit configuration file $bldkitconf \n"; + } + my @lines = <$CF>; + close $CF; + + my $osinfo = xCAT::BuildKitUtils->osver(); + my $kitrepoid = $osinfo; + $kitrepoid =~ s/\,//; + my ($osbasename, $osmore) = split(/\,/, $osinfo); + my ($osmajorversion, $osminorversion) = split(/\./, $osmore); + my $osarch = `uname -p`; + chomp($osarch); + my $kitcomponent_basename = $kitname . "_compute"; + + if ($debianflag == 1) { + if ($osarch eq "ppc64le") { + $osarch = "ppc64el"; + } + $kitcomponent_basename = $kitname . "-compute"; + } + + for (@lines) { + s/<<>>/$kitname/; + s/<<>>/$kitrepoid/; + s/<<>>/$osbasename/; + s/<<>>/$osmajorversion/; + s/<<>>/$osminorversion/; + s/<<>>/$osarch/; + s/<<>>/$kitcomponent_basename/; + if ($debianflag) { + s/(filename=.*?)\-(.*)\.noarch\.rpm/$1_$2_all.deb/; + } + if ($osbasename =~ /rh/) { + s/.*<<>>/ compat_osbasenames=centos/; + } + } + + # Write the buildkit.conf back out + my $NCF; + unless (open($NCF, ">$bldkitconf")) { + return 1; + } + if ($::VERBOSE) { + print "Inserted initial values into $bldkitconf \n"; + } + print $NCF @lines; + close($NCF); + + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 load_bldkitconf + + load the kitbuild.conf file into a global data structure and + verify that the general syntax is correct. + +=cut + +#----------------------------------------------------------------------------- +sub load_bldkitconf +{ + my $bldkitconf = shift; + + # read in the buildkit.conf file + my $CF; + unless (open($CF, "<", $bldkitconf)) { + print "The Kit build file $bldkitconf does not exist in the current directory. \n"; + return 1; + } + if ($::VERBOSE) { + print "Reading kit configuration file $bldkitconf \n"; + } + my @lines = <$CF>; + close $CF; + + my $current_section = 'no section'; + my %current_entry; + my $syntax_error = ''; + my $bad_line = ''; + my $line_number = 0; + foreach my $l (@lines) { + $line_number++; + + # skip blank and comment lines + next if ($l =~ /^\s*$/ || $l =~ /^\s*#/); + + # process a real line + # new section? + if ($l =~ /^\s*(\w+)\s*:/) { + my $section = $1; + if (defined($::buildkit_def{$section})) { + if (($section eq 'kit') && + ($::bldkit_config->{$section}{'exists'})) { + $syntax_error = "More than one \"$section:\" section exists "; + $bad_line = $l; + last; + } + $::bldkit_config->{$section}{'exists'} = 1; + push(@{ $::bldkit_config->{$current_section}{'entries'} }, {%current_entry}); + $current_section = $section; + undef %current_entry; + next; + } + } + if ($l =~ /^\s*(\w+)\s*=\s*(.*)\s*/) { + my $attr = $1; + my $val = $2; + my $orig_attr = $attr; + my $orig_val = $val; + $attr =~ s/^\s*//; # Remove any leading whitespace + $attr =~ s/\s*$//; # Remove any trailing whitespace + $attr =~ tr/A-Z/a-z/; # Convert to lowercase + $val =~ s/^\s*//; + $val =~ s/\s*$//; + + if (defined($::buildkit_def{$current_section}{$attr})) { + if ($val ne '') { $current_entry{$attr} = $val; } + } else { + if ($current_section eq 'no section') { + $syntax_error = "No section specified for attribute $attr."; + } else { + my $valid_attrs = join(', ', (keys(%{ $::buildkit_def{$current_section} }))); + $syntax_error = "Attribute \"$attr\" is not valid for section \"$current_section\". Valid attributes are: $valid_attrs.\n"; + } + $bad_line = $l; + last; + } + + } else { + $syntax_error = "Invalid line format"; + $bad_line = $l; + last; + + } + } + + # Need at least one kit and one kitrepo section + if (!$syntax_error) { + if (!($::bldkit_config->{'kit'}{'exists'})) { + $syntax_error = "No \"kit:\" section found. At least one section required. "; + $bad_line = ''; + } elsif (!($::bldkit_config->{'kitrepo'}{'exists'})) { + $syntax_error = "No \"kitrepo:\" section found. At least one section required. "; + $bad_line = ''; + } else { + push(@{ $::bldkit_config->{$current_section}{'entries'} }, {%current_entry}); + } + } + + if ($syntax_error) { + print "Error processing file $bldkitconf \n"; + print "Syntax error found on line $line_number:\n"; + print "$bad_line \n"; + print "$syntax_error \n"; + print "\n"; + print "The Kit build file does not have the correct format. \n"; + print "The format should be: \n"; + print "
: \n"; + print " = \n"; + print " = \n"; + print " ... \n"; + print "
: \n"; + print " = \n"; + print " = \n"; + print " ... \n"; + print "The valid section names are: kit, kitrepo, kitcomponent, kitpackages. \n"; + print "There must be exactly one kit, and must be at least one kitrepo section. \n"; + return 1; + } + + # Check for mandatory attributes + foreach my $s (keys %{$::bldkit_config}) { + if (!defined($::buildkit_def{$s})) { next; } + foreach my $se (@{ $::bldkit_config->{$s}{entries} }) { + foreach my $a (keys %{ $::buildkit_def{$s} }) { + if (($::buildkit_def{$s}{$a}->{mandatory}) && + (!defined($se->{$a}))) { + print "The \"$a\" mandatory attribute must be defined in the \"$s\" section of the Kit build file \n"; + return 1; + } + } + } + } + + #use Data::Dumper; + #print Dumper($::bldkit_config); + + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 validate_bldkitconf + + validate the loaded buildkit configuration data + +=cut + +#----------------------------------------------------------------------------- +sub validate_bldkitconf +{ + my $kitname = $::bldkit_config->{kit}{entries}[0]->{basename}; + my $full_kitname = $kitname; + $full_kitname .= '-' . $::bldkit_config->{kit}{entries}[0]->{version}; + if (defined($::bldkit_config->{kit}{entries}[0]->{release})) { + $full_kitname .= '-' . $::bldkit_config->{kit}{entries}[0]->{release}; + } + my $short_kitname = $full_kitname; + if (defined($::bldkit_config->{kit}{entries}[0]->{osbasename})) { + $full_kitname .= '-' . $::bldkit_config->{kit}{entries}[0]->{osbasename}; + } + if (defined($::bldkit_config->{kit}{entries}[0]->{osmajorversion})) { + if (!defined($::bldkit_config->{kit}{entries}[0]->{osbasename})) { + print "Error: Kit osmajorversion attribute was specified but Kit osbasename was not set. \n"; + return 1; + } + $full_kitname .= '-' . $::bldkit_config->{kit}{entries}[0]->{osmajorversion}; + } + if (defined($::bldkit_config->{kit}{entries}[0]->{osminorversion})) { + my $kitminor = $::bldkit_config->{kit}{entries}[0]->{osminorversion}; + unless ($kitminor =~ /^\d/) { + $kitminor = split /<=|>=|==|<|>|=/, $::bldkit_config->{kit}{entries}[0]->{osminorversion}; + } + if ((!defined($::bldkit_config->{kit}{entries}[0]->{osbasename})) || + (!defined($::bldkit_config->{kit}{entries}[0]->{osmajorversion}))) { + print "Error: Kit osminorversion attribute was specified but either Kit osbasename or Kit osmajorversion were not set. \n"; + return 1; + } + $full_kitname .= '-' . $kitminor; + } + if (defined($::bldkit_config->{kit}{entries}[0]->{osarch})) { + $full_kitname .= '-' . $::bldkit_config->{kit}{entries}[0]->{osarch}; + } + $::bldkit_config->{kit}{entries}[0]->{kitname} = $full_kitname; + $::deploy_dir .= "/" . $full_kitname; + + # Make sure each kit kitdeployparams file exists + if (defined($::bldkit_config->{kit}{entries}[0]->{kitdeployparams})) { + my $kd_file = $::workdir . "/other_files/" . $::bldkit_config->{kit}{entries}[0]->{kitdeployparams}; + if (!-r $kd_file) { + print "Kit Deployment Parameters file $kd_file does not exist or is not readable\n"; + return 1; + } + if (&edit_deployparams($kd_file, 1)) { return 1; } + } + + # Make sure each kitrepo has unique distro info + my $kr_count = scalar @{ $::bldkit_config->{kitrepo}{entries} }; + if ($kr_count > 1) { + foreach my $kri (0 .. $kr_count - 2) { + foreach my $kri2 ($kri + 1 .. $kr_count - 1) { + my $kr = $::bldkit_config->{kitrepo}{entries}[$kri]; + my $kr2 = $::bldkit_config->{kitrepo}{entries}[$kri2]; + if ($kr->{kitrepoid} eq $kr2->{kitrepoid}) { + print "There are two or more kitrepo sections with the same kitrepoid \"$kr->{kitrepoid}\". \n"; + return 1; + } + if (($kr->{osbasename} eq $kr2->{osbasename}) && + ($kr->{osmajorversion} eq $kr2->{osmajorversion}) && + ($kr->{osarch} eq $kr2->{osarch})) { + if ((defined($kr->{osminorversion}) && + defined($kr2->{osminorversion}) && + ($kr->{osminorversion} eq $kr2->{osminorversion})) || + (!defined($kr->{osminorversion}) && + !defined($kr2->{osminorversion}))) { + print "There are two or more kitrepo sections which are defined with the same OS name, major/minor version, and architecture. \n"; + return 1; + } + } + } + } + } + + # Kitcomponent version/release are now optional - + # default to kit version/release + foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { + if (!defined($kc->{version})) { + $kc->{version} = $::bldkit_config->{kit}{entries}[0]->{version}; + } + if (!defined($kc->{release})) { + if (!defined($::bldkit_config->{kit}{entries}[0]->{release})) { + print "Kitcomponent $kc->{basename} does not have a release specified and there is no Kit release value set to use as a default. \n"; + return 1; + } else { + $kc->{release} = $::bldkit_config->{kit}{entries}[0]->{release}; + } + } + + } + + # Make sure each kitcomponent has unique basename/repoid + # If same basename, make sure version/release are same, too + my $kc_count = scalar @{ $::bldkit_config->{kitcomponent}{entries} }; + if ($kc_count > 1) { + foreach my $kci (0 .. $kc_count - 2) { + foreach my $kci2 ($kci + 1 .. $kc_count - 1) { + if ($::bldkit_config->{kitcomponent}{entries}[$kci]->{basename} + eq $::bldkit_config->{kitcomponent}{entries}[$kci2]->{basename}) { + if ($::bldkit_config->{kitcomponent}{entries}[$kci]->{kitrepoid} + eq $::bldkit_config->{kitcomponent}{entries}[$kci2]->{kitrepoid}) { + + print "Two or more kitcomponents are defined with the same basename \"$::bldkit_config->{kitcomponent}{entries}[$kci]->{basename}\" and the same repoid \"$::bldkit_config->{kitcomponent}{entries}[$kci]->{kitrepoid}\". \n"; + return 1; + } + if (($::bldkit_config->{kitcomponent}{entries}[$kci]->{version} + ne $::bldkit_config->{kitcomponent}{entries}[$kci2]->{version}) || + ($::bldkit_config->{kitcomponent}{entries}[$kci]->{release} + ne $::bldkit_config->{kitcomponent}{entries}[$kci2]->{release}) + ) { + print "Two or more kitcomponents are defined with the same basename \"$::bldkit_config->{kitcomponent}{entries}[$kci]->{basename}\" but with different version or release. \n"; + return 1; + } + } + } + } + } + + # Kitrepo checks + foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { + my $reponame = $short_kitname; + if ((defined($::bldkit_config->{kit}{entries}[0]->{osbasename})) && + ($::bldkit_config->{kit}{entries}[0]->{osbasename} ne + $kr->{osbasename})) { + print "Warning: Kit osbasename is set to \"$::bldkit_config->{kit}{entries}[0]->{osbasename}\", but this does not match kitrepo $kr->{kitrepoid} osbasename \"$kr->{osbasename}\". Processing will continue, but verify that you do not have an error in your buildkit configuration file. \n"; + } + $reponame .= '-' . $kr->{osbasename}; + if ((defined($::bldkit_config->{kit}{entries}[0]->{osmajorversion})) && + ($::bldkit_config->{kit}{entries}[0]->{osmajorversion} ne + $kr->{osmajorversion})) { + print "Warning: Kit osmajorversion is set to \"$::bldkit_config->{kit}{entries}[0]->{osmajorversion}\", but this does not match kitrepo $kr->{kitrepoid} osmajorversion \"$kr->{osmajorversion}\". Processing will continue, but verify that you do not have an error in your buildkit configuration file. \n"; + } + $reponame .= '-' . $kr->{osmajorversion}; + if (defined($kr->{osminorversion})) { + my $krminor = $kr->{osminorversion}; + unless ($krminor =~ /^\d/) { + $krminor = split /<=|>=|==|<|>|=/, $kr->{osminorversion}; + } + if ((defined($::bldkit_config->{kit}{entries}[0]->{osminorversion})) && + ($::bldkit_config->{kit}{entries}[0]->{osminorversion} ne + $kr->{osminorversion})) { + print "Warning: Kit osminorversion is set to \"$::bldkit_config->{kit}{entries}[0]->{osminorversion}\", but this does not match kitrepo $kr->{kitrepoid} osminorversion \"$kr->{osminorversion}\". Processing will continue, but verify that you do not have an error in your buildkit configuration file. \n"; + } + $reponame .= '.' . $krminor; + $::bldkit_config->{kit}{entries}[0]->{osminorversion} = $krminor; + } + if ((defined($::bldkit_config->{kit}{entries}[0]->{osarch})) && + ($::bldkit_config->{kit}{entries}[0]->{osarch} ne + $kr->{osarch})) { + print "Warning: Kit osarch is set to \"$::bldkit_config->{kit}{entries}[0]->{osarch}\", but this does not match kitrepo $kr->{kitrepoid} osarch \"$kr->{osarch}\". Processing will continue, but verify that you do not have an error in your buildkit configuration file. \n"; + } + $reponame .= '-' . $kr->{osarch}; + $kr->{kitreponame} = $reponame; + } + + # Kitcomponent checks + foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { + + # Make sure all kitcomponent kitrepoids are defined + my $found = 0; + my %repo; + if ($debianflag) { + if ($kc->{basename} =~ /_/) { + print "Kit Component basename can not contain underscore.\n"; + return 1; + } + } + foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { + if ($kc->{kitrepoid} eq $kr->{kitrepoid}) { + $found = 1; + %repo = %{$kr}; + $kc->{kitreponame} = $kr->{kitreponame}; + push(@{ $kr->{packages} }, &comppkgname($kc, $kr)); + last; + } + } + if (!$found) { + print "Kit Repository \"$kc->{kitrepoid}\" required by the Kit Component \"$kc->{basename}\" not defined in the Kit Build file.\n"; + return 1; + } + + # Create full kitcomponent name + my $compname = $kc->{basename}; + $compname .= '-' . $kc->{version}; + $compname .= '-' . $kc->{release}; + $compname .= '-' . $repo{osbasename}; + $compname .= '-' . $repo{osmajorversion}; + if (defined($repo{osminorversion})) { + my $minorversion = $repo{osminorversion}; + unless ($minorversion =~ /^\d/) { + $minorversion = split /<=|>=|==|<|>|=/, $repo{osminorversion}; + } + $compname .= '.' . $minorversion; + } + $compname .= '-' . $repo{osarch}; + $kc->{kitcompname} = $compname; + + # Make sure all kitcomponent kitpkgdeps are defined + if (defined($kc->{kitpkgdeps})) { + foreach my $d (split(/,/, $kc->{kitpkgdeps})) { + $d =~ s/\s+//g; + $d =~ s/^([\w\.\-]+)[<>=]*.*$/$1/; + my $found = 0; + foreach my $kp (@{ $::bldkit_config->{kitpackage}{entries} }) { + if ($kp->{filename} =~ /^$d[\.\-]?/) { + foreach my $kprid (split(/,/, $kp->{kitrepoid})) { + $kprid =~ s/\s+//g; + if ($kc->{kitrepoid} eq $kprid) { + $found = 1; + last; + } + } + } + if ($found) { last; } + } + if (!$found) { + print "Kit Package \"$d\" required by the Kit Component \"$kc->{basename}\" was not found in the Kit Component\'s repository \"$kc->{kitrepoid}\".\n"; + return 1; + } + } + } + + # Make sure all kitcomponent driverpacks are defined + if (defined($kc->{driverpacks})) { + my @drvs = split(/,/, $kc->{driverpacks}); + foreach my $d (@drvs) { + $d =~ s/\s+//g; + my $found = 0; + foreach my $kp (@{ $::bldkit_config->{kitpackage}{entries} }) { + if ($kp->{filename} eq $d) { + foreach my $kprid (split(/,/, $kp->{kitrepoid})) { + $kprid =~ s/\s+//g; + if ($kc->{kitrepoid} eq $kprid) { + $found = 1; + last; + } + } + } + if ($found) { last; } + } + if (!$found) { + print "Driver package \"$d\" required by the Kit Component \"$kc->{basename}\" was not found in the Kit Component\'s repository \"$kc->{kitrepoid}\".\n"; + return 1; + } + } + } + + # Make sure files exist + if (defined($kc->{exlist})) { + my $ck_file = $::workdir . "/other_files/" . $kc->{exlist}; + if (!-r $ck_file) { + print "Exclude List file $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; + return 1; + } + } + if (defined($kc->{preinstall})) { + my $ck_file = $::workdir . "/scripts/" . $kc->{preinstall}; + if (!-r $ck_file) { + print "Pre-Install script $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; + return 1; + } + } + if (defined($kc->{postinstall})) { + my $ck_file = $::workdir . "/scripts/" . $kc->{postinstall}; + if (!-r $ck_file) { + print "Post-Install script $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; + return 1; + } + } + if (defined($kc->{preuninstall})) { + my $ck_file = $::workdir . "/scripts/" . $kc->{preuninstall}; + if (!-r $ck_file) { + print "Pre-Uninstall script $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; + return 1; + } + } + if (defined($kc->{postuninstall})) { + my $ck_file = $::workdir . "/scripts/" . $kc->{postuninstall}; + if (!-r $ck_file) { + print "Post-Uninstall script $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; + return 1; + } + } + if (defined($kc->{preupgrade})) { + my $ck_file = $::workdir . "/scripts/" . $kc->{preupgrade}; + if (!-r $ck_file) { + print "Pre-Upgrade script $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; + return 1; + } + } + if (defined($kc->{postupgrade})) { + my $ck_file = $::workdir . "/scripts/" . $kc->{postupgrade}; + if (!-r $ck_file) { + print "Post-Upgrade script $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; + return 1; + } + } + if (defined($kc->{genimage_postinstall})) { + foreach my $script (split(/\,/, $kc->{genimage_postinstall})) { + $script =~ s/\s+//g; + my $ck_file = $::workdir . "/scripts/" . $script; + if (!-r $ck_file) { + print "genimage_postinstall script $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; + return 1; + } + } + } + if (defined($kc->{postbootscripts})) { + foreach my $script (split(/\,/, $kc->{postbootscripts})) { + $script =~ s/\s+//g; + my $ck_file = $::workdir . "/scripts/" . $script; + if (!-r $ck_file) { + print "Postboot script $ck_file defined in Kit Componenet \"$kc->{basename}\" does not exist or is not readable\n"; + return 1; + } + } + } + if (defined($kc->{non_native_pkgs})) { + if ($kc->{non_native_pkgs} =~ /EXTERNALPKGS/) { + $::NON_NATIVE_PKGS->{ $kc->{kitcompname} } = 1; + $::HAVE_NON_NATIVE_PKGS = 1; + } + } + } + + # Kitpackage checks + foreach my $kp (@{ $::bldkit_config->{kitpackage}{entries} }) { + + # determine if valid build method + if ((defined($kp->{isexternalpkg})) || + (defined($kp->{rpm_prebuiltdir}))) { + if ((defined($kp->{rpm_srpm})) || + (defined($kp->{rpm_srctarball})) || + (defined($kp->{rpm_spec})) || + (defined($kp->{rpm_srcdir}))) { + print "Cannot determine build method for Kit Package $kp->{filename}. Conflicting attributes were specified.\n"; + return 1; + } + if (!(defined($kp->{isexternalpkg}))) { $kp->{isexternalpkg} = 'no'; } + my $orig_isext = $kp->{isexternalpkg}; + $kp->{isexternalpkg} =~ s/\s+//g; + $kp->{isexternalpkg} =~ tr/A-Z/a-z/; # convert to lowercase + if ($kp->{isexternalpkg} eq '0') { $kp->{isexternalpkg} = 'no'; } + if ($kp->{isexternalpkg} eq '1') { $kp->{isexternalpkg} = 'yes'; } + if (($kp->{isexternalpkg} ne 'yes') && + ($kp->{isexternalpkg} ne 'no')) { + print "Error in definition for Kit Package $kp->{filename}. Invalid attribute value \'isexternalpkg=$orig_isext\'. Valid values are \'no\'|\'0\' or \'yes\'|\'1\'.\n"; + return 1; + } + if (($kp->{isexternalpkg} eq 'yes')) { + $::HAVE_EXTERNAL_PKG = 1; + } + if (($kp->{isexternalpkg} eq 'yes') && + (defined($kp->{rpm_prebuiltdir}))) { + print "Error in definition for Kit Package $kp->{filename}. Do not specify \'isexternalpkg=$orig_isext\' with 'rpm_prebuiltdir'.\n"; + return 1; + } + } elsif (defined($kp->{rpm_srpm})) { + if ((defined($kp->{rpm_prebuiltdir})) || + (defined($kp->{rpm_srctarball})) || + (defined($kp->{rpm_spec})) || + (defined($kp->{rpm_srcdir}))) { + print "Cannot determine build method for Kit Package $kp->{filename}. Conflicting attributes were specified.\n"; + return 1; + } + } elsif (defined($kp->{rpm_srctarball}) && + defined($kp->{rpm_spec})) { + if ((defined($kp->{rpm_prebuiltdir})) || + (defined($kp->{rpm_srpm})) || + (defined($kp->{rpm_srcdir}))) { + print "Cannot determine build method for Kit Package $kp->{filename}. Conflicting attributes were specified.\n"; + return 1; + } + } elsif (defined($kp->{rpm_srcdir}) && + defined($kp->{rpm_spec})) { + if ((defined($kp->{rpm_prebuiltdir})) || + (defined($kp->{rpm_srpm})) || + (defined($kp->{rpm_srctarball}))) { + print "Cannot determine build method for Kit Package $kp->{filename}. Conflicting attributes were specified.\n"; + return 1; + } + } else { + print "Cannot determine build method for Kit Package $kp->{filename}. Verify that your Kit Build File is correct. \n"; + return 1; + } + + # Make sure all kitpackage kitrepoids are defined + foreach my $kprid (split(/,/, $kp->{kitrepoid})) { + my $found = 0; + $kprid =~ s/\s+//g; + foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { + if ($kprid eq $kr->{kitrepoid}) { + $found = 1; + $kp->{kitreponame} .= "," . $kr->{kitreponame}; + if (!($kp->{isexternalpkg} eq 'yes')) { + push(@{ $kr->{packages} }, $kp->{filename}); + } + last; + } + } + if (!$found) { + print "Kit Repository \"$kprid\" required by the Kit Package \"$kp->{filename}\" is not defined in the Kit Build file.\n"; + return 1; + } + } + $kp->{kitreponame} =~ s/^,//; + if (!$::NEW_PARTIAL_KIT) { + + # Make sure files exist + if (defined($kp->{rpm_spec})) { + my $ck_file = $::workdir . "/source_packages/" . $kp->{rpm_spec}; + if (!-r $ck_file) { + print "RPM spec file $ck_file defined in Kit Package \"$kp->{filename}\" does not exist or is not readable\n"; + return 1; + } + } + if (defined($kp->{rpm_srcdir})) { + my $ck_dir = $::workdir . "/source_packages/" . $kp->{rpm_srcdir}; + if (!-d $ck_dir) { + print "RPM source directory $ck_dir defined in Kit Package \"$kp->{filename}\" does not exist or is not readable\n"; + return 1; + } + } + if (defined($kp->{rpm_srctarball})) { + my $ck_file = $::workdir . "/source_packages/" . $kp->{rpm_srctarball}; + if (!-r $ck_file) { + print "RPM source tarfile $ck_file defined in Kit Package \"$kp->{filename}\" does not exist or is not readable\n"; + return 1; + } + } + if (defined($kp->{rpm_srpm})) { + my $ck_file = $::workdir . "/source_packages/" . $kp->{rpm_srpm}; + if (!-r $ck_file) { + print "Source RPM $ck_file defined in Kit Package \"$kp->{filename}\" does not exist or is not readable\n"; + return 1; + } + } + if (defined($kp->{rpm_prebuiltdir})) { + my $ck_dir = $::workdir . "/source_packages/" . $kp->{rpm_prebuiltdir}; + if (!-d $ck_dir) { + print "Pre-built RPM directory $ck_dir defined in Kit Package \"$kp->{filename}\" does not exist or is not readable\n"; + return 1; + } + my $ck_file = $ck_dir . "/" . $kp->{filename}; + if (system("ls $ck_file > /dev/null")) { + + # if (! -r $ck_file ) { + print "Pre-built rpm $ck_file defined in Kit Package \"$kp->{filename}\" does not exist or is not readable\n"; + return 1; + } + } + } + } + + #use Data::Dumper; + #print Dumper($::bldkit_config->{kitrepo}); + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 comppkgname + + build a metapkg rpm filename for this kitcomponent + input: kitcomponent hash + kitrepo hash that this kitcomponent belongs to + +=cut + +#----------------------------------------------------------------------------- +sub comppkgname +{ + my $comp = shift; + + my $pkgname = $comp->{basename}; + if ($debianflag) { + $pkgname .= '_' . $comp->{version}; + $pkgname .= '-' . $comp->{release}; + $pkgname .= '_all.deb'; + } + else { + $pkgname .= '-' . $comp->{version}; + $pkgname .= '-' . $comp->{release}; + $pkgname .= '.noarch.rpm'; + } + return $pkgname; +} + +#----------------------------------------------------------------------------- + +=head3 validate_repo + + validate whether a kit repo has been built + input: repo hash + returns rc: + 0 - repo status is DONE + 1 - repo status is NOT DONE + verbose mode displays message for first rpm not built + +=cut + +#----------------------------------------------------------------------------- +sub validate_repo +{ + my $repo = shift; + + my $repodir = $::base_repodir . "/" . $repo->{kitreponame}; + if (!-d $repodir) { + if ($::VERBOSE) { + print "\n$repodir does not exist. No rpms have been built for this kitrepo. \n"; + } + return 1; + } + + # Make sure each repo pkg exists + foreach my $pkg (@{ $repo->{packages} }) { + + # skip check for kit component meta rpm if it includes + # external non-native pkgs + my $skip_check = 0; + foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { + if ($repo->{kitrepoid} eq $kc->{kitrepoid}) { + my $kitpkgname = comppkgname($kc); + if (($kitpkgname eq $pkg) && + ($::NON_NATIVE_PKGS->{ $kc->{kitcompname} })) { + $skip_check = 1; + last; + } + } + } + if (!$skip_check) { + my $pkg_filename = $repodir . '/' . $pkg; + if (system("ls $pkg_filename > /dev/null")) { + if ($::VERBOSE) { + print "\nFile $pkg in directory $repodir does not exist or is not readable. \n"; + } + return 1; + } + } + } + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 validate_os + + validate whether a kit repo matches the current OS + input: repo hash + returns rc: + 0 - match + 1 - no match + verbose mode displays message for mismatch details + +=cut + +#----------------------------------------------------------------------------- +sub validate_os +{ + my $repo = shift; + + my $osinfo = xCAT::BuildKitUtils->osver(); + my ($osbasename, $osmore) = split(/\,/, $osinfo); + my ($osmajorversion, $osminorversion) = split(/\./, $osmore); + my $osarch = `uname -p`; + chomp($osarch); + + if ($debianflag == 1) { + if ($osarch eq "ppc64le") { + $osarch = "ppc64el"; + } + } + $osinfo =~ s/\,//; + my $repo_osinfo = "$repo->{osbasename}$repo->{osmajorversion}"; + my $minorversion; + if (defined($repo->{osminorversion})) { + $minorversion = $repo->{osminorversion}; + unless ($minorversion =~ /^\d/) { + $minorversion = split /<=|>=|==|<|>|=/, $repo->{osminorversion}; + } + $repo_osinfo .= ".$minorversion"; + } + $repo_osinfo .= "-$repo->{osarch} "; + my $mismatch_msg = "The local host is running $osinfo-$osarch. This does not match the Kit Repository \"$repo->{kitrepoid}\" data: $repo_osinfo"; + if (defined($repo->{compat_osbasenames})) { + $mismatch_msg .= " or the compatible OS distros: $repo->{compat_osbasenames} "; + } + + + my $compat_match = 0; + if ($repo->{osbasename} ne $osbasename) { + if (defined($repo->{compat_osbasenames})) { + foreach my $cos (split(/,/, $repo->{compat_osbasenames})) { + if ($cos eq $osbasename) { + $compat_match = 1; + last; + } + } + } + if (!$compat_match) { + print "$mismatch_msg \n"; + if ($::VERBOSE) { + print "\n Local OS basename $osbasename does not match repository.\n"; + } + return 1; + } + } + if (($repo->{osmajorversion} ne $osmajorversion) && + (!$compat_match)) { + print "$mismatch_msg \n"; + if ($::VERBOSE) { + print "\n Local OS major version $osmajorversion does not match repository.\n"; + } + return 1; + } + if (defined($repo->{osminorversion})) { + if (($minorversion ne $osminorversion) && + (!$compat_match)) { + print "$mismatch_msg \n"; + if ($::VERBOSE) { + print "\n Local OS minor version $osminorversion does not match repository.\n"; + } + return 1; + } + } + if ($repo->{osarch} ne $osarch) { + print "$mismatch_msg \n"; + if ($::VERBOSE) { + print "\n Local OS arch $osarch does not match repository.\n"; + } + return 1; + } + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 build_kitcomp + + build a metapkg rpm for this kitcomponent + input: kitcomponent hash + +=cut + +#----------------------------------------------------------------------------- +sub build_kitcomp +{ + my $comp = shift; + my %repo; + my $rpmbuild_dir = $::workdir . "/rpmbuild"; + my $tmpdir = $::workdir . "/tmp/$comp->{kitcompname}"; + my $kcmetaname = comppkgname($comp); + + # If this kitcomponent has external non-native pkgs, + # skip the meta rpm build + if (defined($::NON_NATIVE_PKGS) && + defined($::NON_NATIVE_PKGS->{ $comp->{kitcompname} }) && + $::NON_NATIVE_PKGS->{ $comp->{kitcompname} }) { + if ($::VERBOSE) { + print "Kit component $comp->{kitcompname} has external non-native packages. Skipping rpm build for $kcmetaname. \n"; + } + return 0; + } + + # find the kitrepo hash for this component + foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { + if ($comp->{kitrepoid} eq $kr->{kitrepoid}) { + %repo = %{$kr}; + last; + } + } + my $repodir = $::base_repodir . "/" . $repo{kitreponame}; + + # Fix the kitpkgdeps value for this kitcomponent + # For any kitpkgdep that has an rpm file in the repo, + # specifically reference it's version-release + if (&update_kitcomp_kitpkgdeps($comp, $repodir)) { return 1; } + + $::VALID_PRER_COMPONENT = 0; + + if (!$::PREREQUISITE) { + if ($comp->{ospkgdeps} || $comp->{preinstall} || $comp->{preupgrade}) { + if (&gen_kitcomp_spec($comp, \%repo, 'PREREQUISITE')) { return 1; } + + # run the rpmbuild command + my $curdir = $::workdir; + my $cmd = "rm -Rf $curdir/rpmbuild"; + system($cmd); + my $avoiderr = $rpmbuild_dir . "/BUILDROOT/prep_" . $comp->{basename}; + $avoiderr .= "-$comp->{version}-$comp->{release}.$repo{osarch}"; + mkpath($avoiderr); + $avoiderr = $rpmbuild_dir . "/BUILD/"; + mkpath($avoiderr); + $avoiderr = $rpmbuild_dir . "/SRPMS/"; + mkpath($avoiderr); + $avoiderr = $rpmbuild_dir . "/RPMS/noarch/"; + mkpath($avoiderr); + + # Read the kit component prerequisite rpm name + + my $specfile = $::workdir . "/tmp/$comp->{kitcompname}-prep.spec"; + my $rpmbuild_cmd = "rpmbuild --define \"_topdir $rpmbuild_dir\" -ba $specfile"; + + # don't want debug info - 3845 + # if (!$::VERBOSE) { + $rpmbuild_cmd .= ' --quiet '; + + # } + if (system($rpmbuild_cmd)) { + print "Error running rpmbuild command for kit component $comp->{kitcompname} meta package\n"; + return 1; + } + my @built_rpms = `find $rpmbuild_dir/RPMS -name "*.rpm"`; + foreach my $rpm (@built_rpms) { + chomp($rpm); + if (system("cp -fp $rpm $repodir")) { + print "Error copying rpm $rpm to build repo directory $repodir \n"; + return 1; + } + } + + $::VALID_PRER_COMPONENT = 1; + + } + + if (&gen_kitcomp_spec($comp, \%repo, 'METARPM')) { return 1; } + } else { + + # Create spec file for this kit component + if (&gen_kitcomp_spec($comp, \%repo, 'ALL')) { return 1; } + } + + # run the rpmbuild command + my $curdir = $::workdir; + my $cmd = "rm -Rf $curdir/rpmbuild"; + system($cmd); + my $avoiderr = $rpmbuild_dir . "/BUILDROOT/" . $comp->{basename}; + $avoiderr .= "-$comp->{version}-$comp->{release}.$repo{osarch}"; + mkpath($avoiderr); + $avoiderr = $rpmbuild_dir . "/BUILD/"; + mkpath($avoiderr); + $avoiderr = $rpmbuild_dir . "/SRPMS/"; + mkpath($avoiderr); + $avoiderr = $rpmbuild_dir . "/RPMS/noarch/"; + mkpath($avoiderr); + + # Read the kit component meta rpm name + + my $specfile = $::workdir . "/tmp/$comp->{kitcompname}.spec"; + my $rpmbuild_cmd = "rpmbuild --define \"_topdir $rpmbuild_dir\" -ba $specfile"; + + # Copy in any non-native packages + if (defined($comp->{non_native_pkgs})) { + mkpath($tmpdir); + mkpath("$rpmbuild_dir/SOURCES"); + my $sourcedir = $::workdir . "/source_packages"; + + foreach my $pkgfile (split(/,/, $comp->{non_native_pkgs})) { + my $pkg_file; + my ($key, $value) = split /:/, $pkgfile; + if ("$key" =~ /EXTERNALPKGS/) { + $pkg_file = $value; + } else { + $pkg_file = $key; + } + + $cmd = "cp -p $sourcedir/$pkg_file $tmpdir"; + if (system($cmd)) { + print "Error copying non-native package file $sourcedir/$pkg_file to $tmpdir\n"; + return 1; + } + } + $cmd = "cd $tmpdir/..;mv $comp->{kitcompname} $comp->{basename}; tar -czf $rpmbuild_dir/SOURCES/$comp->{basename}.tar.gz $comp->{basename};mv $comp->{basename} $comp->{kitcompname}"; + if (system($cmd)) { + print "Error creating tarfile $rpmbuild_dir/SOURCES/$comp->{kitreponame}-$comp->{kitcompname}.tar from $sourcedir/*"; + return 1; + } + } + + # - don't want debug info - 3845 + # if (!$::VERBOSE) { + $rpmbuild_cmd .= ' --quiet '; + + # } + + if (system($rpmbuild_cmd)) { + print "Error running rpmbuild command for kit component $comp->{kitcompname} meta package\n"; + return 1; + } + my @built_rpms = `find $rpmbuild_dir/RPMS -name "*.rpm"`; + foreach my $rpm (@built_rpms) { + chomp($rpm); + if (system("cp -fp $rpm $repodir")) { + print "Error copying rpm $rpm to build repo directory $repodir \n"; + return 1; + } + } + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 update_kitcomp_kitpkgdeps + + Update the kitcomponent kitpkgdeps string + For any kitpkgdep that does not explicitly specify a version-release + comparison string and for which an rpm exists in the repo, + query the rpm for its version-release info and set an explicit + comparison string. + Reason we need to do all this: We need to force yum/zypper to update + the product rpms. A simple package name in the kitcomponent meta rpm + REQUIRES entry will not cause the product to get updated if an older + version is already installed. Need to explicitly require this version + and release of the product package. + input: kitcomponent hash + kitrepo directory + +=cut + +#----------------------------------------------------------------------------- +sub update_kitcomp_kitpkgdeps +{ + my $comp = shift; + my $repodir = shift; + + if (defined($comp->{kitpkgdeps})) { + + # we have some rpms listed in buildkit.conf file + my $new_kitpkgdeps = ''; + foreach my $d (split(/,/, $comp->{kitpkgdeps})) { + $d =~ s/\s+//g; + my $d_short = $d; + + # strip off everything after ">=" + $d_short =~ s/^([\w\.\-]+)[<>=]*.*$/$1/; + + # if they are the same then there was no v/r info provided + if ($d_short eq $d) { + + # no version-release comparisons specified for this kitpkgdep + # do we have this rpm file? + # get a list of any matches + my $lscmd = "cd $repodir; /bin/ls $d-\[0-9\]\*.rpm 2>/dev/null"; + my @rpmlist = `$lscmd`; + + if (scalar(@rpmlist) == 0) { + next; + } + + # get the newest version there is + my $newestrpm = xCAT::BuildKitUtils->get_latest_version($repodir, \@rpmlist); + + if (!$newestrpm) { + print "Error: Could not determine the latest version of rpm $d contained in $repodir. \n"; + next; + } + + # get the Version and release values for this rpm + my $cmd = "rpm -q --qf \"%{NAME} >= %{VERSION}-%{RELEASE}\" -p $repodir/$newestrpm 2>/dev/null"; + if ($::VERBOSE) { + print "running rpm query to get version-release info: \n $cmd \n"; + } + + my $new_d = `$cmd`; + if (!$new_d) { + print "Error: Could not determine the latest version of rpm $d. \n"; + next; + } + + chomp($new_d); + if ($::VERBOSE) { + print "output: \n \'$new_d\' \n"; + } + if ($new_d ne '') { + $new_kitpkgdeps .= "$new_d,"; + } else { + $new_kitpkgdeps .= "$d,"; + } + } else { + $new_kitpkgdeps .= "$d,"; + } + } + + $new_kitpkgdeps =~ s/(\,)*$//; + $comp->{kitpkgdeps} = $new_kitpkgdeps; + } + + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 gen_kitcomp_spec + + generate the rpm spec file for the kitcomponent metapkg rpm + input: kitcomponent hash + kitrepo hash + +=cut + +#----------------------------------------------------------------------------- +sub gen_kitcomp_spec +{ + my $comp = shift; + my $repo = shift; + my $level = shift; + my $scriptdir = $::workdir . "/scripts/"; + my $tmpdir = $::workdir . "/tmp/"; + + # read in the template spec file + my $spec_template = $::XCATSHARE . "/kits/kitcomponent.spec.template"; + my $SF; + unless (open($SF, "<", $spec_template)) { + print "Error attempting to open the xCAT Kit Component template file $spec_template. \n"; + return 1; + } + if ($::VERBOSE) { + print "Reading the xCAT Kit Component template file $spec_template. \n"; + } + my @lines = <$SF>; + close $SF; + + my $kitname = $::bldkit_config->{kit}{entries}[0]->{basename}; + my $kitcompname = $comp->{kitcompname}; + + my ($prescript, $postscript, $preupscript, $postupscript, $preunscript, $postunscript, $nonnativepkgs, $sourcetar, $setup, $files) = ' '; + if ($level eq 'PREREQUISITE' || $level eq 'ALL') { + if (defined($comp->{preinstall})) { + $prescript = &load_script("$scriptdir$comp->{preinstall}"); + $prescript = "if [ \"\$1\" = \"1\" ] ; then\n" . $prescript . "\nfi"; } + if (defined($comp->{preupgrade})) { + $preupscript = &load_script("$scriptdir$comp->{preupgrade}"); + $preupscript = "if [ \"\$1\" = \"2\" ] ; then\n" . $preupscript . "\nfi"; } + } + if ($level eq 'METARPM' || $level eq 'ALL') { + if (defined($comp->{preuninstall})) { + $preunscript = &load_script("$scriptdir$comp->{preuninstall}"); } + if (defined($comp->{postinstall})) { + $postscript = &load_script("$scriptdir$comp->{postinstall}"); + $postscript = "if [ \"\$1\" = \"1\" ] ; then\n" . $postscript . "\nfi"; } + if (defined($comp->{postupgrade})) { + $postupscript = &load_script("$scriptdir$comp->{postupgrade}"); + $postupscript = "if [ \"\$1\" = \"2\" ] ; then\n" . $postupscript . "\nfi"; } + if (defined($comp->{postuninstall})) { + $postunscript = &load_script("$scriptdir$comp->{postuninstall}"); } + if (defined($comp->{non_native_pkgs})) { + $nonnativepkgs = "\n"; + $nonnativepkgs .= "mkdir -p \$RPM_BUILD_ROOT/opt/xcat/kits/$kitname/$kitcompname \n"; + $nonnativepkgs .= "cp -a * \$RPM_BUILD_ROOT/opt/xcat/kits/$kitname/$kitcompname \n"; + $sourcetar = "Source: $comp->{basename}.tar.gz"; + $setup = "\%setup -q -n $comp->{basename}"; + $files = "/opt/xcat/kits"; + } + } + + # remove lines that correspond to optional tags that have no values + # in this instance. Adding lines to the spec file that have + # no values will cause a build error. + my @newlines; + foreach my $l (@lines) { + chomp; + + # don't add vendor,packager,url to spec file unless we have a value + if ($l =~ /INSERT_vendor_HERE/) { + if (!$::bldkit_config->{kit}{entries}[0]->{vendor}) { + next; + } + } + if ($l =~ /INSERT_packager_HERE/) { + if (!$::bldkit_config->{kit}{entries}[0]->{packager}) { + next; + } + } + if ($l =~ /INSERT_url_HERE/) { + if (!$::bldkit_config->{kit}{entries}[0]->{url}) { + next; + } + } + push @newlines, $l; + } + @lines = @newlines; + + if ($level eq 'ALL') { + for (@lines) { + chomp; + s/<<>>/$kitname/; + s/<<>>/$comp->{basename}/; + s/<<>>/$comp->{version}/; + s/<<>>/$comp->{release}/; +s/<<>>/$::bldkit_config->{kit}{entries}[0]->{kitlicense}/; +s/<<>>/$::bldkit_config->{kit}{entries}[0]->{vendor}/; +s/<<>>/$::bldkit_config->{kit}{entries}[0]->{packager}/; + s/<<>>/$::bldkit_config->{kit}{entries}[0]->{url}/; + s/<<>>/$comp->{ospkgdeps}/; + s/<<>>/$comp->{kitpkgdeps}/; + s/<<>>/$comp->{kitcompdeps}/; + s/<<>>/$comp->{description}/; + s/<<>>/$nonnativepkgs/; + s/<<>>/$sourcetar/; + s/<<>>/$setup/; + s/<<>>/$files/; + s/<<>>/$prescript/; + s/<<>>/$postscript/; + s/<<>>/$preupscript/; + s/<<>>/$postupscript/; + s/<<>>/$preunscript/; +s/<<>>/$postunscript/; + } + } elsif ($level eq 'PREREQUISITE') { + for (@lines) { + chomp; + s/<<>>/$kitname/; + s/<<>>/prep_$comp->{basename}/; + s/<<>>/$comp->{version}/; + s/<<>>/$comp->{release}/; +s/<<>>/$::bldkit_config->{kit}{entries}[0]->{kitlicense}/; +s/<<>>/$::bldkit_config->{kit}{entries}[0]->{vendor}/; +s/<<>>/$::bldkit_config->{kit}{entries}[0]->{packager}/; + s/<<>>/$::bldkit_config->{kit}{entries}[0]->{url}/; + s/<<>>/$comp->{ospkgdeps}/; + s/<<>>//; + s/<<>>//; + s/<<>>/$comp->{description}/; + s/<<>>//; + s/<<>>//; + s/<<>>//; + s/<<>>//; + s/<<>>/$prescript/; + s/<<>>//; + s/<<>>/$preupscript/; + s/<<>>//; + s/<<>>/$preunscript/; + s/<<>>//; + } + + } elsif ($level eq 'METARPM') { + for (@lines) { + chomp; + s/<<>>/$kitname/; + s/<<>>/$comp->{basename}/; + s/<<>>/$comp->{version}/; + s/<<>>/$comp->{release}/; +s/<<>>/$::bldkit_config->{kit}{entries}[0]->{kitlicense}/; +s/<<>>/$::bldkit_config->{kit}{entries}[0]->{vendor}/; +s/<<>>/$::bldkit_config->{kit}{entries}[0]->{packager}/; + s/<<>>/$::bldkit_config->{kit}{entries}[0]->{url}/; + s/<<>>//; + s/<<>>/$comp->{kitpkgdeps}/; + + #Update kitcompdeps for prep_ + if ($::VALID_PRER_COMPONENT) { +s/<<>>/$comp->{kitcompdeps},prep_$comp->{basename}/; + } else { +s/<<>>/$comp->{kitcompdeps}/; + } + s/<<>>/$comp->{description}/; + s/<<>>/$nonnativepkgs/; + s/<<>>/$sourcetar/; + s/<<>>/$setup/; + s/<<>>/$files/; + s/<<>>//; + s/<<>>/$postscript/; + s/<<>>//; + s/<<>>/$postupscript/; + s/<<>>/$preunscript/; +s/<<>>/$postunscript/; + } + } + + # Write the generated spec file + mkpath($tmpdir); + + my $fn; + my $NSF; + if ($level eq 'PREREQUISITE') { + $fn = $comp->{kitcompname} . "-prep.spec" + } else { + $fn = $comp->{kitcompname} . ".spec" + } + unless (open($NSF, ">$tmpdir$fn")) { + return 1; + } + if ($::VERBOSE) { + print "Created kitcomponent spec file \'$tmpdir$fn\'\n"; + + } + foreach my $line (@lines) { + print $NSF $line, "\n"; + } + + close($NSF); + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 build_kitcomp_debian + + + +=cut + +#----------------------------------------------------------------------------- +sub build_kitcomp_debian { + my $comp = shift; + my %repo; + my $debbuilddir = $::workdir . "/debbuild/" . $comp->{kitcompname}; + my $kcmetaname = comppkgname($comp); + + #If this kitcomponent has external non-native pkgs, + #skip the meta package build + if (defined($::NON_NATIVE_PKGS) && + defined($::NON_NATIVE_PKGS->{ $comp->{kitcompname} }) && + $::NON_NATIVE_PKGS->{ $comp->{kitcompname} }) { + if ($::VERBOSE) { + print "Kit component $comp->{kitcompname} has external non-native packages. Skipping rpm build for $kcmetaname. \n"; + } + return 0; + } + + # find the kitrepo hash for this component + foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { + if ($comp->{kitrepoid} eq $kr->{kitrepoid}) { + %repo = %{$kr}; + last; + } + } + + + #run the dpkg-buildpackage command + my $curdir = $::workdir; + my $cmd = "rm -Rf $debbuilddir"; + system($cmd); + mkpath($debbuilddir); + + $::VALID_PREP_COMPONENT = 0; + + if (!$::PREREQUISITE) { + if ($comp->{ospkgdeps} || $comp->{preinstall} || $comp->{preupgrade} || $comp->{preuninstall}) { + + #Create debian directory for this kit component preppackage + + if (&gen_kitcomp_debdir_prep($comp, \%repo)) { return 1; } + $::VALID_PREP_COMPONENT = 1; + + # build prep deb + my $prep_compversion = $comp->{version} . "-" . $comp->{release}; + my $prep_buildstring = "Prep Kit component build package."; + my $prep_debbuilddir = $::workdir . "/debbuild/" . "prep-" . $comp->{kitcompname}; + my $prep_debianbuildcmd = "cd $prep_debbuilddir;debchange -v $prep_compversion -b -c debian/changelog $prep_buildstring;dpkg-buildpackage $dpkg_flag"; + + if (system($prep_debianbuildcmd)) { + print "Error running \"dpkg-buildpackage $dpkg_flag\" command for kit component prep-$comp->{kitcompname} meta package\n"; + return 1; + } + } + + #Create debian directory for this kit component metapackage + + if (&gen_kitcomp_debdir($comp, \%repo, 'METADEB')) { return 1; } + + } else { + + #Create debian directory for this kit component + + if (&gen_kitcomp_debdir($comp, \%repo, 'ALL')) { return 1; } + + } + + + + if (defined($comp->{non_native_pkgs})) { + my $sourcedir = $::workdir . "/source_packages"; + + foreach my $pkgfile (split(/,/, $comp->{non_native_pkgs})) { + my $pkg_file; + my ($key, $value) = split /:/, $pkgfile; + if ("$key" =~ /EXTERNALPKGS/) { + $pkg_file = $value; + } else { + $pkg_file = $key; + } + + $cmd = "cp -p $sourcedir/$pkg_file $debbuilddir"; + if (system($cmd)) { + print "Error copying non-native package file $sourcedir/$pkg_file to debbuilddir\n"; + return 1; + } + } + } + my $compversion = $comp->{version} . "-" . $comp->{release}; + my $buildstring = "\'Kit component build package.\'"; + my $debianbuildcmd = "cd $debbuilddir;debchange -v $compversion -b -c debian/changelog $buildstring;dpkg-buildpackage $dpkg_flag"; + if (!$::NON_NATIVE_PKGS->{ $comp->{kitcompname} }) { + if (system($debianbuildcmd)) { + print "Error running \"dpkg-buildpackage $dpkg_flag\" command for kit component $comp->{kitcompname} meta package\n"; + return 1; + } + my $repodir = $::base_repodir . "/" . $repo{kitreponame}; + my @builtdebs = `find $::workdir/debbuild -maxdepth 1 -name "*.deb"`; + foreach my $deb (@builtdebs) { + chomp($deb); + if (system("cp -fp $deb $repodir")) { + print "Error copying package $deb to build repo directory $repodir \n"; + return 1; + } + } + } + return 0; +} + + +#----------------------------------------------------------------------------- + +=head3 gen_kitcomp_debdir_prep + + + +=cut + +#----------------------------------------------------------------------------- +sub gen_kitcomp_debdir_prep { + my $comp = shift; + my $repo = shift; + my $scriptdir = $::workdir . "/scripts/"; + my $combuilddir = $::workdir . "/debbuild/" . "prep-" . $comp->{kitcompname}; + + #copy the debian dir template to the build path + mkpath("$combuilddir/debian"); + my $cmd = "cp -Rf " . $::XCATSHARE . "/kits/debian_template/* $combuilddir/debian/"; + system($cmd); + + my $kitname = $::bldkit_config->{kit}{entries}[0]->{basename}; + my $kitcompname = "prep-" . $comp->{kitcompname}; + my $upgradeflag = "pre-" . $comp->{basename} . ".tmp"; + + my ($prescript, $postscript, $preupscript, $postupscript, $preunscript, $postunscript, $nonnativepkgs) = ''; + if (defined($comp->{preinstall})) { + $prescript = &load_script("$scriptdir$comp->{preinstall}"); + } + if (defined($comp->{preupgrade})) { + $preupscript = &load_script("$scriptdir$comp->{preupgrade}"); + } + if (defined($comp->{preuninstall})) { + $preunscript = &load_script("$scriptdir$comp->{preuninstall}"); + } + + #replace all special sub string in all files under debian + unless (opendir(DH, "${combuilddir}/debian/")) { + print "Can not open the xCAT Kit Component debian dir: ${combuilddir}/debian/"; + return 1; + } + + foreach (readdir(DH)) { + my $file = "${combuilddir}/debian/$_"; + if (-d $file) { + next; + } + + unless (open(FH, "<", $file)) { + print "Error attempting to open the xCAT Kit Component ${kitcompname}'s debian template file $file.\n"; + close(DH); + return 1; + } + + if ($::VERBOSE) { + print "Reading the xCAT Kit Component ${kitcompname}'s debian template file $file. \n"; + } + my @lines = ; + close(FH); + my $prep_comp_name = "prep-" . $comp->{basename}; + for (@lines) { + chomp; + s/<<>>/$prep_comp_name/; + s/<<>>/$comp->{ospkgdeps}/; + s/<<>>//; + s/<<>>//; + s/<<>>/$comp->{description}/; + s/<<>>/$upgradeflag/; + s/<<>>/$prescript/; + s/<<>>//; + s/<<>>/$preupscript/; + s/<<>>//; + s/<<>>/$preunscript/; + s/<<>>//; + + } + my $joined_lines = join("\n", @lines); + @lines = split(/\\n/, $joined_lines); + + open(FH, ">", $file); + if ($::VERBOSE) { + print "Created kitcomponent ${kitcompname}'s build file under debian dir $file"; + } + print FH @lines; + close(FH); + } + closedir(DH); + + return 0; +} + + + +#----------------------------------------------------------------------------- + +=head3 gen_kitcomp_debdir + + + +=cut + +#----------------------------------------------------------------------------- +sub gen_kitcomp_debdir { + my $comp = shift; + my $repo = shift; + my $level = shift; + my $scriptdir = $::workdir . "/scripts/"; + my $combuilddir = $::workdir . "/debbuild/" . $comp->{kitcompname}; + + #copy the debian dir template to the build path + mkpath("$combuilddir/debian"); + my $cmd = "cp -Rf " . $::XCATSHARE . "/kits/debian_template/* $combuilddir/debian/"; + system($cmd); + + my $kitname = $::bldkit_config->{kit}{entries}[0]->{basename}; + my $kitcompname = $comp->{kitcompname}; + my $upgradeflag = $comp->{basename} . ".tmp"; + + my ($prescript, $postscript, $preupscript, $postupscript, $preunscript, $postunscript, $nonnativepkgs) = ''; + + if ($level eq 'METADEB' || $level eq 'ALL') + { + if (defined($comp->{postinstall})) { + $postscript = &load_script("$scriptdir$comp->{postinstall}"); + } + + if (defined($comp->{postupgrade})) { + $postupscript = &load_script("$scriptdir$comp->{postupgrade}"); + } + if (defined($comp->{postuninstall})) { + $postunscript = &load_script("$scriptdir$comp->{postuninstall}"); + } + if (defined($comp->{non_native_pkgs})) { + $nonnativepkgs = "\n"; + $nonnativepkgs .= "mkdir -p \$RPM_BUILD_ROOT/opt/xcat/kits/$kitname/$kitcompname \n"; + $nonnativepkgs .= "cp -a * \$RPM_BUILD_ROOT/opt/xcat/kits/$kitname/$kitcompname \n"; + } + } + if ($level eq 'ALL') + { + if (defined($comp->{preinstall})) { + $prescript = &load_script("$scriptdir$comp->{preinstall}"); + } + if (defined($comp->{preupgrade})) { + $preupscript = &load_script("$scriptdir$comp->{preupgrade}"); + } + if (defined($comp->{preuninstall})) { + $preunscript = &load_script("$scriptdir$comp->{preuninstall}"); + } + } + + + #replace all special sub string in all files under debian + unless (opendir(DH, "${combuilddir}/debian/")) { + print "Can not open the xCAT Kit Component debian dir: ${combuilddir}/debian/"; + return 1; + } + + foreach (readdir(DH)) { + my $file = "${combuilddir}/debian/$_"; + if (-d $file) { + next; + } + + unless (open(FH, "<", $file)) { + print "Error attempting to open the xCAT Kit Component ${kitcompname}'s debian template file $file.\n"; + close(DH); + return 1; + } + + if ($::VERBOSE) { + print "Reading the xCAT Kit Component ${kitcompname}'s debian template file $file. \n"; + } + my @lines = ; + close(FH); + my $prepcomp = "prep-" . $comp->{basename}; + for (@lines) { + chomp; + s/<<>>/$comp->{basename}/; + s/<<>>/$comp->{ospkgdeps}/; + s/<<>>/$comp->{kitpkgdeps}/; + if ($::VALID_PREP_COMPONENT) { +s/<<>>/$comp->{kitcompdeps},$prepcomp/; + } + else + { +s/<<>>/$comp->{kitcompdeps}/; + } + + s/<<>>/$comp->{description}/; + s/<<>>/$upgradeflag/; + s/<<>>/$prescript/; + s/<<>>/$postscript/; + s/<<>>/$preupscript/; + s/<<>>/$postupscript/; + s/<<>>/$preunscript/; +s/<<>>/$postunscript/; + } + my $joined_lines = join("\n", @lines); + @lines = split(/\\n/, $joined_lines); + + open(FH, ">", $file); + if ($::VERBOSE) { + print "Created kitcomponent ${kitcompname}'s build file under debian dir $file"; + } + print FH @lines; + close(FH); + } + closedir(DH); + + if (defined($comp->{non_native_pkgs})) { + unless (open(FH, ">", "${combuilddir}/debian/dir")) { + print "Error attempting to open the xCAT Kit Component ${kitcompname}'s debian file dir.\n"; + return 1; + } + print FH "opt/xcat/kits/$kitname/$kitcompname/"; + close(FH); + + unless (open(FH, ">", "${combuilddir}/debian/install")) { + print "Error attempting to open the xCAT Kit Component ${kitcompname}'s debian file dir.\n"; + return 1; + } + foreach my $pkgfile (split(/,/, $comp->{non_native_pkgs})) { + my $pkgname = ''; + my ($key, $value) = split /:/, $pkgfile; + if ("$key" =~ /EXTERNALPKGS/) { + $pkgname = $value; + } else { + $pkgname = $key; + } + print FH "$pkgname opt/xcat/kits/$kitname/$kitcompname/ \n"; + } + close(FH); + } + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 load_script + + load a kitcomponent script into a single return string + with imbedded newline chars + input: fullpath of scriptname + +=cut + +#----------------------------------------------------------------------------- +sub load_script +{ + my $scriptname = shift; + my $SF; + unless (open($SF, "<", $scriptname)) { + print "Error attempting to open the file $scriptname. \n"; + return; + } + if ($::VERBOSE) { + print "Reading the file $scriptname. \n"; + } + my @lines = <$SF>; + close $SF; + + my $script_contents = join('', @lines); + return $script_contents; +} + +#----------------------------------------------------------------------------- + +=head3 create_kitconf + + Create the kit configuration file to put into the kit tar file. + +=cut + +#----------------------------------------------------------------------------- +sub create_kitconf +{ + # Build kit config file entries from buildkit config input + my $kitname = $::bldkit_config->{kit}{entries}[0]->{kitname}; + foreach my $s (keys %{$::bldkit_config}) { + if (!defined($::buildkit_def{$s})) { next; } + if ($s eq 'kitpackage') { next; } + my $li = 0; + foreach my $se (@{ $::bldkit_config->{$s}{entries} }) { + $::kit_config->{$s}{entries}[$li]->{kitname} = $kitname; + + # copy all defined attrs over + foreach my $a (keys %{ $::buildkit_def{$s} }) { + if (($::buildkit_def{$s}{$a}->{cp_to_kitconfig} eq '1') && + (defined($se->{$a}))) { + if ($s eq 'kitcomponent') { + if ($a eq 'kitpkgdeps') { + my $value; + foreach my $d (split(/,/, $se->{$a})) { + $d =~ s/\s+//g; + $d =~ s/^([\w\.\-]+)[<>=]*.*$/$1/; + $value .= "$d,"; + } + $value =~ s/(\,)*$//; + $se->{$a} = $value; + } + } + $::kit_config->{$s}{entries}[$li]->{$a} = $se->{$a}; + } + + # cp_to_kitconfig=2 means copy the file to the new kit + # but only do the copy if this is a final kit build + if (($::buildkit_def{$s}{$a}->{cp_to_kitconfig} eq '2') && + (defined($se->{$a})) && + !$::HAVE_EXTERNAL_PKG && !$::HAVE_NON_NATIVE_PKGS) { + my $prefix = "$kitname"; + if ($s eq 'kitcomponent') { + $prefix = "$::bldkit_config->{$s}{entries}[$li]->{kitcompname}"; + if (($a eq 'postbootscripts') || + ($a eq 'genimage_postinstall')) { + $prefix = "KIT_" . $prefix; + } + if (!($::kit_config->{$s}{entries}[$li]->{$a} = + &cp_to_builddir($a, $se->{$a}, $::workdir . '/' . $::buildkit_def{$s}{$a}->{base_dir}, $prefix, $::bldkit_config->{$s}{entries}[$li]))) { + return 1; + } + } else { + if (!($::kit_config->{$s}{entries}[$li]->{$a} = + &cp_to_builddir($a, $se->{$a}, $::workdir . '/' . $::buildkit_def{$s}{$a}->{base_dir}, $prefix))) { + return 1; + } + } + } + } + + # Handle special attrs, these 3 attributes did not defined in the buildkit.conf, special cases. + if ($s eq 'kitrepo') { + $::kit_config->{$s}{entries}[$li]->{kitreponame} = + $se->{kitreponame}; + } elsif ($s eq 'kitcomponent') { + $::kit_config->{$s}{entries}[$li]->{kitcompname} = + $se->{kitcompname}; + $::kit_config->{$s}{entries}[$li]->{kitreponame} = + $se->{kitreponame}; + if (!$::PREREQUISITE and ($se->{ospkgdeps} || $se->{preinstall} || $se->{preupgrade} || $se->{preuninstall})) { + if ($debianflag) { + $::kit_config->{$s}{entries}[$li]->{prerequisite} = + "prep-" . $se->{basename}; + } else { + $::kit_config->{$s}{entries}[$li]->{prerequisite} = + "prep_" . $se->{basename}; + } + } + } + $li++; + } + } + + # Handle external packages + if ($::HAVE_EXTERNAL_PKG) { + foreach my $kp (@{ $::bldkit_config->{kitpackage}{entries} }) { + if ($kp->{isexternalpkg} eq 'yes') { + my %current_entry; + $current_entry{filename} = $kp->{filename}; + $current_entry{kitreponame} = $kp->{kitreponame}; + push(@{ $::kit_config->{EXTERNALPKG}{'entries'} }, {%current_entry}); + } + } + } + + + # Handle non_native_pkgs + foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { + if ($::NON_NATIVE_PKGS->{ $kc->{kitcompname} }) { + my @nativefiles; + foreach my $pkgfile (split(/,/, $kc->{non_native_pkgs})) { + my ($key, $value) = split /:/, $pkgfile; + if ("$key" =~ /EXTERNALPKGS/) { + push(@nativefiles, $value); + } + } + + my %current_entry; + $current_entry{filename} = join ',', @nativefiles; + $current_entry{kitcompname} = $kc->{kitcompname}; + $current_entry{basename} = $kc->{basename}; + $current_entry{kitreponame} = $kc->{kitreponame}; + push(@{ $::kit_config->{NONNATIVEPKGS}{'entries'} }, {%current_entry}); + } + } + + + # Write Kit Config File + my @lines; + my $li = 0; + $lines[ $li++ ] = "# Kit Configuration File for $kitname generated by buildkit\n"; + $lines[ $li++ ] = "kitbuildinfo: \n"; + my $xCAT_buildkit_version = ''; + if ($debianflag) { + $xCAT_buildkit_version = `dpkg-query --show -f='\${Version}' xcat-buildkit`; + } + else { + $xCAT_buildkit_version = `rpm -q --qf \"%{VERSION}-%{RELEASE}\" xCAT-buildkit`; + } + $lines[ $li++ ] = " xCAT_version = $xCAT_buildkit_version \n"; + $lines[ $li++ ] = " build_date = " . localtime() . "\n"; + $lines[ $li++ ] = " kitframework = $::KITFRAMEWORK \n"; + $lines[ $li++ ] = " compatible_kitframeworks = $::COMPATIBLE_KITFRAMEWORKS \n"; + + foreach my $s ('kit', 'kitrepo', 'kitcomponent', 'EXTERNALPKG', 'NONNATIVEPKGS') { + foreach my $se (@{ $::kit_config->{$s}{entries} }) { + $lines[ $li++ ] = "$s: \n"; + foreach my $a (keys %{$se}) { + $lines[ $li++ ] = " $a = $se->{$a} \n"; + } + } + } + + if ((!-d $::deploy_dir) && (!mkpath($::deploy_dir))) { + print "Error creating build directory $::deploy_dir.\n"; + return; + } + + my $full_kit_conf = $::deploy_dir . "/" . $::kit_conf; + my $NCF; + unless (open($NCF, ">$full_kit_conf")) { + return 1; + } + if ($::VERBOSE) { + print "Wrote new kit configuration file $full_kit_conf \n"; + } + print $NCF @lines; + close($NCF); + + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 cp_to_builddir + + Copy specified files into the build directory renaming as indicated + and substituting strings if needed + +=cut + +#----------------------------------------------------------------------------- +sub cp_to_builddir +{ + my $type = shift; + my $files = shift; + my $from_dir = shift; + my $prefix = shift; + my $kitcomp = shift; + + my $copied_files; + my $other_files = $::deploy_dir . "/other_files"; + if ((!-d $other_files) && (!mkpath($other_files))) { + print "Error creating build directory $other_files.\n"; + return; + } + foreach my $file (split(/\,/, $files)) { + $file =~ s/\s+//g; + my $from_file = $from_dir . "/" . $file; + my $from_file_base = basename($file); + my $to_file_base = $prefix . "_" . $from_file_base; + my $to_file = $other_files . "/" . $to_file_base; + + # Read in the file + my $FF; + unless (open($FF, "<", $from_file)) { + print "The Kit file $from_file could not be read. \n"; + return 1; + } + my @lines = <$FF>; + for (@lines) { +s/<<>>/$::bldkit_config->{kit}{entries}[0]->{kitname}/g; +s/<<>>/$::bldkit_config->{kit}{entries}[0]->{basename}/g; +s/<<>>/$::bldkit_config->{kit}{entries}[0]->{version}/g; +s/<<>>/$::bldkit_config->{kit}{entries}[0]->{release}/g; + if (defined($kitcomp)) { +s/<<>>/$kitcomp->{kitcompname}/g; +s/<<>>/$kitcomp->{basename}/g; +s/<<>>/$kitcomp->{version}/g; +s/<<>>/$kitcomp->{release}/g; + } + } + + # Write the file back out + my $TF; + unless (open($TF, ">$to_file")) { + print "Error copying file $from_file to build directory $other_files \n"; + return 1; + } + if ($::VERBOSE) { + print "Copied $from_file to $to_file replacing kit and kitcomponent strings as needed. \n"; + } + print $TF @lines; + close($TF); + + $copied_files .= ",$to_file_base"; + + if (($type eq 'postbootscripts') || + ($type eq 'genimage_postinstall')) { + system("chmod 755 $to_file"); + } + } + $copied_files =~ s/^\,//; + return $copied_files; +} + +#----------------------------------------------------------------------------- + +=head3 create_builddir + + Create the build directory and copy in all required files for building + the kit tar file. + +=cut + +#----------------------------------------------------------------------------- +sub create_builddir +{ + my $kitname = $::bldkit_config->{kit}{entries}[0]->{kitname}; + + # Note: + # - repos already created and validated + # - kit.conf file already created + # - exlists, postbootscripts, and deployparams already copied + + # copy plugins to build dir and edit to insert correct plugin and kit names + my $plugin_dir = $::deploy_dir . "/plugins"; + if (-d "$::workdir/plugins") { + if ((!-d $plugin_dir) && (!mkpath($plugin_dir))) { + print "Error creating build directory $plugin_dir.\n"; + return 1; + } + + foreach my $plugin (<$::workdir/plugins/*.pm>) { + my $plugin_base = basename($plugin); + my $mod_kitname = $kitname; + $mod_kitname =~ s/\-/\_/g; + $mod_kitname =~ s/\./\_/g; + my $to_plugin = $plugin_dir . "/" . $mod_kitname . "_" . $plugin_base; + + if (system("cp -fp $plugin $to_plugin")) { + + # non-zero return from system call + print "Error copying plugin file $plugin to build directory $plugin_dir \n"; + return 1; + } + if (&edit_plugin($to_plugin)) { return 1; } + } + } + + # copy docs to build dir + if (-d "$::workdir/docs") { + if (system("cp -fRp $::workdir/docs $::deploy_dir")) { + + # non-zero return from system call + print "Error copying doc files $::workdir/docs to build directory $::deploy_dir \n"; + return 1; + } + } + + # Edit deploy params file to make sure correct format for xCAT + if (defined($::kit_config->{kit}{entries}[0]->{kitdeployparams})) { + my $kd_file = $::deploy_dir . "/other_files/" . $::kit_config->{kit}{entries}[0]->{kitdeployparams}; + if (&edit_deployparams($kd_file)) { return 1; } + } + + if ($::HAVE_EXTERNAL_PKG or $::HAVE_NON_NATIVE_PKGS) { + + # Copy the kitcomponent meta rpm spec if there is external non_native_pkgs. + if ($debianflag) { + foreach my $comp (keys %{$::NON_NATIVE_PKGS}) { + my $kitrepo; + foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { + if ($comp eq $kc->{kitcompname}) { + $kitrepo = $kc->{kitreponame} + } + } + mkpath("$::deploy_dir/tmp/"); + my $cmd = "cp -fRP $::workdir/debbuild/$comp $::deploy_dir/tmp/$comp"; + if (system("$cmd")) { + print "Error copying kitcomponent meta debian build file $::workdir/debbuild/$comp to build directory $::deploy_dir \n"; + return 1; + } + } + } + + # Copy over the original buildkit.conf file and input files + # to help make addpkgs processing easier later + mkpath("$::deploy_dir/build_input/"); + if (system("cp -fp $::full_buildkit_conf $::deploy_dir/build_input")) { + + # non-zero return from system call + print "Error copying buildkit config file $::full_buildkit_conf to build directory $::deploy_dir/build_input \n"; + return 1; + } + } + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 create_PARTIAL_builddir + + Create the build directory for a PARTIAL kit (needs external pkgs) + and copy in all required files for building the kit tar file. + This includes most build input without editting files since + they will need to be generated at addpkgs time. + +=cut + +#----------------------------------------------------------------------------- +sub create_PARTIAL_builddir +{ + my $kitname = $::bldkit_config->{kit}{entries}[0]->{kitname}; + + # Note: + # - repos already created and validated + # - kit.conf file already created + # - exlists, postbootscripts, and deployparams already copied + + # copy docs to build dir + if (-d "$::workdir/docs") { + if (system("cp -fRp $::workdir/docs $::deploy_dir")) { + + # non-zero return from system call + print "Error copying doc files $::workdir/docs to build directory $::deploy_dir \n"; + return 1; + } + } + + # Copy over the original buildkit.conf file and input files + # to help make addpkgs processing easier later + mkpath("$::deploy_dir/build_input/"); + if (system("cp -fp $::full_buildkit_conf $::deploy_dir/build_input")) { + + # non-zero return from system call + print "Error copying buildkit config file $::full_buildkit_conf to build directory $::deploy_dir/build_input \n"; + return 1; + } + if (-d "$::workdir/other_files") { + if (system("cp -fpR $::workdir/other_files $::deploy_dir/build_input")) { + + # non-zero return from system call + print "Error copying $::workdir/otherfiles to build directory $::deploy_dir/build_input \n"; + return 1; + } + } + if (-d "$::workdir/plugins") { + if (system("cp -fpR $::workdir/plugins $::deploy_dir/build_input")) { + + # non-zero return from system call + print "Error copying $::workdir/plugins to build directory $::deploy_dir/build_input \n"; + return 1; + } + } + if (-d "$::workdir/scripts") { + if (system("cp -fpR $::workdir/scripts $::deploy_dir/build_input")) { + + # non-zero return from system call + print "Error copying $::workdir/scripts to build directory $::deploy_dir/build_input \n"; + return 1; + } + } + + # Copy over any provided non-native packages + my $to_source_dir = "$::deploy_dir/build_input/source_packages"; + mkpath("$to_source_dir"); + foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { + if (defined($kc->{non_native_pkgs})) { + my $sourcedir = $::workdir . "/source_packages"; + foreach my $pkgfile (split(/,/, $kc->{non_native_pkgs})) { + my $pkg_file; + my ($key, $value) = split /:/, $pkgfile; + if ("$key" =~ /EXTERNALPKGS/) { + next; + } else { + $pkg_file = $key; + } + + my $cmd = "cp -p $sourcedir/$pkg_file $to_source_dir"; + if (system($cmd)) { + print "Error copying non-native package file $sourcedir/$pkg_file to $to_source_dir \n"; + return 1; + } + } + } + } + + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 edit_deployparams + + Edit the kit deployment parameters to make sure it has correct + syntax for xCAT otherpkglist support + + +=cut + +#----------------------------------------------------------------------------- +sub edit_deployparams +{ + my $file = shift; + my $validate_only = shift; + + # read in the file + my $DF; + unless (open($DF, "<", $file)) { + print "The Kit deployment parameters file $file could not be read. \n"; + return 1; + } + my @lines = <$DF>; + close $DF; + + # Edit the files + my $changed = 0; + my @new_lines; + my $ln = 0; + foreach my $l (@lines) { + $ln++; + + # skip blank lines + if ($l =~ /^\s*$/) { + push(@new_lines, $l); + next; + } + + # #ENV lines + $l =~ s/^\s+//; # compress leading blanks + if ($l =~ /^\#ENV\:/) { + if (!($l =~ /\#\s*$/)) { + chomp $l; + $l .= "#\n"; + $changed = 1; + } + push(@new_lines, $l); + next; + } + + # skip all other comments + if ($l =~ /^\s*#/) { + push(@new_lines, $l); + next; + } + + # Add #ENV if not specified + if ($l =~ /^\w*\s*\=/) { + chomp $l; + $l = "#ENV: $l #"; + $changed = 1; + push(@new_lines, $l); + next; + } + + # Syntax error + print "Syntax error in kit deployment parameters file $file \n"; + print "line $ln: \n"; + print "$l \n"; + return 1; + } + + # Write the file back out + if ($changed && !$validate_only) { + my $NDF; + unless (open($NDF, ">$file")) { + return 1; + } + if ($::VERBOSE) { + print "Editted kit deployment parameters file $file \n"; + } + print $NDF @lines; + close($NDF); + } + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 edit_plugin + + Edit the kit plugin file to insert the full kit name + + +=cut + +#----------------------------------------------------------------------------- +sub edit_plugin +{ + my $file = shift; + my $kitname = $::bldkit_config->{kit}{entries}[0]->{kitname}; + + # convert dashes to underscore since the kitname is used as perl pkg names + # in the plugin and this causes perl syntax errors + my $mod_kitname = $kitname; + $mod_kitname =~ s/\-/\_/g; + $mod_kitname =~ s/\./\_/g; + + # read in the file + my $PF; + unless (open($PF, "<", $file)) { + print "The Kit plugin file $file could not be read. \n"; + return 1; + } + my @lines = <$PF>; + close $PF; + + for (@lines) { + s/<<>>/$kitname/g; + s/<<>>/$mod_kitname/g; + } + + # Write the plugin back out + my $NPF; + unless (open($NPF, ">$file")) { + return 1; + } + if ($::VERBOSE) { + print "Inserted kitname values into $file \n"; + } + print $NPF @lines; + close($NPF); + + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 kit_addpkgs + + buildkit addpkgs + +=cut + +#----------------------------------------------------------------------------- +sub kit_addpkgs +{ + # add RPM pkgs to an existing kit tarfile + my $kittarfile = $::KIT_ADDPKGS; + my $kitbfname = basename($kittarfile); + $kitbfname =~ s/.tar.bz2$//; + $kitbfname =~ s/.NEED_PRODUCT_PKGS$//; + my $tmpdir_base = "/tmp/$kitbfname"; + + # - could be list of pkgdir s + my @pkgdirlist = split(",", $::PKGDIR); + + print "$tmpdir_base\n"; + # Cleanup - should have been removed when last command ran + # - but just in case + system("rm -Rf $tmpdir_base"); + + # the tar file may not be in the current dir + $kittarfile = "$::workdir/$kittarfile"; + + if (!(-r $kittarfile)) { + print "The Kit tar file $kittarfile could not be read. \n"; + return 1; + } + $kittarfile = abs_path($kittarfile); + + foreach my $rpmdir (@pkgdirlist) { + if (!(-d $rpmdir)) { + print "The package directory $rpmdir could not be read. \n"; + return 1; + } + } + + # Create work directory + if ((!-d $tmpdir_base) && (!mkpath($tmpdir_base))) { + print "Error creating temporary work directory $tmpdir_base\n"; + return 1; + } + + print "Extracting tar file $kittarfile. Please wait.\n"; + + if (system("cd $tmpdir_base; tar -jxf $kittarfile ")) { + print "Error extracting tarfile $kittarfile \n"; + + # Cleanup + system("rm -Rf $tmpdir_base"); + return 1; + } + + my $tmp_kit_conf = `find $tmpdir_base -name kit.conf`; + chomp($tmp_kit_conf); + my $tmpdir = dirname($tmp_kit_conf); + + # read in the file + my $CKF; + unless (open($CKF, "<", $tmp_kit_conf)) { + print "The Kit configuration file $tmp_kit_conf could not be read or was not included in the kit tar file. \n"; + + # Cleanup + system("rm -Rf $tmpdir_base"); + return 1; + } + my @lines = <$CKF>; + close $CKF; + + $::PREREQUISITE = 1; + foreach my $l (@lines) { + + # skip blank and comment lines + if ($l =~ /^\s*$/ || $l =~ /^\s*#/) { + next; + } + if ($l =~ /prerequisite/) { + $::PREREQUISITE = 0; + } + } + + # + # check contents of kit.conf to make sure the framework + # is compatible with this codes framework + $::kitframework = &check_framework(\@lines); + if (!defined($::kitframework)) { + return 1; + } + + # if this in not a partial kit then the framework must be 2 or greater + my $kit_name = basename($kittarfile); + if ((!($kit_name =~ /NEED_PRODUCT_PKGS/)) && ($::kitframework < 2)) { + print "This kit cannot be updated. To update a complete kit the kit framework\n value must be greater than or equal to 2. You can use the\n\t\'lskit -F \' \ncommand to check the framework value of the kit.\n"; + return 1; + } + + ### Check if this is a new partial kit built with xCAT 2.8.1 or newer + if (-d "$tmpdir/build_input") { + system("mv $tmpdir/build_input $tmpdir_base"); + return &NEW_kit_addpkgs($tmpdir_base, $tmpdir); + } + + ### OLD KITS BUILT PRIOR TO xCAT 2.8.1 + ### this code will eventually become obsolete and should be removed + ### do not update + if (defined($::KITVERSION) || defined($::KITRELEASE)) { + print "kitversion and kitrelease substitution is not supported for this incomplete kit. Run \"buildkit addpkgs\" without the \"-k|--kitversion\" and \"-r| --kitrelease\" options. \n"; + exit 1; + } + + my $rpmdir = $::PKGDIR; + + my $ext_filename = ''; + my $ext_reponames = ''; + my $non_native_filename = ''; + my $non_native_kitcompname = ''; + my $non_native_basename = ''; + my $non_native_kitreponame = ''; + my %create_repodata_list; + my @new_lines; + my $section = ''; + my $kitname = ''; + my $kitbasename = ''; + my $kitversion = ''; + my $kitostype = ''; + + foreach my $l (@lines) { + + # skip blank and comment lines + if ($l =~ /^\s*$/ || $l =~ /^\s*#/) { + push(@new_lines, $l); + next; + } + + # new section? + if ($l =~ /^\s*(\w+)\s*:/) { + $section = $1; + if ($section eq 'EXTERNALPKG') { + $ext_filename = ''; + $ext_reponames = ''; + next; + } + if ($section eq 'NONNATIVEPKGS') { + $non_native_filename = ''; + $non_native_kitcompname = ''; + $non_native_basename = ''; + $non_native_kitreponame = ''; + next; + } + push(@new_lines, $l); + next; + } + if ($l =~ /^\s*(\w+)\s*=\s*(.*)\s*/) { + my $attr = $1; + my $val = $2; + my $orig_attr = $attr; + my $orig_val = $val; + $attr =~ s/^\s*//; # Remove any leading whitespace + $attr =~ s/\s*$//; # Remove any trailing whitespace + $attr =~ tr/A-Z/a-z/; # Convert to lowercase + $val =~ s/^\s*//; + $val =~ s/\s*$//; + + + if ($section eq 'kit') { + if ($attr eq 'basename') { $kitbasename = $val; } + if ($attr eq 'version') { $kitversion = $val; } + if ($attr eq 'ostype') { $kitostype = $val; } + if (($kitbasename ne '') && ($kitversion ne '') && + ($kitostype ne '')) { + $kitname = "$kitbasename-$kitversion-$kitostype"; + } + } + + if ($section eq 'EXTERNALPKG') { + if ($attr eq 'filename') { + $ext_filename = $val; + } elsif ($attr eq 'kitreponame') { + $ext_reponames = $val; + } else { + next; + } + if (($ext_filename ne '') && ($ext_reponames ne '')) { + my $fromfile = $rpmdir . "/" . $ext_filename; + if (system("ls $fromfile > /dev/null")) { + print "The product package file $ext_filename could not be read from the package directory $rpmdir. \n"; + + # Cleanup + system("rm -Rf $tmpdir_base"); + return 1; + } + foreach my $repo (split(/,/, $ext_reponames)) { + my $repodir = $tmpdir . "/repos/" . $repo; + if (!-d ($repodir) && (!mkpath($repodir))) { + print "Error creating repository directory $repodir\n"; + + # Cleanup + system("rm -Rf $tmpdir_base"); + return 1; + } + if (system("cp -fp $fromfile $repodir")) { + print "Error copying package file $fromfile to $repodir \n"; + + # Cleanup + system("rm -Rf $tmpdir_base"); + return 1; + } + $create_repodata_list{$repodir} = 1; + } + } + next; + } + + if ($section eq 'NONNATIVEPKGS') { + if ($attr eq 'filename') { + $non_native_filename = $val; + } elsif ($attr eq 'kitcompname') { + $non_native_kitcompname = $val; + } elsif ($attr eq 'basename') { + $non_native_basename = $val; + } elsif ($attr eq 'kitreponame') { + $non_native_kitreponame = $val; + } else { + next; + } + if (($non_native_filename ne '') + && ($non_native_kitcompname ne '') + && ($non_native_basename ne '') + && ($non_native_kitreponame ne '')) { + + #find out the useful dir + my $tdir = $tmpdir . "/tmp/"; + my $source_dir = "$tdir/$non_native_kitcompname"; + my $spec = "$tdir/$non_native_kitcompname.spec"; + if (!-d "$tdir" or !-d "$source_dir") { + print "Error open kitcomponent rpm build direcotry $tdir or $tdir/$non_native_kitcompname \n"; + + # Cleanup + system("rm -Rf $tmpdir_base"); + return 1; + } + + #copy the nan_native_pkgs to the source dir + foreach my $tepmfilename (split(/,/, $non_native_filename)) { + + #the $non_native_filename may contain several pkgs, can check and copy at the same time + my $fromfile = $rpmdir . "/" . $tepmfilename; + if (system("ls $fromfile > /dev/null")) { + print "The product package file $non_native_filename could not be read from the package directory $rpmdir. \n"; + system("rm -Rf $tmpdir_base"); + return 1; + } + if (system("cp -fp $fromfile $tdir/$non_native_kitcompname")) { + print "Error copying package file $fromfile to $tdir/$non_native_kitcompname \n"; + + # Cleanup + system("rm -Rf $tmpdir_base"); + return 1; + } + } + + #for debian/ubuntu + my $repodir = $tmpdir . "/repos/" . $non_native_kitreponame; + if ($debianflag) { + my $debbuildcmd = "cd $source_dir;dpkg-buildpackage $dpkg_flag"; + if (system($debbuildcmd)) { + print "error running debian build cmd for kit component $non_native_basename meta package.\n"; + return 1; + } + my @debs = `find $tdir -maxdepth 1 -name "*.deb"`; + foreach my $debname (@debs) { + chomp($debname); + if (system("mv -f $debname $repodir")) { + print "Error copying package $debname to build repo directory $repodir. \n"; + return 1; + } + } + } + else { + if (!-r "$spec") { + print "Error open kitcomponent rpm build spec $tdir/$non_native_kitcompname.spec \n"; + + # Cleanup + system("rm -Rf $tmpdir_base"); + return 1; + } + my $rpmbuild_dir = $tmpdir . "/rpmbuild"; + my $cmd = "rm -Rf $rpmbuild_dir"; + system($cmd); + + my $avoiderr = $rpmbuild_dir . "/BUILDROOT/"; + mkpath($avoiderr); + $avoiderr = $rpmbuild_dir . "/BUILD/"; + mkpath($avoiderr); + $avoiderr = $rpmbuild_dir . "/SRPMS/"; + mkpath($avoiderr); + $avoiderr = $rpmbuild_dir . "/RPMS/noarch/"; + mkpath($avoiderr); + + unless (open(SF, "<", $spec)) { + print "Error attempting to open spec $spec of kitcomponent $non_native_basename. \n"; + return 1; + } + + mkpath("$rpmbuild_dir/SOURCES"); + $cmd = "cd $source_dir/..;mv $non_native_kitcompname $non_native_basename; tar -czf $rpmbuild_dir/SOURCES/$non_native_basename.tar.gz $non_native_basename;mv $non_native_basename $non_native_kitcompname;"; + if (system($cmd)) { + print "Error creating tarfile $rpmbuild_dir/SOURCES/$non_native_basename.tar from $source_dir/*"; + return 1; + } + my $rpmbuild_cmd = "rpmbuild --define \"_topdir $rpmbuild_dir\" -ba $spec"; + if (!$::VERBOSE) { + $rpmbuild_cmd .= ' --quiet '; + } + if (system($rpmbuild_cmd)) { + print "Error running rpmbuild command for kit component $non_native_basename meta package\n"; + return 1; + } + + # Copy the built meta rpm to repo + my @built_rpms = `find $rpmbuild_dir/RPMS -name "*.rpm"`; + foreach my $rpm (@built_rpms) { + chomp($rpm); + if (system("cp -fp $rpm $repodir")) { + print "Error copying rpm $rpm to build repo directory $repodir \n"; + return 1; + } + } + } + $create_repodata_list{$repodir} = 1; + } + next; + } + + push(@new_lines, $l); + } + } + + # Re-write kit.conf with EXTERNALPKG and NONNATIVEPKGS sections removed + my $NCF; + unless (open($NCF, ">$tmp_kit_conf")) { + return 1; + } + print $NCF @new_lines; + close($NCF); + + # Clean up RPMBUILD and tmp in kit directory + my $cmd = "rm -Rf $tmpdir/tmp"; + system("$cmd"); + unless ($debianflag) { + $cmd = "rm -Rf $tmpdir/rpmbuild"; + system("$cmd"); + } + + # Run createrepo for each updated directory + foreach my $repo (keys(%create_repodata_list)) { + my $createrepocmd = ''; + if ($debianflag) { + $createrepocmd = "cd $repo;dpkg-scanpackages . > Packages"; + } + else { + $createrepocmd = "createrepo $repo"; + } + if (system($createrepocmd )) { + print "Error running $createrepocmd. \n"; + + # Cleanup + system("rm -Rf $tmpdir_base"); + return 1; + } + } + + # Create new tar file in current directory + my $new_tarfile = $::workdir . '/' . $kitbfname . '.tar.bz2'; + if (system("cd $tmpdir; cd ..; tar -cjhf $new_tarfile $kitname/*")) { + print "Error building tarfile $new_tarfile \n"; + + # Cleanup + system("rm -Rf $tmpdir_base"); + return 1; + } + print "Kit tar file $new_tarfile successfully built \n"; + + # Cleanup + system("rm -Rf $tmpdir_base"); + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 NEW_kit_addpkgs + + buildkit addpkgs + +=cut + +#----------------------------------------------------------------------------- +sub NEW_kit_addpkgs +{ + # add RPM pkgs to an existing kit tarfile + my $tmpdir_base = shift; + my $tmpdir = shift; + + # - could be list of pkgdir dirs + my @pkgdirlist = split(",", $::PKGDIR); + + $::NEW_PARTIAL_KIT = 1; + $::workdir = "$tmpdir_base/build_input"; + $::full_buildkit_conf = $::workdir . "/" . $::buildkit_conf; + $::deploy_dir = $tmpdir_base; #kitname appended by validate_bldkitconf routine + + my $tmp_buildkit_conf = `find $tmpdir_base -name $::buildkit_conf`; + + chomp($tmp_buildkit_conf); + if ($tmp_buildkit_conf ne $::full_buildkit_conf) { + print "$tmp_buildkit_conf should match $::full_buildkit_conf .... error??? \n"; + } + + my $loadrc = &load_bldkitconf($tmp_buildkit_conf); + if ($loadrc != 0) { + print "Error reading buildkit config file $tmp_buildkit_conf \n"; + return 1; + } + + if (defined($::KITVERSION)) { + $::bldkit_config->{kit}{entries}[0]->{version} = $::KITVERSION; + } + if (defined($::KITRELEASE)) { + $::bldkit_config->{kit}{entries}[0]->{release} = $::KITRELEASE; + } + + my $chkrc = &validate_bldkitconf(); + if ($chkrc != 0) { + print "Error validating buildkit config file $tmp_buildkit_conf \n"; + return 1; + } + + if ($tmpdir ne $::deploy_dir) { + if (system("mv $tmpdir $::deploy_dir ")) { + print "Error moving $tmpdir to $::deploy_dir \n"; + return 1; + } + } + $::build_dir = $::deploy_dir; + $::base_repodir = "$::deploy_dir/repos"; + my $kitname = $::bldkit_config->{kit}{entries}[0]->{kitname}; + + # Handle external packages + if ($::HAVE_EXTERNAL_PKG) { + foreach my $kp (@{ $::bldkit_config->{kitpackage}{entries} }) { + if ($kp->{isexternalpkg} eq 'yes') { + my $ext_filename = $kp->{filename}; + my $ext_reponames = $kp->{kitreponame}; + my $files; + if ($debianflag) { + $files = xCAT::BuildKitUtils->find_latest_pkg_deb(\@pkgdirlist, $ext_filename); + } + else { + $files = xCAT::BuildKitUtils->find_latest_pkg(\@pkgdirlist, $ext_filename); + } + if (!defined($files)) { + print "Error: The product package file $ext_filename was not found in the package directory(s) @pkgdirlist.\n"; + + # Cleanup + system("rm -Rf $tmpdir_base"); + return 1; + } + + my @fromfiles = @$files; + + foreach my $repo (split(/,/, $ext_reponames)) { + my $repodir = $::base_repodir . "/" . $repo; + if (!-d ($repodir) && (!mkpath($repodir))) { + print "Error creating repository directory $repodir\n"; + + # Cleanup + system("rm -Rf $tmpdir_base"); + return 1; + } + + foreach my $fromfile (@fromfiles) { + if (system("cp -fp $fromfile $repodir")) { + print "Error copying package file $fromfile to $repodir \n"; + + # Cleanup + system("rm -Rf $tmpdir_base"); + return 1; + } + } + if ($::VERBOSE) { + print "Copied @fromfiles\n to $repodir\n"; + } + } + } + } + } + + # Handle non_native_pkgs + # Comma-separated list of non-native package + # paths that will be included as files in this kit + # component. + # these are not RPMs! + my $to_source_dir = "$::workdir/source_packages"; + mkpath("$to_source_dir"); + foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { + if ($::NON_NATIVE_PKGS->{ $kc->{kitcompname} }) { + my @nativefiles; + foreach my $pkgfile (split(/,/, $kc->{non_native_pkgs})) { + my ($key, $value) = split /:/, $pkgfile; + if ("$key" =~ /EXTERNALPKGS/) { + + #the $non_native_filename may contain several pkgs, can check and copy at the same time + foreach my $nnpkg (split(/,/, $value)) { + my $found = 0; + foreach my $pdir (@pkgdirlist) { + my $fromfile = $pdir . "/" . $nnpkg; + if (system("ls $fromfile > /dev/null")) { + next; + } else { + $found++; + if (system("cp -fp $fromfile $to_source_dir")) { + print "Error copying package file $fromfile to $to_source_dir \n"; + + # Cleanup + system("rm -Rf $tmpdir_base"); + next; + } else { + if ($::VERBOSE) { + print "Copied $fromfile to $to_source_dir\n"; + } + } + } + } + if (!$found) { + print "Could not find $nnpkg.\n"; + } + } + } + } + } + } + + # Turn off external pkg flags and build the kit component meta pkgs + $::HAVE_EXTERNAL_PKG = ''; + $::HAVE_NON_NATIVE_PKGS = ''; + $::NON_NATIVE_PKGS = {}; + + foreach my $kc (@{ $::bldkit_config->{kitcomponent}{entries} }) { + my $rc = 0; + if ($debianflag) { + $rc = &build_kitcomp_debian($kc); + } + else { + $rc = &build_kitcomp($kc); + } + if ($rc) { + print "Error building kitcomponent metapackage for $kc->{basename} \n"; + return 1; + } + } + + # run createrepo + foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) { + my $repodir = "$::base_repodir/$kr->{kitreponame}"; + if (-d $repodir) { + my $cr_opts = ''; + if (($kr->{osbasename} =~ m/rh|RH|centos|CentOS/) && + ($kr->{osmajorversion} eq '5')) { + $cr_opts = '-s md5'; + } + my $repocmd = ""; + if ($debianflag) { + $repocmd = "cd $repodir;dpkg-scanpackages . > Packages"; + } + else { + $repocmd = "createrepo $cr_opts $repodir"; + } + if (system($repocmd )) { + print "Error building the repository meta-data with the createrepo command \n"; + return 1; + } + } + } + + + #When using -k -r, there are useless repodir + #delete useless repo dir + my $kitrepodirby = $::base_repodir; + my $cmdby = "/bin/ls $kitrepodirby 2>/dev/null"; + my $outputby = `$cmdby`; + my @allrepolist = split(/\n/, $outputby); + my @dellist; + + foreach my $reponame (@allrepolist) + { + my $match = 0; + foreach my $kr (@{ $::bldkit_config->{kitrepo}{entries} }) + { + my $repodirname = "$kr->{kitreponame}"; + + if (${repodirname} eq ${reponame}) + { + ${match}++; + } + } + if (${match} == 0) + { + push(@dellist, $reponame); + } + } + + foreach my $del (@dellist) + { + my $delrepodir = $::base_repodir . "/" . $del; + if (-d $delrepodir) + { + my $delcmd = "rm -Rf $delrepodir"; + if (system($delcmd)) + { + print "Failed to delete useless repo directory \n"; + } + } + } + + + # Build the full kit tar file + my $buildtar_rc = &kit_buildtar; + + # clean out the tmp dir + system("rm -Rf $tmpdir_base"); + + if ($buildtar_rc) { + print "Error building full kit tarfile \n"; + return 1; + } + return 0; +} + +#----------------------------------------------------------------------------- + +=head3 check_framework + + Check the compatible frameworks of the kit to see if it is + compatible with the running code. + + If one of the compatible frameworks of the kit matches one of the + compatible frameworks of the running code then we're good. + + NOTE: compatible_kitframeworks are the kitframeworks that I can add + and kit frameworks that I can be added to. + + Returns: + 0 - kit framework value + undef - error + + Example: + my $kitframework = &check_framework(\@lines); + +=cut + +#----------------------------------------------------------------------------- +sub check_framework +{ + my $lines = shift; + + my @kitconflines = @$lines; + + my $kitbasename; + my $kitcompat; + my $kitframework; + my $section = ''; + foreach my $l (@kitconflines) { + + # skip blank and comment lines + if ($l =~ /^\s*$/ || $l =~ /^\s*#/) { + next; + } + + if ($l =~ /^\s*(\w+)\s*:/) { + $section = $1; + next; + } + + if ($l =~ /^\s*(\w+)\s*=\s*(.*)\s*/) { + my $attr = $1; + my $val = $2; + $attr =~ s/^\s*//; # Remove any leading whitespace + $attr =~ s/\s*$//; # Remove any trailing whitespace + $attr =~ tr/A-Z/a-z/; # Convert to lowercase + $val =~ s/^\s*//; + $val =~ s/\s*$//; + + if ($section eq 'kitbuildinfo') { + if ($attr eq 'compatible_kitframeworks') { + $kitcompat = $val; + } + if ($attr eq 'kitframework') { + $kitframework = $val; + } + } + if ($section eq 'kit') { + if ($attr eq 'basename') { $kitbasename = $val; } + } + } + } + + if (!$kitcompat) { + print "Warning: Could not determine the kit compatible framework values for \'$kitbasename\' from the kit.conf file. Continuing for now.\n"; + return 0; + } + + my @kit_compat_list = split(',', $kitcompat); + my @my_compat_list = split(',', $::COMPATIBLE_KITFRAMEWORKS); + + foreach my $myfw (@my_compat_list) { + chomp $myfw; + foreach my $kitfw (@kit_compat_list) { + chomp $kitfw; + + if ($myfw eq $kitfw) { + return $kitframework; + } + } + } + print "Error: The kit named \'$kitbasename\' is not compatible with this version of the buildkit command. \'$kitbasename\' is compatible with \'$kitcompat\' and the buildkit command is compatible with \'$::COMPATIBLE_KITFRAMEWORKS\'\n"; + return undef; +} diff --git a/xCAT-buildkit/xCAT-buildkit.spec b/xCAT-buildkit/xCAT-buildkit.spec index 2b7d550a4..8531dac38 100644 --- a/xCAT-buildkit/xCAT-buildkit.spec +++ b/xCAT-buildkit/xCAT-buildkit.spec @@ -35,6 +35,8 @@ xCAT-buildkit provides the buildkit tool and sample kit files to build an xCAT k # Convert pods to man pages and html pages mkdir -p share/man/man1 mkdir -p share/doc/man1 +pod2man pods/man1/buildkit.1.pod > share/man/man1/buildkit.1 +pod2html pods/man1/buildkit.1.pod > share/doc/man1/buildkit.1.html %install rm -rf $RPM_BUILD_ROOT @@ -44,18 +46,30 @@ mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man1 mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/man1 +# These were built dynamically in the build phase +cp share/man/man1/* $RPM_BUILD_ROOT/%{prefix}/share/man/man1 +chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man1/* +cp share/doc/man1/* $RPM_BUILD_ROOT/%{prefix}/share/doc/man1 +chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/man1/* + %ifos linux cp -aR share/xcat/kits/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits/ +#chmod -R 644 $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits/* find $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits -type d -exec chmod 755 {} \; find $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits -type f -exec chmod 644 {} \; cp -a lib/perl/xCAT/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT +#chmod -R 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/* find $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT -type d -exec chmod 755 {} \; find $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT -type f -exec chmod 644 {} \; +cp -a bin/* $RPM_BUILD_ROOT/%{prefix}/bin/ +chmod -R 755 $RPM_BUILD_ROOT/%{prefix}/bin/* %else cp -hpR share/xcat/kits/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits/ chmod -R 644 $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits/* cp -hpR lib/perl/xCAT/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/ chmod -R 755 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/* +cp -hpR bin/* $RPM_BUILD_ROOT/%{prefix}/bin/ +chmod -R 755 $RPM_BUILD_ROOT/%{prefix}/bin/* %endif mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-buildkit From 85f3f56b884eebcdea6cf5095b3394add1f75f15 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 3 Oct 2019 11:47:04 -0400 Subject: [PATCH 246/276] Revert "Remove kit links" This reverts commit ac3ae5630fd89633599e4664f4b2f4c327e91e97. --- xCAT-client/debian/xcat-client.links | 8 ++++++++ xCAT-client/xCAT-client.spec | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/xCAT-client/debian/xcat-client.links b/xCAT-client/debian/xcat-client.links index cc310d33f..0bf090cd8 100644 --- a/xCAT-client/debian/xcat-client.links +++ b/xCAT-client/debian/xcat-client.links @@ -92,6 +92,14 @@ opt/xcat/bin/xcatclient opt/xcat/bin/lshwconn opt/xcat/bin/xcatclientnnr opt/xcat/sbin/makeroutes opt/xcat/bin/xcatclientnnr opt/xcat/sbin/snmove opt/xcat/bin/xcatclientnnr opt/xcat/bin/lsxcatd +opt/xcat/bin/xcatclientnnr opt/xcat/bin/lskit +opt/xcat/bin/xcatclientnnr opt/xcat/bin/addkit +opt/xcat/bin/xcatclientnnr opt/xcat/bin/rmkit +opt/xcat/bin/xcatclientnnr opt/xcat/bin/lskitcomp +opt/xcat/bin/xcatclientnnr opt/xcat/bin/addkitcomp +opt/xcat/bin/xcatclientnnr opt/xcat/bin/rmkitcomp +opt/xcat/bin/xcatclientnnr opt/xcat/bin/chkkitcomp +opt/xcat/bin/xcatclientnnr opt/xcat/bin/lskitdeployparam opt/xcat/bin/xcatclient opt/xcat/bin/postage opt/xcat/bin/xcatclient opt/xcat/bin/cfghost opt/xcat/bin/xcatclientnnr opt/xcat/bin/cfgve diff --git a/xCAT-client/xCAT-client.spec b/xCAT-client/xCAT-client.spec index 69b2c34d1..5b44dabcf 100644 --- a/xCAT-client/xCAT-client.spec +++ b/xCAT-client/xCAT-client.spec @@ -249,6 +249,14 @@ ln -sf ../bin/xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/cfghost ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/cfgve ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/lsve ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/rmosdistro +ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/lskit +ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/addkit +ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/rmkit +ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/lskitcomp +ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/addkitcomp +ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/rmkitcomp +ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/chkkitcomp +ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/lskitdeployparam ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/lskmodules ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/nodeimport ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/nodediscoverstart From 3c2b70a104b41ad4439eea8c31bd666299df87d5 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 3 Oct 2019 15:09:24 -0400 Subject: [PATCH 247/276] Remove comments that kits were removed --- xCAT-server/share/xcat/tools/go-xcat | 4 ---- 1 file changed, 4 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 290916800..dc402a8a8 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -23,10 +23,6 @@ # - xCAT uninstallation # 2019-03-22 GONG Jie # - Better debug log when reading repository failed -# 2019-07-24 Mark Gurevich -# - Removed references to buildkit -# 2019-08-12 Mark Gurevich -# - Added xCAT-buildkit to uninstall list # 2019-08-15 Mark Gurevich # - Added conserver-xcat to uninstall list # From dbb66408221e6dd96b2f69e0ae886c6e2ede7c63 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 7 Oct 2019 13:25:26 -0400 Subject: [PATCH 248/276] OpenBMC fixes for OP940 changes [Python] --- xCAT-openbmc-py/lib/python/agent/common/rest.py | 6 ++++-- xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/common/rest.py b/xCAT-openbmc-py/lib/python/agent/common/rest.py index e82485c6d..54fb5b4eb 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/rest.py +++ b/xCAT-openbmc-py/lib/python/agent/common/rest.py @@ -15,10 +15,12 @@ from . import exceptions as xcat_exception class RestSession(object): - def __init__(self): + def __init__(self, auth=None): self.session = requests.Session() self.cookies = None - self.auth = None + # If userid and password were passed in, use them for basic authorization + # This is required to connect to BMC with OP940 level, ignored for lower OP levels + self.auth = auth def request(self, method, url, headers, data=None, timeout=30): diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 3f1565833..2ce1a547e 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -248,12 +248,12 @@ RSPCONFIG_APIS = { EVENTLOG_URLS = { "list": "/logging/enumerate", - "clear_all": "/logging/action/deleteAll", + "clear_all": "/logging/action/DeleteAll", "resolve": "/logging/entry/{}/attr/Resolved", } RAS_POLICY_TABLE = "/opt/ibm/ras/lib/policyTable.json" -RAS_POLICY_MSG = "Install the OpenBMC RAS package to obtain more details logging messages." +RAS_POLICY_MSG = "Install the OpenBMC RAS package to obtain more detailed logging messages." RAS_NOT_FOUND_MSG = " Not found in policy table: " RESULT_OK = 'ok' @@ -279,7 +279,7 @@ class OpenBMCRest(object): # print back to xcatd or just stdout self.messager = kwargs.get('messager') - self.session = rest.RestSession() + self.session = rest.RestSession((self.username,self.password)) self.root_url = HTTP_PROTOCOL + self.bmcip + PROJECT_URL self.download_root_url = HTTP_PROTOCOL + self.bmcip + '/' From 85101a7c3c3aef525886594e7fbf0acde2ddecb2 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 9 Oct 2019 11:59:37 -0400 Subject: [PATCH 249/276] Workflow Guide document fixes --- .../guides/get-started/workflow_guide.rst | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/docs/source/guides/get-started/workflow_guide.rst b/docs/source/guides/get-started/workflow_guide.rst index 49bedef5b..0cb1f594b 100644 --- a/docs/source/guides/get-started/workflow_guide.rst +++ b/docs/source/guides/get-started/workflow_guide.rst @@ -1,71 +1,69 @@ Workflow Guide ============== -If xCAT looks suitable for your requirement, following steps are recommended procedure to set up an xCAT cluster. +If xCAT looks suitable for your requirement, following steps are recommended to set up an xCAT cluster. -#. Find a server as your xCAT management node +#. Find a server for xCAT management node - The server can be a bare-metal server or a virtual machine. The major factor for selecting a server is the number of machines in your cluster. The bigger the cluster is, the performance of server need to be better. + The server can be a bare-metal server or a virtual machine. The major factor for selecting a server is the number of machines in your cluster. The bigger the cluster is, the performance of server need to be better. - ``NOTE``: The architecture of xCAT management node is recommended to be same as the target compute node in the cluster. + The architecture of xCAT management node is recommended to be same as the target compute node in the cluster. #. Install xCAT on your selected server - The server which installed xCAT will be the **xCAT Management Node**. + The server where xCAT is installed will be the **xCAT Management Node**. - Refer to the doc: :doc:`xCAT Install Guide <../guides/install-guides/index>` to learn how to install xCAT on a server. + Refer to the doc: :doc:`xCAT Install Guide ` to learn how to install xCAT on a server. -#. Start to use xCAT management node + Refer to the doc: :doc:`xCAT Admin Guide ` to learn how to manage xCAT Management server. - Refer to the doc: :doc:`xCAT Admin Guide <../guides/admin-guides/index>`. +#. Discover target compute nodes in the cluster -#. Discover target nodes in the cluster + Define the target nodes in the xCAT database before managing them. - You have to define the target nodes in the xCAT database before managing them. + For a small cluster (less than 5), you can collect the information of target nodes one by one and then define them manually through ``mkdef`` command. - For a small cluster (less than 5), you can collect the information of target nodes one by one and then define them manually through ``mkdef`` command. + For a bigger cluster, you can use the automatic method to discover the target nodes. The discovered nodes will be defined to xCAT database. You can use ``lsdef`` to display them. - For a bigger cluster, you can use the automatic method to discover the target nodes. The discovered nodes will be defined to xCAT database. You can use ``lsdef`` to display them. + Refer to the doc: :doc:`xCAT discovery Guide ` to learn how to discover and define compute nodes. - Refer to the doc: :doc:`xCAT discovery Guide <../guides/admin-guides/manage_clusters/ppc64le/discovery/index>` to learn how to discover and define compute nodes. +#. Perform hardware control operations against the target compute nodes -#. Try to perform the hardware control against the target nodes + Verify the hardware control for defined nodes. e.g. ``rpower stat``. - Now you have the node definition. Verify the hardware control for defined nodes is working. e.g. ``rpower stat``. - - Refer to the doc: :doc:`Hardware Management <../guides/admin-guides/manage_clusters/ppc64le/management/index>` to learn how to perform the remote hardware control. + Refer to the doc: :doc:`Hardware Management ` to learn how to perform the remote hardware control. #. Deploy OS on the target nodes - * Prepare the OS images - * Customize the OS images (Optional) - * Perform the OS deployment + * Prepare the OS images + * Customize the OS images (Optional) + * Perform the OS deployment - Refer to the doc: :doc:`Diskful Install <../guides/admin-guides/manage_clusters/ppc64le/diskful/index>`, :doc:`Diskless Install <../guides/admin-guides/manage_clusters/ppc64le/diskless/index>` to learn how to deploy OS for a target node. + Refer to the doc: :doc:`Diskful Install `, :doc:`Diskless Install ` to learn how to deploy OS for a target node. #. Update the OS after the deployment - You may require to update the OS of certain target nodes after the OS deployment, try the ``updatenode`` command. ``updatenode`` command can execute the following tasks for target nodes: + You may require to update the OS of certain target nodes after the OS deployment, try the ``updatenode`` command. ``updatenode`` command can execute the following tasks for target nodes: * Install additional software/application for the target nodes * Sync some files to the target nodes * Run some postscript for the target nodes - Refer to the doc: :doc:`Updatenode <../guides/admin-guides/manage_clusters/ppc64le/updatenode>` to learn how to use ``updatenode`` command. + Refer to the doc: :doc:`Updatenode ` to learn how to use ``updatenode`` command. #. Run parallel commands -When managing a cluster with hundreds or thousands of nodes, operating on many nodes in parallel might be necessary. xCAT has some parallel commands for that. + When managing a cluster with hundreds or thousands of nodes, operating on many nodes in parallel might be necessary. xCAT has some parallel commands for that. * Parallel shell * Parallel copy * Parallel ping - Refer to the :doc:`/guides/admin-guides/manage_clusters/ppc64le/parallel_cmd` to learn how to use parallel commands. + Refer to the :doc:`/guides/admin-guides/manage_clusters/ppc64le/parallel_cmd` to learn how to use parallel commands. #. Contribute to xCAT (Optional) -While using xCAT, if you find something (code, documentation, ...) that can be improved and you want to contribute that to xCAT, do that for your and other xCAT users benefit. And welcome to xCAT community! + While using xCAT, if you find something (code, documentation, ...) that can be improved and you want to contribute that to xCAT, do that for your and other xCAT users benefit. And welcome to xCAT community! Refer to the :doc:`/developers/index` to learn how to contribute to xCAT community. From 41f73fff85c842f3e4a560fab6686d77ecb9267f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 10 Oct 2019 10:17:27 -0400 Subject: [PATCH 250/276] Add delay to nodeset testcase --- xCAT-test/autotest/testcase/nodeset/cases0 | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/nodeset/cases0 b/xCAT-test/autotest/testcase/nodeset/cases0 index 3550b3a22..2e807673c 100644 --- a/xCAT-test/autotest/testcase/nodeset/cases0 +++ b/xCAT-test/autotest/testcase/nodeset/cases0 @@ -223,6 +223,7 @@ check:rc!=0 cmd:chdef -t node -o testnode1 ip= check:rc==0 cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:sleep 2 cmd:getent hosts testnode1 | grep testnode1 check:rc!=0 cmd:nodeset testnode1 osimage=rhels6.99-x86_64-install-compute From adc7ee5171ef89eea97c3d32a391fdeb6557587c Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 11 Oct 2019 12:26:55 -0400 Subject: [PATCH 251/276] Insert devel into xcat-dep repo file --- builddep.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/builddep.sh b/builddep.sh index 3344c2aa5..75235fa99 100755 --- a/builddep.sh +++ b/builddep.sh @@ -248,9 +248,6 @@ for i in `find -mindepth 2 -maxdepth 2 -type d `; do fi done -# Modify xcat-dep.repo files to point to the correct place -echo "===> Modifying the xcat-dep.repo files to point to the correct location..." - echo "===> Making sure that the mklocalrepo.sh file contains execute permission ..." ls -ltr ${XCATCOREDIR}/${WORKING_TARGET_DIR}/mklocalrepo.sh if [[ ! -x "${XCATCOREDIR}/${WORKING_TARGET_DIR}/mklocalrepo.sh" ]]; then @@ -294,6 +291,11 @@ echo "===> Creating $DFNAME ..." tar $verbosetar -jcf $DFNAME xcat-dep chmod a+r $DFNAME + +# Modify all xcat-dep.repo files to point to the correct place: $YUM +echo "===> Modifying the xcat-dep.repo files to point to the correct 'yum/devel' location..." +find ${WORKING_TARGET_DIR} -type f -name "xcat-dep.repo" -exec sed -i s#/yum/xcat-dep#/${YUM}/xcat-dep#g {} \; + if [[ ${UP} -eq 0 ]]; then echo "Upload not being done, set UP=1 to upload to xcat.org" exit 0; From a5f72ad3a43c0dd994f59d88723cc547569d55ca Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 14 Oct 2019 14:50:40 -0400 Subject: [PATCH 252/276] remove node definition from rscan --- xCAT-test/autotest/testcase/rscan/cases0 | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/xCAT-test/autotest/testcase/rscan/cases0 b/xCAT-test/autotest/testcase/rscan/cases0 index 636920a00..6f411c88b 100644 --- a/xCAT-test/autotest/testcase/rscan/cases0 +++ b/xCAT-test/autotest/testcase/rscan/cases0 @@ -24,6 +24,7 @@ end start:rscan_w label:others,hctrl_hmc hcp:hmc +cmd:lsdef -t node all -z > /tmp/all.stanza cmd:lsdef -t node -l $$CN -z > /tmp/$$CN.stanza check:rc==0 cmd:perl -pi -e 's/$$CN/testnode/g' /tmp/$$CN.stanza @@ -37,14 +38,15 @@ check:output=~hmc\s+__GETNODEATTR($$CN,hcp)__+\s+\w{4}-\w{3}\s+\w{7} cmd:lsdef -l $$CN check:rc==0 check:output=~hcp=__GETNODEATTR($$CN,hcp)__ -cmd:rmdef $$CN,testnode -cmd:perl -pi -e 's/testnode/$$CN/g' /tmp/$$CN.stanza -cmd:cat /tmp/$$CN.stanza | mkdef -z +cmd:rmdef all +cmd:cat /tmp/all.stanza | mkdef -z +cmd:rm -f /tmp/all.stanza cmd:rm -f /tmp/$$CN.stanza end start:rscan_x_w label:others,hctrl_hmc hcp:hmc +cmd:lsdef -t node all -z > /tmp/all.stanza cmd:lsdef -t node -l $$CN -z > /tmp/$$CN.stanza check:rc==0 cmd:perl -pi -e 's/$$CN/testnode/g' /tmp/$$CN.stanza @@ -56,14 +58,15 @@ check:output=~[\w-]+ cmd:lsdef -l $$CN check:rc==0 check:output=~hcp=__GETNODEATTR($$CN,hcp)__ -cmd:rmdef $$CN,testnode -cmd:perl -pi -e 's/testnode/$$CN/g' /tmp/$$CN.stanza -cmd:cat /tmp/$$CN.stanza | mkdef -z +cmd:rmdef all +cmd:cat /tmp/all.stanza | mkdef -z +cmd:rm -f /tmp/all.stanza cmd:rm -f /tmp/$$CN.stanza end start:rscan_z_w label:others,hctrl_hmc hcp:hmc +cmd:lsdef -t node all -z > /tmp/all.stanza cmd:lsdef -t node -l $$CN -z > /tmp/$$CN.stanza check:rc==0 cmd:perl -pi -e 's/$$CN/testnode/g' /tmp/$$CN.stanza @@ -75,9 +78,8 @@ check:output=~parent=[\w-]+ check:lsdef -l $$CN check:rc==0 check:output=~parent=[\w-]+ -cmd:rmdef $$CN,testnode -cmd:perl -pi -e 's/testnode/$$CN/g' /tmp/$$CN.stanza -cmd:cat /tmp/$$CN.stanza | mkdef -z +cmd:rmdef all +cmd:cat /tmp/all.stanza | mkdef -z +cmd:rm -f /tmp/all.stanza cmd:rm -f /tmp/$$CN.stanza end - From 9e82869d54163791698c0703ab898b45a5c49049 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 14 Oct 2019 16:57:22 -0400 Subject: [PATCH 253/276] Clean genimage before kdump test --- xCAT-test/autotest/testcase/kdump/linux_diskless_kdump | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index 0e0ba3104..3ef555b2d 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -47,6 +47,7 @@ check:rc==0 cmd:chdef -t node $$CN -p postscripts=enablekdump check:rc==0 +cmd:rmimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute @@ -70,10 +71,13 @@ check:rc==0 check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN "echo 'echo 1 > /proc/sys/kernel/sysrq; echo c > /proc/sysrq-trigger' > /tmp/kdump.trigger" cmd:xdsh $$CN "chmod 755 /tmp/kdump.trigger" + +cmd:xdsh $$CN "rpm -q at" cmd:xdsh $$CN "service atd start" -cmd:sleep 30 +check:rc==0 + cmd:xdsh $$CN "at now +1 minutes <<< /tmp/kdump.trigger" -cmd:sleep 600 +cmd:sleep 300 cmd:vmcorefile=`find /opt/xcat/share/xcat/tools/autotest/kdumpdir/ -name vmcore`;if [[ -s $vmcorefile ]]; then echo "this file is not empty";else echo "this file is empty"; fi check:output=~not empty From 84f6f9a63702a22fb64c3d9a1b6a364dc10b35f6 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 16 Oct 2019 17:16:37 -0400 Subject: [PATCH 254/276] Revert "Modify pkgdir for ubuntu16.04.5 x86 testcase" This reverts commit 328aafee2de45d4927017ce9b6ef927709aa9ba4. --- .../testcase/installation/reg_linux_diskless_installation_flat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index 59aaa36b0..b048d547a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -34,7 +34,7 @@ cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi cmd:mount |sort > /tmp/mountoutput/file.org cmd:cat /tmp/mountoutput/file.org cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu18.04.2" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ ppc64(el|le) ]] && [[ "__GETNODEATTR($$CN,mgt)__" =~ "kvm" ]] ; then mkdir -p /install/custom/netboot/ubuntu; sed -e 's@linux-image-generic-hwe-18.04@linux-image-generic@g' /install/custom/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist; chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute pkglist=/install/custom/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist; fi -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 From fda16b6bdf73dd4c349c14ad87927a81efc422a1 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 16 Oct 2019 17:17:07 -0400 Subject: [PATCH 255/276] Revert "Modify pkgdir for ubuntu16.04.5 x86 testcase (2)" This reverts commit da5c7512116021cd1f3d314c59b145045418a0bc. --- ...nux_diskless_installation_flat_postscripts_failed | 2 +- .../reg_linux_diskless_installation_hierarchy | 2 +- xCAT-test/autotest/testcase/packimg/cases0 | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed index 7b1bae418..41391a68f 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed @@ -37,7 +37,7 @@ check:rc==0 cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi cmd:mount |sort > /tmp/mountoutput/file.org cmd:cat /tmp/mountoutput/file.org -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index 478cfe9c5..bd8fe4876 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -37,7 +37,7 @@ check:rc==0 cmd:if [[ -f /test.synclist ]] ;then mv -f /test.synclist /test.synclist.bak;fi; cmd:echo "/test.synclist -> /test.synclist" > /test.synclist;chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/test.synclist check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 diff --git a/xCAT-test/autotest/testcase/packimg/cases0 b/xCAT-test/autotest/testcase/packimg/cases0 index 0d7347087..d04d92940 100644 --- a/xCAT-test/autotest/testcase/packimg/cases0 +++ b/xCAT-test/autotest/testcase/packimg/cases0 @@ -64,7 +64,7 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $ check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz /rootimg.cpio.gz.bak;fi -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 @@ -109,7 +109,7 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $ check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz /rootimg.cpio.gz.bak;fi -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 @@ -158,7 +158,7 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $ check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.xz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.xz /rootimg.cpio.xz.bak;fi -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 @@ -203,7 +203,7 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $ check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz /rootimg.tar.gz.bak;fi -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 @@ -263,7 +263,7 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $ check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz /rootimg.tar.gz.bak;fi -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 @@ -319,7 +319,7 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $ check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.xz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.xz /rootimg.tar.xz.bak;fi -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute; fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 From 2987f224f6b51907a6d0fd708f9817221fa89239 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 17 Oct 2019 12:01:14 -0400 Subject: [PATCH 256/276] Template docs and stanzas fixes --- .../ppc64le/discovery/manually_define.rst | 19 ++++++++----------- .../discovery/schedule_environment.rst | 2 +- .../objects/node/ppc64le-ipmi.stanza | 4 ++-- .../objects/node/ppc64le-openbmc.stanza | 4 ++-- .../objects/node/ppc64lekvmguest.stanza | 4 ++-- xCAT/templates/objects/node/x86_64.stanza | 4 ++-- .../objects/node/x86_64kvmguest.stanza | 4 ++-- 7 files changed, 19 insertions(+), 22 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/manually_define.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/manually_define.rst index c0e7a156c..f0a7ff7ee 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/manually_define.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/manually_define.rst @@ -14,7 +14,6 @@ Execute ``mkdef`` command to define the node: :: The manually defined node will be like this:: - # lsdef cn1 Object name: cn1 bmc=50.0.101.1 bmcpassword=admin @@ -33,28 +32,26 @@ The manually defined node will be like this:: ``mkdef --template`` can be used to create node definitions easily from the typical node definition templates or existing node definitions, some examples: -* creating node definition "cn2" with an existing node definition "cn1" :: +* creating node definition "cn2" from an existing node definition "cn1" :: - # mkdef -t node -o cn2 --template cn1 mac=66:55:44:33:22:11 ip=172.12.139.2 bmc=172.11.139.2 - 1 object definitions have been created or modified. + mkdef -t node -o cn2 --template cn1 mac=66:55:44:33:22:11 ip=172.12.139.2 bmc=172.11.139.2 - except the attributes specified(``mac``, ``ip`` and ``bmc`` attribute here), other attibutes of the newly created node "cn2" inherit the values of template node "cn1" + except for the attributes specified (``mac``, ``ip`` and ``bmc``), other attributes of the newly created node "cn2" inherit the values of template node "cn1" -* creating a node definition "cn2" with the template "ppc64le-openbmc-template"(openbmc controlled ppc64le node) shipped by xCAT :: +* creating a node definition "cn2" with the template "ppc64le-openbmc-template" (openbmc controlled ppc64le node) shipped by xCAT :: - # mkdef -t node -o cn2 --template ppc64le-openbmc-template mac=66:55:44:33:22:11 ip=172.12.139.2 bmc=172.11.139.2 bmcpassword=USERID bmcusername=PASSW0RD - 1 object definitions have been created or modified. + mkdef -t node -o cn2 --template ppc64le-openbmc-template mac=66:55:44:33:22:11 ip=172.12.139.2 bmc=172.11.139.2 bmcusername=USERID bmcpassword=PASSW0RD the unspecified attributes of newly created node "cn2" will be assigned with the default values in the template to list all the node definition templates available in xCAT, run :: - # lsdef -t node --template + lsdef -t node --template to display the full definition of template "ppc64le-openbmc-template", run :: - # lsdef -t node --template ppc64le-openbmc-template + lsdef -t node --template ppc64le-openbmc-template - the mandatory attributes, which must be specified while creating definitions with templates, are denoted with the value ``MANDATORY:`` in template definition. + the mandatory attributes, which must be specified while creating definitions with templates, are denoted with the value ``MANDATORY:`` in template definition. the optional attributes, which can be specified optionally, are denoted with the value ``OPTIONAL:`` in template definition diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/schedule_environment.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/schedule_environment.rst index a1a0eb8f6..a556870b1 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/schedule_environment.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/schedule_environment.rst @@ -5,7 +5,7 @@ Management Node info:: MN Hostname: xcat1 MN NIC info for Management Network(Host network): eth1, 10.0.1.1/16 - MN NIC info for Service Network(FSP/BMC nework): eth2, 50.0.1.1/16 + MN NIC info for Service Network(FSP/BMC network): eth2, 50.0.1.1/16 Dynamic IP range for Hosts: 10.0.100.1-10.0.100.100 Dynamic IP range for FSP/BMC: 50.0.100.1-50.0.100.100 diff --git a/xCAT/templates/objects/node/ppc64le-ipmi.stanza b/xCAT/templates/objects/node/ppc64le-ipmi.stanza index 3b134926d..706e6edf6 100644 --- a/xCAT/templates/objects/node/ppc64le-ipmi.stanza +++ b/xCAT/templates/objects/node/ppc64le-ipmi.stanza @@ -8,8 +8,8 @@ ppc64le-template: bmcusername="MANDATORY:the username of the BMC" cons=ipmi groups=all - ip=OPTIONAL:the ip address of the node - mac=OPTIONAL:the mac of the node + ip="MANDATORY:the ip address of the node" + mac="MANDATORY:the mac of the node" mgt=ipmi netboot=petitboot nodetype=mp diff --git a/xCAT/templates/objects/node/ppc64le-openbmc.stanza b/xCAT/templates/objects/node/ppc64le-openbmc.stanza index 43af130a9..e4418f9a1 100644 --- a/xCAT/templates/objects/node/ppc64le-openbmc.stanza +++ b/xCAT/templates/objects/node/ppc64le-openbmc.stanza @@ -8,8 +8,8 @@ ppc64le-openbmc-template: bmcusername="MANDATORY:the username of the BMC" cons=openbmc groups=all - ip=OPTIONAL:the ip address of the node - mac=OPTIONAL:the mac of the node + ip="MANDATORY:the ip address of the node" + mac="MANDATORY:the mac of the node" mgt=openbmc netboot=petitboot nodetype=mp diff --git a/xCAT/templates/objects/node/ppc64lekvmguest.stanza b/xCAT/templates/objects/node/ppc64lekvmguest.stanza index b6e28d1f2..afa31e27e 100644 --- a/xCAT/templates/objects/node/ppc64lekvmguest.stanza +++ b/xCAT/templates/objects/node/ppc64lekvmguest.stanza @@ -4,8 +4,8 @@ ppc64lekvmguest-template: objtype=node arch=ppc64le groups=all - ip="OPTIONAL:the ip address of the kvm guest" - mac="OPTIONAL:the mac of the kvm guest" + ip="MANDATORY:the ip address of the kvm guest" + mac="MANDATORY:the mac of the kvm guest" mgt=kvm netboot=grub2 vmcpus=2 diff --git a/xCAT/templates/objects/node/x86_64.stanza b/xCAT/templates/objects/node/x86_64.stanza index b59a46066..a2ad508d8 100644 --- a/xCAT/templates/objects/node/x86_64.stanza +++ b/xCAT/templates/objects/node/x86_64.stanza @@ -10,8 +10,8 @@ x86_64-template: getmac=ipmi groups=all hcp= - ip="OPTIONAL:the ip address of the node" - mac="OPTIONAL:the mac of the node" + ip="MANDATORY:the ip address of the node" + mac="MANDATORY:the mac of the node" mgt=ipmi netboot=xnba serialport=0 diff --git a/xCAT/templates/objects/node/x86_64kvmguest.stanza b/xCAT/templates/objects/node/x86_64kvmguest.stanza index 52d8efb5c..5b2329477 100644 --- a/xCAT/templates/objects/node/x86_64kvmguest.stanza +++ b/xCAT/templates/objects/node/x86_64kvmguest.stanza @@ -4,8 +4,8 @@ x86_64kvmguest-template: objtype=node arch=x86_64 groups=all - ip="OPTIONAL:the ip address of the kvm guest" - mac="OPTIONAL:the mac of the kvm guest" + ip="MANDATORY:the ip address of the kvm guest" + mac="MANDATORY:the mac of the kvm guest" mgt=kvm netboot=xnba serialport=0 From aa93414e69e98c01b8c4f82b003bdc1e4f404084 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 17 Oct 2019 15:08:09 -0400 Subject: [PATCH 257/276] bmcdiscover node name when serial or mtm and mac not available --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index a16765531..8c979363b 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -1160,8 +1160,10 @@ sub bmcdiscovery_ipmi { $mtm = '' if ($mtm =~ /^0+$/); $serial = '' if ($serial =~ /^0+$/); - unless (($mtm or $serial) or $ipmac{$ip}) { - xCAT::MsgUtils->message("W", { data => ["BMC Type/Model and/or Serial and MAC Address is unavailable for $ip"] }, $::CALLBACK); + # To constract a node name need either mac or both mtm and serial + # Exit if mac AND one of mtm or serial is missing + if (!($mtm and $serial) and !$ipmac{$ip}) { + xCAT::MsgUtils->message("W", { data => ["BMC Type/Model and Serial or MAC Address is unavailable for $ip"] }, $::CALLBACK); return; } @@ -1292,8 +1294,10 @@ sub bmcdiscovery_openbmc{ $mtm = '' if ($mtm =~ /^0+$/); $serial = '' if ($serial =~ /^0+$/); - unless (($mtm or $serial) or $ipmac{$ip}) { - xCAT::MsgUtils->message("W", { data => ["Could not obtain Valid Model Type and/or Serial Number and MAC Address for BMC at $ip"] }, $::CALLBACK); + # To constract a node name need either mac or both mtm and serial + # Exit if mac AND one of mtm or serial is missing + if (!($mtm and $serial) and !$ipmac{$ip}) { + xCAT::MsgUtils->message("W", { data => ["BMC Type/Model and Serial or MAC Address is unavailable for $ip"] }, $::CALLBACK); return; } From f32620c86577709394842d1672ba2f2d30dda8fe Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 17 Oct 2019 16:39:35 -0400 Subject: [PATCH 258/276] Use the openbmc is and pw in the example --- .../manage_clusters/ppc64le/discovery/manually_define.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/manually_define.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/manually_define.rst index f0a7ff7ee..1e7ba95f0 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/manually_define.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/manually_define.rst @@ -40,7 +40,7 @@ The manually defined node will be like this:: * creating a node definition "cn2" with the template "ppc64le-openbmc-template" (openbmc controlled ppc64le node) shipped by xCAT :: - mkdef -t node -o cn2 --template ppc64le-openbmc-template mac=66:55:44:33:22:11 ip=172.12.139.2 bmc=172.11.139.2 bmcusername=USERID bmcpassword=PASSW0RD + mkdef -t node -o cn2 --template ppc64le-openbmc-template mac=66:55:44:33:22:11 ip=172.12.139.2 bmc=172.11.139.2 bmcusername=root bmcpassword=0penBmc the unspecified attributes of newly created node "cn2" will be assigned with the default values in the template From fee95d488267b0f35a5bc24ff4b74efc40414533 Mon Sep 17 00:00:00 2001 From: cxhong Date: Thu, 17 Oct 2019 17:48:59 -0400 Subject: [PATCH 259/276] modify nodeset return code for hierarchy support --- xCAT-server/lib/xcat/plugins/rinstall.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index 2eed25a01..899e91c06 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -389,14 +389,18 @@ sub rinstall { # if only provision one node and failed nodeset, will exit the command # instead of continue with rnetboot/rsetboot, rpower. + # check if it is hierarchy cluster if (scalar(@nodes) == 1) { - $rsp->{error}->[0] = "Failed to run 'nodeset' against the node: @nodes"; - $rsp->{errorcode}->[0] = 1; - xCAT::MsgUtils->message("E", $rsp, $callback); - return 1; + my $nrtab = xCAT::Table->new('noderes'); + my $sn = $nrtab->getNodeAttribs(@nodes,['servicenode']); + if (!$sn) { + $rsp->{error}->[0] = "Failed to run 'nodeset' against the node: @nodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + return 1; + } } - foreach my $node (@failurenodes) { delete $nodes{$node}; } From fe4db25042ce5931a234eaaa85ff07a4bf783c62 Mon Sep 17 00:00:00 2001 From: cxhong Date: Fri, 18 Oct 2019 12:00:26 -0400 Subject: [PATCH 260/276] modify rinstall for service node error --- xCAT-server/lib/xcat/plugins/rinstall.pm | 28 +++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index 899e91c06..cc40b7b29 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -362,6 +362,8 @@ sub rinstall { # We got an error with the nodeset my @successnodes; my @failurenodes; + my @failuresns; + my $snfailure; # copy into a temporary variable to avoid of circular reference my @lines = @$res; foreach my $line (@lines) { @@ -384,16 +386,32 @@ sub rinstall { } return 1; } + + if ($line =~ /Unable to dispatch hierarchical sub-command to (\S+):3001/) { + $snfailure=1; + push @failuresns,$1; + } xCAT::MsgUtils->message("I", $rsp, $callback); } # if only provision one node and failed nodeset, will exit the command # instead of continue with rnetboot/rsetboot, rpower. - # check if it is hierarchy cluster - if (scalar(@nodes) == 1) { - my $nrtab = xCAT::Table->new('noderes'); - my $sn = $nrtab->getNodeAttribs(@nodes,['servicenode']); - if (!$sn) { + if ( (scalar(@nodes) == 1) ) { + #exit the command if it's service node failure + if ($snfailure) { + my $node = $nodes[0]; + my $nrtab = xCAT::Table->new('noderes'); + my $nrents = $nrtab->getNodeAttribs($node, [qw(servicenode)]); + my $nodesn = $nrents->{servicenode}; + foreach my $tmpsn (@failuresns) { + if ($nodesn eq $tmpsn) { + $rsp->{error}->[0] = "Unable connect to Service node $nodesn, failed to run 'nodeset' against the node: @nodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + return 1; + } + } + } else { $rsp->{error}->[0] = "Failed to run 'nodeset' against the node: @nodes"; $rsp->{errorcode}->[0] = 1; xCAT::MsgUtils->message("E", $rsp, $callback); From 159942dc9b10a7d93b5bd233ccc4ed0150c1363f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 21 Oct 2019 16:48:44 -0400 Subject: [PATCH 261/276] Make bmcuser, bmcpassword and mac optional, but ip mandatory in template --- xCAT/templates/objects/node/ppc64le-ipmi.stanza | 6 +++--- xCAT/templates/objects/node/ppc64le-openbmc.stanza | 6 +++--- xCAT/templates/objects/node/ppc64lekvmguest.stanza | 2 +- xCAT/templates/objects/node/x86_64.stanza | 6 +++--- xCAT/templates/objects/node/x86_64kvmguest.stanza | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/xCAT/templates/objects/node/ppc64le-ipmi.stanza b/xCAT/templates/objects/node/ppc64le-ipmi.stanza index 706e6edf6..476b45dd8 100644 --- a/xCAT/templates/objects/node/ppc64le-ipmi.stanza +++ b/xCAT/templates/objects/node/ppc64le-ipmi.stanza @@ -4,12 +4,12 @@ ppc64le-template: objtype=node arch=ppc64le bmc="MANDATORY:The hostname or ip address of the BMC adapater" - bmcpassword="MANDATORY:the password of the BMC" - bmcusername="MANDATORY:the username of the BMC" + bmcpassword="OPTIONAL:the password of the BMC" + bmcusername="OPTIONAL:the username of the BMC" cons=ipmi groups=all ip="MANDATORY:the ip address of the node" - mac="MANDATORY:the mac of the node" + mac="OPTIONAL:the mac of the node" mgt=ipmi netboot=petitboot nodetype=mp diff --git a/xCAT/templates/objects/node/ppc64le-openbmc.stanza b/xCAT/templates/objects/node/ppc64le-openbmc.stanza index e4418f9a1..927331c0c 100644 --- a/xCAT/templates/objects/node/ppc64le-openbmc.stanza +++ b/xCAT/templates/objects/node/ppc64le-openbmc.stanza @@ -4,12 +4,12 @@ ppc64le-openbmc-template: objtype=node arch=ppc64le bmc="MANDATORY:The hostname or ip address of the BMC adapater" - bmcpassword="MANDATORY:the password of the BMC" - bmcusername="MANDATORY:the username of the BMC" + bmcpassword="OPTIONAL:the password of the BMC" + bmcusername="OPTIONAL:the username of the BMC" cons=openbmc groups=all ip="MANDATORY:the ip address of the node" - mac="MANDATORY:the mac of the node" + mac="OPTIONAL:the mac of the node" mgt=openbmc netboot=petitboot nodetype=mp diff --git a/xCAT/templates/objects/node/ppc64lekvmguest.stanza b/xCAT/templates/objects/node/ppc64lekvmguest.stanza index afa31e27e..2610d38b3 100644 --- a/xCAT/templates/objects/node/ppc64lekvmguest.stanza +++ b/xCAT/templates/objects/node/ppc64lekvmguest.stanza @@ -5,7 +5,7 @@ ppc64lekvmguest-template: arch=ppc64le groups=all ip="MANDATORY:the ip address of the kvm guest" - mac="MANDATORY:the mac of the kvm guest" + mac="OPTIONAL:the mac of the kvm guest" mgt=kvm netboot=grub2 vmcpus=2 diff --git a/xCAT/templates/objects/node/x86_64.stanza b/xCAT/templates/objects/node/x86_64.stanza index a2ad508d8..085ccc17e 100644 --- a/xCAT/templates/objects/node/x86_64.stanza +++ b/xCAT/templates/objects/node/x86_64.stanza @@ -4,14 +4,14 @@ x86_64-template: objtype=node arch=x86_64 bmc="MANDATORY:The hostname or ip address of the BMC adapater" - bmcpassword="MANDATORY:the password of the BMC" - bmcusername="MANDATORY:the username of the BMC" + bmcpassword="OPTIONAL:the password of the BMC" + bmcusername="OPTIONAL:the username of the BMC" cons=ipmi getmac=ipmi groups=all hcp= ip="MANDATORY:the ip address of the node" - mac="MANDATORY:the mac of the node" + mac="OPTIONAL:the mac of the node" mgt=ipmi netboot=xnba serialport=0 diff --git a/xCAT/templates/objects/node/x86_64kvmguest.stanza b/xCAT/templates/objects/node/x86_64kvmguest.stanza index 5b2329477..16494de27 100644 --- a/xCAT/templates/objects/node/x86_64kvmguest.stanza +++ b/xCAT/templates/objects/node/x86_64kvmguest.stanza @@ -5,7 +5,7 @@ x86_64kvmguest-template: arch=x86_64 groups=all ip="MANDATORY:the ip address of the kvm guest" - mac="MANDATORY:the mac of the kvm guest" + mac="OPTIONAL:the mac of the kvm guest" mgt=kvm netboot=xnba serialport=0 From ea81eb7d55c4239899c4f1d0231cfc37d0d41782 Mon Sep 17 00:00:00 2001 From: Gerd Pokorra Date: Tue, 22 Oct 2019 14:53:29 +0200 Subject: [PATCH 262/276] files to install CentOS 8 --- .../install/centos/compute.centos8.pkglist | 11 ++++ .../xcat/install/centos/compute.centos8.tmpl | 59 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 xCAT-server/share/xcat/install/centos/compute.centos8.pkglist create mode 100644 xCAT-server/share/xcat/install/centos/compute.centos8.tmpl diff --git a/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist b/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist new file mode 100644 index 000000000..0feb58550 --- /dev/null +++ b/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist @@ -0,0 +1,11 @@ +@^minimal-environment +chrony +net-tools +nfs-utils +openssh-server +rsync +util-linux +wget +python3 +tar +bzip2 diff --git a/xCAT-server/share/xcat/install/centos/compute.centos8.tmpl b/xCAT-server/share/xcat/install/centos/compute.centos8.tmpl new file mode 100644 index 000000000..3719fd0c6 --- /dev/null +++ b/xCAT-server/share/xcat/install/centos/compute.centos8.tmpl @@ -0,0 +1,59 @@ +#version=CentOS8 +# Use text install +text +# Use network installation +%include /tmp/repos +# Keyboard layouts +keyboard --vckeymap=us --xlayouts='us' +# System language +lang en_US.UTF-8 + +# Network information +#KICKSTARTNET# +# Root password +rootpw --iscrypted #CRYPT:passwd:key=system,username=root:password# +# Not run the Setup Agent on first boot +firstboot --disable +# Do not configure the X Window System +skipx +# System services +#services --enabled="chronyd" +# System timezone +timezone #TABLE:site:key=timezone:value# --isUtc +# Partition clearing information +zerombr +clearpart --all --initlabel +#XCAT_PARTITION_START# +%include /tmp/partitionfile +#XCAT_PARTITION_END# + +# Do not configure any iptables rules +firewall --disable +selinux --disable +reboot + +%packages +#INCLUDE_DEFAULT_PKGLIST# + +%end + +%anaconda +pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +%end +%pre +{ +echo "Running Kickstart Pre-installation script..." +#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rhels8# +} &>>/tmp/pre-install.log +%end +%post --interpreter=/bin/bash +mkdir -p /var/log/xcat/ +cat /tmp/pre-install.log >>/var/log/xcat/xcat.log +{ +echo "Running Kickstart Post-installation script..." +#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat.ng# +#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rhels8# +} &>>/var/log/xcat/xcat.log +%end From 2d706b9c75ec98900ab9214dd6f5ae72859b53e7 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 22 Oct 2019 11:51:23 -0400 Subject: [PATCH 263/276] bmcsetup Other LAN and 802.3 LAN for Channel Medium Type --- xCAT-genesis-scripts/usr/bin/bmcsetup | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xCAT-genesis-scripts/usr/bin/bmcsetup b/xCAT-genesis-scripts/usr/bin/bmcsetup index fa5955adb..15d5af578 100755 --- a/xCAT-genesis-scripts/usr/bin/bmcsetup +++ b/xCAT-genesis-scripts/usr/bin/bmcsetup @@ -271,14 +271,16 @@ fi LAN_MED_TYPE="802.3" if [ ! -z "$ISOPENBMC" ]; then - # Overvide the default value for OpenBMC - LAN_MED_TYPE="Other LAN" + # For OpenBMC, the value of "Channel Medium Type" attribute could be "Other LAN" for FW drivers prior to OP940.01 + # and "802.3" for FW drivers OP940.01 and later + LAN_MED_TYPE="802.3|Other LAN" fi +# Loop through channels and pick the one to communicate on while [ -z "$LANCHAN" ]; do logger -s -t $log_label -p local4.info "Auto detecting LAN channel..." for TLANCHAN in {1..16}; do # Try to get the channel information; then get the MAC which is used for the channel - if ipmitool channel info $TLANCHAN 2> /dev/null | grep "$LAN_MED_TYPE" > /dev/null 2>&1 && ipmitool raw 0xc 2 $TLANCHAN 5 0 0 > /dev/null 2>&1; then + if ipmitool channel info $TLANCHAN 2> /dev/null | grep -E "$LAN_MED_TYPE" > /dev/null 2>&1 && ipmitool raw 0xc 2 $TLANCHAN 5 0 0 > /dev/null 2>&1; then LANCHAN=$TLANCHAN break; fi; From 70d4be0cd06f198b4bb7bbf6c7e07f5697f9fcff Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 23 Oct 2019 15:45:25 -0400 Subject: [PATCH 264/276] Add regression test tabdump debug for service node not removed --- xCAT-test/autotest/bundle/rhels_ppc_daily.bundle | 4 ++++ xCAT-test/autotest/testcase/tabdump/cases0 | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle index 863a65c2d..1a68b4805 100644 --- a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle @@ -266,6 +266,7 @@ tabdump_w_lt tabdump_w_match tabdump_w_ne tabdump_w_notmatch +tabdump_servicenode tabgrep_err tabgrep_h tabgrep_node @@ -281,6 +282,7 @@ tabrestore_err tabrestore_h tabrestore_null tabrestore_table +tabdump_servicenode unregnotif_f unregnotif_h unregnotif_null @@ -290,6 +292,7 @@ xcatconfig_u_check_xcatsslversion_rhels_sles xcatd_restart xcatd_start xcatd_stop +tabdump_servicenode xcatstanzafile_attribute xcatstanzafile_colon xcatstanzafile_defaultvalue @@ -298,3 +301,4 @@ xcatstanzafile_normal xcatstanzafile_objtype xcatstanzafile_specificvalue xcatstanzafile_tab +tabdump_servicenode diff --git a/xCAT-test/autotest/testcase/tabdump/cases0 b/xCAT-test/autotest/testcase/tabdump/cases0 index a1f1a1127..33bfb8b1e 100644 --- a/xCAT-test/autotest/testcase/tabdump/cases0 +++ b/xCAT-test/autotest/testcase/tabdump/cases0 @@ -177,3 +177,9 @@ cmd:tabdump -d site | grep xcatiport check:rc==0 check:output=~xcatiport end + +start:tabdump_servicenode +label:mn_only,ci_test,db +cmd:tabdump servicenode +check:rc==0 +end From 6ef420b28f74a31ab581f88b0246669db320df15 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 23 Oct 2019 16:22:15 -0400 Subject: [PATCH 265/276] Add more calls to run tabdump servicenode --- .../autotest/bundle/rhels_ppc_daily.bundle | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle index 1a68b4805..86dcbb0ed 100644 --- a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle @@ -1,6 +1,9 @@ SN_setup_case +tabdump_servicenode reg_linux_diskless_installation_hierarchy +tabdump_servicenode reg_linux_diskfull_installation_hierarchy +tabdump_servicenode updatenode_P_script1 updatenode_P_script1_script2 updatenode_P_script2 @@ -22,6 +25,7 @@ updatenode_syncfile_MERGE updatenode_v updatenode_without_flag updatenode_without_options +tabdump_servicenode xdcp_nonroot_user xdcp_src_dst xdsh_E @@ -37,6 +41,7 @@ xdsh_permission_denied xdsh_q xdsh_regular_command xdsh_t +tabdump_servicenode assign_certain_command_permission chdef_dynamic_group chdef_group @@ -52,21 +57,25 @@ chdef_t_network chdef_t_node chdef_t_o_error chdef_z +tabdump_servicenode chtab_d chtab_h chtab_modify_key chtab_modify_node chtab_null chtab_v +tabdump_servicenode confignetwork_secondarynic_nicips_updatenode_false confignetwork_secondarynic_nicnetworks_updatenode_false confignetwork_secondarynic_nictype_updatenode_false +tabdump_servicenode copycds_a copycds_a_err copycds_iso copycds_n copycds_n_a copycds_n_err +tabdump_servicenode disable_root_permission_in_policy_table dumpxCATdb_a_p_nullskiptables dumpxCATdb_a_p_nullskiptables_V @@ -77,10 +86,12 @@ dumpxCATdb_p_nullskiptables dumpxCATdb_p_nullskiptables_V dumpxCATdb_p_skiptables dumpxCATdb_v +tabdump_servicenode encrypted_passwd_md5_diskfull encrypted_passwd_openssl_diskfull encrypted_passwd_sha256_diskfull encrypted_passwd_sha512_diskfull +tabdump_servicenode gettab_H gettab_err gettab_h @@ -88,6 +99,7 @@ gettab_key_table getmacs_d getmacs_f_D getmacs_noderange +tabdump_servicenode lsdef_a lsdef_null lsdef_t @@ -99,6 +111,7 @@ lsdef_t_w lslite_h lslite_i lslite_noderange +tabdump_servicenode lsxcatd_a lsxcatd_d lsxcatd_h @@ -108,11 +121,13 @@ makedhcp_a_d makedhcp_d makedhcp_n makedhcp_remote_network +tabdump_servicenode makedns makedns_d_node makedns_h makedns_n makedns_n_noderange +tabdump_servicenode makehost_n_r makehosts_d makehosts_h @@ -122,6 +137,7 @@ makehosts_n makehosts_n_noderange makehosts_null makeknownhosts_node_d +tabdump_servicenode makentp_h makentp_v mkdef_null @@ -132,12 +148,14 @@ mkdef_regex_nicsip mkdef_rhels73 mkdef_t_o_error mkdef_z +tabdump_servicenode nodeadd_err_symbol nodeadd_h nodeadd_noderange nodeadd_noderange_nodetype nodeadd_null nodeadd_v +tabdump_servicenode nodech_delete nodech_error_node nodech_error_table @@ -154,10 +172,12 @@ nodech_noderange_table_include nodech_noderange_table_unequal nodech_noderange_table_uninclude nodech_v +tabdump_servicenode nodegrpch_err nodegrpch_groups nodegrpch_h nodegrpch_v +tabdump_servicenode nodels_H nodels_S nodels_b @@ -178,6 +198,7 @@ nodels_table_include nodels_tablevalue nodels_tablevalue_tablecolumn nodels_v +tabdump_servicenode noderange_10-20 noderange_XCAT_NODE_PREFIX noderange_XCAT_NODE_SUFFIX @@ -191,6 +212,7 @@ noderm_err_node noderm_h noderm_noderange noderm_null +tabdump_servicenode nodeset_check_warninginfo nodeset_errorcommand nodeset_grub2 @@ -199,6 +221,7 @@ nodeset_yaboot nodeset_stat nodestat_err_node nodestat_usage +tabdump_servicenode packimage_h packimage_v pping_h @@ -219,11 +242,13 @@ regnotif_h regnotif_null regnotif_o regnotif_v +tabdump_servicenode restorexCAT_h restorexCATdb_a_p_V restorexCATdb_p_V restorexCATdb_v restorexCATdb_wrongpath +tabdump_servicenode rinv_all rinv_bus rinv_config @@ -233,6 +258,7 @@ rinv_serial rinv_noderange_err rmdef_null rmdef_t_err +tabdump_servicenode rpower_boot rpower_err_noderange rpower_noderange @@ -246,11 +272,14 @@ rscan_x rscan_x_w rscan_z rscan_z_w +tabdump_servicenode run_command_with_XCATBYPASS runcmdinstaller_h +tabdump_servicenode rvitals_all rvitals_lcds rvitals_noderange_err +tabdump_servicenode tabdump_d tabdump_d_nodehm tabdump_f_d From 616e2e4d12f0a2e375d8339af016285674e13b96 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 23 Oct 2019 17:24:31 -0400 Subject: [PATCH 266/276] Better message for Ubuntu uninstall --- xCAT-server/share/xcat/tools/go-xcat | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index dc402a8a8..ce35926e1 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,7 +2,7 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.43 +# Version 1.0.44 # # Copyright (C) 2016 - 2019 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) @@ -25,6 +25,8 @@ # - Better debug log when reading repository failed # 2019-08-15 Mark Gurevich # - Added conserver-xcat to uninstall list +# 2019-10-23 Mark Gurevich +# - Display a list of packages that could not be uninstalled # function usage() @@ -173,7 +175,7 @@ GO_XCAT_INSTALL_LIST=(perl-xcat xcat xcat-buildkit xcat-client xcat-genesis-scripts-amd64 xcat-genesis-scripts-ppc64 xcat-server elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat xcat-genesis-base-amd64 xcat-genesis-base-ppc64 xnba-undi) -# The package list of all the packages should be installed +# The package list of all the packages should be uninstalled GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}" goconserver xCAT-SoftLayer xCAT-confluent xCAT-csm xCAT-genesis-builder xCAT-openbmc-py xCAT-probe xCAT-test xCAT-vlan xCATsn xCAT-UI-deps @@ -1576,6 +1578,7 @@ function remove_package_apt() local -a yes=() [[ "$1" = "-y" ]] && yes=("-y") && shift apt-get --allow-unauthenticated remove "${yes[@]}" "$@" + warn_if_bad "$?" "Unable to remove xCAT packages: "`apt --installed list 2>&1 | grep xcat | cut -d '/' -f 1` } function remove_package() @@ -1590,6 +1593,7 @@ function purge_package_apt() local -a yes=() [[ "$1" = "-y" ]] && yes=("-y") && shift apt-get --allow-unauthenticated purge "${yes[@]}" "$@" + warn_if_bad "$?" "Unable to purge xCAT packages: "`apt --installed list 2>&1 | grep xcat | cut -d '/' -f 1` } function purge_package_others() @@ -2092,22 +2096,17 @@ case "${GO_XCAT_ACTION}" in debug_logger <<-EOF - xCAT has been completely uninstalled! + xCAT has been uninstalled. + To install again - https://xcat.org/download.html EOF ;; "uninstall") debug_trace uninstall_xcat -y - boo_boo_if_bad "$?" debug_logger <<-EOF - xCAT has been uninstalled! - ========================== - - If you intend to install xCAT again, please follow the guideline on the - xcat.org website. - - https://xcat.org/download.html + xCAT has been uninstalled. + To install again - https://xcat.org/download.html EOF ;; esac From 58b670934c59ea7436c61723c7ed1e999926dfc0 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 24 Oct 2019 10:28:38 -0400 Subject: [PATCH 267/276] Doc fixes for osimage definition creation --- .../common/deployment/create_img.rst | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/create_img.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/create_img.rst index cb60aa607..fcf2cafb4 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/create_img.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/create_img.rst @@ -1,15 +1,15 @@ Select or Create an osimage Definition ====================================== -Before creating an image on xCAT, the distro media should be prepared ahead. That can be ISOs or DVDs. +Before creating an image on xCAT, the distro media should be prepared. That can be ISOs or DVDs. -XCAT use 'copycds' command to create an image which will be available to install nodes. ``copycds`` will copy all contents of Distribution DVDs/ISOs or Service Pack DVDs/ISOs to a destination directory, and create several relevant osimage definitions by default. +XCAT uses ``copycds`` command to create an image which will be available to install nodes. ``copycds`` will copy all contents of Distribution DVDs/ISOs or Service Pack DVDs/ISOs to a destination directory, and create several relevant osimage definitions by default. If using an ISO, copy it to (or NFS mount it on) the management node, and then run: :: copycds /.iso -**Note**: while sle15 contains installer medium and packages medium, need ``copycds`` copy all contents of DVD1 of the installer medium and DVD1 of the packages medium, for example: :: +.. note:: While sle15 contains installer medium and packages medium, need ``copycds`` copy all contents of DVD1 of the installer medium and DVD1 of the packages medium, for example: :: copycds SLE-15-Installer-DVD-ppc64le-GM-DVD1.iso SLE-15-Packages-ppc64le-GM-DVD1.iso @@ -41,11 +41,11 @@ In these osimage definitions shown above * **--netboot-compute** is the default osimage definition used for diskless installation * **--install-service** is the default osimage definition used for service node deployment which shall be used in hierarchical environment -**Note**: There are more things needed for **ubuntu ppc64le** osimages: +.. note:: Additional steps are needed for **ubuntu ppc64le** osimages: -For pre-18.04 version of Ubuntu for ppc64el, the initrd.gz shipped with the ISO does not support network booting. In order to install ubuntu with xCAT, you need to follow the steps below to complete the osimage definition. +For pre-16.04.02 version of Ubuntu for ppc64el, the ``initrd.gz`` shipped with the ISO does not support network booting. In order to install Ubuntu with xCAT, you need to follow the steps to complete the osimage definition. -* Download mini.iso from +* Download ``mini.iso`` from [ubuntu 14.04.1]: http://xcat.org/files/netboot/ubuntu14.04.1/ppc64el/mini.iso @@ -59,7 +59,7 @@ For pre-18.04 version of Ubuntu for ppc64el, the initrd.gz shipped with the ISO [ubuntu 16.04.1]: http://xcat.org/files/netboot/ubuntu16.04.1/ppc64el/mini.iso -* Mount mini.iso :: +* Mount ``mini.iso`` :: mkdir /tmp/iso mount -o loop mini.iso /tmp/iso @@ -69,11 +69,9 @@ For pre-18.04 version of Ubuntu for ppc64el, the initrd.gz shipped with the ISO mkdir -p /install//ppc64el/install/netboot cp /tmp/iso/install/initrd.gz /install//ppc64el/install/netboot -**[Below tips maybe helpful for you]** - **[Tips 1]** -If this is the same distro version as what your management node uses, create a .repo file in /etc/yum.repos.d with contents similar to: :: +If this is the same distro version as what your management node uses, create a ``.repo`` file in ``/etc/yum.repos.d`` with contents similar to: :: [local--] name=xCAT local @@ -81,7 +79,7 @@ If this is the same distro version as what your management node uses, create a . enabled=1 gpgcheck=0 -In this way, if you need to install some additional RPMs into your MN later, you can simply install them with ``yum``. Or if you are installing a software on your MN that depends some RPMs from this disto, those RPMs will be found and installed automatically. +This way, if you need to install some additional RPMs into your MN later, you can simply install them with ``yum``. Or if you are installing a software on your MN that depends some RPMs from this disto, those RPMs will be found and installed automatically. **[Tips 2]** @@ -91,7 +89,7 @@ You can create/modify an osimage definition easily with any existing osimage def Except the specified attributes **, the attributes of ** will inherit the values of template osimage **. -As an example, the following command creates a new osimage "myosimage.rh7.compute.netboot" based on the existing osimage "rhels7.4-ppc64le-netboot-compute" with some customized attributes :: +As an example, the following command creates a new osimage ``myosimage.rh7.compute.netboot`` based on the existing osimage ``rhels7.4-ppc64le-netboot-compute`` with some customized attributes :: mkdef -t osimage -o myosimage.rh7.compute.netboot --template rhels7.4-ppc64le-netboot-compute synclists=/tmp/synclist otherpkgdir=/install/custom/osimage/myosimage.rh7.compute.netboot/3rdpkgs/ otherpkglist=/install/custom/osimage/myosimage.rh7.compute.netboot/3rd.pkglist From efc5f54c2b07ed66329cb28b81e4d5cac879e99a Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 24 Oct 2019 16:10:27 -0400 Subject: [PATCH 268/276] Add regression test tabdump debug for service node not removed 2 --- xCAT-test/autotest/bundle/rhels_ppc_daily.bundle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle index 86dcbb0ed..39cd43183 100644 --- a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle @@ -266,10 +266,14 @@ rpower_noderange_nodeps rpower_off rpower_on rpower_stat +tabdump_servicenode rscan_noderange +tabdump_servicenode rscan_w +tabdump_servicenode rscan_x rscan_x_w +tabdump_servicenode rscan_z rscan_z_w tabdump_servicenode From 6c1b569c6a61c3e64296365c64841801626bc980 Mon Sep 17 00:00:00 2001 From: cxhong Date: Fri, 25 Oct 2019 10:21:44 -0400 Subject: [PATCH 269/276] add remove service node from servicenode table --- xCAT-test/autotest/testcase/rscan/cases0 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xCAT-test/autotest/testcase/rscan/cases0 b/xCAT-test/autotest/testcase/rscan/cases0 index 6f411c88b..98f09ae30 100644 --- a/xCAT-test/autotest/testcase/rscan/cases0 +++ b/xCAT-test/autotest/testcase/rscan/cases0 @@ -40,6 +40,7 @@ check:rc==0 check:output=~hcp=__GETNODEATTR($$CN,hcp)__ cmd:rmdef all cmd:cat /tmp/all.stanza | mkdef -z +cmd:chtab -d node=$$SN servicenode cmd:rm -f /tmp/all.stanza cmd:rm -f /tmp/$$CN.stanza end @@ -60,6 +61,7 @@ check:rc==0 check:output=~hcp=__GETNODEATTR($$CN,hcp)__ cmd:rmdef all cmd:cat /tmp/all.stanza | mkdef -z +cmd:chtab -d node=$$SN servicenode cmd:rm -f /tmp/all.stanza cmd:rm -f /tmp/$$CN.stanza end @@ -80,6 +82,7 @@ check:rc==0 check:output=~parent=[\w-]+ cmd:rmdef all cmd:cat /tmp/all.stanza | mkdef -z +cmd:chtab -d node=$$SN servicenode cmd:rm -f /tmp/all.stanza cmd:rm -f /tmp/$$CN.stanza end From d2ade80f29f28f5a187725abe42d9009a413bc9a Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 25 Oct 2019 10:42:14 -0400 Subject: [PATCH 270/276] Add display statement to genesis testcase script --- xCAT-test/autotest/testcase/genesis/test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index 83378c407..bdd174318 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -43,6 +43,7 @@ function check_destiny() { runcmd $cmd; cmd="makenetworks"; runcmd $cmd; + ip addr show makehosts ${TESTNODE} grep ${TESTNODE} /etc/hosts cmd="nodeset ${TESTNODE} shell"; From d034005e811be414909c3ab5b211500d20e2c6b6 Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 28 Oct 2019 14:33:54 -0400 Subject: [PATCH 271/276] Error message if running kits on rhel8 --- xCAT-buildkit/bin/buildkit | 7 +++++++ xCAT-server/lib/xcat/plugins/kit.pm | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/xCAT-buildkit/bin/buildkit b/xCAT-buildkit/bin/buildkit index eb119cde1..4842e47ed 100755 --- a/xCAT-buildkit/bin/buildkit +++ b/xCAT-buildkit/bin/buildkit @@ -344,6 +344,13 @@ if ($tempstring =~ /debian/ || $tempstring =~ /ubuntu/) { $debianflag = 1; } +my ($sysos, $sysver) = split /,/, $tempstring; +if ( ($sysos =~ /rh/) && ($sysver ge 8) ) { + print "ERROR: KITs are not supported on rhel8 or above\n"; + exit(1); +} + + # This is an undocumented flag to support our local build team # to allow building Ubuntu kits on our RH build machines. # It requires RH rpms such as dep, fakeroot, perl-File-DesktopEntry, diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 2b1a0d6c4..d61cebbde 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -33,7 +33,7 @@ $::KITFRAMEWORK = "2"; $::COMPATIBLE_KITFRAMEWORKS = "0,1,2"; my $debianflag = 0; -my $tempstring = xCAT::Utils->osver(); +my $tempstring = xCAT::Utils->osver(all); if ($tempstring =~ /debian/ || $tempstring =~ /ubuntu/) { $debianflag = 1; @@ -99,6 +99,12 @@ sub process_request $::PID = $$; } + my ($sysos, $sysver) = split /,/, $tempstring; + if ( ($sysos =~ /rh/) && ($sysver ge 8) ) { + $callback->({ error => ["KITs are not supported on rhel8 or above"], errorcode => [1] }); + return 1; + } + my $command = $request->{command}->[0]; my $rc; From cb84cd87ac98add8f06d49e64ce7d29c14009a1f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 30 Oct 2019 13:56:03 -0400 Subject: [PATCH 272/276] Restart libssl1.1 without asking when installing xCAT on Ubuntu for regression --- xCAT-test/autotest/testcase/install_xCAT/case0 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xCAT-test/autotest/testcase/install_xCAT/case0 b/xCAT-test/autotest/testcase/install_xCAT/case0 index 87b29595a..52041c0c5 100644 --- a/xCAT-test/autotest/testcase/install_xCAT/case0 +++ b/xCAT-test/autotest/testcase/install_xCAT/case0 @@ -31,6 +31,9 @@ stop:yes cmd:arc_all=`uname -a`; code=`lsb_release -sc`;if [[ $arc_all =~ "ppc64le" ]]; then arch="ppc64el";else arch="x86_64";fi; cp "/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-$arch.sources.list" "/etc/apt/sources.list" cmd:apt-get clean;apt-get update check:rc==0 +cmd:echo '* libraries/restart-without-asking boolean true' | debconf-set-selections +check:rc==0 +cmd:debconf-show libssl1.1 cmd:cp /core-*-snap.tar.bz2 /install_xCAT_xcat-core.tar.bz2 check:rc==0 cmd:cp /xcat-dep*.tar.bz2 /install_xCAT_xcat-dep.tar.bz2 From e38731ca396671da88c0935dc2c2b839ee52b9ec Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 30 Oct 2019 14:08:19 -0400 Subject: [PATCH 273/276] Linmit to only x86 environment --- xCAT-test/autotest/testcase/install_xCAT/case0 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/install_xCAT/case0 b/xCAT-test/autotest/testcase/install_xCAT/case0 index 52041c0c5..35183600a 100644 --- a/xCAT-test/autotest/testcase/install_xCAT/case0 +++ b/xCAT-test/autotest/testcase/install_xCAT/case0 @@ -31,8 +31,7 @@ stop:yes cmd:arc_all=`uname -a`; code=`lsb_release -sc`;if [[ $arc_all =~ "ppc64le" ]]; then arch="ppc64el";else arch="x86_64";fi; cp "/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-$arch.sources.list" "/etc/apt/sources.list" cmd:apt-get clean;apt-get update check:rc==0 -cmd:echo '* libraries/restart-without-asking boolean true' | debconf-set-selections -check:rc==0 +cmd:arc_all=`uname -a`; if [[ $arc_all =~ "x86_64" ]]; then echo '* libraries/restart-without-asking boolean true' | debconf-set-selections; fi cmd:debconf-show libssl1.1 cmd:cp /core-*-snap.tar.bz2 /install_xCAT_xcat-core.tar.bz2 check:rc==0 From f19604304b1e13dcfb2979e9f7081db7d4f3b910 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 1 Nov 2019 14:52:04 -0400 Subject: [PATCH 274/276] Fix formatting in postscritps doc --- .../deployment/prepostscripts/post_script.rst | 143 +++++++++--------- 1 file changed, 68 insertions(+), 75 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst index f976329ec..277c96346 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst @@ -3,14 +3,14 @@ Using Postscript ---------------- -xCAT automatically runs a few postscripts and postbootscripts that are delivered with xCAT to set up the nodes. You can also add your own scripts to further customize the nodes. This explains the xCAT support to do this. +xCAT automatically runs a few postscripts and postbootscripts that are delivered with xCAT to set up the nodes. You can also add your own scripts to further customize the nodes. Types of scripts ~~~~~~~~~~~~~~~~ -There are two types of scripts in the postscripts table ( postscripts and postbootscripts). The types are based on when in the install process they will be executed. Run the following for more information: +There are two types of scripts in the postscripts table ( postscripts and postbootscripts). The types are based on when in the install process they will be executed. Run the following for more information:: - ``man postscripts`` + man postscripts * **postscripts attribute** - List of scripts that should be run on this node after diskful installation or diskless boot. @@ -20,17 +20,17 @@ There are two types of scripts in the postscripts table ( postscripts and postbo * **[SLES]** - Postscripts will be run after the reboot but before the init.d process. For Linux diskless deployment, the postscripts will be run at the init.d time, and xCAT will automatically add the list of postscripts from the postbootscripts attribute to run after postscripts list. + Postscripts will be run after the reboot but before the ``init.d`` process. For Linux diskless deployment, the postscripts will be run at the ``init.d`` time, and xCAT will automatically add the list of postscripts from the postbootscripts attribute to run after postscripts list. -* **postbootscripts attribute** - list of postbootscripts that should be run on this Linux node at the init.d time after diskful installation reboot or diskless boot -* **xCAT**, by default, for diskful installs only runs the postbootscripts on the install and not on reboot. In xCAT a site table attribute runbootscripts is available to change this default behavior. If set to yes, then the postbootscripts will be run on install and on reboot. +* **postbootscripts attribute** - list of postbootscripts that should be run on this Linux node at the ``init.d`` time after diskful installation reboot or diskless boot +* **xCAT**, by default, for diskful installs only runs the postbootscripts on the install and not on reboot. In xCAT a ``site`` table attribute ``runbootscripts`` is available to change this default behavior. If set to ``yes``, then the postbootscripts will be run on install and on reboot. -**xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot.** +.. note:: xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. Adding your own postscripts ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -To add your own script, place it in /install/postscripts on the management node. Make sure it is executable and world readable. Then add it to the postscripts table for the group of nodes you want it to be run on (or the "all" group if you want it run on all nodes in the appropriate attribute, according to when you want it to run). +To add your own script, place it in ``/install/postscripts`` on the management node. Make sure it is executable and world readable. Then add it to the ``postscripts`` table for the group of nodes you want it to be run on (or the ``all`` group if you want it run on all nodes). To check what scripts will be run on your node during installation: :: @@ -42,11 +42,9 @@ You can pass parameters to the postscripts. For example: :: script1 p1 p2,script2,.... +``p1 p2`` are the parameters to ``script1``. - -p1 p2 are the parameters to script1. - -Postscripts could be placed in the subdirectories in /install/postscripts on management node, and specify "subdir/postscriptname" in the postscripts table to run the postscripts in the subdirectories. This feature could be used to categorize the postscripts for different purposes. Here is an example: :: +Postscripts could be placed in the subdirectories in ``/install/postscripts`` on management node, and specify ``subdir/postscriptname`` in the ``postscripts`` table to run the postscripts in the subdirectories. This feature could be used to categorize the postscripts for different purposes. For example: :: mkdir -p /install/postscripts/subdir1 mkdir -p /install/postscripts/subdir2 @@ -55,18 +53,15 @@ Postscripts could be placed in the subdirectories in /install/postscripts on man chdef node1 -p postscripts=subdir1/postscript1,subdir2/postscript2 updatenode node1 -P -If some of your postscripts will affect the network communication between the management node and compute node, like restarting network or configuring bond, the postscripts execution might not be able to be finished successfully because of the network connection problems, even if we put this postscript be the last postscript in the list, xCAT still may not be able to update the node status to be "booted". The recommendation is to use the Linux "at" mechanism to schedule this network-killing postscript to be run at a later time. Here is an example: +If some of your postscripts will affect the network communication between the management node and compute node, like restarting network or configuring bond, the postscripts execution might not be able to be finished successfully because of the network connection problems. Even if we put this postscript be the last postscript in the list, xCAT still may not be able to update the node status to be ``booted``. The recommendation is to use the Linux ``at`` mechanism to schedule this network-killing postscript to be run at a later time. For example: -The user needs to add a postscript to customize the nics bonding setup, the nics bonding setup will break the network between the management node and compute node, then we could use "at" to run this nic bonding postscripts after all the postscripts processes have been finished. +The user needs to add a postscript to customize the nics bonding setup, the nics bonding setup will break the network between the management node and compute node. User could use ``at`` to run this nic bonding postscripts after all the postscripts processes have been finished. -We could write a script, say, /install/postscripts/nicbondscript, the nicbondscript simply calls the confignicsbond using **"at"**: :: +Write a script, ``/install/postscripts/nicbondscript``, the ``nicbondscript`` simply calls the ``confignicsbond`` using ``at``: :: [root@xcatmn ~]#cat /install/postscripts/nicbondscript - #!/bin/bash - at -f ./confignicsbond now + 1 minute - [root@xcatmn ~]# Then :: @@ -77,23 +72,23 @@ Recommended Postscript design ''''''''''''''''''''''''''''' -* Postscripts that you want to run anywhere, Linux, should be written in shell. This should be available on all OS's. If only on the service nodes, you can use Perl . -* Postscripts should log errors using the following command **local4** is the default xCAT syslog class. **logger -t xCAT -p local4.info "your info message**". +* Postscripts that you want to run anywhere on Linux, should be written in shell. This should be available on all OS's. If only on the service nodes, you can use Perl . +* Postscripts should log errors using the following command (``local4`` is the default xCAT syslog class). ``logger -t xCAT -p local4.info "your info message"``. * Postscripts should have good and error exit codes (i.e 0 and 1). -* Postscripts should be well documented. At the top of the script, the first few lines should describe the function and inputs and output. You should have comments throughout the script. This is especially important if using regx. +* Postscripts should be well documented. At the top of the script, the first few lines should describe the function and inputs and output. You should have comments throughout the script. This is especially important if using ``regx``. PostScript/PostbootScript execution ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When your script is executed on the node, all the attributes in the site table are exported as variables for your scripts to use. You can add extra attributes for yourself. See the sample mypostscript file below. +When your script is executed on the node, all the attributes in the ``site`` table are exported as variables for your scripts to use. You can add extra attributes for yourself. See the sample ``mypostscript`` file below. -To run the postscripts, a script is built, so the above exported variables can be input. You can usually find that script in /xcatpost on the node and for example in the Linux case it is call mypostscript. A good way to debug problems is to go to the node and just run mypostscript and see errors. You can also check the syslog on the Management Node for errors. +To run the postscripts, a script is built, so the above exported variables can be input. You can usually find that script in ``/xcatpost`` on the node and in the Linux case it is call ``mypostscript``. A good way to debug problems is to go to the node and just run ``mypostscript`` and see errors. You can also check the ``syslog`` on the Management Node for errors. -When writing you postscripts, it is good to follow the example of the current postscripts and write errors to syslog and in shell. See Suggestions for writing scripts. +When writing you postscripts, it is good to follow the example of the current postscripts and write errors to ``syslog`` and in shell. See Suggestions for writing scripts. -All attributes in the site table are exported and available to the postscript/postbootscript during execution. See the mypostscript file, which is generated and executed on the nodes to run the postscripts. +All attributes in the ``site`` table are exported and available to the postscript/postbootscript during execution. See the ``mypostscript`` file, which is generated and executed on the nodes to run the postscripts. -Example of mypostscript :: +Example of ``mypostscript`` :: #subroutine used to run postscripts run_ps () { @@ -216,7 +211,7 @@ Example of mypostscript :: run_ps script2 # postscripts-end-here\n -The mypostscript file is generated according to the mypostscript.tmpl file. +The ``mypostscript`` file is generated according to the ``mypostscript.tmpl`` file. .. _Using-the-mypostscript-template-label: @@ -226,38 +221,40 @@ Using the mypostscript template Using the mypostscript template ''''''''''''''''''''''''''''''' -xCAT provides a way for the admin to customize the information that will be provided to the postscripts/postbootscripts when they run on the node. This is done by editing the mypostscript.tmpl file. The attributes that are provided in the shipped mypostscript.tmpl file should not be removed. They are needed by the default xCAT postscripts. +xCAT provides a way for the admin to customize the information that will be provided to the postscripts/postbootscripts when they run on the node. This is done by editing the ``mypostscript.tmpl`` file. The attributes that are provided in the shipped ``mypostscript.tmpl`` file should not be removed. They are needed by the default xCAT postscripts. -The mypostscript.tmpl, is shipped in the /opt/xcat/share/xcat/mypostscript directory. +The ``mypostscript.tmpl``, is shipped in the ``/opt/xcat/share/xcat/mypostscript`` directory. -If the admin customizes the mypostscript.tmpl, they should copy the mypostscript.tmpl to /install/postscripts/mypostscript.tmpl, and then edit it. The mypostscript for each node will be named mypostscript.. The generated mypostscript.. will be put in the /tftpboot/mypostscripts directory. +If the admin customizes the ``mypostscript.tmpl``, they should copy the ``mypostscript.tmpl`` to ``/install/postscripts/mypostscript.tmpl``, and then edit it. The ``mypostscript`` for each node will be named ``mypostscript.``. The generated ``mypostscript.``. will be put in the ``/tftpboot/mypostscripts directory``. site table precreatemypostscripts attribute ''''''''''''''''''''''''''''''''''''''''''' -If the site table precreatemypostscripts attribute is set to 1 or yes, it will instruct xCAT at nodeset and updatenode time to query the db once for all of the nodes passed into the command and create the mypostscript file for each node and put them in a directory in $TFTPDIR(for example /tftpboot). The created mypostscript.. file in the /tftpboot/mypostscripts directory will not be regenerated unless another nodeset or updatenode command is run to that node. This should be used when the system definition has stabilized. It saves time on the updatenode or reboot by not regenerating the mypostscript file. +If the site table ``precreatemypostscripts`` attribute is set to ``1`` or ``yes``, it will instruct xCAT at ``nodeset`` and ``updatenode`` time to query the db once for all of the nodes passed into the command and create the ``mypostscript`` file for each node and put them in a directory in ``$TFTPDIR`` (for example ``/tftpboot``). The created ``mypostscript.``. file in the ``/tftpboot/mypostscripts`` directory will not be regenerated unless another ``nodeset`` or ``updatenode`` command is run to that node. This should be used when the system definition has stabilized. It saves time on the ``updatenode`` or reboot by not regenerating the ``mypostscript`` file. -If the precreatemyposcripts attribute is yes, and a database change is made or xCAT code is upgraded, then you should run a new nodeset or updatenode to regenerate the /tftpboot/mypostscript/mypostscript.. file to pick up the latest database setting. The default for precreatemypostscripts is no/0. +If the ``precreatemyposcripts`` attribute is ``yes``, and a database change is made or xCAT code is upgraded, then you should run a new ``nodeset`` or ``updatenode`` to regenerate the ``/tftpboot/mypostscript/mypostscript.`` file to pick up the latest database setting. The default for ``precreatemypostscripts`` is ``no/0``. -When you run nodeset or updatenode, it will search the **/install/postscripts/mypostscript.tmpl** first. If the **/install/postscripts/mypostscript.tmpl** exists, it will use that template to generate the mypostscript for each node. Otherwise, it will use **/opt/xcat/share/xcat/mypostscript/mypostscript.tmpl**. +When you run ``nodeset`` or ``updatenode``, it will search the ``/install/postscripts/mypostscript.tmpl`` first. If the ``/install/postscripts/mypostscript.tmpl`` exists, it will use that template to generate the ``mypostscript`` for each node. Otherwise, it will use ``/opt/xcat/share/xcat/mypostscript/mypostscript.tmpl``. Content of the template for mypostscript '''''''''''''''''''''''''''''''''''''''' -**The attributes that are defined in the shipped mypostscript.tmpl file** should not be removed. The xCAT default postscripts rely on that information to run successfully. **The following will explain the entries in the mypostscript.tmpl file**. +.. note:: The attributes that are defined in the shipped mypostscript.tmpl file should not be removed. The xCAT default postscripts rely on that information to run successfully. -The SITE_TABLE_ALL_ATTRIBS_EXPORT line in the file directs the code to export all attributes defined in the site table. -Note: the attributes are not always defined exactly as in the site table to avoid conflict with other table attributes of the same name. For example, the site table master attribute is named SITEMASTER in the generated mypostscript file. :: +The following will explain the entries in the ``mypostscript.tmpl`` file. + +The ``SITE_TABLE_ALL_ATTRIBS_EXPORT`` line in the file directs the code to export all attributes defined in the ``site`` table. +The attributes are not always defined exactly as in the ``site`` table to avoid conflict with other table attributes of the same name. For example, the site table master attribute is named SITEMASTER in the generated mypostscript file. :: #SITE_TABLE_ALL_ATTRIBS_EXPORT# -The following line exports ENABLESSHBETWEENNODES by running the internal xCAT routine (enablesshbetweennodes). :: +The following line exports ``ENABLESSHBETWEENNODES`` by running the internal xCAT routine (``enablesshbetweennodes``). :: ENABLESSHBETWEENNODES=#Subroutine:xCAT::Template::enablesshbetweennodes:$NODE# export ENABLESSHBETWEENNODES -**tabdump()** is used to get all the information in the **** table :: +``tabdump()`` is used to get all the information in the ```` table :: tabdump(networks) @@ -271,7 +268,7 @@ These lines get a comma separated list of the groups to which the node belongs. GROUP=#TABLE:nodelist:$NODE:groups# export GROUP -These lines reads the nodesres table, the given attributes (nfsserver,installnic,primarynic,xcatmaster,routenames) for the node **($NODE)**, and exports it. :: +These lines reads the ``nodesres`` table, the given attributes (``nfsserver``, ``installnic``, ``primarynic``, ``xcatmaster``, ``routenames``) for the node ``($NODE)``, and exports it. :: NFSSERVER=#TABLE:noderes:$NODE:nfsserver# export NFSSERVER @@ -284,11 +281,11 @@ These lines reads the nodesres table, the given attributes (nfsserver,installnic NODEROUTENAMES=#TABLE:noderes:$NODE:routenames# export NODEROUTENAMES -The following entry exports multiple variables from the routes table. Not always set. :: +The following entry exports multiple variables from the ``routes`` table. Not always set. :: #ROUTES_VARS_EXPORT# -The following lines export nodetype table attributes. :: +The following lines export ``nodetype`` table attributes. :: OSVER=#TABLE:nodetype:$NODE:os# export OSVER @@ -304,17 +301,17 @@ The following adds the current directory to the path for the postscripts. :: PATH=`dirname $0`:$PATH export PATH -The following sets the NODESETSTATE by running the internal xCAT getnodesetstate script. :: +The following sets the ``NODESETSTATE`` by running the internal xCAT ``getnodesetstate`` script. :: NODESETSTATE=#Subroutine:xCAT::Postage::getnodesetstate:$NODE# export NODESETSTATE -The following says the postscripts are not being run as a result of updatenode.(This is changed =1, when updatenode runs). :: +The following says the postscripts are not being run as a result of ``updatenode``. (This is changed ``=1``, when ``updatenode`` runs). :: UPDATENODE=0 export UPDATENODE -The following sets the NTYPE to compute,service or MN. :: +The following sets the ``NTYPE`` to compute, service or MN. :: NTYPE=$NTYPE export NTYPE @@ -324,7 +321,7 @@ The following sets the mac address. :: MACADDRESS=#TABLE:mac:$NODE:mac# export MACADDRESS -If vlan is setup, then the #VLAN_VARS_EXPORT# line will provide the following exports: :: +If vlan is setup, then the ``#VLAN_VARS_EXPORT#`` line will provide the following exports: :: VMNODE='YES' export VMNODE @@ -334,7 +331,7 @@ If vlan is setup, then the #VLAN_VARS_EXPORT# line will provide the following ex .. #VLAN_VARS_EXPORT# -If monitoring is setup, then the #MONITORING_VARS_EXPORT# line will provide: :: +If monitoring is setup, then the ``#MONITORING_VARS_EXPORT#`` line will provide: :: MONSERVER=11.10.34.108 export MONSERVER @@ -342,7 +339,7 @@ If monitoring is setup, then the #MONITORING_VARS_EXPORT# line will provide: :: export MONMASTER #MONITORING_VARS_EXPORT# -The OSIMAGE_VARS_EXPORT# line will provide, for example: :: +The ``#OSIMAGE_VARS_EXPORT#`` line will provide, for example: :: OSPKGDIR=/install// export OSPKGDIR @@ -352,7 +349,7 @@ The OSIMAGE_VARS_EXPORT# line will provide, for example: :: #OSIMAGE_VARS_EXPORT# -THE NETWORK_FOR_DISKLESS_EXPORT# line will provide diskless networks information, if defined. :: +THE ``#NETWORK_FOR_DISKLESS_EXPORT#`` line will provide diskless networks information, if defined. :: NETMASK=255.255.255.0 export NETMASK @@ -361,9 +358,9 @@ THE NETWORK_FOR_DISKLESS_EXPORT# line will provide diskless networks information .. #NETWORK_FOR_DISKLESS_EXPORT# -Note: the **#INCLUDE_POSTSCRIPTS_LIST#** and the **#INCLUDE_POSTBOOTSCRIPTS_LIST#** sections in **/tftpboot/mypostscript(mypostbootscripts)** on the Management Node will contain all the postscripts and postbootscripts defined for the node. When running an **updatenode** command for only some of the scripts , you will see in the **/xcatpost/mypostscript** file on the node, the list has been redefined during the execution of updatenode to only run the requested scripts. For example, if you run **updatenode -P** syslog. +Note: the ``#INCLUDE_POSTSCRIPTS_LIST#`` and the ``#INCLUDE_POSTBOOTSCRIPTS_LIST#`` sections in ``/tftpboot/mypostscript(mypostbootscripts)`` on the Management Node will contain all the postscripts and postbootscripts defined for the node. When running an ``updatenode`` command for only some of the scripts , you will see in the ``/xcatpost/mypostscript`` file on the node, the list has been redefined during the execution of ``updatenode`` to only run the requested scripts. For example, if you run ``updatenode -P syslog``. -The **#INCLUDE_POSTSCRIPTS_LIST#** flag provides a list of postscripts defined for this **$NODE**. :: +The ``#INCLUDE_POSTSCRIPTS_LIST#`` flag provides a list of postscripts defined for this ``$NODE``. :: #INCLUDE_POSTSCRIPTS_LIST# @@ -378,7 +375,7 @@ For example, you will see in the generated file the following stanzas: :: syncfiles # node-postscripts-end-here -The **#INCLUDE_POSTBOOTSCRIPTS_LIST#** provides a list of postbootscripts defined for this **$NODE**. :: +The ``#INCLUDE_POSTBOOTSCRIPTS_LIST#`` provides a list of postbootscripts defined for this ``$NODE``. :: #INCLUDE_POSTBOOTSCRIPTS_LIST# @@ -394,7 +391,7 @@ For example, you will see in the generated file the following stanzas: :: Kinds of variables in the template ''''''''''''''''''''''''''''''''''' -**Type 1:** For the simple variable, the syntax is as follows. The mypostscript.tmpl has several examples of this. **$NODE** is filled in by the code. **UPDATENODE** is changed to 1, when the postscripts are run by ``updatenode``. **$NTYPE** is filled in as either compute,service or MN. :: +**Type 1:** For the simple variable, the syntax is as follows. The ``mypostscript.tmpl`` has several examples of this. ``$NODE`` is filled in by the code. ``UPDATENODE`` is changed to 1, when the postscripts are run by ``updatenode``. ``$NTYPE`` is filled in as either ``compute``, ``service`` or ``MN``. :: NODE=$NODE export NODE @@ -403,11 +400,11 @@ Kinds of variables in the template NTYPE=$NTYPE export NTYPE -**Type 2:** This is the syntax to get the value of one attribute from the **** and its key is **$NODE**. It does not support tables with two keys. Some of the tables with two keys are **(litefile,prodkey,deps,monsetting,mpa,networks)**. :: +**Type 2:** This is the syntax to get the value of one attribute from the ```` and its key is ``$NODE``. It does not support tables with two keys. Some of the tables with two keys are ``litefile``, ``prodkey``, ``deps``, ``monsetting``, ``mpa``, ``networks``. :: VARNAME=#TABLE:tablename:$NODE:attribute# -For example, to get the new updatestatus attribute from the nodelist table: :: +For example, to get the new ``updatestatus`` attribute from the ``nodelist`` table: :: UPDATESTATUS=#TABLE:nodelist:$NODE:updatestatus# export UPDATESTATUS @@ -418,20 +415,20 @@ For example, to get the new updatestatus attribute from the nodelist table: :: or VARNAME=#Subroutine:modulename::subroutinename# -Examples in the mypostscript.tmpl are the following: :: +Examples in the ``mypostscript.tmpl`` are the following: :: NODESETSTATE=#Subroutine:xCAT::Postage::getnodesetstate:$NODE# export NODESETSTATE ENABLESSHBETWEENNODES=#Subroutine:xCAT::Template::enablesshbetweennodes:$NODE# export ENABLESSHBETWEENNODES -Note: Type 3 is not an open interface to add extensions to the template. +.. note:: Type 3 is not an open interface to add extensions to the template. -**Type 4:** The syntax is #FLAG#. When parsing the template, the code generates all entries defined by **#FLAG#**, if they are defined in the database. For example: To export all values of all attributes from the site table. The tag is :: +**Type 4:** The syntax is ``#FLAG#``. When parsing the template, the code generates all entries defined by ``#FLAG#``, if they are defined in the database. For example: To export all values of all attributes from the ``site`` table. The tag is :: #SITE_TABLE_ALL_ATTRIBS_EXPORT# -For the **#SITE_TABLE_ALL_ATTRIBS_EXPORT#** flag, the related subroutine will get the attributes' values and deal with the special case. such as : the site.master should be exported as **"SITEMASTER"**. And if the noderes.xcatmaster exists, the noderes.xcatmaster should be exported as **"MASTER"**, otherwise, we also should export site.master as the **"MASTER"**. +For the ``#SITE_TABLE_ALL_ATTRIBS_EXPORT#`` flag, the related subroutine will get the attributes' values and deal with the special case. such as : the ``site.master`` should be exported as ``"SITEMASTER"``. And if the ``noderes.xcatmaster`` exists, the ``noderes.xcatmaster`` should be exported as ``"MASTER"``, otherwise, we also should export ``site.master`` as the ``"MASTER"``. Other examples are: :: @@ -442,11 +439,9 @@ Other examples are: :: #INCLUDE_POSTSCRIPTS_LIST# - includes the list of all postscripts for the node #INCLUDE_POSTBOOTSCRIPTS_LIST# - includes the list of all postbootscripts for the node -Note: Type4 is not an open interface to add extensions to the templatel. +.. note:: Type4 is not an open interface to add extensions to the template. -**Type 5:** Get all the data from the specified table. The **** should not be a node table, like nodelist. This should be handles with TYPE 2 syntax to get specific attributes for the **$NODE**. tabdump would result in too much data for a nodetype table. Also the auditlog, eventlog should not be in tabdump for the same reason. site table should not be specified, it is already provided with the **#SITE_TABLE_ALL_ATTRIBS_EXPORT#** flag. It can be used to get the data from the two key tables (like switch). :: - - The syntax is: +**Type 5:** Get all the data from the specified table. The ```` should not be a node table, like ``nodelist``. This should be handles with TYPE 2 syntax to get specific attributes for the ``$NODE``. ``tabdump`` would result in too much data for a ``nodetype`` table. Also the ``auditlog``, ``eventlog`` should not be in ``tabdump`` for the same reason. ``site`` table should not be specified, it is already provided with the ``#SITE_TABLE_ALL_ATTRIBS_EXPORT#`` flag. It can be used to get the data from the two key tables (like ``switch``). The syntax is: :: tabdump() @@ -455,7 +450,7 @@ Edit mypostscript.tmpl **Add new attributes into mypostscript.tmpl** -When you add new attributes into the template, you should edit the **/install/postscripts/mypostscript.tmpl** which you created by copying **/opt/xcat/share/xcat/mypostscript/mypostscript.tmpl**. Make all additions before the **# postscripts-start-here** section. xCAT will first look in **/install/postscripts/mypostscript.tmpl** for a file and then if not found will use the one in **/opt/xcat/share/xcat/mypostcript/mypostscript.tmpl**. +When you add new attributes into the template, you should edit the ``/install/postscripts/mypostscript.tmpl`` which you created by copying ``/opt/xcat/share/xcat/mypostscript/mypostscript.tmpl``. Make all additions before the ``# postscripts-start-here`` section. xCAT will first look in ``/install/postscripts/mypostscript.tmpl`` for a file and then, if not found, will use the one in ``/opt/xcat/share/xcat/mypostcript/mypostscript.tmpl``. For example: :: @@ -467,11 +462,11 @@ For example: :: ## The following flag postscripts-end-here must not be deleted. # postscripts-end-here -Note: If you have a hierarchical cluster, you must copy your new mypostscript.tmpl to **/install/postscripts/mypostscript.tmpl** on the service nodes, unless **/install/postscripts** directory is mounted from the MN to the service node. +.. note:: If you have a hierarchical cluster, you must copy your new ``mypostscript.tmpl`` to ``/install/postscripts/mypostscript.tmpl`` on the service nodes, unless ``/install/postscripts`` directory is mounted from the MN to the service node. **Remove attribute from mypostscript.tmpl** -If you want to remove an attribute that you have added, you should remove all the related lines or comment them out with ##. For example, comment out the added lines. :: +If you want to remove an attribute that you have added, you should remove all the related lines or comment them out with ``##``. For example, comment out the added lines. :: ##UPDATESTATUS=#TABLE:nodelist:$NODE:updatestatus# ##export UPDATESTATUS @@ -481,32 +476,30 @@ Test the new template There are two quick ways to test the template. -#. -If the node is up: :: +1. If the node is up :: - updatenode -P syslog + updatenode -P syslog -Check your generated template : :: + Check your generated ``mypostscript`` on the compute node: :: - Check the generated mypostscript file on compute node /xcatpost. + vi /xcatpost/mypostscript -#. -Another way, is set the precreate option :: +2. Set the ``precreatemypostscripts`` option :: chdef -t site -o clustersite precreatemypostscripts=1 -Then run :: + Then run :: nodeset .... -Check your generated template :: + Check your generated ``mypostscript`` :: vi /tftpboot/mypostscripts/mypostscript. Sample /xcatpost/mypostscript ''''''''''''''''''''''''''''''' -This is an example of the generated postscript for a servicenode install. It is found in /xcatpost/mypostscript on the node. :: +This is an example of the generated postscript for a servicenode install. It is found in ``/xcatpost/mypostscript`` on the node. :: # global value to store the running status of the postbootscripts,the value #is non-zero if one postbootscript failed From 51759927ec3cc5fd2c5acbd3ee28966f470216a2 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 4 Nov 2019 13:11:56 -0500 Subject: [PATCH 275/276] Restart libssl1.1 without asking for regression Ubuntu pkg install --- xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm index 0eb9c3b8d..f272d7354 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm @@ -43,6 +43,7 @@ cmd:xdsh $$CN "apt-get clean all" check:rc==0 cmd:xdsh $$CN "apt-get update" check:rc==0 +cmd:arc_all=`uname -a`; if [[ $arc_all =~ "x86_64" ]]; then xdsh $$CN "echo '* libraries/restart-without-asking boolean true' | debconf-set-selections"; fi cmd:xdsh $$CN "apt-get -y install build-essential dpkg-dev dh-make debhelper fakeroot gnupg lintian pbuilder quilt reprepro libsoap-lite-perl libdbi-perl" check:rc==0 cmd:xdsh $$CN "rm -rf /oldxcat" From 2f4f5d4057b0554f0585a8329edb9de10c647d67 Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 4 Nov 2019 14:51:59 -0500 Subject: [PATCH 276/276] link packlist from rh to centos --- .../share/xcat/netboot/centos/compute.centos8.ppc64le.exlist | 1 + .../share/xcat/netboot/centos/compute.centos8.ppc64le.pkglist | 1 + .../xcat/netboot/centos/compute.centos8.ppc64le.postinstall | 1 + .../share/xcat/netboot/centos/compute.centos8.x86_64.exlist | 1 + .../share/xcat/netboot/centos/compute.centos8.x86_64.pkglist | 1 + .../share/xcat/netboot/centos/compute.centos8.x86_64.postinstall | 1 + 6 files changed, 6 insertions(+) create mode 120000 xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.exlist create mode 120000 xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.pkglist create mode 120000 xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.postinstall create mode 120000 xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.exlist create mode 120000 xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.pkglist create mode 120000 xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.postinstall diff --git a/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.exlist b/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.exlist new file mode 120000 index 000000000..f468ba7e1 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.exlist @@ -0,0 +1 @@ +../rh/compute.rhels8.ppc64le.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.pkglist new file mode 120000 index 000000000..38195cc33 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.pkglist @@ -0,0 +1 @@ +../rh/compute.rhels8.ppc64le.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.postinstall b/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.postinstall new file mode 120000 index 000000000..011158f7b --- /dev/null +++ b/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.postinstall @@ -0,0 +1 @@ +../rh/compute.rhels8.ppc64le.postinstall \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.exlist b/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.exlist new file mode 120000 index 000000000..a6d9c0135 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.exlist @@ -0,0 +1 @@ +../rh/compute.rhels8.x86_64.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.pkglist new file mode 120000 index 000000000..5ecd4c4d1 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.pkglist @@ -0,0 +1 @@ +../rh/compute.rhels8.x86_64.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.postinstall b/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.postinstall new file mode 120000 index 000000000..3e16d254e --- /dev/null +++ b/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.postinstall @@ -0,0 +1 @@ +../rh/compute.rhels8.x86_64.postinstall \ No newline at end of file