From 9d6feb53115e2dcc49a644400da4d62a16c1c3c6 Mon Sep 17 00:00:00 2001 From: Captain Throwback Date: Fri, 27 Jul 2018 10:05:24 -0400 Subject: twrp: use ANDROID_ROOT environment variable instead of hard-coded /system path I updated most of the references I found, but there might be more For devices that have to mount system at /system_root, this allows system to be bind mounted to /system and detected properly by TWRP Change-Id: I9f142fd8cec392f5b88e95476258dab9c21a9aac --- partition.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'partition.cpp') diff --git a/partition.cpp b/partition.cpp index 0272708cd..15fc4e307 100644 --- a/partition.cpp +++ b/partition.cpp @@ -431,7 +431,7 @@ bool TWPartition::Process_Fstab_Line(const char *fstab_line, bool Display_Error, } else if (Is_File_System(Fstab_File_System)) { Find_Actual_Block_Device(); Setup_File_System(Display_Error); - if (Mount_Point == "/system") { + if (Mount_Point == PartitionManager.Get_Android_Root_Path()) { Display_Name = "System"; Backup_Display_Name = Display_Name; Storage_Name = Display_Name; @@ -1487,7 +1487,7 @@ bool TWPartition::UnMount(bool Display_Error) { int never_unmount_system; DataManager::GetValue(TW_DONT_UNMOUNT_SYSTEM, never_unmount_system); - if (never_unmount_system == 1 && Mount_Point == "/system") + if (never_unmount_system == 1 && Mount_Point == PartitionManager.Get_Android_Root_Path()) return true; // Never unmount system if you're not supposed to unmount it if (Is_Storage && MTP_Storage_ID > 0) @@ -2607,7 +2607,7 @@ bool TWPartition::Restore_Tar(PartitionSettings *part_settings) { ret = true; #ifdef HAVE_CAPABILITIES // Restore capabilities to the run-as binary - if (Mount_Point == "/system" && Mount(true) && TWFunc::Path_Exists("/system/bin/run-as")) { + if (Mount_Point == PartitionManager.Get_Android_Root_Path() && Mount(true) && TWFunc::Path_Exists("/system/bin/run-as")) { struct vfs_cap_data cap_data; uint64_t capabilities = (1 << CAP_SETUID) | (1 << CAP_SETGID); -- cgit v1.2.3