1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 22:43:17 +02:00

layout: Add -i <region>[:<file>] support

Add an optional sub-parameter to the -i parameter to allow building the
image to be written from multiple files. This will also allow regions to
be read from flash and written to separate image files.

This is a rebase of a patch that was ported from chromiumos. A lot of
things have changed, but the idea is the same.

Original patch by Louis Yung-Chieh Lo <yjlou@chromium.org>:
Summary: Support -i partition:file feature for both read and write.
Commit: 9c7525f
Review URL: http://codereview.chromium.org/6611015

Ported version by Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
and Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>:
Summary: [PATCH 2/6] layout: Add -i <region>[:<file>] support.
Review URL: https://mail.coreboot.org/pipermail/flashrom/2013-October/011729.html

Change-Id: Ic5465659605d8431d931053967b40290195cfd99
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Signed-off-by: Daniel Campello <campello@chromium.org>
Co-Authored-by: Edward O'Callaghan <quasisec@google.com>
Co-Authored-by: Daniel Campello <campello@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/23021
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sam McNally <sammc@google.com>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
This commit is contained in:
Daniel Campello
2021-04-13 10:47:25 -06:00
committed by Edward O'Callaghan
parent 3f19ba95f1
commit 45d50a101e
6 changed files with 234 additions and 37 deletions

View File

@ -48,7 +48,8 @@ flashrom \- detect, read, write, verify and erase flash chips
\fB\-p\fR <programmername>[:<parameters>] [\fB\-c\fR <chipname>]
(\fB\-\-flash\-name\fR|\fB\-\-flash\-size\fR|
[\fB\-E\fR|\fB\-r\fR <file>|\fB\-w\fR <file>|\fB\-v\fR <file>]
[(\fB\-l\fR <file>|\fB\-\-ifd|\fB \-\-fmap\fR|\fB\-\-fmap-file\fR <file>) [\fB\-i\fR <image>]]
[(\fB\-l\fR <file>|\fB\-\-ifd|\fB \-\-fmap\fR|\fB\-\-fmap-file\fR <file>)
[\fB\-i\fR <image>[:<file>]]]
[\fB\-n\fR] [\fB\-N\fR] [\fB\-f\fR])]
[\fB\-V\fR[\fBV\fR[\fBV\fR]]] [\fB-o\fR <logfile>]
.SH DESCRIPTION
@ -239,10 +240,45 @@ The following ROM images may be present in an IFD:
gbe gigabit ethernet firmware
pd platform specific data
.TP
.B "\-i, \-\-image <imagename>"
Only flash region/image
.B <imagename>
from flash layout.
.B "\-i, \-\-include <region>[:<file>]"
Read or write only
.B <region>
to or from ROM.
The
.B "\-i"
option may be used multiple times if the user wishes to read or write
multiple regions using a single command.
.sp
The user may optionally specify a corresponding
.B <file>
for any region they wish to read or write. A read operation will read the
corresponding regions from ROM and write individual files for each one. A write
option will read file(s) and write to the corresponding region(s) in ROM.
.sp
For write operations, files specified using
.B "\-i"
take precedence over content from the argument to
.B "\-w."
.sp
Examples:
.sp
To read regions named
.BR "foo " and " bar"
in layout file
.B <layout>
into region-sized files
.BR "foo.bin " and " bar.bin" ", run:
.sp
.B " flashrom \-p prog \-l <layout> \-i foo:foo.bin -i bar:bar.bin -r rom.bin
.sp
To write files
.BR "foo.bin " and " bar.bin"
into regions named
.BR "foo " and " bar" " in layout file
.BR <layout>
to the ROM, run:
.sp
.B " flashrom \-p prog \-l <layout> \-i foo:foo.bin -i bar:bar.bin -w rom.bin
.TP
.B "\-\-flash\-name"
Prints out the detected flash chips name.