summaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2018-06-01 02:28:52 +0200
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-06-01 02:28:52 +0200
commitbda4495176512e94a214a140602a5191a54f3f50 (patch)
tree6e87f5b4184557f92d7c6a92babdfc84521c5c33 /recovery.cpp
parentMerge "updater_sample: Add @GuardedBy" (diff)
parentrecovery: add --fsck_unshare_blocks option for adb remount (diff)
downloadandroid_bootable_recovery-bda4495176512e94a214a140602a5191a54f3f50.tar
android_bootable_recovery-bda4495176512e94a214a140602a5191a54f3f50.tar.gz
android_bootable_recovery-bda4495176512e94a214a140602a5191a54f3f50.tar.bz2
android_bootable_recovery-bda4495176512e94a214a140602a5191a54f3f50.tar.lz
android_bootable_recovery-bda4495176512e94a214a140602a5191a54f3f50.tar.xz
android_bootable_recovery-bda4495176512e94a214a140602a5191a54f3f50.tar.zst
android_bootable_recovery-bda4495176512e94a214a140602a5191a54f3f50.zip
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 56b2567d1..98cbfed2f 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -55,6 +55,7 @@
#include "adb_install.h"
#include "common.h"
#include "device.h"
+#include "fsck_unshare_blocks.h"
#include "fuse_sdcard_provider.h"
#include "fuse_sideload.h"
#include "install.h"
@@ -969,6 +970,7 @@ Device::BuiltinAction start_recovery(Device* device, const std::vector<std::stri
[](const std::string& arg) { return const_cast<char*>(arg.c_str()); });
static constexpr struct option OPTIONS[] = {
+ { "fsck_unshare_blocks", no_argument, nullptr, 0 },
{ "just_exit", no_argument, nullptr, 'x' },
{ "locale", required_argument, nullptr, 0 },
{ "prompt_and_wipe_data", no_argument, nullptr, 0 },
@@ -997,6 +999,7 @@ Device::BuiltinAction start_recovery(Device* device, const std::vector<std::stri
bool sideload_auto_reboot = false;
bool just_exit = false;
bool shutdown_after = false;
+ bool fsck_unshare_blocks = false;
int retry_count = 0;
bool security_update = false;
std::string locale;
@@ -1014,7 +1017,9 @@ Device::BuiltinAction start_recovery(Device* device, const std::vector<std::stri
break;
case 0: {
std::string option = OPTIONS[option_index].name;
- if (option == "locale") {
+ if (option == "fsck_unshare_blocks") {
+ fsck_unshare_blocks = true;
+ } else if (option == "locale") {
// Handled in recovery_main.cpp
} else if (option == "prompt_and_wipe_data") {
should_prompt_and_wipe_data = true;
@@ -1181,6 +1186,10 @@ Device::BuiltinAction start_recovery(Device* device, const std::vector<std::stri
if (sideload_auto_reboot) {
ui->Print("Rebooting automatically.\n");
}
+ } else if (fsck_unshare_blocks) {
+ if (!do_fsck_unshare_blocks()) {
+ status = INSTALL_ERROR;
+ }
} else if (!just_exit) {
// If this is an eng or userdebug build, automatically turn on the text display if no command
// is specified. Note that this should be called before setting the background to avoid