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

[mlnx-onie-fw-update] Fix reboot script usage #118

Closed
wants to merge 1 commit into from

Conversation

stepanblyschak
Copy link
Owner

@stepanblyschak stepanblyschak commented Apr 24, 2024

/usr/local/bin/reboot could return execution back to the invoking script in case of using graceful reboot. So, exit the script with reboot return code instead of proceeding with execution.

Why I did it

Fix BIOS fw update procedure.

Work item tracking
  • Microsoft ADO (number only):

How I did it

Return exit code from reboot script in mlnx-onie-fw-update.sh

How to verify it

Tested with successful reboot:

root@r-leopard-58:/home/admin# sudo fwutil install chassis component BIOS fw <url>
Downloading firmware:
[##########################################################################################################################################################################################]  100%
Warning: Immediate cold reboot is required to complete BIOS firmware update.
New firmware will be installed, continue? [y/N]: y
Installing firmware:
    /tmp/0ACLH004.rom
INFO: Staging BIOS firmware update with ONIE updater
Staging firmware update: /tmp/99-0ACLH004.rom
** Pending firmware update information:
Name            | Version / Type | Attempts |Size (Bytes)  | Date
================+================+==========+==============+====================
99-0ACLH004.rom | bios_update    |        0 |      8388608 | 2024-04-24 14:12:19
================+================+==========+==============+====================

For more detailed information run: onie-fwpkg show-pending <update_name>
INFO: Rebooting in 5 sec...
/var/log: 3.6 GiB (3896754176 bytes) trimmed on /dev/loop1
/host: 23.2 GiB (24865517568 bytes) trimmed on /dev/sda3

INFO: firmware is up to date

Watchdog armed for 180 seconds
Wed 24 Apr 2024 02:12:34 PM UTC Issuing OS-level reboot ...
root@r-leopard-58:/home/admin# Connection to r-leopard-58 closed by remote host.

Failed reboot case (reboot script returned non zero exit code):

root@r-leopard-58:/home/admin# sudo fwutil install chassis component BIOS fw <url>
Downloading firmware:
[##########################################################################################################################################################################################]  100%
Warning: Immediate cold reboot is required to complete BIOS firmware update.
New firmware will be installed, continue? [y/N]: y
Installing firmware:
    /tmp/0ACLH004.rom
INFO: Staging BIOS firmware update with ONIE updater
Removing firmware update results: 99-0ACLH004.rom
Staging firmware update: /tmp/99-0ACLH004.rom
** Pending firmware update information:
Name            | Version / Type | Attempts |Size (Bytes)  | Date
================+================+==========+==============+====================
99-0ACLH004.rom | bios_update    |        0 |      8388608 | 2024-04-24 14:19:19
================+================+==========+==============+====================

For more detailed information run: onie-fwpkg show-pending <update_name>
INFO: Rebooting in 5 sec...
/var/log: 3.6 GiB (3859709952 bytes) trimmed on /dev/loop1
/host: 23.1 GiB (24844869632 bytes) trimmed on /dev/sda3

INFO: firmware is up to date

Removing pending firmware update: 99-0ACLH004.rom
ERROR: Failed to update BIOS firmware: Failed to trigger firmware update: Command '['/usr/bin/mlnx-onie-fw-update.sh', 'update']' returned non-zero exit status 1.
Error: Firmware install failed.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305
  • 202311

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

/usr/local/bin/reboot could return execution back to the invoking script in case of using graceful reboot.
So, exit the script with reboot return code instead of proceeding with execution.

Signed-off-by: Stepan Blyschak <[email protected]>
@stepanblyschak stepanblyschak force-pushed the onie-fw-update-reboot-fix branch from bf57489 to 0cdbf8e Compare April 25, 2024 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants