2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-21 07:08:12 +00:00

feat(openeuler): render repositories from configured install root

This commit is contained in:
Vinícius Ferrão
2026-09-15 00:40:55 -03:00
parent f2805433c1
commit ac8fe0275f
2 changed files with 10 additions and 5 deletions
+8 -3
View File
@@ -3,19 +3,19 @@ use DBI;
use File::Find;
use File::Spec;
use File::Path;
use xCAT::TableUtils;
my $yumrepofile;
my $distname;
my $arch;
my $installpfx;
my $distrepopfx="/install/postscripts/repos";
sub localize_yumrepo {
my $self = shift;
my $pkgdir = shift;
$distname=shift;
$arch=shift;
my $distrepopfx = xCAT::TableUtils->getInstallDir() . '/postscripts/repos';
mkpath("$distrepopfx/$pkgdir");
open($yumrepofile, ">", "$distrepopfx/$pkgdir/local-repository.tmpl");
@@ -31,6 +31,7 @@ sub localize_yumrepo {
sub remove_yumrepo {
my $self = shift;
my $pkgdir = shift;
my $distrepopfx = xCAT::TableUtils->getInstallDir() . '/postscripts/repos';
rmtree("$distrepopfx/$pkgdir/local-repository.tmpl");
}
@@ -61,7 +62,11 @@ sub generate_repo
print $yumrepofile "name=xCAT configured yum repository for $yumurl\n";
print $yumrepofile "baseurl=$yumurl\n";
print $yumrepofile "enabled=1\n";
print $yumrepofile "gpgcheck=0\n\n";
if ($distname =~ /^openeuler/) {
print $yumrepofile "gpgcheck=1\nskip_if_unavailable=False\n\n";
} else {
print $yumrepofile "gpgcheck=0\n\n";
}
}
sub fix_directory {
+2 -2
View File
@@ -311,7 +311,7 @@ sub subvars {
my $space10 = " " x 10;
my $space12 = " " x 12;
foreach my $pkgdir (@pkgdirs) {
if ($platform =~ /^(rh|SL|centos|alma|ol|fedora|rocky)$/) {
if ($platform =~ /^(rh|SL|centos|alma|ol|fedora|rocky|openeuler)$/) {
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.
@@ -321,7 +321,7 @@ sub subvars {
$source_in_pre .= "\necho 'repo --name=pkg$c --baseurl=http://'\$nextserver'$httpportsuffix/$pkgdir' >> /tmp/repos";
$source .= "repo --name=pkg$c --baseurl=http://#TABLE:noderes:\$NODE:nfsserver#$httpportsuffix/$pkgdir\n"; #for rhels5.9
}
my $distrepofile="/install/postscripts/repos/$pkgdir/local-repository.tmpl";
my $distrepofile="$installroot/postscripts/repos/$pkgdir/local-repository.tmpl";
if( -f "$distrepofile" and -s "$distrepofile"){
my $repofd;
my $repo_in_post;