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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user