-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor magic mount #7685
Refactor magic mount #7685
Conversation
ebbe342
to
45bcbaa
Compare
ca5f892
to
6bebf40
Compare
My magisk modules are detecting some original files from mirror while installing whether the rom is already have it or not. if we cannot detect the original files, then the second installations after reboot will produce wrong detections which result in my modules will think the rom is already have the file (even the file is from the module at the first installation, not from the original rom), the the module will not use the file again. In result, the second installation will lose the file. |
Lines 17 to 18 in a0b8aa4
.magisk is an internal directory, modules should not depend on it. I think it's better for the module to fix its incorrect behavior than to prevent magisk from developing |
For your case, you can use |
but and |
yes. but note that |
This comment was marked as off-topic.
This comment was marked as off-topic.
This command is deprecated but retained for compatibility reasons. You can replace it with the following script, which behave the same but support KSU. MAGISKTMP=/sbin
[ -d /sbin ] || MAGISKTMP=/debug_ramdisk |
40b336a
to
c5f2b43
Compare
c5f2b43
to
e782660
Compare
e46cdcd
to
8e7186e
Compare
e782660
to
0415c52
Compare
4a144b4
to
a0b5fa6
Compare
I think it can fix #6914 |
Mirror was previously used for accessing the original file during magic mount when we are using a tmpfs to cover the target. However, since we introduce atomic mount, we switch all tmpfs mount in worker and then move to the target at once. It means that we can still access the original file when we are constructing the tmpfs mount point. Thus we no longer need mirror.
I just wanted to make one final comment on the mirror removal matter... This is kinda too bad, since the mirror was an easy way to access and change the real partitions using root on devices that allow that, for both stock and custom ROMs. That's quite a loss of function for the affected older Android versions, or any ROM not using ext4-dedup/erofs and could still allow rw system. Yes, it was an "internal" feature, but it is a loss for root nonetheless. |
Just unmount all magic mounts in a new private mount namespace. I believe a developer using magisk's internal details should be able to do it. Because this is easier than using mirror and is a documented, supported method. |
Hmm what about in a module post-fs-data.sh or other script? |
magisk --denylist exec sh |
Oh wow, that's a very cool feature. Wasn't aware of it! Thanks! 🙌 |
Mirror was previously used for accessing the original file during magic mount when we are using a tmpfs to cover the target. However, since we introduce atomic mount, we switch all tmpfs mount in worker and then move to the target at once. It means that we can still access the original file when we are constructing the tmpfs mount point. Thus we no longer need mirror.