2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

Add --releasever argument to yum command for RHEL 8

Add --setopt=module_platform_id=platform:el8 for RHEL 8
This commit is contained in:
GONG Jie 2019-01-22 16:27:31 +08:00
parent 67ca6ea79c
commit 700f50cf98

View File

@ -358,6 +358,14 @@ if($onlyinitrd){
my $yumcmd = "yum $non_interactive -c /tmp/genimage.$$.yum.conf --installroot=$rootimg_dir/ --disablerepo=* ";
if ($osver =~ /^rhel\D*(\d*)[.\d]*.*$/) {
$majorrel = $1;
if ($majorrel > 7) {
$yumcmd .= "--releasever=" . $majorrel . " ";
$yumcmd .= "--setopt=module_platform_id=platform:el" . $majorrel . " ";
}
}
foreach (0 .. $repnum) {
$yumcmd .= "--enablerepo=$osver-$arch-$_ ";
}