summaryrefslogtreecommitdiffstats
path: root/fs_mgr/fs_mgr_fstab.c
diff options
context:
space:
mode:
authorSami Tolvanen <samitolvanen@google.com>2015-03-22 12:40:05 +0000
committerSami Tolvanen <samitolvanen@google.com>2015-03-24 09:02:47 +0000
commit946a0f3e1925c8cc9be08e3e34758d577cbe7f31 (patch)
tree28c5d823324dfcbb20c587628bea6b204908d5be /fs_mgr/fs_mgr_fstab.c
parent1d792dd4161728240e23f21aceaff74070b24c7e (diff)
downloadsystem_core-946a0f3e1925c8cc9be08e3e34758d577cbe7f31.zip
system_core-946a0f3e1925c8cc9be08e3e34758d577cbe7f31.tar.gz
system_core-946a0f3e1925c8cc9be08e3e34758d577cbe7f31.tar.bz2
Use structured format for verity metadata
Specify the location of verity metadata in fstab, and use a type-length-value format for the metadata that allows other data to be stored in the same location in an extensible way. Change-Id: Id8711f7d51dc1e4e9a4d84f9951240f64528e69d
Diffstat (limited to 'fs_mgr/fs_mgr_fstab.c')
-rw-r--r--fs_mgr/fs_mgr_fstab.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs_mgr/fs_mgr_fstab.c b/fs_mgr/fs_mgr_fstab.c
index ab8f128..2c3c90d 100644
--- a/fs_mgr/fs_mgr_fstab.c
+++ b/fs_mgr/fs_mgr_fstab.c
@@ -24,6 +24,7 @@
struct fs_mgr_flag_values {
char *key_loc;
+ char *verity_loc;
long long part_length;
char *label;
int partnum;
@@ -107,6 +108,14 @@ static int parse_flags(char *flags, struct flag_list *fl,
* location of the keys. Get it and return it.
*/
flag_vals->key_loc = strdup(strchr(p, '=') + 1);
+ } else if ((fl[i].flag == MF_VERIFY) && flag_vals) {
+ /* If the verify flag is followed by an = and the
+ * location for the verity state, get it and return it.
+ */
+ char *start = strchr(p, '=');
+ if (start) {
+ flag_vals->verity_loc = strdup(start + 1);
+ }
} else if ((fl[i].flag == MF_FORCECRYPT) && flag_vals) {
/* The forceencrypt flag is followed by an = and the
* location of the keys. Get it and return it.
@@ -291,6 +300,7 @@ struct fstab *fs_mgr_read_fstab(const char *fstab_path)
fstab->recs[cnt].fs_mgr_flags = parse_flags(p, fs_mgr_flags,
&flag_vals, NULL, 0);
fstab->recs[cnt].key_loc = flag_vals.key_loc;
+ fstab->recs[cnt].verity_loc = flag_vals.verity_loc;
fstab->recs[cnt].length = flag_vals.part_length;
fstab->recs[cnt].label = flag_vals.label;
fstab->recs[cnt].partnum = flag_vals.partnum;