From f1a98db8fe40dd9be3206619ad3adbb432856af7 Mon Sep 17 00:00:00 2001 From: Bruno Martins Date: Sun, 16 Jun 2024 00:04:15 +0100 Subject: [PATCH] fixup! recovery: Add wipe system partition option Change-Id: I8808bc49f1dcb5e3f6edb2a33a9eec65aa241068 --- install/include/install/wipe_data.h | 3 ++- install/wipe_data.cpp | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/install/include/install/wipe_data.h b/install/include/install/wipe_data.h index 47a5a802..0890a4b0 100644 --- a/install/include/install/wipe_data.h +++ b/install/include/install/wipe_data.h @@ -31,4 +31,5 @@ bool WipeCache(RecoveryUI* ui, const std::function& confirm, bool WipeData(Device* device, bool keep_memtag_mode = false, std::string_view new_fstype = ""); // Returns true on success. -bool WipeSystem(RecoveryUI* ui, const std::function& confirm); +bool WipeSystem(RecoveryUI* ui, const std::function& confirm, + std::string_view new_fstype = ""); diff --git a/install/wipe_data.cpp b/install/wipe_data.cpp index 2b3b8c8a..f78a7fb6 100644 --- a/install/wipe_data.cpp +++ b/install/wipe_data.cpp @@ -162,13 +162,14 @@ bool WipeData(Device* device, bool keep_memtag_mode, std::string_view data_fstyp return success; } -bool WipeSystem(RecoveryUI* ui, const std::function& confirm_func) { +bool WipeSystem(RecoveryUI* ui, const std::function& confirm_func, + std::string_view new_fstype) { if (confirm_func && !confirm_func()) { return false; } 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"); return success; }