partitionmanager: Unlock every block partitions during setup

For example, Super volumes are read-only by default.

Change-Id: I0fc144842e42177d715c968bd1ee79e1406dae59
(cherry picked from commit d63fcaa879adc8f4be6ca2de3967e767c7542877)
This commit is contained in:
me-cafebabe
2022-07-28 03:19:20 +08:00
committed by bigbiff
parent bd2268aa01
commit f29cf9e84e
+3 -3
View File
@@ -303,6 +303,8 @@ void TWPartitionManager::Setup_Fstab_Partitions(bool Display_Error) {
Prepare_Super_Volume((*iter));
}
Unlock_Block_Partitions();
//Setup Apex before decryption
TWPartition* sys = PartitionManager.Find_Partition_By_Path(PartitionManager.Get_Android_Root_Path());
TWPartition* ven = PartitionManager.Find_Partition_By_Path("/vendor");
@@ -2834,8 +2836,6 @@ bool TWPartitionManager::Flash_Image(string& path, string& filename) {
full_filename = path + "/" + filename;
Unlock_Block_Partitions();
gui_msg("image_flash_start=[IMAGE FLASH STARTED]");
gui_msg(Msg("img_to_flash=Image to flash: '{1}'")(full_filename));
@@ -3550,7 +3550,7 @@ void TWPartitionManager::Unlock_Block_Partitions() {
continue;
}
if (ioctl(fd, BLKROSET, &OFF) == -1) {
LOGERR("Unable to unlock %s for flashing: %s\n", block_device.c_str());
LOGERR("Unable to unlock %s: %s\n", block_device.c_str());
continue;
}
close(fd);