diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 069355f45..616c7d6ea 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -314,6 +314,25 @@ sub mknetboot } else { $imgname = "$osver-$arch-netboot-$profile"; } + + + if (! $osimagetab) { + $osimagetab = xCAT::Table->new('osimage'); + } + + if ($osimagetab) { + my ($ref1) = $osimagetab->getAttribs({imagename => $imgname}, 'rootfstype'); + if (($ref1) && ($ref1->{'rootfstype'})) { + $rootfstype = $ref1->{'rootfstype'}; + } + } else { + $callback->( + { error => [ qq{Cannot find the linux image called "$osver-$arch-$provmethod-$profile", maybe you need to use the "nodeset osimage=" command to set the boot state} ], + errorcode => [1]} + ); + } + + if ( ! $linuximagetab ) { $linuximagetab = xCAT::Table->new('linuximage'); } diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 3034d2c9e..7b4050d0d 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -151,6 +151,29 @@ sub mknetboot $arch = $ent->{arch}; $profile = $ent->{profile}; $rootfstype = "nfs"; # TODO: try to get it from the option or table + my $imgname; + if ($statelite) { + $imgname = "$osver-$arch-statelite-$profile"; + } else { + $imgname = "$osver-$arch-netboot-$profile"; + } + + if (! $osimagetab) { + $osimagetab = xCAT::Table->new('osimage'); + } + + if ($osimagetab) { + my ($ref1) = $osimagetab->getAttribs({imagename => $imgname}, 'rootfstype'); + if (($ref1) && ($ref1->{'rootfstype'})) { + $rootfstype = $ref1->{'rootfstype'}; + } + } else { + $callback->( + { error => [ qq{Cannot find the linux image called "$osver-$arch-$provmethod-$profile", maybe you need to use the "nodeset osimage=" command to set the boot state} ], + errorcode => [1]} + ); + } + $rootimgdir="$installroot/netboot/$osver/$arch/$profile"; }