From 890aa93bd199b0e5f5ab39f9c4f44b3ac01fff0a Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 27 Jul 2021 10:07:01 -0400 Subject: [PATCH 1/4] Support Rocky Linux on service nodes --- perl-xCAT/xCAT/data/discinfo.pm | 1 - xCAT-server/lib/perl/xCAT/Template.pm | 2 +- xCAT-server/lib/xcat/plugins/anaconda.pm | 10 ++++++++++ .../share/xcat/install/rocky/compute.rocky8.pkglist | 13 +------------ .../share/xcat/install/rocky/compute.rocky8.tmpl | 2 +- .../install/rocky/service.rocky8.otherpkgs.pkglist | 1 + .../share/xcat/install/rocky/service.rocky8.pkglist | 1 + .../share/xcat/install/rocky/service.rocky8.tmpl | 1 + .../xcat/netboot/rocky/service.rocky8.x86_64.exlist | 1 + .../rocky/service.rocky8.x86_64.otherpkgs.pkglist | 1 + .../netboot/rocky/service.rocky8.x86_64.pkglist | 1 + .../netboot/rocky/service.rocky8.x86_64.postinstall | 1 + xCAT-server/share/xcat/tools/go-xcat | 7 +++++-- .../autotest/testcase/installation/SN_setup_case | 6 +++--- .../reg_linux_diskless_installation_hierarchy | 4 ++-- 15 files changed, 30 insertions(+), 22 deletions(-) mode change 100644 => 120000 xCAT-server/share/xcat/install/rocky/compute.rocky8.pkglist create mode 120000 xCAT-server/share/xcat/install/rocky/service.rocky8.otherpkgs.pkglist create mode 120000 xCAT-server/share/xcat/install/rocky/service.rocky8.pkglist create mode 120000 xCAT-server/share/xcat/install/rocky/service.rocky8.tmpl create mode 120000 xCAT-server/share/xcat/netboot/rocky/service.rocky8.x86_64.exlist create mode 120000 xCAT-server/share/xcat/netboot/rocky/service.rocky8.x86_64.otherpkgs.pkglist create mode 120000 xCAT-server/share/xcat/netboot/rocky/service.rocky8.x86_64.pkglist create mode 120000 xCAT-server/share/xcat/netboot/rocky/service.rocky8.x86_64.postinstall diff --git a/perl-xCAT/xCAT/data/discinfo.pm b/perl-xCAT/xCAT/data/discinfo.pm index b7dd0e553..445cf5eab 100755 --- a/perl-xCAT/xCAT/data/discinfo.pm +++ b/perl-xCAT/xCAT/data/discinfo.pm @@ -14,7 +14,6 @@ require Exporter; use strict; our %distnames = ( - "1624205633.869423" => "rocky8.4", #x86_64 "1578087695.538488" => "centos8.1", #x86_64 "1578087695.537220" => "centos8.1", #ppc64le "1480943823.812754" => "centos7.3", #x86_64 diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 346ee8e6b..66e72b835 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -299,7 +299,7 @@ sub subvars { my $writerepo; my $c = 0; foreach my $pkgdir (@pkgdirs) { - if ($platform =~ /^(rh|SL|centos|ol|fedora)$/) { + if ($platform =~ /^(rh|SL|centos|ol|fedora|rocky)$/) { if ($c == 0) { # After some tests, if we put the repo in pre scripts in the kickstart like for rhels6.x # the rhels5.9 will not be installed successfully. So put in kickstart directly. diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index b73fb78ee..600c2cbf6 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2132,6 +2132,16 @@ sub copycd my @ol_version = split /[- ]/, $desc; $distname = "ol" . $ol_version[1]; } + elsif ($desc =~ /Rocky Linux/) + { + # + # Attempt to auto-detect for Rocky Linux OS, the last element + # (accessed with [-1] array index) has typically been the version + # ex: "Rocky Linux 8" + # + my @rl_version = split / /, $desc; + $distname = "rocky" . $ol_version[-1]; + } elsif ($desc =~ /^[\d\.]+$/) { open($dinfo, $mntpath . "/.treeinfo"); diff --git a/xCAT-server/share/xcat/install/rocky/compute.rocky8.pkglist b/xCAT-server/share/xcat/install/rocky/compute.rocky8.pkglist deleted file mode 100644 index 13eb3c39b..000000000 --- a/xCAT-server/share/xcat/install/rocky/compute.rocky8.pkglist +++ /dev/null @@ -1,12 +0,0 @@ -@^minimal-environment -chrony -net-tools -nfs-utils -openssh-server -rsync -util-linux -wget -python3 -tar -bzip2 -perl-interpreter diff --git a/xCAT-server/share/xcat/install/rocky/compute.rocky8.pkglist b/xCAT-server/share/xcat/install/rocky/compute.rocky8.pkglist new file mode 120000 index 000000000..ccb1fe4ef --- /dev/null +++ b/xCAT-server/share/xcat/install/rocky/compute.rocky8.pkglist @@ -0,0 +1 @@ +../rh/compute.rhels8.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/rocky/compute.rocky8.tmpl b/xCAT-server/share/xcat/install/rocky/compute.rocky8.tmpl index 3719fd0c6..ba3baa532 100644 --- a/xCAT-server/share/xcat/install/rocky/compute.rocky8.tmpl +++ b/xCAT-server/share/xcat/install/rocky/compute.rocky8.tmpl @@ -1,4 +1,4 @@ -#version=CentOS8 +#version=Rocky8 # Use text install text # Use network installation diff --git a/xCAT-server/share/xcat/install/rocky/service.rocky8.otherpkgs.pkglist b/xCAT-server/share/xcat/install/rocky/service.rocky8.otherpkgs.pkglist new file mode 120000 index 000000000..03999f75f --- /dev/null +++ b/xCAT-server/share/xcat/install/rocky/service.rocky8.otherpkgs.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.otherpkgs.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/rocky/service.rocky8.pkglist b/xCAT-server/share/xcat/install/rocky/service.rocky8.pkglist new file mode 120000 index 000000000..818f670ec --- /dev/null +++ b/xCAT-server/share/xcat/install/rocky/service.rocky8.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/rocky/service.rocky8.tmpl b/xCAT-server/share/xcat/install/rocky/service.rocky8.tmpl new file mode 120000 index 000000000..373e2f6eb --- /dev/null +++ b/xCAT-server/share/xcat/install/rocky/service.rocky8.tmpl @@ -0,0 +1 @@ +../rh/service.rhels8.tmpl \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/rocky/service.rocky8.x86_64.exlist b/xCAT-server/share/xcat/netboot/rocky/service.rocky8.x86_64.exlist new file mode 120000 index 000000000..9d1e45244 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rocky/service.rocky8.x86_64.exlist @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/rocky/service.rocky8.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/rocky/service.rocky8.x86_64.otherpkgs.pkglist new file mode 120000 index 000000000..03999f75f --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rocky/service.rocky8.x86_64.otherpkgs.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.otherpkgs.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/rocky/service.rocky8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rocky/service.rocky8.x86_64.pkglist new file mode 120000 index 000000000..cba1edc0e --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rocky/service.rocky8.x86_64.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/rocky/service.rocky8.x86_64.postinstall b/xCAT-server/share/xcat/netboot/rocky/service.rocky8.x86_64.postinstall new file mode 120000 index 000000000..cd4cbff17 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rocky/service.rocky8.x86_64.postinstall @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.postinstall \ No newline at end of file diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 8c66bc919..e6d384ce1 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.49 +# Version 1.0.50 # # Copyright (C) 2016 - 2021 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) @@ -38,6 +38,8 @@ # - Add support for Oracle Linux # 2021-07-08 Peter Wong # - Provide correct versions of packages to be installed +# 2021-07-27 Mark Gurevich +# - Add support for Rocky Linux # @@ -1589,6 +1591,7 @@ function add_xcat_dep_repo_yum_or_zypper() case "${distro}" in "centos"*) distro="rh${distro#centos}" ;; "ol"*) distro="rh${distro#ol}" ;; + "rocky"*) distro="rh${distro#rocky}" ;; "fedora10"|"fedora11") distro="fedora9" ;; "fedora1"[678]) distro="rh6" ;; "fedora19"|"fedora2"?) distro="rh7" ;; @@ -2288,7 +2291,7 @@ Version: ${GO_XCAT_LINUX_VERSION} EOF case "${GO_XCAT_LINUX_DISTRO}" in -"centos"|"fedora"|"rhel"|"sles"|"ubuntu"|"ol") +"centos"|"fedora"|"rhel"|"sles"|"ubuntu"|"ol"|"rocky") ;; *) warn_if_bad 1 "${GO_XCAT_LINUX_DISTRO}: unsupported Linux distro" diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index 3d5628ef8..5af708407 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -46,13 +46,13 @@ check:rc==0 cmd:cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-core && createrepo . check:rc==0 -cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";path2="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then path="sles";path2="sles";elif [[ "__GETNODEATTR($$SN,os)__" =~ "ol" ]];then path="ol";path2="rh";fi; ver="__GETNODEATTR($$SN,os)__"; tmp=${ver%%.*};ver=`echo "$tmp"|sed 's:[a-zA-Z]::g'`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/$path2$ver/__GETNODEATTR($$SN,arch)__ && createrepo .; +cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";path2="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then path="sles";path2="sles";elif [[ "__GETNODEATTR($$SN,os)__" =~ "ol" ]];then path="ol";path2="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "rocky" ]];then path="rocky";path2="rh";fi; ver="__GETNODEATTR($$SN,os)__"; tmp=${ver%%.*};ver=`echo "$tmp"|sed 's:[a-zA-Z]::g'`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/$path2$ver/__GETNODEATTR($$SN,arch)__ && createrepo .; check:rc==0 cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkgdir=/install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__ check:rc==0 -cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then path="sles";elif [[ "__GETNODEATTR($$SN,os)__" =~ "ol" ]];then path="ol";fi; ver="__GETNODEATTR($$SN,os)__"; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/$path/service.${ver%%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist; +cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then path="sles";elif [[ "__GETNODEATTR($$SN,os)__" =~ "ol" ]];then path="ol";elif [[ " __GETNODEATTR($$SN,os)__" =~ "rocky" ]];then path="rocky";fi; ver="__GETNODEATTR($$SN,os)__"; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/$path/service.${ver%%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist; check:rc==0 #add support python in sn @@ -106,7 +106,7 @@ check:rc==0 cmd:if rpm -qa|grep xCAT-openbmc-py 2>&1; then xdsh $$SN "rpm -qa|grep python2-greenlet"; else echo "there is no xCAT-openbmc-py installed in MN, skip check python2-greenlet installation in SN"; exit 0;fi check:rc==0 cmd:xdsh $$SN "cat /var/log/xcat/xcat.log" -cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]]; then if [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then xdsh $$SN "zypper -n install perl-Sys-Virt"; elif [[ "__GETNODEATTR($$SN,os)__" =~ "rh" || "__GETNODEATTR($$SN,os)__" =~ "ol" ]];then xdsh $$SN "yum install -y perl-Sys-Virt";fi;fi +cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]]; then if [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then xdsh $$SN "zypper -n install perl-Sys-Virt"; elif [[ "__GETNODEATTR($$SN,os)__" =~ "rh" || "__GETNODEATTR($$SN,os)__" =~ "ol" || "__GETNODEATTR($$SN,os)__" =~ "rocky" ]];then xdsh $$SN "yum install -y perl-Sys-Virt";fi;fi check:rc==0 cmd:makentp -a 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 6f483fbfd..1d0c719a0 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -156,8 +156,8 @@ cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netb cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -#Make sure squashfs-tools rpm is installed on RHEL and OL -cmd:if [[ "$$OS" =~ "rhel" || "$$OS" =~ "ol" ]]; then yum install -y squashfs-tools; fi +#Make sure squashfs-tools rpm is installed on RHEL, OL and Rocky +cmd:if [[ "$$OS" =~ "rhel" || "$$OS" =~ "ol" || "$$OS" =~ "rocky" ]]; then yum install -y squashfs-tools; fi #Make sure squashfs-tools rpm is installed on Ubuntu cmd:if [[ "$$OS" =~ "ubuntu" ]]; then apt-get install -y squashfs-tools; fi From 5f54bceba4009a1e98b142e5ba40930465864b2f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 27 Jul 2021 10:13:28 -0400 Subject: [PATCH 2/4] Wrong variable used --- xCAT-server/lib/xcat/plugins/anaconda.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 600c2cbf6..117ecdb31 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2140,7 +2140,7 @@ sub copycd # ex: "Rocky Linux 8" # my @rl_version = split / /, $desc; - $distname = "rocky" . $ol_version[-1]; + $distname = "rocky" . $rl_version[-1]; } elsif ($desc =~ /^[\d\.]+$/) { From fe71328f305d69b9e4ae851894e2cf4544ac06e3 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 27 Jul 2021 10:18:17 -0400 Subject: [PATCH 3/4] Revert to using discinfo --- perl-xCAT/xCAT/data/discinfo.pm | 1 + xCAT-server/lib/xcat/plugins/anaconda.pm | 10 ---------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/perl-xCAT/xCAT/data/discinfo.pm b/perl-xCAT/xCAT/data/discinfo.pm index 445cf5eab..b7dd0e553 100755 --- a/perl-xCAT/xCAT/data/discinfo.pm +++ b/perl-xCAT/xCAT/data/discinfo.pm @@ -14,6 +14,7 @@ require Exporter; use strict; our %distnames = ( + "1624205633.869423" => "rocky8.4", #x86_64 "1578087695.538488" => "centos8.1", #x86_64 "1578087695.537220" => "centos8.1", #ppc64le "1480943823.812754" => "centos7.3", #x86_64 diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 117ecdb31..b73fb78ee 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2132,16 +2132,6 @@ sub copycd my @ol_version = split /[- ]/, $desc; $distname = "ol" . $ol_version[1]; } - elsif ($desc =~ /Rocky Linux/) - { - # - # Attempt to auto-detect for Rocky Linux OS, the last element - # (accessed with [-1] array index) has typically been the version - # ex: "Rocky Linux 8" - # - my @rl_version = split / /, $desc; - $distname = "rocky" . $rl_version[-1]; - } elsif ($desc =~ /^[\d\.]+$/) { open($dinfo, $mntpath . "/.treeinfo"); From 908ccf9922107f9b208c4e5d5f38acaa0506801b Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 27 Jul 2021 11:38:13 -0400 Subject: [PATCH 4/4] Rename otherpkgs.pkglist for Rocky8 --- ....otherpkgs.pkglist => service.rocky8.x86_64.otherpkgs.pkglist} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename xCAT-server/share/xcat/install/rocky/{service.rocky8.otherpkgs.pkglist => service.rocky8.x86_64.otherpkgs.pkglist} (100%) diff --git a/xCAT-server/share/xcat/install/rocky/service.rocky8.otherpkgs.pkglist b/xCAT-server/share/xcat/install/rocky/service.rocky8.x86_64.otherpkgs.pkglist similarity index 100% rename from xCAT-server/share/xcat/install/rocky/service.rocky8.otherpkgs.pkglist rename to xCAT-server/share/xcat/install/rocky/service.rocky8.x86_64.otherpkgs.pkglist