diff options
-rw-r--r-- | src/include/fmap.h | 4 | ||||
-rw-r--r-- | src/lib/fmap.c | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/include/fmap.h b/src/include/fmap.h index 684a05c607..5834831489 100644 --- a/src/include/fmap.h +++ b/src/include/fmap.h @@ -27,6 +27,10 @@ int find_fmap_directory(struct region_device *fmrd); * 0 on success, < 0 on error. */ int fmap_locate_area_as_rdev(const char *name, struct region_device *area); +/* Just like fmap_locate_area_as_rdev(), however the region device is + * created from the RW boot device. */ +int fmap_locate_area_as_rdev_rw(const char *name, struct region_device *area); + /* Locate the named area in the fmap and fill in a region with the * offset and size of that area within the boot media. Return 0 on success, * < 0 on error. */ diff --git a/src/lib/fmap.c b/src/lib/fmap.c index bf99037f54..9602134d94 100644 --- a/src/lib/fmap.c +++ b/src/lib/fmap.c @@ -80,6 +80,16 @@ int fmap_locate_area_as_rdev(const char *name, struct region_device *area) return boot_device_ro_subregion(&ar, area); } +int fmap_locate_area_as_rdev_rw(const char *name, struct region_device *area) +{ + struct region ar; + + if (fmap_locate_area(name, &ar)) + return -1; + + return boot_device_rw_subregion(&ar, area); +} + int fmap_locate_area(const char *name, struct region *ar) { struct region_device fmrd; |