From f60613b4e8cda91e9ca73c733ca8517af3264b41 Mon Sep 17 00:00:00 2001 From: cfig Date: Thu, 29 Aug 2019 13:17:28 +0800 Subject: [PATCH] fastboot: preserve partition_type if wants_wipe=true originally if wants_wipe=true, program will erase and format partitions, but after fb->Erase(), partition type should be raw(all 0xFFs), then following fb_perform_format() will miss its original partition_type Now we call fb_perform_format() with original fs type to keep the partition consistent after wiping. Change-Id: Ic778850588d5dd6fee23169d20c26bcbaa510627 --- fastboot/fastboot.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 5bd37e183..4737ae4d6 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -2058,10 +2058,10 @@ int FastBootTool::Main(int argc, char* argv[]) { if (partition == "userdata" && set_fbe_marker) { fprintf(stderr, "setting FBE marker on initial userdata...\n"); std::string initial_userdata_dir = create_fbemarker_tmpdir(); - fb_perform_format(partition, 1, "", "", initial_userdata_dir); + fb_perform_format(partition, 1, partition_type, "", initial_userdata_dir); delete_fbemarker_tmpdir(initial_userdata_dir); } else { - fb_perform_format(partition, 1, "", "", ""); + fb_perform_format(partition, 1, partition_type, "", ""); } } }