topjohnwu / Magisk

The Magic Mask for Android
GNU General Public License v3.0
45.84k stars 11.54k forks source link

Magisk Modules Incompatible with overlayfs #2359

Closed androidacy-user closed 1 year ago

androidacy-user commented 4 years ago

I'm running OxygenOS 10.3.0 on a OnePlus 7 Pro, and the Debloat module is not replacing files in /product correctly.

The find command indicates it's doing what it should (eg $MODPATH/product/app/badapp/.replace) and magisk logs indicate it was replaced.

However, the app is still installed as a system app and using a root file manager to examine the folders, the actual contents (not what should be magic mounted) shows up.

Logs to follow.

Sent from my OnePlus 7 Pro using FastHub

androidacy-user commented 4 years ago

Magisk Logs Boot log

Sent from my OnePlus 7 Pro using FastHub

skittles9823 commented 4 years ago

Might want to give this module an install and see if that helps.

https://github.com/Magisk-Modules-Repo/overlayfix

androidacy-user commented 4 years ago

Refuses to install saying it's not needed

androidacy-user commented 4 years ago

Weird it installed this time around. However still no go.

skittles9823 commented 4 years ago

Hmm, must be a different issue to the one I was thinking about then.

Didgeridoohan commented 4 years ago

@linuxandria What's the output of cat /proc/mounts?

androidacy-user commented 4 years ago

This

Sent from my OnePlus 7 Pro using FastHub

Didgeridoohan commented 4 years ago

From what I can see it is the same issue that @Zackptg5's script is supposed to fix. You have an overlay of /product after the Magisk mounts, so that takes over and replaces anything Magisk related.

androidacy-user commented 4 years ago

I flashed said module as I already said and it didn't help

Zackptg5 commented 4 years ago

@linuxandria My module currently doesn't address replacements. Overlay mounts work by combining everything present in the lowerdirs. If you look at your mounted /product folder, you'll see the .replace file from your module and the original files as well.

I'm working on an update to address this. Hoping to get it working right this weekend when I get the chance to work on it

androidacy-user commented 4 years ago

@Zackptg5 nonetheless would be nice to see magisk natively support overlayfs as I'm sure with more devices launching with 10 (and obviously some upgrading to it), they will utilize it for sale of RO system setups.

Interestingly enough if I'm not mistaken, OnePlus has made /product entirely an overlayfs. Looks like it is actually located in /system/product

Zackptg5 commented 4 years ago

@linuxandria I would too. The trouble with oneplus's overlay implementation is that they do it when boot completes which is why magisk mounts are all effectively overwritten

Zackptg5 commented 4 years ago

@linuxandria Can you give this a go? Works fine for me Overlay_Mount_Fix_v1.2.zip

androidacy-user commented 4 years ago

@Zackptg5 well I no longer had to worry about it replacing files correctly..... .... because my device stopped booting.

About 2-3 sec into the boot process it completely froze, then would reboot, then would freeze again until I forced rebooting to bootloader via key combo.

Zackptg5 commented 4 years ago

From the overlay zip? It's just a service.d script that doesn't even run until it's about booted. Ugh, I don't get how there's such varying results with this

androidacy-user commented 4 years ago

@Zackptg5 I have absolutely no idea what OnePlus did here but you're script broke boot so badly my logging script never starts - meaning I don't even have logs.

Initially I blamed it on EdXposed because I just updated it but uninstalling that did no good.

And ofc disabling yours didn't completely work b/c you use /data/adb/service d. But yeah, stumps me as to why that'd kill the device too.

Zackptg5 commented 4 years ago

@linuxandria Just updated overlay fix in the mag repo. Completely redone from last version, no issues reported with it so give it a shot (it's different from the betas I dropped on TG).

androidacy-user commented 4 years ago

@Zackptg5 looks ok. Hopefully @topjohnwu can figure out a native fix.

osm0sis commented 4 years ago

Any improvement on this with the new module logic in 20405?

androidacy-user commented 4 years ago

Any improvement on this with the new module logic in 20405?

No improvement unfortunately

Kein commented 4 years ago

EDIT: after some digging looks like this is a bit different issue albeit related to mounts

techIndia-hacker commented 3 years ago

Any solution guys? I can't mount product in oneplus 8. Should i install the overlay module? Is it working?

techIndia-hacker commented 3 years ago

Ok the module works fine. Thanks

osm0sis commented 2 years ago

Could be worth trying with 24305, original init handles a lot more now

HuskyDG commented 1 year ago

This problem is not fixed yet

osm0sis commented 1 year ago

K. Can you provide fresh logs of Magisk interacting with overlayfs and failing to work as expected?

HuskyDG commented 1 year ago

K. Can you provide fresh logs of Magisk interacting with overlayfs and failing to work as expected?

This is not my problem, but someone on Telegram reports to me. I knew how Magic mount work. The mirrors of partitions don't include overlayfs so magisk won't know them to magic mount back

IMG_20221029_202138_344

If place files to /product/app using magicmount - all files dissapearing from this folder This most likely happens because when the system boots, many my_*/app partitions are mounted in /product/app using overlay.  And if you apply magic mount to /product/app, then mounting these many partitions breaks, so there is nothing in the /product/app folder.  Is there anything that can be done to avoid this?

tehcneko commented 1 year ago

Magisk breaks pangu overlays in MIUI 14.

overlay on /system/app type overlay (ro,seclabel,relatime,lowerdir=/mnt/vendor/mi_ext/system/app/:/product/pangu/system/app/:/system/app) overlay on /system/framework type overlay (ro,seclabel,relatime,lowerdir=/product/pangu/system/framework/:/system/framework) overlay on /system/etc/sysconfig type overlay (ro,seclabel,relatime,lowerdir=/mnt/vendor/mi_ext/system/etc/sysconfig/:/system/etc/sysconfig) overlay on /system/etc/permissions type overlay (ro,seclabel,relatime,lowerdir=/mnt/vendor/mi_ext/system/etc/permissions/:/product/pangu/system/etc/permissions/:/system/etc/permissions)