summaryrefslogtreecommitdiff
path: root/host/lib/include/fmap.h
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2019-02-28 23:13:54 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-03-05 12:58:42 -0800
commitedf6a8889aaabfc6446957f897f98c7a7e622298 (patch)
tree526a3cb0c4fed66adbf99ac727946f99e38cb616 /host/lib/include/fmap.h
parent638b79822725ae41072a3342b796d333c1f0f23e (diff)
downloadvboot-edf6a8889aaabfc6446957f897f98c7a7e622298.tar.gz
futility: updater: Preserve all sections with FMAP_AREA_PRESERVE set
Many projects started their initial builds without knowing that some sections must be preserved when being updated. This may be solved by adding section name to 'preserved' list in firmware updater (for instance, CL:1239797), or include that section as sub area of {RO,RW}_PRESERVE. However, there are problems in both solutions. For example, installing an older image will run old updater, which will not preserve the new names. Also, if there are multiple sections must be preserved (and not contiguous - see CL:1493629) there will be problems. Additionally, changing FMAP layout usually causes more problems. As a result, adding the description in FMAP area would be the better idea. A new FMAP_AREA_PRESERVE suggests firmware updater to preserve a section if possible. In Coreboot, this can be easily set in *.fmd using flag (PRESERVE). See https://review.coreboot.org/31709 for example. BUG=chromium:936768 TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: Ie56f65dd418faa97ffb78b1acff613e7d7e268b8 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1495054 Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'host/lib/include/fmap.h')
-rw-r--r--host/lib/include/fmap.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/host/lib/include/fmap.h b/host/lib/include/fmap.h
index d6c33c65..02f97c2d 100644
--- a/host/lib/include/fmap.h
+++ b/host/lib/include/fmap.h
@@ -27,6 +27,14 @@ typedef struct _FmapHeader {
uint16_t fmap_nareas;
} __attribute__((packed)) FmapHeader;
+enum fmap_flags {
+ FMAP_AREA_STATIC = 1 << 0,
+ FMAP_AREA_COMPRESSED = 1 << 1,
+ FMAP_AREA_RO = 1 << 2,
+ /* Should be preserved on update or rollback. */
+ FMAP_AREA_PRESERVE = 1 << 3,
+};
+
typedef struct _FmapAreaHeader {
uint32_t area_offset;
uint32_t area_size;