From f5547386da41275c363be50b07e3b4c2f85d5078 Mon Sep 17 00:00:00 2001 From: LinkBoi00 <50962670+LinkBoi00@users.noreply.github.com> Date: Tue, 16 Nov 2021 08:56:12 +0200 Subject: [PATCH] action: Only unmount /vendor if it actually exists * Since commit 168bc4caaedfdf655a71ba24a1c5a7f2b905a122 the vendor partition gets unmounted prior to switching the slots. However, devices without a vendor partition (e.g. tissot's stock partition table) will have errors since the partition doesn't actually exist * Therefore, it should be only mounted if that partition exists in the partition table Change-Id: Id16ab55e25d05964ca0de1bf218914d66c2b0205 --- gui/action.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gui/action.cpp b/gui/action.cpp index 96727518..819e4ad8 100755 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -1942,15 +1942,15 @@ int GUIAction::setbootslot(std::string arg) { operation_start("Set Boot Slot"); if (!simulate) { - if (!PartitionManager.UnMount_By_Path("/vendor", false)) { - // PartitionManager failed to unmount /vendor, this should not happen, - // but in case it does, do a lazy unmount - LOGINFO("WARNING: vendor partition could not be unmounted normally!\n"); - umount2("/vendor", MNT_DETACH); - PartitionManager.Set_Active_Slot(arg); - } else { - PartitionManager.Set_Active_Slot(arg); + if (PartitionManager.Find_Partition_By_Path("/vendor")) { + if (!PartitionManager.UnMount_By_Path("/vendor", false)) { + // PartitionManager failed to unmount /vendor, this should not happen, + // but in case it does, do a lazy unmount + LOGINFO("WARNING: vendor partition could not be unmounted normally!\n"); + umount2("/vendor", MNT_DETACH); + } } + PartitionManager.Set_Active_Slot(arg); } else { simulate_progress_bar(); }