2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

Support multiple syncfile list for packimage process (#5524)

This commit is contained in:
cxhong 2018-08-16 23:01:55 -04:00 committed by yangsong
parent 0dc260db29
commit dcaa21aa13
2 changed files with 17 additions and 7 deletions

View File

@ -423,13 +423,19 @@ sub process_request {
if (not $nosyncfiles) {
# 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) {
if ( defined($syncfile) && -d $rootimg_dir) {
my $myenv='';
if($envars){
$myenv.=" XCAT_OSIMAGE_ENV=$envars";
}
print "Syncing files from $syncfile to root image dir: $rootimg_dir\n";
system("$myenv $::XCATROOT/bin/xdcp -i $rootimg_dir -F $syncfile");
my @filelist = split ',', $syncfile;
foreach my $synclistfile (@filelist) {
if ( -f $synclistfile) {
print "Syncing files from $synclistfile to root image dir: $rootimg_dir\n";
my $cmd = "$myenv $::XCATROOT/bin/xdcp -i $rootimg_dir -F $synclistfile";
xCAT::Utils->runcmd($cmd, 0, 1);
}
}
}
} else {
print "Bypass of syncfiles requested, will not sync files to root image directory.\n";

View File

@ -233,10 +233,14 @@ sub process_request {
#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`;
if (defined($syncfile) && -d $rootimg_dir) {
my @filelist = split ',', $syncfile;
foreach my $synclistfile (@filelist) {
if ( -f $synclistfile) {
print "sync files from $synclistfile to the $rootimg_dir\n";
`$::XCATROOT/bin/xdcp -i $rootimg_dir -F $synclistfile`;
}
}
}
# check if the file "litefile.save" exists or not