Lines Matching +full:mount +full:- +full:observe
8 * http://www.apache.org/licenses/LICENSE-2.0
34 #include <android-base/file.h>
35 #include <android-base/logging.h>
36 #include <android-base/parseint.h>
37 #include <android-base/properties.h>
38 #include <android-base/stringprintf.h>
39 #include <android-base/strings.h>
72 * /cache/recovery/command - INPUT - command line for tool, one arg per line
73 * /cache/recovery/log - OUTPUT - combined log file from recovery run(s)
76 * --update_package=path - verify install an OTA package file
77 * --install_with_fuse - install the update package with FUSE. This allows installation of large
79 * --wipe_data - erase user data (and cache), then reboot
80 * --prompt_and_wipe_data - prompt the user that data is corrupt, with their consent erase user
82 * --wipe_cache - wipe cache (but not user data), then reboot
83 * --show_text - show the recovery text menu, used by some bootloader (e.g. http://b/36872519).
84 * --set_encrypted_filesystem=on|off - enables / diasables encrypted fs
85 * --just_exit - do nothing; exit and reboot
93 * 2. main system writes "--wipe_data" to /cache/recovery/command
95 * 4. get_args() writes BCB with "boot-recovery" and "--wipe_data"
96 * -- after this, rebooting will restart the erase --
100 * -- after this, rebooting will restart the main system --
104 * 1. main system downloads OTA package to /cache/some-filename.zip
105 * 2. main system writes "--update_package=/cache/some-filename.zip"
107 * 4. get_args() writes BCB with "boot-recovery" and "--update_package=..."
108 * -- after this, rebooting will attempt to reinstall the update --
112 * -- after this, rebooting will (try to) restart the main system --
126 std::string locale = ui->GetLocale(); in FinishRecovery()
127 // Save the locale to cache, so if recovery is next started up without a '--locale' argument in FinishRecovery()
128 // (e.g., directly from the bootloader) it will use the last-known locale. in FinishRecovery()
132 LOG(ERROR) << "Failed to mount " << LOCALE_FILE; in FinishRecovery()
161 size_t chosen_item = device->GetUI()->ShowMenu( in yes_no()
171 size_t chosen_item = device->GetUI()->ShowPromptWipeDataConfirmationMenu( in ask_to_wipe_data()
190 "Reason: " + device->GetReason().value_or(""), in prompt_and_wipe_data()
192 // clang-format off in prompt_and_wipe_data()
197 // clang-format on in prompt_and_wipe_data()
199 size_t chosen_item = device->GetUI()->ShowPromptWipeDataMenu( in prompt_and_wipe_data()
211 CHECK(device->GetReason().has_value()); in prompt_and_wipe_data()
244 if (access(Paths::Get().temporary_log_file().c_str(), R_OK) == -1) { in choose_recovery_file()
257 chosen_item = device->GetUI()->ShowMenu( in choose_recovery_file()
267 device->GetUI()->ShowFile(entries[chosen_item]); in choose_recovery_file()
273 ui->ShowText(false); in run_graphics_test()
275 ui->SetProgressType(RecoveryUI::INDETERMINATE); in run_graphics_test()
276 ui->SetBackground(RecoveryUI::INSTALLING_UPDATE); in run_graphics_test()
279 ui->SetBackground(RecoveryUI::ERROR); in run_graphics_test()
282 ui->SetBackground(RecoveryUI::NO_COMMAND); in run_graphics_test()
285 ui->SetBackground(RecoveryUI::ERASING); in run_graphics_test()
289 ui->SetStage(1, 3); in run_graphics_test()
290 ui->SetBackground(RecoveryUI::INSTALLING_UPDATE); in run_graphics_test()
292 ui->SetStage(2, 3); in run_graphics_test()
293 ui->SetBackground(RecoveryUI::INSTALLING_UPDATE); in run_graphics_test()
295 ui->SetStage(3, 3); in run_graphics_test()
296 ui->SetBackground(RecoveryUI::INSTALLING_UPDATE); in run_graphics_test()
299 ui->SetStage(-1, -1); in run_graphics_test()
300 ui->SetBackground(RecoveryUI::INSTALLING_UPDATE); in run_graphics_test()
302 ui->SetProgressType(RecoveryUI::DETERMINATE); in run_graphics_test()
303 ui->ShowProgress(1.0, 10.0); in run_graphics_test()
307 ui->SetProgress(fraction); in run_graphics_test()
311 ui->ShowText(true); in run_graphics_test()
316 if (!update_bootloader_message({ "--reason=update_in_progress" }, &err)) { in WriteUpdateInProgress()
325 // Only prompt for non-A/B or Virtual A/B devices. in AskToReboot()
351 size_t chosen_item = device->GetUI()->ShowMenu( in AskToReboot()
360 // is to reboot or shutdown depending on if the --shutdown_after flag was passed to recovery.
362 auto ui = device->GetUI(); in PromptAndWait()
363 bool update_in_progress = (device->GetReason().value_or("") == "update_in_progress"); in PromptAndWait()
372 ui->SetBackground(RecoveryUI::NO_COMMAND); in PromptAndWait()
377 ui->SetBackground(RecoveryUI::ERROR); in PromptAndWait()
386 ui->SetProgressType(RecoveryUI::EMPTY); in PromptAndWait()
394 size_t chosen_item = ui->ShowMenu( in PromptAndWait()
395 headers, device->GetMenuItems(), 0, false, in PromptAndWait()
401 // Device-specific code may take some action here. It may return one of the core actions in PromptAndWait()
406 : device->InvokeMenuItem(chosen_item); in PromptAndWait()
424 if (!ui->IsTextVisible()) { in PromptAndWait()
439 if (ui->IsTextVisible()) { in PromptAndWait()
454 WipeCache(ui, ui->IsTextVisible() ? confirm_func : nullptr); in PromptAndWait()
455 if (!ui->IsTextVisible()) return Device::NO_ACTION; in PromptAndWait()
471 ui->ShowText(false); in PromptAndWait()
480 ui->Print("\nInstall from %s completed with status %d.\n", adb ? "ADB" : "SD card", status); in PromptAndWait()
487 if (!ui->IsTextVisible()) { in PromptAndWait()
491 ui->SetBackground(RecoveryUI::ERROR); in PromptAndWait()
492 ui->Print("Installation aborted.\n"); in PromptAndWait()
508 screen_ui->CheckBackgroundTextImages(); in PromptAndWait()
515 ui->Print("Virtual A/B: snapshot partitions creation failed.\n"); in PromptAndWait()
518 if (ensure_path_mounted_at(android::fs_mgr::GetSystemRoot(), "/mnt/system") != -1) { in PromptAndWait()
519 ui->Print("Mounted /system.\n"); in PromptAndWait()
550 if (!android::base::StartsWith(arg, "--retry_count")) { in set_retry_bootloader_message()
556 options.push_back(android::base::StringPrintf("--retry_count=%d", retry_count)); in set_retry_bootloader_message()
642 // null-terminated char* array, but without counting null as an arg (i.e. argv[argc] should be in start_recovery()
644 while ((arg = getopt_long(args_to_parse.size() - 1, args_to_parse.data(), "", OPTIONS, in start_recovery()
645 &option_index)) != -1) { in start_recovery()
698 printf("stage is [%s]\n", device->GetStage().value_or("").c_str()); in start_recovery()
699 printf("reason is [%s]\n", device->GetReason().value_or("").c_str()); in start_recovery()
701 auto ui = device->GetUI(); in start_recovery()
705 ui->SetSystemUpdateText(security_update); in start_recovery()
708 if (!device->GetStage().has_value() && in start_recovery()
709 sscanf(device->GetStage().value().c_str(), "%d/%d", &st_cur, &st_max) == 2) { in start_recovery()
710 ui->SetStage(st_cur, st_max); in start_recovery()
716 ui->SetTitle(title_lines); in start_recovery()
718 ui->ResetKeyInterruptStatus(); in start_recovery()
719 device->StartRecovery(); in start_recovery()
737 // to log the update attempt since update_package is non-NULL. in start_recovery()
741 ui->Print("battery capacity is not enough for installing package: %d%% needed\n", in start_recovery()
747 // Skip update-on-reboot when bootreason is kernel_panic or similar in start_recovery()
748 ui->Print("bootreason is in the blocklist; skip OTA installation\n"); in start_recovery()
780 ui->Print("Installation aborted.\n"); in start_recovery()
790 ui->Print("Retry attempt %d\n", retry_count); in start_recovery()
799 ui->ShowText(true); in start_recovery()
805 CHECK(device->GetReason().has_value()); in start_recovery()
813 ui->ShowText(true); in start_recovery()
814 ui->SetBackground(RecoveryUI::ERROR); in start_recovery()
817 ui->ShowText(false); in start_recovery()
830 // mode. When 'sideload-auto-reboot' is used, text display will NOT be turned on by default. And in start_recovery()
835 ui->ShowText(true); in start_recovery()
838 ui->Print("\nInstall from ADB complete (status: %d).\n", status); in start_recovery()
841 ui->Print("Rebooting automatically.\n"); in start_recovery()
846 ui->Print("\nInstall from ADB complete (status: %d).\n", status); in start_recovery()
852 ui->ShowText(true); in start_recovery()
855 ui->SetBackground(RecoveryUI::NO_COMMAND); in start_recovery()
859 ui->SetBackground(RecoveryUI::ERROR); in start_recovery()
860 if (!ui->IsTextVisible()) { in start_recovery()
866 // - If the state is INSTALL_REBOOT, device will reboot into the target as specified in in start_recovery()
868 // - If the recovery menu is visible, prompt and wait for commands. in start_recovery()
869 // - If the state is INSTALL_NONE, wait for commands (e.g. in user build, one manually boots in start_recovery()
871 // - In all other cases, reboot the device. Therefore, normal users will observe the device in start_recovery()
875 if (status == INSTALL_NONE || ui->IsTextVisible()) { in start_recovery()