diff --git a/xCAT-server/lib/xcat/plugins/packimage.pm b/xCAT-server/lib/xcat/plugins/packimage.pm index fe08e6c2b..831683347 100755 --- a/xCAT-server/lib/xcat/plugins/packimage.pm +++ b/xCAT-server/lib/xcat/plugins/packimage.pm @@ -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"; diff --git a/xCAT-server/lib/xcat/plugins/statelite.pm b/xCAT-server/lib/xcat/plugins/statelite.pm index 88ff3169c..60bbcc082 100644 --- a/xCAT-server/lib/xcat/plugins/statelite.pm +++ b/xCAT-server/lib/xcat/plugins/statelite.pm @@ -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