Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fwutil.md] Fwutil Auto-update support #648

Merged
merged 28 commits into from
Jan 26, 2021
Merged
Changes from 3 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
19325ff
initial version of platform-fw-update hld
sujinmkang Jul 14, 2020
fc6ea86
Update fwutil to support the automatic fw update
sujinmkang Jul 26, 2020
16ed6f2
Auto fw update
sujinmkang Jul 27, 2020
e7cf636
update
sujinmkang Aug 3, 2020
15b74f0
add auto-update command to support automatic firmware update
sujinmkang Aug 12, 2020
a16ee43
fix some command options
sujinmkang Aug 12, 2020
04cc424
platform_componenets.json
sujinmkang Aug 19, 2020
e8c8a15
add more custom scripts details and fw_update_reboot_plugin
sujinmkang Aug 21, 2020
503c3e8
Update
sujinmkang Sep 10, 2020
4a7454f
typo
sujinmkang Sep 10, 2020
72a0845
review comment
sujinmkang Sep 15, 2020
ff5441b
more auto-update utility requirement
sujinmkang Sep 28, 2020
ac2bc84
add utility commandline example
sujinmkang Sep 28, 2020
4b14a26
utility response
sujinmkang Sep 29, 2020
c4aed03
address review comments
sujinmkang Oct 6, 2020
fbaf6f4
update the flow of auto-update
sujinmkang Oct 8, 2020
d1a8e93
address review comments
sujinmkang Oct 29, 2020
314cc36
address review comments about the task file definition
sujinmkang Nov 6, 2020
0acc4c9
review comments
sujinmkang Nov 9, 2020
5a2324e
review comments
sujinmkang Nov 12, 2020
44afb41
review comments
sujinmkang Nov 20, 2020
289263e
review comments
sujinmkang Nov 23, 2020
8700f97
review comments
sujinmkang Nov 24, 2020
efca3bf
add more detail about FW package
sujinmkang Nov 30, 2020
8cbf627
Add more information about firmware image package and platform api re…
sujinmkang Dec 2, 2020
93416e5
update with review comments
sujinmkang Dec 17, 2020
4c76c14
additional review comments
sujinmkang Dec 18, 2020
3574859
Add more requirements for auto-update
sujinmkang Jan 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 78 additions & 9 deletions doc/fwutil/fwutil.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ The purpose of the update commands group is to provide an interface
for automatic FW installation of various platform components.

Automatic FW installation requires platform_components.json to be created and placed at:
_sonic-buildimage/device/<platform_name>/<onie_platform>/platform_components.json_
_sonic-buildimage/device/<platform_name>/<onie_platform>/platform_fw_updatecomponents.json_
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sujinmkang Typo? Maybe it's better to have something like platform_fw_updates?


**Example:**
1. Non modular chassis platform
Expand All @@ -350,15 +350,15 @@ _sonic-buildimage/device/<platform_name>/<onie_platform>/platform_components.jso
"Chassis1": {
"component": {
"BIOS": {
"firmware": "/etc/<platform_name>/fw/<onie_platform>/chassis1/bios.bin",
"firmware": "/usr/share/sonic/<platform_name>/<onie_platform>/fw_update/bios.bin",
"version": "0ACLH003_02.02.010"
},
"CPLD": {
"firmware": "/etc/<platform_name>/fw/<onie_platform>/chassis1/cpld.bin",
"firmware": "/usr/share/sonic/<platform_name>/<onie_platform>/fw_update/cpld.bin",
"version": "10"
},
"FPGA": {
"firmware": "/etc/<platform_name>/fw/<onie_platform>/chassis1/fpga.bin",
"firmware": "/usr/share/sonic/<platform_name>/<onie_platform>/fw_update/fpga.bin",
"version": "5"
}
}
Expand All @@ -374,15 +374,15 @@ _sonic-buildimage/device/<platform_name>/<onie_platform>/platform_components.jso
"Chassis1": {
"component": {
"BIOS": {
"firmware": "/etc/<platform_name>/fw/<onie_platform>/chassis1/bios.bin",
"firmware": "/usr/share/sonic/<platform_name>/<onie_platform>/fw_update/bios.bin",
"version": "0ACLH003_02.02.010"
},
"CPLD": {
"firmware": "/etc/<platform_name>/fw/<onie_platform>/chassis1/cpld.bin",
"firmware": "/usr/share/sonic/<platform_name>/<onie_platform>/fw_update/cpld.bin",
"version": "10"
},
"FPGA": {
"firmware": "/etc/<platform_name>/fw/<onie_platform>/chassis1/fpga.bin",
"firmware": "/usr/share/sonic/<platform_name>/<onie_platform>/fw_update/fpga.bin",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sujinmkang Not sure whether this is the right place for fw binaries. Also this may overlap with the sonic_device_data package contents.

"version": "5"
}
}
Expand All @@ -392,18 +392,50 @@ _sonic-buildimage/device/<platform_name>/<onie_platform>/platform_components.jso
"Module1": {
"component": {
"CPLD": {
"firmware": "/etc/<platform_name>/fw/<onie_platform>/module1/cpld.bin",
"firmware": "/usr/share/sonic/<platform_name>/<onie_platform>/fw_update/cpld.bin",
"version": "10"
},
"FPGA": {
"firmware": "/etc/<platform_name>/fw/<onie_platform>/module1/fpga.bin",
"firmware": "/usr/share/sonic/<platform_name>/<onie_platform>/fw_update/fpga.bin",
"version": "5"
}
}
}
}
}
```
3. Platform component fw update configuration with platform specific script and boot options
```json
{
"chassis": {
"Chassis1": {
"component": {
"BIOS": {
"firmware": "/usr/share/sonic/<platform_name>/<onie_platform>/fw_update/bios.bin",
"script": "/usr/share/sonic/<platform_name>/<onie_platform>/fw_update/bios_fw_update",
"version": "0ACLH003_02.02.010"
"required_reboot": "None"
"immediate_action": "No"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sujinmkang IMHO, this should be fetched automatically by Platform API if needed.
The config file should be simple and clear.

Use case: the same firmware package may have a different behaviour based on device vendor/model.
Example: SSD with/without on-the-fly update mode

},
"CPLD": {
"firmware": "/usr/share/sonic/<platform_name>/<onie_platform>/fw_update/cpld.bin",
"script": "/usr/share/sonic/<platform_name>/<onie_platform>/fw_update/cpld_fw_update",
"version": "10"
"required_reboot": "powercycle"
"immediate_action": "No"
},
"FPGA": {
"firmware": "/usr/share/sonic/<platform_name>/<onie_platform>/fw_update/fpga.bin",
"script": "/usr/share/sonic/<platform_name>/<onie_platform>/fw_update/fpga_fw_update",
"version": "5"
"required_reboot": "cold"
"immediate_action": "Yes"
}
}
}
}
}
```

**Note:**
1. FW update will be disabled if component definition is not provided (e.g., 'BIOS': { })
Expand Down Expand Up @@ -454,6 +486,24 @@ Warning: <firmware_update_notification>
New FW will be installed, continue? [y/N]: N
Aborted!
```
3. Non modular chassis platform
```bash
root@sonic:~# fwutil --yes --image=next --boot=cold --immediate=yes
Copy link
Collaborator

@nazariig nazariig Aug 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sujinmkang I suggest to use something like:
fwutil update components fw --yes --image=next --boot=fast

Warning: <firmware_update_notification>
...
FW update in progress ...
...
root@sonic:~# fwutil --yes --image=next --boot=any --immediate=no
Warning: <firmware_update_notification>
...
FW update in progress ...
...
root@sonic:~# fwutil --yes --image=next --boot=any --immediate=yes --component=ssd
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sujinmkang What about modular platforms? AFAIK, there is no clear restrictions on component names, which means that different modules can share the same component name. And what should be the expected behaviour in that case?

Warning: <firmware_update_notification>
...
FW update in progress ...
...
```

**Supported options:**
1. -y|--yes - automatic yes to prompts. Assume "yes" as answer to all prompts and run non-interactively
Expand Down Expand Up @@ -490,6 +540,24 @@ Aborted!

###### Figure 5: FW install (modular) flow

## 3.4 Update component FW

### 3.4.1 Non modular chassis platform

TBD

### 3.4.2 Modular chassis platform

TBD

### 3.4.3 Auto FW update based on the configuration file

1. Find the available firmware based on boot type and immediate action type from platform specific fw update configuration file.
Exit if no configuration file exists.
2. Update the firmware using the script if it's specified in the configuration. Otherwise, fwutil will use the platform api to update the firmware.
Exit if the update fails in any step.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sujinmkang I would like to propose a new CLI tree:

fwutil
|--- show
|    |--- version
|    |--- status
|    |--- updates -i|--image=<current|next> -c|--config=<path_to_platform_fw_updates>
|
|--- install
|    |--- chassis
|    |    |--- component <component_name>
|    |         |--- fw -y|--yes <fw_path>
|    |
|    |--- module <module_name>
|         |--- component <component_name>
|              |--- fw -y|--yes <fw_path>
|
|--- update
     |--- chassis
     |    |--- component <component_name>
     |         |--- fw -y|--yes -f|--force -i|--image=<current|next> -c|--config=<path_to_platform_fw_updates>
     |
     |--- module <module_name>
     |    |--- component <component_name>
     |         |--- fw -y|--yes -f|--force -i|--image=<current|next> -c|--config=<path_to_platform_fw_updates>
     |
     |--- components
          |--- fw -y|--yes -f|--force -i|--image=<current|next> -b|--boot=<cold|fast|warm> -c|--config=<path_to_platform_fw_updates>

Copy link
Collaborator

@nazariig nazariig Aug 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sujinmkang Some thoughts:

  1. In case platform API is not implemented (plugin mode) the fwutil CLI won't be fully available - only automatic installation mode. That's something which need to be highlighted in this design
  2. Platform API should be extended with the new boot argument
  3. How to handle version and script fields in case Platform API is not implemented
  4. Need to extend the design with some output examples for automatic installation mode



# 4 Tests

## 4.1 Unit tests
Expand All @@ -501,3 +569,4 @@ Aborted!
5. Install BIOS/CPLD/FPGA FW on modular chassis
6. Update BIOS/CPLD/FPGA FW on non modular chassis
7. Update BIOS/CPLD/FPGA FW on modular chassis
8. Auto Update BIOS/CPLD/FPGA FW with boot and action options