From d3e575c77aec76020328263c4e49be0198ae0d39 Mon Sep 17 00:00:00 2001 From: Mohd Faraz Date: Mon, 2 Jan 2023 22:47:51 +0100 Subject: [PATCH] partitionmanager: don't treat non-existing logical partitions * As per google no. logical partitions can be increased or decreased. * eg. some devices updated to vendor_dlkm or odm_dlkm but their stock doesn't. * Fixes: No more error on device with vendor_dlkm in recovery fstab Mounting in custom OS. Change-Id: Ibb5019808ef4f69ff421b57aaeb24d91b8d34cef Signed-off-by: Mohd Faraz --- partitionmanager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/partitionmanager.cpp b/partitionmanager.cpp index 02a8e3189..81a14d17c 100755 --- a/partitionmanager.cpp +++ b/partitionmanager.cpp @@ -299,7 +299,8 @@ void TWPartitionManager::Setup_Fstab_Partitions(bool Display_Error) { else (*iter)->Has_Android_Secure = false; - if ((*iter)->Is_Super) Prepare_Super_Volume((*iter)); + if ((*iter)->Is_Super && !Prepare_Super_Volume(*iter)) + Partitions.erase(iter--); } Unlock_Block_Partitions(); @@ -4089,6 +4090,7 @@ bool TWPartitionManager::Prepare_All_Super_Volumes() { if ((*iter)->Is_Super) { if (!Prepare_Super_Volume(*iter)) { status = false; + Partitions.erase(iter--); } PartitionManager.Output_Partition(*iter); }