Adding synclist support for statelite and also adding synclists support for user customized imagenames

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11395 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
wanghuaz 2012-01-19 08:01:57 +00:00
parent 3ff7e9887d
commit afff5fa64b
3 changed files with 27 additions and 19 deletions

View File

@ -241,7 +241,7 @@ sub getsynclistfile()
$nodes = shift;
}
my ($os, $arch, $profile, $inst_type) = @_;
my ($os, $arch, $profile, $inst_type, $imgname) = @_;
my $installdir = xCAT::Utils->getInstallDir();
@ -364,6 +364,17 @@ sub getsynclistfile()
return \%node_syncfile;
} else {
if ($imgname) {
my $osimage_t = xCAT::Table->new('osimage');
unless ($osimage_t) {
return ;
}
my $synclist = $osimage_t->getAttribs({imagename=>$imgname}, 'synclists');
if ($synclist && $synclist->{'synclists'}) {
return $synclist->{'synclists'};
}
}
my $platform = "";
if ($os) {
if ($os =~ /rh.*/) { $platform = "rh"; }

View File

@ -316,14 +316,12 @@ sub process_request {
umask($oldmask);
}
# sync fils configured in the synclist to the rootimage
unless ($imagename) {
$syncfile = xCAT::SvrUtils->getsynclistfile(undef, $osver, $arch, $profile, "netboot");
if (defined ($syncfile) && -f $syncfile
&& -d $rootimg_dir) {
print "sync files from $syncfile to the $rootimg_dir\n";
system("$::XCATROOT/bin/xdcp -i $rootimg_dir -F $syncfile");
}
# sync fils configured in the synclist to the rootimage
$syncfile = xCAT::SvrUtils->getsynclistfile(undef, $osver, $arch, $profile, "netboot", $imagename);
if (defined ($syncfile) && -f $syncfile
&& -d $rootimg_dir) {
print "sync files from $syncfile to the $rootimg_dir\n";
system("$::XCATROOT/bin/xdcp -i $rootimg_dir -F $syncfile");
}
my $verb = "Packing";

View File

@ -187,16 +187,6 @@ sub process_request {
umask($oldmask);
}
# sync fils configured in the synclist to the rootimage
#if (!$imagename) {
# $syncfile = xCAT::SvrUtils->getsynclistfile(undef, $osver, $arch, $profile, "netboot");
# if (defined ($syncfile) && -f $syncfile
# && -d $rootimg_dir) {
# print "sync files from $syncfile to the $rootimg_dir\n";
# `$::XCATROOT/bin/xdcp -i $rootimg_dir -F $syncfile`;
# }
#}
my $distname = $osver;
unless ( -r "$::XCATROOT/share/xcat/netboot/$distname/" or not $distname) {
chop($distname);
@ -220,6 +210,15 @@ sub process_request {
$exlistloc = xCAT::SvrUtils->get_exlist_file_name("$::XCATROOT/share/xcat/netboot/$distname", $profile, $osver, $arch);
}
}
#sync fils configured in the synclist to the rootimage
$syncfile = xCAT::SvrUtils->getsynclistfile(undef, $osver, $arch, $profile, "netboot", $imagename);
if (defined ($syncfile) && -f $syncfile
&& -d $rootimg_dir) {
print "sync files from $syncfile to the $rootimg_dir\n";
`$::XCATROOT/bin/xdcp -i $rootimg_dir -F $syncfile`;
}
# check if the file "litefile.save" exists or not
# if it doesn't exist, then we get the synclist, and run liteMe
# if it exists, it means "liteimg" has run more than one time, we need to compare with the synclist