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

[Bug] Disallow factory image update if boot page is also factory #3049

Merged
merged 8 commits into from Dec 4, 2023

Conversation

anandhv
Copy link
Contributor

@anandhv anandhv commented Nov 22, 2023

Description

The BMC disallows this combo to prevent the user from bricking the card. But it returns a non-descript error message.
I enhanced fpgasupdate to additionally check for this combo and error out.

We need to compare 2 things:

  1. The target flash page of the given binary. This is simply the 'ConType' in the Block0 region of the binary. The code already parsed this out.
  2. The current boot-page, which is read from a sysfs entry.

To facilitate #2, I added a boot_page sysfs_node object to the 'fme' device in fpga.py. It looks for the specific name of the entry.
I then read the entry in main() and perform the check.

Signed-off-by: Venkateswaran, Anandh anandh.venkateswaran@intel.com

Collateral (docs, reports, design examples, case IDs):

https://hsdes.intel.com/appstore/article/#/14020513236
https://hsdes.intel.com/appstore/article/#/14020332395

  • [NO] Document Update Required? (Specify FIM/AFU/Scripts)

Tests added:

Tests run:

Manually tested on Comet-Creek using all combinations of boot-page and target flash page. When both are 'factory', we error-out gracefully. For all other combos, the operation completed successfully.

@anandhv anandhv changed the title disallow factory image update if boot page is also factory [Bug] Disallow factory image update if boot page is also factory Nov 22, 2023
@anandhv anandhv marked this pull request as ready for review November 30, 2023 18:01
@anandhv anandhv requested a review from a team as a code owner November 30, 2023 18:01
Copy link
Contributor

@tswhison tswhison left a comment

Choose a reason for hiding this comment

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

👍

@anandhv anandhv merged commit 068f852 into OFS:master Dec 4, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants