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

Enhance next image detection for Aboot in sonic-installer #3433

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

Staphylo
Copy link
Contributor

What I did

Fix a crash of sonic-installer for Aboot bootloaders when the next image is not exactly an installed sonic image.

How I did it

The Aboot bootloader relies of the SWI= keyword argument in the boot-config file to know which image to boot.
This value is also used by sonic-installer to figure to extract the next image that will be executed.
The current code has an issue as it only expects the next image to match the installation path of a SONiC image but not anything else.

This means that SWI=flash:sonic-aboot-broadcom.swi is not valid and can therefore be a problem when trying to install a new image via cold reboot.

How to verify it

Try sonic-installer list with the following values in boot-config

SWI=flash:image-something-expected/.sonic-boot.swi
SWI=flash:sonic-aboot-broadcom.swi
SWI=

@Blueve
Copy link
Contributor

Blueve commented Jul 31, 2024

Hi @Staphylo
can you help check if this fix capable for 202305/202311 and 202405?

@StormLiangMS
Copy link
Contributor

/azp run Azure.sonic-utilities

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@StormLiangMS
Copy link
Contributor

/azp run Azure.sonic-utilities

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Blueve
Blueve previously approved these changes Aug 30, 2024
The Aboot bootloader relies of the SWI= keyword argument in the
boot-config file to know which image to boot.
This value is also used by sonic-installer to figure to extract the next
image that will be executed.
The current code has an issue as it only expects the next image to match
the installation path of a SONiC image but not anything else.

This means that `SWI=flash:sonic-aboot-broadcom.swi` is not valid and
can therefore be a problem when trying to install a new image via cold
reboot.

Additionally a missing or empty boot-config would generate a python
backtrace instead of gracefully recovering from this state.
@Staphylo Staphylo force-pushed the master-fix-next-image branch from 9ed67e7 to 4185fb6 Compare September 2, 2024 15:26
@Blueve
Copy link
Contributor

Blueve commented Sep 6, 2024

ADO: 29332764

@yxieca yxieca merged commit 8fa076d into sonic-net:master Sep 11, 2024
7 checks passed
mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Sep 11, 2024
The Aboot bootloader relies of the SWI= keyword argument in the
boot-config file to know which image to boot.
This value is also used by sonic-installer to figure to extract the next
image that will be executed.
The current code has an issue as it only expects the next image to match
the installation path of a SONiC image but not anything else.

This means that `SWI=flash:sonic-aboot-broadcom.swi` is not valid and
can therefore be a problem when trying to install a new image via cold
reboot.

Additionally a missing or empty boot-config would generate a python
backtrace instead of gracefully recovering from this state.
mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Sep 11, 2024
The Aboot bootloader relies of the SWI= keyword argument in the
boot-config file to know which image to boot.
This value is also used by sonic-installer to figure to extract the next
image that will be executed.
The current code has an issue as it only expects the next image to match
the installation path of a SONiC image but not anything else.

This means that `SWI=flash:sonic-aboot-broadcom.swi` is not valid and
can therefore be a problem when trying to install a new image via cold
reboot.

Additionally a missing or empty boot-config would generate a python
backtrace instead of gracefully recovering from this state.
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #3540

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #3541

mssonicbld pushed a commit that referenced this pull request Sep 11, 2024
The Aboot bootloader relies of the SWI= keyword argument in the
boot-config file to know which image to boot.
This value is also used by sonic-installer to figure to extract the next
image that will be executed.
The current code has an issue as it only expects the next image to match
the installation path of a SONiC image but not anything else.

This means that `SWI=flash:sonic-aboot-broadcom.swi` is not valid and
can therefore be a problem when trying to install a new image via cold
reboot.

Additionally a missing or empty boot-config would generate a python
backtrace instead of gracefully recovering from this state.
mssonicbld pushed a commit that referenced this pull request Sep 11, 2024
The Aboot bootloader relies of the SWI= keyword argument in the
boot-config file to know which image to boot.
This value is also used by sonic-installer to figure to extract the next
image that will be executed.
The current code has an issue as it only expects the next image to match
the installation path of a SONiC image but not anything else.

This means that `SWI=flash:sonic-aboot-broadcom.swi` is not valid and
can therefore be a problem when trying to install a new image via cold
reboot.

Additionally a missing or empty boot-config would generate a python
backtrace instead of gracefully recovering from this state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants