fixup! recovery: Add wipe system partition option

Change-Id: I8808bc49f1dcb5e3f6edb2a33a9eec65aa241068
This commit is contained in:
Bruno Martins 2024-06-16 00:04:15 +01:00 committed by zlewchan
parent 86c4471e76
commit f1a98db8fe
2 changed files with 5 additions and 3 deletions

View file

@ -31,4 +31,5 @@ bool WipeCache(RecoveryUI* ui, const std::function<bool()>& confirm,
bool WipeData(Device* device, bool keep_memtag_mode = false, std::string_view new_fstype = ""); bool WipeData(Device* device, bool keep_memtag_mode = false, std::string_view new_fstype = "");
// Returns true on success. // Returns true on success.
bool WipeSystem(RecoveryUI* ui, const std::function<bool()>& confirm); bool WipeSystem(RecoveryUI* ui, const std::function<bool()>& confirm,
std::string_view new_fstype = "");

View file

@ -162,13 +162,14 @@ bool WipeData(Device* device, bool keep_memtag_mode, std::string_view data_fstyp
return success; return success;
} }
bool WipeSystem(RecoveryUI* ui, const std::function<bool()>& confirm_func) { bool WipeSystem(RecoveryUI* ui, const std::function<bool()>& confirm_func,
std::string_view new_fstype) {
if (confirm_func && !confirm_func()) { if (confirm_func && !confirm_func()) {
return false; return false;
} }
ui->Print("\n-- Wiping system...\n"); ui->Print("\n-- Wiping system...\n");
bool success = EraseVolume(android::fs_mgr::GetSystemRoot().c_str(), ui); bool success = EraseVolume(android::fs_mgr::GetSystemRoot().c_str(), ui, new_fstype);
ui->Print("System wipe %s.\n", success ? "complete" : "failed"); ui->Print("System wipe %s.\n", success ? "complete" : "failed");
return success; return success;
} }