From 7e90f3e8eafe979530f30a954ab3975e19ceb166 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Sun, 30 Jun 2013 03:47:58 +0000 Subject: [PATCH] Code drop for Xeon Phi (mic) support. add the handling of tar format src to call the copytar command git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16820 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/copycds.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/copycds.pm b/xCAT-server/lib/xcat/plugins/copycds.pm index 053074014..fa6062d09 100644 --- a/xCAT-server/lib/xcat/plugins/copycds.pm +++ b/xCAT-server/lib/xcat/plugins/copycds.pm @@ -93,6 +93,22 @@ sub process_request { } else { $file = $_; } + # handle the copycds for tar file + # if the source file is tar format, call the 'copytar' command to handle it. + # currently it's used for Xeon Phi (mic) support + if (-r $file) { + my @filestat = `file $file`; + if (grep /tar archive/, @filestat) { + # this is a tar file, call the 'copytar' to generate the image + my $newreq = dclone($request); + $newreq->{command}= [ 'copytar' ]; #Note the singular, it's different + $newreq->{arg} = ["-f", $file, "-n", $distname]; + $doreq->($newreq, $callback); + + return; + } + } + my $mntopts = "-t udf,iso9660"; #Prefer udf formate to iso when media supports both, like MS media if (-r $file and -b $file) # Block device? { $mntopts .= " -o ro"; }