Magisk icon indicating copy to clipboard operation
Magisk copied to clipboard

Magisk Modules Incompatible with overlayfs

Open androidacy-user opened this issue 5 years ago • 28 comments

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 avatar Jan 30 '20 01:01 androidacy-user

Magisk Logs Boot log

Sent from my OnePlus 7 Pro using FastHub

androidacy-user avatar Jan 30 '20 01:01 androidacy-user

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

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

skittles9823 avatar Jan 30 '20 03:01 skittles9823

Refuses to install saying it's not needed

androidacy-user avatar Jan 30 '20 03:01 androidacy-user

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

androidacy-user avatar Jan 30 '20 03:01 androidacy-user

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

skittles9823 avatar Jan 30 '20 03:01 skittles9823

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

Didgeridoohan avatar Jan 30 '20 11:01 Didgeridoohan

This

Sent from my OnePlus 7 Pro using FastHub

androidacy-user avatar Jan 30 '20 11:01 androidacy-user

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.

Didgeridoohan avatar Jan 30 '20 12:01 Didgeridoohan

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

androidacy-user avatar Jan 30 '20 12:01 androidacy-user

@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

Zackptg5 avatar Jan 31 '20 04:01 Zackptg5

@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

androidacy-user avatar Jan 31 '20 19:01 androidacy-user

@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 avatar Jan 31 '20 21:01 Zackptg5

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

Zackptg5 avatar Feb 01 '20 22:02 Zackptg5

@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.

androidacy-user avatar Feb 02 '20 00:02 androidacy-user

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

Zackptg5 avatar Feb 02 '20 06:02 Zackptg5

@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.

androidacy-user avatar Feb 02 '20 16:02 androidacy-user

@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).

Zackptg5 avatar Feb 14 '20 20:02 Zackptg5

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

androidacy-user avatar Feb 18 '20 18:02 androidacy-user

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

osm0sis avatar Apr 23 '20 05:04 osm0sis

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

No improvement unfortunately

androidacy-user avatar Apr 24 '20 00:04 androidacy-user

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

Kein avatar May 21 '20 02:05 Kein

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

techIndia-hacker avatar Sep 02 '20 03:09 techIndia-hacker

Ok the module works fine. Thanks

techIndia-hacker avatar Sep 02 '20 05:09 techIndia-hacker

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

osm0sis avatar Mar 22 '22 07:03 osm0sis

This problem is not fixed yet

HuskyDG avatar Oct 29 '22 13:10 HuskyDG

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

osm0sis avatar Oct 29 '22 13:10 osm0sis

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?

HuskyDG avatar Oct 29 '22 13:10 HuskyDG

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)

tehcneko avatar Dec 12 '22 03:12 tehcneko