2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-03 03:50:08 +00:00

Updates from review

This commit is contained in:
Mark Gurevich 2017-08-01 12:01:21 -04:00
parent 711f1549db
commit 1d9909e074
4 changed files with 103 additions and 47 deletions

View File

@ -46,13 +46,20 @@ NeXtScale FPC specific:
\ **rflash**\ \ *noderange*\ \ *http_directory*\
OpenPOWER BMC specific:
=======================
OpenPOWER BMC specific (using IPMI):
====================================
\ **rflash**\ \ *noderange*\ [\ *hpm_file_path*\ | \ **-d=**\ \ *data_directory*\ ] [\ **-c | -**\ **-check**\ ] [\ **-**\ **-retry=**\ \ *count*\ ] [\ **-V**\ ]
OpenPOWER OpenBMC specific :
============================
\ **rflash**\ \ *noderange*\ [\ *tar_file_path*\ | \ *image_id*\ ] [\ **-c | -**\ **-check**\ ] [\ **-a | -**\ **-activate**\ ] [\ **-l | -**\ **-list**\ ] [\ **-u | -**\ **-upload**\ ]
*******************
\ **Description**\
@ -118,14 +125,22 @@ NeXtScale FPC specific:
The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http information required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details: XCAT_NeXtScale_Clusters
OpenPOWER specific:
===================
OpenPOWER specific (using IPMI):
================================
The command will update firmware for OpenPOWER BMC when given an OpenPOWER node and either the hpm formatted file path or path to a data directory.
\ **Note:**\ When using \ **rflash**\ in hierarchical environment, the hpm file or data directory must be accessible from Service Nodes.
OpenPOWER OpenBMC specific:
===========================
The command will update firmware for OpenPOWER OpenBMC when given an OpenPOWER node and either an update .tar file or an uploaded image id.
\ **Note:**\ When using \ **rflash**\ in hierarchical environment, the .tar file must be accessible from Service Nodes.
***************
\ **Options**\
@ -141,7 +156,7 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node
\ **-c|-**\ **-check**\
Check the firmware version of BMC and HPM file.
Check the firmware version of BMC and an update file.
@ -187,6 +202,24 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node
\ **-a|-**\ **-activate**\
Activate update image. Image id must be specified.
\ **-l|-**\ **-list**\
List currently uploaded update images. "(\*)" indicates currently active image.
\ **-u|-**\ **-upload**\
Upload update image. Specified file must be in .tar format.
\ **-v|-**\ **-version**\
Displays the command's version.

View File

@ -342,8 +342,10 @@ my %usage = (
rflash <noderange> -p <rpm_directory> [--activate {disruptive|deferred}] [-d <data_directory>]
rflash <noderange> [--commit | --recover] [-V|--verbose]
rflash <noderange> [--bpa_acdl]
PPC64LE (using BMC Management) specific:
rflash <noderange> [-c | --check] [--retry=<count>] [-V] [<hpm_file>|-d=<data_directory>]",
PPC64LE (using IPMI Management) specific:
rflash <noderange> [-c|--check] [--retry=<count>] [-V] [<hpm_file>|-d=<data_directory>]
PPC64LE (using OpenBMC Management) specific:
rflash <noderange> [-c|--check] [-l|--list] [-a|--activate] [-u|--upload] [<tar_file>|<image_id>]",
"mkhwconn" =>
"Usage:
mkhwconn [-h|--help]

View File

@ -22,10 +22,14 @@ B<rflash> I<noderange> {B<--commit>|B<--recover>}
B<rflash> I<noderange> I<http_directory>
=head2 OpenPOWER BMC specific:
=head2 OpenPOWER BMC specific (using IPMI):
B<rflash> I<noderange> [I<hpm_file_path> | B<-d=>I<data_directory>] [B<-c>|B<--check>] [B<--retry=>I<count>] [B<-V>]
=head2 OpenPOWER OpenBMC specific :
B<rflash> I<noderange> [I<tar_file_path> | I<image_id>] [B<-c>|B<--check>] [B<-a>|B<--activate>] [B<-l>|B<--list>] [B<-u>|B<--upload>]
=head1 B<Description>
The B<rflash> command initiates Firmware updates on supported xCAT nodes. Licensed Internal Code (also known as microcode) updates are performed on supported HMC-attached POWER5 and POWER6 pSeries nodes, and POWER7 systems using Direct FSP management.
@ -79,11 +83,16 @@ For more details about the Firmware Update using Direct FSP/BPA Management, refe
The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http information required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details: XCAT_NeXtScale_Clusters
=head2 OpenPOWER specific:
=head2 OpenPOWER specific (using IPMI):
The command will update firmware for OpenPOWER BMC when given an OpenPOWER node and either the hpm formatted file path or path to a data directory.
B<Note:> When using B<rflash> in hierarchical environment, the hpm file or data directory must be accessible from Service Nodes.
=head2 OpenPOWER OpenBMC specific:
The command will update firmware for OpenPOWER OpenBMC when given an OpenPOWER node and either an update .tar file or an uploaded image id.
B<Note:> When using B<rflash> in hierarchical environment, the .tar file must be accessible from Service Nodes.
=head1 B<Options>
=over 7
@ -94,7 +103,7 @@ Writes the command's usage statement to standard output.
=item B<-c|--check>
Check the firmware version of BMC and HPM file.
Check the firmware version of BMC and an update file.
=item B<-p> I<directory>
@ -124,6 +133,18 @@ Used to recover the flash image in the permanent side of the chip to the tempora
Specify number of times to retry the update if failure is detected. Default value is 2. Value of 0 can be used to indicate no retries.
=item B<-a|--activate>
Activate update image. Image id must be specified.
=item B<-l|--list>
List currently uploaded update images. "(*)" indicates currently active image.
=item B<-u|--upload>
Upload update image. Specified file must be in .tar format.
=item B<-v|--version>
Displays the command's version.

View File

@ -584,40 +584,42 @@ sub parse_args {
} elsif ($command eq "rflash") {
my $filename_passed = 0;
my $updateid_passed = 0;
my $option_flag;
foreach my $opt (@$extrargs) {
print "Examening $opt \n";
# Only files ending on .tar are allowed
if ($opt =~ /.*\.tar$/i) {
$filename_passed = 1;
print "Opt matches filename ending on .tar \n";
next;
}
# Check if hex number for the updateid is passed
if ($opt =~ /^[[:xdigit:]]+$/i) {
$updateid_passed = 1;
print "Opt matches hex fileid \n";
next;
}
if ($filename_passed) {
# Filename was passed, check flags allowed with file
if ($opt !~ /^-c$|^--check$|^-d$|^--delete$|^-u$|^--upload$/) {
return ([ 1, "Invalid option specified when a file is provided: $opt" ]);
# check if option starting with - was passed
if ($opt =~ /^-/) {
$option_flag = $opt;
}
}
if ($filename_passed) {
# Filename was passed, check flags allowed with file
if ($option_flag !~ /^-c$|^--check$|^-d$|^--delete$|^-u$|^--upload$/) {
return ([ 1, "Invalid option specified when a file is provided: $option_flag" ]);
}
}
else {
if ($updateid_passed) {
# Updateid was passed, check flags allowed with update id
if ($option_flag !~ /^^-d$|^--delete$|^-a$|^--activate$/) {
return ([ 1, "Invalid option specified when an update id is provided: $option_flag" ]);
}
}
else {
if ($updateid_passed) {
# Updateid was passed, check flags allowed with update id
if ($opt !~ /^^-d$|^--delete$|^-a$|^--activate$/) {
return ([ 1, "Invalid option specified when an update id is provided: $opt" ]);
}
}
else {
# Neither Filename nor updateid was not passed, check flags allowed without file or updateid
if ($opt !~ /^-c$|^--check$|^-l$|^--list/) {
return ([ 1, "Invalid option specified: $opt" ]);
}
}
}
# Neither Filename nor updateid was not passed, check flags allowed without file or updateid
if ($option_flag !~ /^-c$|^--check$|^-l$|^--list/) {
return ([ 1, "Invalid option specified: $option_flag" ]);
}
}
}
} else {
return ([ 1, "Command is not supported." ]);
@ -812,25 +814,24 @@ sub parse_command_status {
my $delete = 0;
my $upload = 0;
my $activate = 0;
my $update_file;
if ($$subcommands[-1] =~ /c|check/) {
$check_version = 1;
pop(@$subcommands);
} elsif ($$subcommands[-1] =~ /l|list/) {
$list = 1;
pop(@$subcommands);
} elsif ($$subcommands[-1] =~ /d|delete/) {
$delete = 1;
pop(@$subcommands);
} elsif ($$subcommands[-1] =~ /u|upload/) {
$upload = 1;
pop(@$subcommands);
} elsif ($$subcommands[-1] =~ /a|activate/) {
$activate = 1;
pop(@$subcommands);
foreach $subcommand (@$subcommands) {
if ($subcommand =~ /-c|--check/) {
$check_version = 1;
} elsif ($subcommand =~ /-l|--list/) {
$list = 1;
} elsif ($subcommand =~ /-d|--delete/) {
$delete = 1;
} elsif ($subcommand =~ /-u|--upload/) {
$upload = 1;
} elsif ($subcommand =~ /-a|--activate/) {
$activate = 1;
} else {
$update_file = $subcommand;
}
}
my $update_file = $$subcommands[0];
my $filename = undef;
my $file_id = undef;
my $grep_cmd = "/usr/bin/grep -a";
@ -1903,7 +1904,6 @@ sub rflash_response {
}
}
#if ($activation_state eq "xyz.openbmc_project.Software.Activation.Activations.Activating") {
if ($activation_state =~ /Software.Activation.Activations.Activating/) {
# Activation still going, sleep for a bit, then print the progress value
sleep(15);