diff options
Diffstat (limited to 'recovery.cpp')
-rw-r--r-- | recovery.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/recovery.cpp b/recovery.cpp index b8fc45f70..b1333eaa5 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -893,8 +893,15 @@ main(int argc, char **argv) { #ifdef TW_INCLUDE_INJECTTWRP // Back up TWRP Ramdisk if needed: + TWPartition* Boot = PartitionManager.Find_Partition_By_Path("/boot"); + LOGI("Backing up TWRP ramdisk...\n"); - system("injecttwrp --backup /tmp/backup_recovery_ramdisk.img"); + if (Boot == NULL || Boot->Current_File_System != "emmc") + system("injecttwrp --backup /tmp/backup_recovery_ramdisk.img"); + else { + string injectcmd = "injecttwrp --backup /tmp/backup_recovery_ramdisk.img bd=" + Boot->Actual_Block_Device; + system(injectcmd.c_str()); + } LOGI("Backup of TWRP ramdisk done.\n"); #endif |