Commit a73e7e9f authored by topjohnwu's avatar topjohnwu

Introduce new module mount implementation

Rewrite the whole module mounting logic from scratch.
Even the algorithm is different compared to the old one.

This new design focuses on a few key points:
- Modular: Custom nodes can be injected into the mount tree.
  It's the main reason for starting the rewrite (needed for Android 11)
- Efficient: Compared to the existing implementation, this is the most
  efficient (both in terms of computation and memory usage) design I
  currently can come up with.
- Accurate: The old mounting logic relies on handling specifically every
  edge case I can think of. During this rewrite I actually found some
  cases that the old design does not handle properly. This new design is
  architected in a way (node types and its rankings) that it should
  handle edge cases all by itself when constructing mount trees.
parent ab853e1f
...@@ -20,6 +20,7 @@ LOCAL_SRC_FILES := \ ...@@ -20,6 +20,7 @@ LOCAL_SRC_FILES := \
core/db.cpp \ core/db.cpp \
core/scripting.cpp \ core/scripting.cpp \
core/restorecon.cpp \ core/restorecon.cpp \
core/module.cpp \
magiskhide/magiskhide.cpp \ magiskhide/magiskhide.cpp \
magiskhide/proc_monitor.cpp \ magiskhide/proc_monitor.cpp \
magiskhide/hide_utils.cpp \ magiskhide/hide_utils.cpp \
......
This diff is collapsed.
This diff is collapsed.
...@@ -41,6 +41,7 @@ void unlock_blocks(); ...@@ -41,6 +41,7 @@ void unlock_blocks();
void post_fs_data(int client); void post_fs_data(int client);
void late_start(int client); void late_start(int client);
void boot_complete(int client); void boot_complete(int client);
void handle_modules();
void remove_modules(); void remove_modules();
/************* /*************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment