DescriptionSupport -i partition:file feature for both read and write.
This is actually 2 steps:
1. support partial read, which is like partial write we already supported.
2. support <file> optional parameter for -i <image>. This is super convenient
for flashrom clients when they only need to read/write partial flash.
They no longer need to prepare the whole flash content. Just prepare
fragmented files, and specify partition names for each.
Stefan and Hungte, this is FYI. But still welcome your comments.
Change-Id: I00465bd2b1cf8fec10b0b18958efc94872e1a44a
BUG=chromium-os:12355
TEST=run the following commands on Mario:
cat > l
0:0xFF LOG
0x220000:0x2201FF RO
0x240000:0x2401FF RO2
0x3FFFF0:0x3FFFFF BV
Ctrl+D
time flashrom -r /tmp/bios
time flashrom -l l -i LOG:log -i RO -i RO2:ro2 -i BV:bv -r /tmp/bios2
# Partial read should be much faster than whole read (around 0.7 seconds).
# File log should contain 256 bytes, and content are like "$LOG" FF FF ...
# File ro2 may contain Mario's VPD 1.0 data.
# File bv should contain boot vector of BIOS, which is 0F 09 E9 6B ... FC FF.
# File bios2 should only contain LOG, RO, RO2, and BV. Rest regions should be 0xFF.
time flashrom -l l -i RO:log -i RO2:bv -w /tmp/bios2
# Would take around 10 seconds (for 2 whole reads and 1 partial write).
time flashrom -l l -i RO:ro_ -i RO2:ro2_ -r /tmp/bios3
# Should be very quick.
# File ro_ should contain log (if RO originally is blank).
# First 16-byte of file ro2_ should contain bv. Rest are original ro2.
# File bios3 should only contain ro_ and ro2_. Rest are all 0xFF.
Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=9c7525f
Patch Set 1 #
Total comments: 12
Patch Set 2 : fixed according to code review and security check. #
Messages
Total messages: 9 (0 generated)
|