From 95ca10563571c52b55867c16df43bba411fb4780 Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Tue, 18 Sep 2018 18:03:32 +0800 Subject: [PATCH] enhancements for sle15 diskful CN deployment (#5605) * add sle dir for copycds * remove HPC packages from sle15 template * copycds support ppc64le sle15 * support packages products for sle15 * create repos for all products in sle15 Package ISO * fix deployment status postbooting in sle15 * support sle15 * add copycds example for sle15 * generate add_on product * polished * adjust product_dir --- .../common/deployment/create_img.rst | 4 +++ xCAT-server/lib/perl/xCAT/Template.pm | 20 +++++++++++- xCAT-server/lib/xcat/plugins/sles.pm | 10 ++++-- .../xcat/install/sles/compute.sle15.pkglist | 2 ++ .../xcat/install/sles/compute.sle15.tmpl | 8 ++--- xCAT-server/xCAT-server.spec | 3 +- xCAT/postscripts/ospkgs | 31 +++++++++++++++++-- 7 files changed, 65 insertions(+), 13 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 4fcb28264..cb60aa607 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 @@ -8,6 +8,10 @@ XCAT use 'copycds' command to create an image which will be available to install 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: :: + + copycds SLE-15-Installer-DVD-ppc64le-GM-DVD1.iso SLE-15-Packages-ppc64le-GM-DVD1.iso If using a DVD, put it in the DVD drive of the management node and run: :: diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 55dc20684..818cbf490 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -324,10 +324,28 @@ sub subvars { SuSE-Linux-pkg$c "; $source_in_pre .= "http://'\$nextserver'$pkgdirSuSE-Linux-pkg$c/falseSuSE-Linux-pkg$c"; + } elsif ($platform =~ /^sle15*/) { + if ( -d "$pkgdir") { + opendir(DIR,$pkgdir); + my @subpkgdir=grep(!/\.\.?$|^media.1$/, readdir DIR); + foreach my $subdir (@subpkgdir){ + my $product_name; + my $product_dir; + $product_dir=$subdir; + if($subdir =~ /^Module-/){ + $product_name="sle-".lc($subdir); + }elsif($subdir =~ /^Product-/){ + $subdir=~s/Product-//; + $product_name=$subdir; + } + if (defined($product_name) && defined($product_dir)){ + $source .="http://XCATNEXTSERVERHOOK$pkgdir$product_name/$product_dir"; + } + } + } } $c++; } - $inc =~ s/#INSTALL_SOURCES#/$source/g; $inc =~ s/#INSTALL_SOURCES_IN_PRE#/$source_in_pre/g; if (("ubuntu" eq $platform) || ("debian" eq $platform)) { diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 7470483b1..46e3a8b79 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -937,7 +937,11 @@ sub mkinstall # trim the "/" in /install/sles11.3/x86_64/ $pkgdir =~ s/\/$//; if ($pkgdir =~ /^($installroot\/$os\/$arch)$/) { - $srcdirs[0] = "$pkgdir/1"; + if ( -d "$pkgdir/2") { + $srcdirs[0] = "$pkgdir/1,$pkgdir/2"; + }else{ + $srcdirs[0] = "$pkgdir/1"; + } $tmppkgdir = join(",", @srcdirs); } @@ -1744,7 +1748,9 @@ sub copycd open($dinfo, $mntpath . "/media.1/media"); my $dsc = <$dinfo>; if ($dsc =~ /x86_64/) { - $darch = "x86_64"; + $darch = "x86_64"; + } elsif ($dsc =~ /ppc64le/) { + $darch = "ppc64le" ; } if ($dsc =~ /Installer/ and $dsc =~ /SLE-15/) { $discnumber = 1; diff --git a/xCAT-server/share/xcat/install/sles/compute.sle15.pkglist b/xCAT-server/share/xcat/install/sles/compute.sle15.pkglist index 2933f493c..c660ed5ed 100644 --- a/xCAT-server/share/xcat/install/sles/compute.sle15.pkglist +++ b/xCAT-server/share/xcat/install/sles/compute.sle15.pkglist @@ -1,2 +1,4 @@ +iputils +vim openssl rsync diff --git a/xCAT-server/share/xcat/install/sles/compute.sle15.tmpl b/xCAT-server/share/xcat/install/sles/compute.sle15.tmpl index 733c59eaf..d2ff50e93 100644 --- a/xCAT-server/share/xcat/install/sles/compute.sle15.tmpl +++ b/xCAT-server/share/xcat/install/sles/compute.sle15.tmpl @@ -45,16 +45,12 @@ - http://XCATNEXTSERVERHOOK/install/sles15/x86_64/2sle-module-basesystem/Module-Basesystem - http://XCATNEXTSERVERHOOK/install/sles15/x86_64/2sle-module-hpc/Module-HPC - http://XCATNEXTSERVERHOOK/install/sles15/x86_64/2sle-module-server-applications/Module-Server-Applications - http://XCATNEXTSERVERHOOK/install/sles15/x86_64/2sle-module-server-applications/Module-Server-Applications - http://XCATNEXTSERVERHOOK/install/sles15/x86_64/2SLE_HPC/Product-HPC + #INSTALL_SOURCES# - SLE_HPC + SLES #INCLUDE_DEFAULT_PTRNLIST_S# diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 90315805e..e491c4927 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -441,7 +441,8 @@ fi %post %ifos linux ln -sf $RPM_INSTALL_PREFIX0/sbin/xcatd /usr/sbin/xcatd - +ln -sf $RPM_INSTALL_PREFIX0/share/xcat/install/sles $RPM_INSTALL_PREFIX0/share/xcat/install/sle +ln -sf $RPM_INSTALL_PREFIX0/share/xcat/netboot/sles $RPM_INSTALL_PREFIX0/share/xcat/netboot/sle if [ "$1" = "1" ]; then #Only if installing for the first time.. if [ -x /usr/lib/systemd/systemd ]; then /usr/bin/systemctl daemon-reload diff --git a/xCAT/postscripts/ospkgs b/xCAT/postscripts/ospkgs index 4c6d095ef..1ebf9132d 100755 --- a/xCAT/postscripts/ospkgs +++ b/xCAT/postscripts/ospkgs @@ -256,7 +256,7 @@ do # (4) for other os, we just keep it here. # For other pkg paths, we just keep it here. if [ $dir == $default_pkgdir ] || [ $dir == "$default_pkgdir/" ]; then - if ( pmatch "$OSVER" "sles*" ); then + if ( pmatch "$OSVER" "sle*" ); then OSPKGDIR="$OSPKGDIR/1" ospkgdir="$ospkgdir/1" elif ( pmatch "$OSVER" "SL5*" ); then @@ -265,7 +265,32 @@ do fi fi array_set_element os_path $index $ospkgdir - + if [ $dir == $default_pkgdir ] || [ $dir == "$default_pkgdir/" ]; then + ospkgdir=$(echo $ospkgdir|sed 's/\/1$/\/2/') + if ( pmatch "$OSVER" "sle15*" ); then + if [ $ARCH == "x86_64" ]; then + for arg in "Product-SLES" "Module-Desktop-Applications" "Module-Live-Patching" \ + "Module-Web-Scripting" "Module-Basesystem" "Module-Development-Tools" "Module-Public-Cloud" \ + "Product-HA" "Product-SLES_SAP" "Module-CAP-Tools" "Module-HPC" "Module-SAP-Applications" \ + "Product-HPC" "Product-WE" "Module-Containers" "Module-Legacy" "Module-Server-Applications" "Product-SLED" + do + ospkgdir_ok="$ospkgdir/$arg" + index=$(expr $index + 1) + array_set_element os_path $index $ospkgdir_ok + done + elif [ $ARCH == "ppc64le" ]; then + for arg in "Product-SLES" "Module-Desktop-Applications" "Module-Live-Patching" \ + "Module-Web-Scripting" "Module-Basesystem" "Module-Development-Tools" "Module-Public-Cloud" \ + "Product-HA" "Product-SLES_SAP" "Module-SAP-Applications" \ + "Module-Containers" "Module-Legacy" "Module-Server-Applications" + do + ospkgdir_ok="$ospkgdir/$arg" + index=$(expr $index + 1) + array_set_element os_path $index $ospkgdir_ok + done + fi + fi + fi if ( pmatch "$OSVER" "rhel*" ); then #default_pkgdir="$INSTALLDIR/$OSVER/$ARCH" if [ $dir == $default_pkgdir ] || [ $dir == "$default_pkgdir/" ]; then @@ -531,7 +556,7 @@ if ( pmatch "$OSVER" "sles10*" ); then fi fi fi -elif ( pmatch "$OSVER" "sles*" ); then +elif ( pmatch "$OSVER" "sle*" ); then #check if zypper is installed result=`rpm -q zypper` if [ $? -ne 0 ]; then