diff options
author | Bowgo Tsai <bowgotsai@google.com> | 2017-03-02 00:03:56 +0800 |
---|---|---|
committer | Bowgo Tsai <bowgotsai@google.com> | 2017-04-14 12:10:49 +0800 |
commit | aaf70e77dc232fde152249bb6f66a227eab35a10 (patch) | |
tree | e0a543390d9cd354f1aae14c33b76b887f49c068 /init/builtins.cpp | |
parent | 8bba52fc4bf1f2f84add7af5d9527ae923cf8ecc (diff) |
fs_mgr: support AVB in fs_mgr_update_verity_state()
fs_mgr_update_verity_state() is invoked by 'verity_update_state' in
init.rc. It will then set property "partition.system.verified" and
"partition.vendor.verified" to verify_mode. We should support this for
AVB as well.
Also change the order of static libs in init to fix the build error
after this change:
system/extras/ext4_utils/ext4_crypt.cpp:69: error: undefined reference to 'property_get'
Bug: 35416769
Test: Mount /system and /vendor with vboot 2.0 (AVB), check the following properties exist.
- [partition.system.verified]: [2]
- [partition.vendor.verified]: [2]
Test: Mount /system and /vendor with vboot 1.0, check the following properties exist.
- [partition.system.verified]: [0]
- [partition.vendor.verified]: [0]
Change-Id: I4328d66a8cb93f26e7960e620a0b2292d5f15900
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r-- | init/builtins.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index e1d9b94ee..2327cdfb4 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -677,11 +677,11 @@ static int do_sysclktz(const std::vector<std::string>& args) { static int do_verity_load_state(const std::vector<std::string>& args) { int mode = -1; - int rc = fs_mgr_load_verity_state(&mode); - if (rc == 0 && mode != VERITY_MODE_DEFAULT) { + bool loaded = fs_mgr_load_verity_state(&mode); + if (loaded && mode != VERITY_MODE_DEFAULT) { ActionManager::GetInstance().QueueEventTrigger("verity-logging"); } - return rc; + return loaded ? 0 : 1; } static void verity_update_property(fstab_rec *fstab, const char *mount_point, @@ -691,7 +691,7 @@ static void verity_update_property(fstab_rec *fstab, const char *mount_point, } static int do_verity_update_state(const std::vector<std::string>& args) { - return fs_mgr_update_verity_state(verity_update_property); + return fs_mgr_update_verity_state(verity_update_property) ? 0 : 1; } static int do_write(const std::vector<std::string>& args) { |