mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 11:22:27 +00:00 
			
		
		
		
	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:
		| @@ -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"; } | ||||
|   | ||||
| @@ -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"; | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user