From 2a4f490b933c899d990230627c3a03a070c11568 Mon Sep 17 00:00:00 2001 From: mxi1 Date: Thu, 31 Mar 2011 08:20:54 +0000 Subject: [PATCH] for defect 3251763 and 3236751, one is for manpage of imgcapture; the other is for the output of imgcapture. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9195 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/pods/man1/imgcapture.1.pod | 18 ++++++++++++------ xCAT-server/lib/xcat/plugins/imgcapture.pm | 13 +++++++++++-- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/xCAT-client/pods/man1/imgcapture.1.pod b/xCAT-client/pods/man1/imgcapture.1.pod index 067839f6a..fbcbeccd8 100644 --- a/xCAT-client/pods/man1/imgcapture.1.pod +++ b/xCAT-client/pods/man1/imgcapture.1.pod @@ -4,8 +4,7 @@ B - Captures an image from a Linux diskful node and create a diskles =head1 SYNOPSIS -B node [B<-p>|B<--profile> I] [B<-i> I] [B<-n> I] [B<-V>|B<--verbose>] - +B node [B<-p>|B<--profile> I] [B<-o>|B<--osimage> I] [B<-i> I] [B<-n> I] [B<-V>|B<--verbose>] B [B<-h> | B<--help>] | [B<-v> | B<--version>] =head1 DESCRIPTION @@ -28,7 +27,11 @@ After the B command returns without any errors, you can customize th =item B<-p|--profile> I -assign I as the profile of the image to be created. +Assign I as the profile of the image to be created. + +=item B<-o|--osimage> I + +Assign the pre-defined I object. The attributes of I will be used to capture and prepare the root image. =item B<-i> I @@ -80,17 +83,20 @@ Verbose output. B is one diskful Linux node, which is managed by xCAT. -1. In order to create the image, run the following command: +1. In order to capture and prepare the root image, run the following command: imgcapture node1 -2. In order to create the image with B as profile, run the command: +2. In order to capture and prepare the root image with B as profile, run the command: imgcapture node1 -p hpc -3. Create the image: its profile is B, and the network interface the diskless node will boot over is B, the driver modules for this network interface is B. +3. In order to capture and prepare the root image: its profile is B, and the network interface the diskless node will boot over is B, the driver modules for this network interface is B. imgcapture node1 -p hpc -i eth0 -n e1000e + +4. There's one pre-defined I. In order to capture and prepare the root image for I, run the command: +imgcapture node1 -o osimage =head1 FILES diff --git a/xCAT-server/lib/xcat/plugins/imgcapture.pm b/xCAT-server/lib/xcat/plugins/imgcapture.pm index 230c50692..852d387c4 100644 --- a/xCAT-server/lib/xcat/plugins/imgcapture.pm +++ b/xCAT-server/lib/xcat/plugins/imgcapture.pm @@ -344,7 +344,16 @@ sub imgcapture { $rsp->{data}->[0] = qq{"The genimage command is: $cmd"}; xCAT::MsgUtils->message("D", $rsp, $callback); } - xCAT::Utils->runcmd($cmd); + my @cmdoutput = xCAT::Utils->runcmd($cmd, 0); + if($::RUNCMD_RC) { + my $rsp = {}; + foreach (@cmdoutput) { + push @{$rsp->{data}}, $_; + } + xCAT::MsgUtils->message("E", $rsp, $callback); + unlink $xcat_imgcapture_tmpfile; + return; + } } else { my $rsp = {}; $rsp->{data}->[0] = qq{Can't run the "genimage" command for $os}; @@ -353,7 +362,7 @@ sub imgcapture { } my $rsp = {}; - $rsp->{data}->[0] = qq{"Done."}; + $rsp->{data}->[0] = qq{Done.}; xCAT::MsgUtils->message("D", $rsp, $callback); unlink $xcat_imgcapture_tmpfile;