From 53273ecce9119a988fdd959938d0d9dd64534420 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Fri, 9 Mar 2018 11:22:54 -0600 Subject: Don't rename twrp.fstab to recovery.fstab update_engine_sideload reads /etc/recovery.fstab during its install process and the twrp.fstab format may not be appropriate for what fs_mgr expects. Change-Id: I059ef22c0e862e60a3bffe5259f70c714fe33ec6 --- twrp.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'twrp.cpp') diff --git a/twrp.cpp b/twrp.cpp index 8c2a24f22..f72d691e8 100644 --- a/twrp.cpp +++ b/twrp.cpp @@ -116,17 +116,13 @@ int main(int argc, char **argv) { gui_init(); printf("=> Linking mtab\n"); symlink("/proc/mounts", "/etc/mtab"); - if (TWFunc::Path_Exists("/etc/twrp.fstab")) { - if (TWFunc::Path_Exists("/etc/recovery.fstab")) { - printf("Renaming regular /etc/recovery.fstab -> /etc/recovery.fstab.bak\n"); - rename("/etc/recovery.fstab", "/etc/recovery.fstab.bak"); - } - printf("Moving /etc/twrp.fstab -> /etc/recovery.fstab\n"); - rename("/etc/twrp.fstab", "/etc/recovery.fstab"); + std::string fstab_filename = "/etc/twrp.fstab"; + if (!TWFunc::Path_Exists(fstab_filename)) { + fstab_filename = "/etc/recovery.fstab"; } - printf("=> Processing recovery.fstab\n"); - if (!PartitionManager.Process_Fstab("/etc/recovery.fstab", 1)) { - LOGERR("Failing out of recovery due to problem with recovery.fstab.\n"); + printf("=> Processing %s\n", fstab_filename.c_str()); + if (!PartitionManager.Process_Fstab(fstab_filename, 1)) { + LOGERR("Failing out of recovery due to problem with fstab.\n"); return -1; } PartitionManager.Output_Partition_Logging(); -- cgit v1.2.3