summaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorDavid Anderson <dvander@google.com>2018-06-01 07:47:22 +0200
committerandroid-build-merger <android-build-merger@google.com>2018-06-01 07:47:22 +0200
commitf5f2d8cc13a2a7136f2e6c7eee6975350d72eab7 (patch)
tree863032ef175cf97c713f7cb16d2a3d8efe38c654 /recovery.cpp
parentMerge "updater_sample: Add @GuardedBy" am: 2759733136 am: a37a085a11 (diff)
parentMerge "recovery: add --fsck_unshare_blocks option for adb remount" am: bda4495176 (diff)
downloadandroid_bootable_recovery-f5f2d8cc13a2a7136f2e6c7eee6975350d72eab7.tar
android_bootable_recovery-f5f2d8cc13a2a7136f2e6c7eee6975350d72eab7.tar.gz
android_bootable_recovery-f5f2d8cc13a2a7136f2e6c7eee6975350d72eab7.tar.bz2
android_bootable_recovery-f5f2d8cc13a2a7136f2e6c7eee6975350d72eab7.tar.lz
android_bootable_recovery-f5f2d8cc13a2a7136f2e6c7eee6975350d72eab7.tar.xz
android_bootable_recovery-f5f2d8cc13a2a7136f2e6c7eee6975350d72eab7.tar.zst
android_bootable_recovery-f5f2d8cc13a2a7136f2e6c7eee6975350d72eab7.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 69b149906..8f39679b7 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"
@@ -989,6 +990,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 },
@@ -1017,6 +1019,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;
@@ -1034,7 +1037,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;
@@ -1201,6 +1206,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