summaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorDavid Anderson <dvander@google.com>2018-05-16 22:43:22 +0200
committerDavid Anderson <dvander@google.com>2018-05-30 22:24:30 +0200
commitedee8361d75715b9bc020d76fa8f38b005a6e912 (patch)
tree8aa3b917ac0d1a3a913ea92d84bc8607d5308bd9 /recovery.cpp
parentMerge "updater_sample: add UpdaterState" (diff)
downloadandroid_bootable_recovery-edee8361d75715b9bc020d76fa8f38b005a6e912.tar
android_bootable_recovery-edee8361d75715b9bc020d76fa8f38b005a6e912.tar.gz
android_bootable_recovery-edee8361d75715b9bc020d76fa8f38b005a6e912.tar.bz2
android_bootable_recovery-edee8361d75715b9bc020d76fa8f38b005a6e912.tar.lz
android_bootable_recovery-edee8361d75715b9bc020d76fa8f38b005a6e912.tar.xz
android_bootable_recovery-edee8361d75715b9bc020d76fa8f38b005a6e912.tar.zst
android_bootable_recovery-edee8361d75715b9bc020d76fa8f38b005a6e912.zip
Diffstat (limited to '')
-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