HuskyDG / magic_overlayfs

Make system partition become read-write (it is also possible without Magisk)
779 stars 197 forks source link

I need help renaming the addon.d folder using Magisk Overlayfs on a KernelSU rooted device #84

Closed averagePedestrian closed 2 weeks ago

averagePedestrian commented 2 weeks ago

Can anyone help me with using Magisk Overlayfs to rename the addon.d folder inside the /system directory? I want to rename this folder to prevent an app from detecting that I'm using a custom ROM.

If I set OVERLAY_MODE=0 and execute the command mount -o rw,remount /system/addon.d, it mounts the contents of the addon.d folder as read-write. This allows me to add, delete, and rename files within addon.d. However, it doesn't let me rename the folder itself. Additionally, attempting to mount /system does not work and results in error: mount: '/system' not in /proc/mounts.

Additional Info

Output of cat /proc/mounts | grep '/system'

/dev/block/dm-2 /system_ext ext4 ro,seclabel,relatime,discard 0 0
overlay /system_ext/lib64 overlay rw,seclabel,relatime,lowerdir=/system_ext,upperdir=/dev/mount_overlayfs/upper/system_ext,workdir=/dev/mount_overlayfs/worker/64770/2 0 0
overlay /system_ext/bin overlay rw,seclabel,relatime,lowerdir=/system_ext,upperdir=/dev/mount_overlayfs/upper/system_ext,workdir=/dev/mount_overlayfs/worker/64770/2 0 0
overlay /system_ext/etc overlay rw,seclabel,relatime,lowerdir=/system_ext,upperdir=/dev/mount_overlayfs/upper/system_ext,workdir=/dev/mount_overlayfs/worker/64770/2 0 0
overlay /system_ext/framework overlay rw,seclabel,relatime,lowerdir=/system_ext,upperdir=/dev/mount_overlayfs/upper/system_ext,workdir=/dev/mount_overlayfs/worker/64770/2 0 0
overlay /system_ext/usr overlay rw,seclabel,relatime,lowerdir=/system_ext,upperdir=/dev/mount_overlayfs/upper/system_ext,workdir=/dev/mount_overlayfs/worker/64770/2 0 0
overlay /system_ext/app overlay rw,seclabel,relatime,lowerdir=/system_ext,upperdir=/dev/mount_overlayfs/upper/system_ext,workdir=/dev/mount_overlayfs/worker/64770/2 0 0
overlay /system_ext/lost+found overlay rw,seclabel,relatime,lowerdir=/system_ext,upperdir=/dev/mount_overlayfs/upper/system_ext,workdir=/dev/mount_overlayfs/worker/64770/2 0 0
overlay /system_ext/priv-app overlay rw,seclabel,relatime,lowerdir=/system_ext,upperdir=/dev/mount_overlayfs/upper/system_ext,workdir=/dev/mount_overlayfs/worker/64770/2 0 0
overlay /system_ext/lib overlay rw,seclabel,relatime,lowerdir=/system_ext,upperdir=/dev/mount_overlayfs/upper/system_ext,workdir=/dev/mount_overlayfs/worker/64770/2 0 0
overlay /system/lib overlay rw,seclabel,relatime,lowerdir=/dev/mount_loop/3/system:/dev/mount_loop/1/system:/dev/mount_loop/0/system:/system,upperdir=/dev/mount_overlayfs/upper/system,workdir=/dev/mount_overlayfs/worker/64769/51 0 0
overlay /system/system_dlkm overlay rw,seclabel,relatime,lowerdir=/dev/mount_loop/3/system:/dev/mount_loop/1/system:/dev/mount_loop/0/system:/system,upperdir=/dev/mount_overlayfs/upper/system,workdir=/dev/mount_overlayfs/worker/64769/51 0 0
overlay /system/usr overlay rw,seclabel,relatime,lowerdir=/dev/mount_loop/3/system:/dev/mount_loop/1/system:/dev/mount_loop/0/system:/system,upperdir=/dev/mount_overlayfs/upper/system,workdir=/dev/mount_overlayfs/worker/64769/51 0 0
overlay /system/framework overlay rw,seclabel,relatime,lowerdir=/dev/mount_loop/3/system:/dev/mount_loop/1/system:/dev/mount_loop/0/system:/system,upperdir=/dev/mount_overlayfs/upper/system,workdir=/dev/mount_overlayfs/worker/64769/51 0 0
overlay /system/apex overlay rw,seclabel,relatime,lowerdir=/dev/mount_loop/3/system:/dev/mount_loop/1/system:/dev/mount_loop/0/system:/system,upperdir=/dev/mount_overlayfs/upper/system,workdir=/dev/mount_overlayfs/worker/64769/51 0 0
overlay /system/priv-app overlay rw,seclabel,relatime,lowerdir=/dev/mount_loop/3/system:/dev/mount_loop/1/system:/dev/mount_loop/0/system:/system,upperdir=/dev/mount_overlayfs/upper/system,workdir=/dev/mount_overlayfs/worker/64769/51 0 0
overlay /system/etc overlay rw,seclabel,relatime,lowerdir=/dev/mount_loop/3/system:/dev/mount_loop/1/system:/dev/mount_loop/0/system:/system,upperdir=/dev/mount_overlayfs/upper/system,workdir=/dev/mount_overlayfs/worker/64769/51 0 0
overlay /system/app overlay rw,seclabel,relatime,lowerdir=/dev/mount_loop/3/system:/dev/mount_loop/1/system:/dev/mount_loop/0/system:/system,upperdir=/dev/mount_overlayfs/upper/system,workdir=/dev/mount_overlayfs/worker/64769/51 0 0
overlay /system/addon.d overlay rw,seclabel,relatime,lowerdir=/dev/mount_loop/3/system:/dev/mount_loop/1/system:/dev/mount_loop/0/system:/system,upperdir=/dev/mount_overlayfs/upper/system,workdir=/dev/mount_overlayfs/worker/64769/51 0 0
overlay /system/bin overlay rw,seclabel,relatime,lowerdir=/dev/mount_loop/3/system:/dev/mount_loop/1/system:/dev/mount_loop/0/system:/system,upperdir=/dev/mount_overlayfs/upper/system,workdir=/dev/mount_overlayfs/worker/64769/51 0 0
overlay /system/lib64 overlay rw,seclabel,relatime,lowerdir=/dev/mount_loop/3/system:/dev/mount_loop/1/system:/dev/mount_loop/0/system:/system,upperdir=/dev/mount_overlayfs/upper/system,workdir=/dev/mount_overlayfs/worker/64769/51 0 0
overlay /system/fonts overlay rw,seclabel,relatime,lowerdir=/dev/mount_loop/3/system:/dev/mount_loop/1/system:/dev/mount_loop/0/system:/system,upperdir=/dev/mount_overlayfs/upper/system,workdir=/dev/mount_overlayfs/worker/64769/51 0 0