util/smmstoretool: support processing ROMs
Input file is parsed for FMAP and SMMSTORE region which is used if found. Otherwise, the whole file is assumed to be the region. Passing an image with FMAP that lacks SMMSTORER is an error. Change-Id: Ieab555d7bbcfa4dadf6a5070d1297acd737440fb Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80903 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
committed by
Martin L Roth
parent
04bd965143
commit
89e056bdf1
@@ -4,13 +4,20 @@ Offline SMMSTORE variable modification tool.
|
||||
|
||||
## Operation
|
||||
|
||||
### File formats
|
||||
|
||||
To discover SMMSTORE, the tool first looks for FMAP header and, if found, for
|
||||
SMMSTORE region. If FMAP is found but it has no SMMSTORE region, that's an
|
||||
error. If there is no FMAP, the whole file is assumed to be SMMSTORE
|
||||
region (e.g., extracted via `cbfstool`).
|
||||
|
||||
### Storage initialization
|
||||
|
||||
If SMMSTORE presence isn't detected and an update operation is requested, the
|
||||
store spanning the whole file is created automatically. Size of the store file
|
||||
must be a multiple of 64 KiB (block size in version 2 of SMMSTORE protocol),
|
||||
the variable storage itself will be 64 KiB in size. That's the way EDK2 makes
|
||||
use of it.
|
||||
store spanning the whole region is created automatically. Size of the store
|
||||
region must be a multiple of 64 KiB (block size in version 2 of SMMSTORE
|
||||
protocol), the variable storage itself will be 64 KiB in size. That's the way
|
||||
EDK2 makes use of it.
|
||||
|
||||
Unlike online editing which mostly appends new variable entries each storage
|
||||
update with this tool drops all deleted or incomplete entries.
|
||||
@@ -28,7 +35,7 @@ Start with:
|
||||
|
||||
```
|
||||
$ smmstoretool -h
|
||||
Usage: smmstoretool smm-store-file sub-command
|
||||
Usage: smmstoretool smm-store-file|rom sub-command
|
||||
smmstoretool -h|--help
|
||||
|
||||
Sub-commands:
|
||||
@@ -58,7 +65,8 @@ to typical configuration values are supported:
|
||||
|
||||
## Examples
|
||||
|
||||
`SMMSTORE` is the name of a file containing SMMSTORE data.
|
||||
`SMMSTORE` is the name of a file containing SMMSTORE data or a full ROM image
|
||||
with FMAP that includes SMMSTORE region.
|
||||
|
||||
### Variable listing
|
||||
|
||||
@@ -111,9 +119,13 @@ $ smmstoretool SMMSTORE remove -g dasharo -n NetworkBoot
|
||||
If one edits a newly generated Dasharo `coreboot.rom`:
|
||||
|
||||
```bash
|
||||
# editing exported storage
|
||||
cbfstool coreboot.rom read -r SMMSTORE -f SMMSTORE
|
||||
smmstoretool SMMSTORE set -g dasharo -n NetworkBoot -t bool -v true
|
||||
cbfstool coreboot.rom write -r SMMSTORE -f SMMSTORE
|
||||
|
||||
# editing in-place storage
|
||||
smmstoretool coreboot.rom set -g dasharo -n NetworkBoot -t bool -v true
|
||||
```
|
||||
|
||||
On the first boot, "Network Boot" setting will already be enabled.
|
||||
|
Reference in New Issue
Block a user