diff options
author | Scott Lobdell <slobdell@google.com> | 2019-01-07 13:44:48 -0800 |
---|---|---|
committer | Steven Laver <lavers@google.com> | 2019-01-15 11:51:19 -0800 |
commit | c65be272aaa3772bf277c5ab922c262951ae40b0 (patch) | |
tree | db56152220de6b113303239d35eb1aaa736f7d82 /init/builtins.cpp | |
parent | 06839ded4b3aa0183456e2f29855f1f580c55b7d (diff) | |
parent | 4ef704127bab68a8b3b20411553f01d3f205325e (diff) |
Merge QP1A.190107.001
Conflicts:
fs_mgr/fs_mgr.cpp
fs_mgr/fs_mgr_fstab.cpp
fs_mgr/fs_mgr_priv.h
fs_mgr/include/fs_mgr.h
Change-Id: Ibb1b0d9d698f1728e4df068f3119ad5f852c96db
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r-- | init/builtins.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index 0612bc77d..ea2035b02 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -473,9 +473,10 @@ static Result<int> mount_fstab(const char* fstabfile, int mount_mode) { // Only needed if someone explicitly changes the default log level in their init.rc. android::base::ScopedLogSeverity info(android::base::INFO); - struct fstab* fstab = fs_mgr_read_fstab(fstabfile); - int child_ret = fs_mgr_mount_all(fstab, mount_mode); - fs_mgr_free_fstab(fstab); + Fstab fstab; + ReadFstabFromFile(fstabfile, &fstab); + + int child_ret = fs_mgr_mount_all(&fstab, mount_mode); if (child_ret == -1) { PLOG(ERROR) << "fs_mgr_mount_all returned an error"; } @@ -619,14 +620,15 @@ static Result<Success> do_mount_all(const BuiltinArguments& args) { } static Result<Success> do_swapon_all(const BuiltinArguments& args) { - struct fstab *fstab; - int ret; + Fstab fstab; + if (!ReadFstabFromFile(args[1], &fstab)) { + return Error() << "Could not read fstab '" << args[1] << "'"; + } - fstab = fs_mgr_read_fstab(args[1].c_str()); - ret = fs_mgr_swapon_all(fstab); - fs_mgr_free_fstab(fstab); + if (!fs_mgr_swapon_all(fstab)) { + return Error() << "fs_mgr_swapon_all() failed"; + } - if (ret != 0) return Error() << "fs_mgr_swapon_all() failed"; return Success(); } @@ -740,13 +742,10 @@ static Result<Success> do_verity_load_state(const BuiltinArguments& args) { return Success(); } -static void verity_update_property(fstab_rec *fstab, const char *mount_point, - int mode, int status) { - property_set("partition."s + mount_point + ".verified", std::to_string(mode)); -} - static Result<Success> do_verity_update_state(const BuiltinArguments& args) { - if (!fs_mgr_update_verity_state(verity_update_property)) { + if (!fs_mgr_update_verity_state([](const std::string& mount_point, int mode) { + property_set("partition." + mount_point + ".verified", std::to_string(mode)); + })) { return Error() << "fs_mgr_update_verity_state() failed"; } return Success(); |