Handle case where the Linux distro copied is sles[xxx]sp[yyy] (e.g. sles11sp1), where xxx is the version and yyy is the service pack. In the case above, the genimage command will not recognize the Linux distro and give an error.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7115 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
phamt 2010-08-17 23:35:09 +00:00
parent 4ca5b1d2a5
commit aaa6317e03
2 changed files with 17 additions and 1 deletions

View File

@ -161,6 +161,12 @@ if($osfamily =~ /rh/){
$osfamily = "rh";
}
# OS version on s390x can contain 'sp', e.g. sles11sp1
# If the $osfamily contains 'sles' and 'sp', the $osfamily = sles
if ($osfamily =~ /sles/ && $osfamily =~ /sp/) {
$osfamily = "sles";
}
#print "OSfamily: $osfamily\n";
$profDir = "$::XCATROOT/share/xcat/netboot/$osfamily";
unless(-d $profDir){

View File

@ -16,7 +16,17 @@ sub get_profile_def_filename {
my $base=shift;
my $ext=shift;
my $dotpos = rindex($osver, ".");
my $dotpos;
# OS version on s390x can contain 'sp', e.g. sles11sp1
# If OS version contains 'sp', get the index of 'sp' instead of '.'
if ($osver =~ /sles/ && $osver =~ /sp/) {
$dotpos = rindex($osver, "sp");
} else {
$dotpos = rindex($osver, ".");
}
my $osbase = substr($osver, 0, $dotpos);
if (-r "$base/$profile.$osver.$arch.$ext") {
return "$base/$profile.$osver.$arch.$ext";