New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 662275 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

flashrom: Preserve sections?

Project Member Reported by hungte@chromium.org, Nov 4 2016

Issue description

Simply brainstorming.

In general we encourage developers to run firmware updater which will preserve right data and check everything. But we've also seen requests for cases like "this device is dead and I want to re-image using servo".

Wondering if there's a more easy way to write firmware with more flexibility? For example,

Add a "-X (exclude)" option that we can specify flashrom to never touch given sections so it's easier to preserve VPD.

 sudo flashrom -p ft2232_spi:type=servo-v2 -w image.bin -n -V -X RO_VPD -X RW_VPD -X GBB
 
SGTM. Conceptually it should be a simple modification to the layout handling logic to include regions by default and exclude based on -X args.

A few rules we should clarify:
1. Exclusion (-X) shall take precedence over inclusion -i. This will allow a subregion to be excluded from a region being included, e.g. "-i RO_SECTION -X RO_VPD" will preserve RO_VPD while overwriting the rest of RO_SECTION.

2. Due to rule #1, if a user specifies a region to be excluded and subregion to be included, error out. In this case the user should not use -X, instead they should only use -i to specify the included region.

3. Excluding a region implies excluding it from verification steps.

LMK if you can think of other requirements to consider. The "Partial Reads and Writes" section on http://go/cros-flashrom might provide some ideas for use cases and how we might need to deal with them.
On second thought, rule #3 should be: Excluding a region implies verification against old content for that region in both normal and --fast-verify modes. 

Currently --fast-verify only applies to included regions, so it needs to be modified to apply to excluded regions as well.
BTW, what does -x (extract) currently do?
Was it really useful?
Status: Available (was: Untriaged)
Good question. It was introduced in https://chromium-review.googlesource.com/#/c/60861/

Basically it reads the whole ROM and dumps each region into individual files. I'm not sure if it's used by anything - We've had the -i region[:file] syntax for longer and tools _should_ be selectively reading regions that way since it's faster and won't leave a bunch of blobs in the filesystem.

Likely this feature is just something that was kludged in before we had the consistency that we've reached today. It might still be kinda nice for other purposes (e.g. dump all regions from a user-generated layout), but I wouldn't mind repurposing the short opt (-x) for the "exclude" option. We can leave the --extract longopt in just in case it's still useful.

Owner: martinroth@chromium.org
Cc: wnhuang@chromium.org
Owner: ----
Project Member

Comment 7 by sheriffbot@chromium.org, Aug 20

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment