Add CBFS/IFD validation + CBFS free space for coreboot builds#2041
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces comprehensive validation to ensure coreboot CBFS size matches the Intel Flash Descriptor (IFD) BIOS region, preventing misconfigurations that could result in firmware that cannot be flashed or boots incorrectly.
Key Changes:
- New validation script (
bin/validate_cbfs_ifd_fit.sh) that parses IFD files, compares CBFS size against BIOS region, and provides space usage statistics - Integration of validation into the coreboot build process at both configure and ROM generation stages
- New Makefile targets (
validate_cbfs_ifdandfix_cbfs_ifd) for manual validation and automatic configuration fixes
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
bin/validate_cbfs_ifd_fit.sh |
New 321-line bash script that validates CONFIG_CBFS_SIZE against IFD BIOS region, supports auto-fix mode, includes Intel 16 MiB decode window limit handling, and provides CBFS free space reporting |
modules/coreboot |
Integrates validation into coreboot configure step (lines 165-173) and final ROM generation (lines 244-256), adds .PHONY marker to force ROM rebuilds |
Makefile |
Adds informational hint for verbose builds when V flag is not set (lines 68-72) and two new targets for manual validation and auto-fix operations (lines 292-318) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4e113ad to
6a89cef
Compare
Introduce validation to ensure coreboot CBFS size matches IFD BIOS region: - Add bin/validate_cbfs_ifd_fit.sh: New script to validate CBFS size against Intel Flash Descriptor (IFD) BIOS region and provide space usage statistics - Add Makefile targets: validate_cbfs_ifd and fix_cbfs_ifd for manual validation and automatic fixes - Integrate validation into coreboot module build process to catch misconfigs at compile time - Add validation to final ROM image generation step - Add informational hint to Makefile when V=1 verbose flag is not set This prevents shipping firmware with CBFS sizes that exceed the available BIOS region, catching configuration errors early in the build process. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
6a89cef to
2b3a7bd
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
2df2833 to
bbfe226
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Improve build performance by avoiding redundant GPG key injections: - Add $(PUBKEY_ASC) as explicit dependency to trigger rebuilds when key changes - Implement caching via .meta file storing SHA256 checksums of source ROM and GPG key - Skip re-injection when both source and key haven't changed since last build - Use shell variables for cleaner code and better maintainability This reduces unnecessary re-injection operations during incremental builds, improving build times when neither the ROM nor the GPG key has been modified. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
bbfe226 to
cfa46bc
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
Makefile:960
- There are excessive blank lines (4 consecutive blank lines) that should be reduced to maintain consistent spacing throughout the Makefile.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Introduce validation to ensure coreboot CBFS size matches IFD BIOS region:
This prevents shipping firmware with CBFS sizes that exceed the available BIOS region, catching configuration errors early in the build process.
As can be seen on CircleCI x220-hotp-maximized build :
Master currently has only 69 KiB for this board. We will try to improve on that on #1991 next