kernel: Refactoring the mount point unloading logic
This commit is contained in:
@@ -1052,14 +1052,6 @@ void susfs_try_umount_all(uid_t uid) {
|
||||
ksu_try_umount("/data/adb/kpm", false, MNT_DETACH, uid);
|
||||
/* For both Legacy KSU and Magic Mount KSU */
|
||||
ksu_try_umount("/debug_ramdisk", true, MNT_DETACH, uid);
|
||||
ksu_try_umount("/sbin", false, MNT_DETACH, uid);
|
||||
|
||||
// try umount hosts file
|
||||
ksu_try_umount("/system/etc/hosts", false, MNT_DETACH, uid);
|
||||
|
||||
// try umount lsposed dex2oat bins
|
||||
ksu_try_umount("/apex/com.android.art/bin/dex2oat64", false, MNT_DETACH, uid);
|
||||
ksu_try_umount("/apex/com.android.art/bin/dex2oat32", false, MNT_DETACH, uid);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1140,18 +1132,24 @@ out_ksu_try_umount:
|
||||
// susfs come first, and lastly umount by ksu, make sure umount in reversed order
|
||||
susfs_try_umount_all(new_uid.val);
|
||||
#else
|
||||
|
||||
// fixme: use `collect_mounts` and `iterate_mount` to iterate all mountpoint and
|
||||
// filter the mountpoint whose target is `/data/adb`
|
||||
ksu_try_umount("/system", true, 0);
|
||||
ksu_try_umount("/system_ext", true, 0);
|
||||
ksu_try_umount("/vendor", true, 0);
|
||||
ksu_try_umount("/product", true, 0);
|
||||
ksu_try_umount("/data/adb/modules", false, MNT_DETACH);
|
||||
ksu_try_umount("/data/adb/kpm", false, MNT_DETACH);
|
||||
try_umount("/system", true, 0);
|
||||
try_umount("/vendor", true, 0);
|
||||
try_umount("/product", true, 0);
|
||||
try_umount("/system_ext", true, 0);
|
||||
|
||||
// try umount modules path
|
||||
try_umount("/data/adb/modules", false, MNT_DETACH);
|
||||
|
||||
// try umount kpm path
|
||||
try_umount("/data/adb/kpm", false, MNT_DETACH);
|
||||
|
||||
// try umount ksu temp path
|
||||
ksu_try_umount("/debug_ramdisk", false, MNT_DETACH);
|
||||
try_umount("/debug_ramdisk", false, MNT_DETACH);
|
||||
|
||||
// try umount ksu su path
|
||||
try_umount("/sbin", false, MNT_DETACH);
|
||||
|
||||
// try umount hosts file
|
||||
ksu_try_umount("/system/etc/hosts", false, MNT_DETACH);
|
||||
|
||||
Reference in New Issue
Block a user