Skip to content

Conversation

@croos12
Copy link

@croos12 croos12 commented Dec 5, 2025

Turns the sonic-nvidia-bluefield.bfb file into a tar archive with a bfb, sonic-nvidia-bluefield.bfb-intermediate and a sha256 checksum, sonic-nvidia-bluefield.bfb-intermediate.sha256 so that the contents of the bfb can be validated before shutting down an rshim when running sonic-bfb-installer.sh

Why I did it

There is currently a bug that any file can be used as the bfb input for sonic-bfb-installer.sh and the script does not validate if it is a proper bfb before shutting down rshims on smartswitch. This can be a problem for when trying to use the download functionality of the script since if the call to download the bfb fails the script will shutdown the rshims and attempt to install the html response page as a bfb.

How I did it

The bfb file is now an archive with the old bfb file, now names bfb-intermediate and a checksum using shasum256. The checksum is used to ensure that the file contents are the bfb that was intended to be installed for the sake of having a method of proving file integrity to the bfb, this is not intended to be a security feature.

How to verify it

Build the new bfb using the make file and attempt to install it using sonic-bfb-installer.sh.

Description for the changelog

Add smartswitch bfb checksum file integrity validation

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

Creates a checksum of bfb contents and uses it for validation in the
sonic-bfb-installer.sh script

Signed-off-by: Connor Roos <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@croos12 croos12 changed the title Creates a checksum of bfb contents and uses it for validation in the sonic-bfb-installer.sh script [SmartSwitch] Add smartswitch bfb checksum file integrity validation Dec 5, 2025
@croos12 croos12 marked this pull request as ready for review December 5, 2025 17:48
@croos12 croos12 requested a review from lguohan as a code owner December 5, 2025 17:48
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

4 participants