diff --git a/docs/source/guides/admin-guides/references/man1/rflash.1.rst b/docs/source/guides/admin-guides/references/man1/rflash.1.rst index 4c69921d0..5f688c7ac 100644 --- a/docs/source/guides/admin-guides/references/man1/rflash.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rflash.1.rst @@ -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. diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 82ac2eff8..6df950099 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -342,8 +342,10 @@ my %usage = ( rflash -p [--activate {disruptive|deferred}] [-d ] rflash [--commit | --recover] [-V|--verbose] rflash [--bpa_acdl] - PPC64LE (using BMC Management) specific: - rflash [-c | --check] [--retry=] [-V] [|-d=]", + PPC64LE (using IPMI Management) specific: + rflash [-c|--check] [--retry=] [-V] [|-d=] + PPC64LE (using OpenBMC Management) specific: + rflash [-c|--check] [-l|--list] [-a|--activate] [-u|--upload] [|]", "mkhwconn" => "Usage: mkhwconn [-h|--help] diff --git a/xCAT-client/pods/man1/rflash.1.pod b/xCAT-client/pods/man1/rflash.1.pod index 9f0cf29f4..283b35381 100644 --- a/xCAT-client/pods/man1/rflash.1.pod +++ b/xCAT-client/pods/man1/rflash.1.pod @@ -22,10 +22,14 @@ B I {B<--commit>|B<--recover>} B I I -=head2 OpenPOWER BMC specific: +=head2 OpenPOWER BMC specific (using IPMI): B I [I | B<-d=>I] [B<-c>|B<--check>] [B<--retry=>I] [B<-V>] +=head2 OpenPOWER OpenBMC specific : + +B I [I | I] [B<-c>|B<--check>] [B<-a>|B<--activate>] [B<-l>|B<--list>] [B<-u>|B<--upload>] + =head1 B The B 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 When using B 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 When using B in hierarchical environment, the .tar file must be accessible from Service Nodes. + =head1 B =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 @@ -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. diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 153792d88..f818b678a 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -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);