diff options
author | Justin DeMartino <jjdemartino@google.com> | 2020-09-21 13:24:08 -0700 |
---|---|---|
committer | Justin DeMartino <jjdemartino@google.com> | 2020-09-21 13:24:08 -0700 |
commit | 338e91517f011da3056cdab4fe75198281cbc997 (patch) | |
tree | daadd64a0a84b5836dda7d2ce15737d4d59abdae /init/builtins.cpp | |
parent | 9a1114d8a44e4d93a719095ad81c119273d43ee4 (diff) | |
parent | 79c5fee02e1430bec2f75956297f5b631e70b407 (diff) |
Merge SP1A.200921.001
Change-Id: I90b97c4e9fb10b1f45e74def404823eed5b1aaa8
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r-- | init/builtins.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index f85246d5c..d58dd6076 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -570,7 +570,6 @@ static Result<void> queue_fs_event(int code, bool userdata_remount) { trigger_shutdown("reboot,requested-userdata-remount-on-fde-device"); } SetProperty("ro.crypto.state", "encrypted"); - SetProperty("ro.crypto.type", "block"); ActionManager::GetInstance().QueueEventTrigger("defaultcrypto"); return {}; } else if (code == FS_MGR_MNTALL_DEV_NOT_ENCRYPTED) { @@ -602,7 +601,6 @@ static Result<void> queue_fs_event(int code, bool userdata_remount) { return Error() << "FscryptInstallKeyring() failed"; } SetProperty("ro.crypto.state", "encrypted"); - SetProperty("ro.crypto.type", "file"); // Although encrypted, we have device key, so we do not need to // do anything different from the nonencrypted case. @@ -613,7 +611,6 @@ static Result<void> queue_fs_event(int code, bool userdata_remount) { return Error() << "FscryptInstallKeyring() failed"; } SetProperty("ro.crypto.state", "encrypted"); - SetProperty("ro.crypto.type", "file"); // Although encrypted, vold has already set the device up, so we do not need to // do anything different from the nonencrypted case. @@ -624,7 +621,6 @@ static Result<void> queue_fs_event(int code, bool userdata_remount) { return Error() << "FscryptInstallKeyring() failed"; } SetProperty("ro.crypto.state", "encrypted"); - SetProperty("ro.crypto.type", "file"); // Although encrypted, vold has already set the device up, so we do not need to // do anything different from the nonencrypted case. @@ -673,18 +669,26 @@ static Result<void> do_mount_all(const BuiltinArguments& args) { } } - auto mount_fstab_return_code = fs_mgr_mount_all(&fstab, mount_all->mode); + auto mount_fstab_result = fs_mgr_mount_all(&fstab, mount_all->mode); SetProperty(prop_name, std::to_string(t.duration().count())); if (mount_all->import_rc) { import_late(mount_all->rc_paths); } + if (mount_fstab_result.userdata_mounted) { + // This call to fs_mgr_mount_all mounted userdata. Keep the result in + // order for userspace reboot to correctly remount userdata. + LOG(INFO) << "Userdata mounted using " + << (mount_all->fstab_path.empty() ? "(default fstab)" : mount_all->fstab_path) + << " result : " << mount_fstab_result.code; + initial_mount_fstab_return_code = mount_fstab_result.code; + } + if (queue_event) { /* queue_fs_event will queue event based on mount_fstab return code * and return processed return code*/ - initial_mount_fstab_return_code = mount_fstab_return_code; - auto queue_fs_result = queue_fs_event(mount_fstab_return_code, false); + auto queue_fs_result = queue_fs_event(mount_fstab_result.code, false); if (!queue_fs_result.ok()) { return Error() << "queue_fs_event() failed: " << queue_fs_result.error(); } @@ -1199,6 +1203,10 @@ static Result<void> do_remount_userdata(const BuiltinArguments& args) { } // TODO(b/135984674): check that fstab contains /data. if (auto rc = fs_mgr_remount_userdata_into_checkpointing(&fstab); rc < 0) { + std::string proc_mounts_output; + android::base::ReadFileToString("/proc/mounts", &proc_mounts_output, true); + android::base::WriteStringToFile(proc_mounts_output, + "/metadata/userspacereboot/mount_info.txt"); trigger_shutdown("reboot,mount_userdata_failed"); } if (auto result = queue_fs_event(initial_mount_fstab_return_code, true); !result.ok()) { |