From d2462570b8dffd2e83dfb9c6e60f8f39697659b5 Mon Sep 17 00:00:00 2001 From: Sandeep Patil Date: Wed, 15 Feb 2017 14:24:39 -0800 Subject: [PATCH] fs_mgr: fix the fs_mgr_setup_verity param name The 'verify_dev' parameter for fs_mgr_setup_verity is confusing, since it doesn't necessarily control the "verification" part of the function. Instead, it merely allows the caller to skip the wait_for_dm_verity_device part of the function. So, rename that parameter for what it is. b/27805372 Test: Boot sailfish Change-Id: I024e02fd728f5cd5bb333d9c3b512861731fa215 Signed-off-by: Sandeep Patil --- fs_mgr/fs_mgr.cpp | 2 ++ fs_mgr/fs_mgr_verity.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp index cc607d3f9..28d33973f 100644 --- a/fs_mgr/fs_mgr.cpp +++ b/fs_mgr/fs_mgr.cpp @@ -661,6 +661,8 @@ static int handle_encryptable(const struct fstab_rec* rec) } } +// TODO: add ueventd notifiers if they don't exist. +// This is just doing a wait_for_device for maximum of 1s int fs_mgr_test_access(const char *device) { int tries = 25; while (tries--) { diff --git a/fs_mgr/fs_mgr_verity.cpp b/fs_mgr/fs_mgr_verity.cpp index 1ec454072..e82913999 100644 --- a/fs_mgr/fs_mgr_verity.cpp +++ b/fs_mgr/fs_mgr_verity.cpp @@ -859,7 +859,10 @@ static void update_verity_table_blk_device(char *blk_device, char **table) *table = strdup(result.c_str()); } -int fs_mgr_setup_verity(struct fstab_rec *fstab, bool verify_dev) +// prepares the verity enabled (MF_VERIFY / MF_VERIFYATBOOT) fstab record for +// mount. The 'wait_for_verity_dev' parameter makes this function wait for the +// verity device to get created before return +int fs_mgr_setup_verity(struct fstab_rec *fstab, bool wait_for_verity_dev) { int retval = FS_MGR_SETUP_VERITY_FAIL; int fd = -1; @@ -1026,7 +1029,7 @@ loaded: } // make sure we've set everything up properly - if (verify_dev && fs_mgr_test_access(fstab->blk_device) < 0) { + if (wait_for_verity_dev && fs_mgr_test_access(fstab->blk_device) < 0) { goto out; }