diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 0b2e82380..6a1ee4d50 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -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-$_ "; }