[fwutil] Add fwutil update all to support the automatic platform component fw updates#1242
Conversation
|
@rkdevi27 and @padmanarayana please review this new PR. |
|
This pull request introduces 1 alert when merging 6d6633f into f46c27e - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 53ec476 into 1c45ca1 - view on LGTM.com new alerts:
|
|
This pull request introduces 2 alerts when merging f4574c9 into f9eb739 - view on LGTM.com new alerts:
|
|
This pull request introduces 2 alerts when merging 7efd058 into 9dc58ea - view on LGTM.com new alerts:
|
scripts/reboot
Outdated
| debug "Handling task file for boot type ${REBOOT_TYPE}” | ||
| ${DEVPATH}/${PLATFORM}/${PLATFORM_FWUTIL_AU_REBOOT_HANDLE} ${REBOOT_TYPE} || PLATFORM_FW_AU_RC=$? | ||
| if [[ $PLATFORM_FW_AU_RC -ne 0 ]]; then | ||
| error "Failed to handle the platform firmware auto-update for ${REBOOT_TYPE} Exit code: $PLATFORM_FW_AU_RC" |
There was a problem hiding this comment.
@sujinmkang please double check whether error is available in this context
|
This pull request introduces 2 alerts when merging f29a5b4 into 5b8da56 - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 15cb89d into 5b8da56 - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging a2ac11c into 8f3b22e - view on LGTM.com new alerts:
|
|
@rkdevi27 @nazariig @padmanarayana can you please help review this PR? |
scripts/reboot
Outdated
| debug "Handling task file for boot type ${REBOOT_TYPE}” | ||
| ${DEVPATH}/${PLATFORM}/${PLATFORM_FWUTIL_AU_REBOOT_HANDLE} ${REBOOT_TYPE} || PLATFORM_FW_AU_RC=$? | ||
| if [[ $PLATFORM_FW_AU_RC -ne 0 ]]; then | ||
| debug "Failed to handle the platform firmware auto-update for ${REBOOT_TYPE} Exit code: $PLATFORM_FW_AU_RC" |
There was a problem hiding this comment.
@sujinmkang debug "ERROR: Failed to handle the platform firmware auto-update for ${REBOOT_TYPE} Exit code: $PLATFORM_FW_AU_RC"
scripts/fast-reboot
Outdated
| debug "Handling task file for boot type ${REBOOT_TYPE}” | ||
| ${DEVPATH}/${PLATFORM}/${PLATFORM_FWUTIL_AU_REBOOT_HANDLE} ${REBOOT_TYPE} || PLATFORM_FW_AU_RC=$? | ||
| if [[ $PLATFORM_FW_AU_RC -ne 0 ]]; then | ||
| debug "Failed to handle the platform firmware auto-update for ${REBOOT_TYPE} Exit code: $PLATFORM_FW_AU_RC" |
There was a problem hiding this comment.
@sujinmkang debug "ERROR: Failed to handle the platform firmware auto-update for ${REBOOT_TYPE} Exit code: $PLATFORM_FW_AU_RC"
|
This pull request introduces 1 alert when merging 393fc18 into a5b78cf - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 68cdb1e into 59ed6f3 - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging f46a3b4 into 9dba93f - view on LGTM.com new alerts:
|
components upgrade.
|
This pull request introduces 1 alert when merging 228e47f into 9492eab - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 4261570 into ad801bf - view on LGTM.com new alerts:
|
… fwutil auto-update (#7721) Why I did it The Mellanox platform is required to support the fwutil auto-update feature defined here This is to allow switches, when performing SONiC upgrades to choose whether to perform firmware upgrades that may interrupt the data plane through a cold boot. How I did it Two methods were added to the component implementations for mellanox. In the base Component class we add a default function that chooses to skip the installation of any firmware unless the cold boot option is provided. This is because the Mellanox platform, by default, does not support installing firmware on ONIE, the CPLD, or the BIOS "on-the-fly". In the ComponentSSD class we add a function that behaves similarly but uses the Mellanox specific SSD firmware upgrade tool to check if the current SSD supports being upgraded on the fly in order to decide whether to skip or perform the installation. How to verify it Unit tests are included with this PR. These test will run on build of target sonic-mellanox.bin You may also perform fwutil auto-update ... commands after sonic-net/sonic-utilities#1242 is merged in.
|
This pull request introduces 1 alert when merging da1e4ef into 4818360 - view on LGTM.com new alerts:
|
… fwutil auto-update (sonic-net#7721) Why I did it The Mellanox platform is required to support the fwutil auto-update feature defined here This is to allow switches, when performing SONiC upgrades to choose whether to perform firmware upgrades that may interrupt the data plane through a cold boot. How I did it Two methods were added to the component implementations for mellanox. In the base Component class we add a default function that chooses to skip the installation of any firmware unless the cold boot option is provided. This is because the Mellanox platform, by default, does not support installing firmware on ONIE, the CPLD, or the BIOS "on-the-fly". In the ComponentSSD class we add a function that behaves similarly but uses the Mellanox specific SSD firmware upgrade tool to check if the current SSD supports being upgraded on the fly in order to decide whether to skip or perform the installation. How to verify it Unit tests are included with this PR. These test will run on build of target sonic-mellanox.bin You may also perform fwutil auto-update ... commands after sonic-net/sonic-utilities#1242 is merged in.
|
This pull request introduces 1 alert when merging dd59bea into cd3ee78 - view on LGTM.com new alerts:
|
| cli_abort(ctx, str(e)) | ||
|
|
||
|
|
||
| # 'updates' subcommand |
There was a problem hiding this comment.
Please change it to 'update'
|
This pull request introduces 1 alert when merging 9c6436a into 720b650 - view on LGTM.com new alerts:
|
fwutil/lib.py
Outdated
| for comp_path, comp_au_status in data.items(): | ||
| if not self.__is_dict(comp_au_status): |
There was a problem hiding this comment.
Since the value for comp_path is a list, please iterate over it seperately.
| for comp_path, comp_au_status in data.items(): | |
| if not self.__is_dict(comp_au_status): | |
| for comp_path, au_status in data.items(): | |
| for comp_au_status in au_status: | |
| if not self.__is_dict(comp_au_status): |
|
|
||
| comp_au_status['comp'] = component_path | ||
| comp_au_status['status'] = status | ||
| comp_au_status['info'] = info |
There was a problem hiding this comment.
Please add version details.
There was a problem hiding this comment.
@ArunSaravananBalachandran I fixed only the parsing part based on the last HLD update. But the last HLD update is a little gap between the requirement for reboot_handler. I will set up a meeting sometime tomorrow to revise the HLD again.
auto update status should be reset after reboot
…vailable version information from get_available_firmware_version() api
ArunSaravananBalachandran
left a comment
There was a problem hiding this comment.
@sujinmkang, could you please add a check (like below) in reboot_pre_check in the reboot scripts to prevent the reboot if a firmware auto update was scheduled for a different reboot type.
fast-reboot
# Make sure firmware auto update is not scheduled for a different reboot
FIRMWARE_AU_STATUS_DIR="/tmp/firmwareupdate"
FW_AU_TASK_FILE_REGEX="${FIRMWARE_AU_STATUS_DIR}/*_fw_au_task"
case "$REBOOT_TYPE" in
"fast-reboot")
FW_AU_TASK_FILE_EXP="${FIRMWARE_AU_STATUS_DIR}/fast_fw_au_task"
;;
"warm-reboot")
FW_AU_TASK_FILE_EXP="${FIRMWARE_AU_STATUS_DIR}/warm_fw_au_task"
;;
esac
FW_AU_TASK_FILE=$(compgen -G ${FW_AU_TASK_FILE_REGEX}) || true
if [[ -n "${FW_AU_TASK_FILE}" ]] && [[ ! -f "${FW_AU_TASK_FILE_EXP}" ]]; then
error "Firmware auto update scheduled for a different reboot: ${FW_AU_TASK_FILE}"
exit "${EXIT_FAILURE}"
fireboot
# Make sure firmware auto update is not scheduled for a different reboot
FIRMWARE_AU_STATUS_DIR="/tmp/firmwareupdate"
FW_AU_TASK_FILE_REGEX="${FIRMWARE_AU_STATUS_DIR}/*_fw_au_task"
FW_AU_TASK_FILE_EXP="${FIRMWARE_AU_STATUS_DIR}/cold_fw_au_task"
FW_AU_TASK_FILE=$(compgen -G ${FW_AU_TASK_FILE_REGEX}) || true
if [[ -n "${FW_AU_TASK_FILE}" ]] && [[ ! -f "${FW_AU_TASK_FILE_EXP}" ]]; then
VERBOSE=yes debug "Firmware auto update scheduled for a different reboot: ${FW_AU_TASK_FILE}"
exit 1
fi
fwutil/lib.py
Outdated
| elif len(value1) == 2 and self.VERSION_KEY not in value1: | ||
| missing_key = self.VERSION_KEY | ||
| break | ||
| elif len(value1) == 3 and self.UTILITY_KEY not in value1: | ||
| missing_key = self.UTILITY_KEY | ||
| break |
There was a problem hiding this comment.
As both VERSION_KEY and UTILITY_KEY are optional, please remove these checks since the above will break even if one of them is not present.
fwutil/lib.py
Outdated
| if missing_key is not None: | ||
| if missing_key is not None and missing_key is not self.UTILITY_KEY and missing_key is not self.VERSION_KEY: |
There was a problem hiding this comment.
This change can be reverted, once the above checks have been removed.
…lict boot type of fw update
fwutil auto_update to support the automatic platform component fw updatesfwutil update all to support the automatic platform component fw updates
- What I did
Add the support for the automatic platform component fw updates
- How I did it
Add
fwutil auto_updateinterfaces- How to verify it
Work with dell to verify the auto_update interfaces with ssd firmware update.
- Previous command output (if the output of a command-line utility has changed)
- New command output (if the output of a command-line utility has changed)
New added command outputs are available in the following HLD:
sonic-net/SONiC#648