Skip to content

Conversation

@arajeev-ARISTA
Copy link
Contributor

Background

During BIOS upgrade in Darwin48V systems, DMI_BOARD_NAME needs to be updated through Aboot aconf programming. Previously we achieved this by adding the aconf programming logic to the fw_util config file.
However, a recent refactoring of the fw_util prevents adding arbitrary shell commands in the config file. This change addresses the issue by adding the support to program custom contents in a flash device which is updated through flashrom.

Summary of changes

  • Added two optional arguments custom_content and custom_content_offset in the Thrift description for FlashromConfig
  • If a flashrom command description with both custom_content and custom_content_offset are found in the fw_util config file, a temporary binary file will be created. The binary file will have custom_content written at custom_content_offset. A flashrom command would then be constructed using this temporary binary file instead of the firmware image. The regions in the flash memory which will be updated are restricted by specifying the layout
  • The command to program the custom content will be in addition to the existing command to program the firmware binary. We are able to specify multiple commands because it’s allowed by the thrift description for upgrade operation

Testing

Upgraded BIOS in a Darwin48V system with fw_util and verified that DMI_BOARD_NAME was programmed.

@facebook-github-bot
Copy link
Contributor

@joancaneus has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@joancaneus
Copy link
Contributor

@arajeev-ARISTA -- We use the linter below to format code at meta

Lint code: CLANGFORMAT
Lint name: format

There are some lints failing on this diff which I will format, but for future reference (when you done with those PR) can you please look into how you can possibly use that linter as well?

@arajeev-ARISTA
Copy link
Contributor Author

@arajeev-ARISTA -- We use the linter below to format code at meta

Lint code: CLANGFORMAT Lint name: format

There are some lints failing on this diff which I will format, but for future reference (when you done with those PR) can you please look into how you can possibly use that linter as well?

Will do, thanks!

@facebook-github-bot
Copy link
Contributor

@arajeev-ARISTA has updated the pull request. You must reimport the pull request before landing.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@arajeev-ARISTA has updated the pull request. You must reimport the pull request before landing.

@arajeev-ARISTA arajeev-ARISTA force-pushed the fw_util_custom_content branch from eed00ef to 4ee8580 Compare April 6, 2025 06:09
@facebook-github-bot
Copy link
Contributor

@arajeev-ARISTA has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@ezeob002 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@ezeob002 merged this pull request in 261c8dc.

joywu-coder pushed a commit to joywu-coder/fboss that referenced this pull request May 26, 2025
…acebook#353)

Summary:
### Background
During BIOS upgrade in Darwin48V systems, `DMI_BOARD_NAME` needs to be updated through Aboot aconf programming. Previously we achieved this by adding the aconf programming logic to the `fw_util` config file.
However, a recent refactoring of the `fw_util` prevents adding arbitrary shell commands in the config file. This change addresses the issue by adding the support to program custom contents in a flash device which is updated through `flashrom`.
### Summary of changes

- Added two optional arguments `custom_content` and `custom_content_offset` in the Thrift description for `FlashromConfig`
- If a `flashrom` command description with both `custom_content` and `custom_content_offset` are found in the `fw_util` config file, a temporary binary file will be created. The binary file will have `custom_content` written at `custom_content_offset`. A `flashrom` command would then be constructed using this temporary binary file instead of the firmware image. The regions in the flash memory which will be updated are restricted by specifying the layout
- The command to program the custom content will be in addition to the existing command to program the firmware binary. We are able to specify multiple commands because it’s allowed by the thrift description for upgrade operation

### Testing
Upgraded BIOS in a Darwin48V system with fw_util and verified that DMI_BOARD_NAME was programmed.

Pull Request resolved: facebook#353

Reviewed By: joancaneus

Differential Revision: D72034772

Pulled By: ezeob002

fbshipit-source-id: 97968aba4425e90b309e5cd1eedb66dd6cb4bdaa
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.

3 participants