Help with Magisk module - Magisk

Hi,
It's nice you do not have to mod .prop files with Magisk module's system.prop .
But how do you mod .xml files ?
I'm struggling here...
Here is the bash I'd like to run, but it will need RW rights on /cust and /product
Code:
cp /cust/hw/eu/xml/hw_defaults.xml /cust/hw/eu/xml/hw_defaults.xml.BACKUP && cp /product/etc/xml/hw_launcher_default_config.xml /product/etc/xml/hw_launcher_default_config.xml.BACKUP && sed -ie 's/<integer settings.global.hw_4g_show="0" reset="true"/<integer settings.global.hw_4g_show="1" reset="true"/g; s/<string app_name_two_lines="false"/<string app_name_two_lines="true"/g; s/<string hw_add_4g_only="250"/<string hw_add_4g_only="208"/g; s/<string hw_data_roam_option="26006,27211"/<string hw_data_roam_option="ALL"/g' /cust/hw/eu/xml/hw_defaults.xml && sed -ie 's/<item name="config_desktopCellsOptionItems" reset="true">4x5,4x4,5x4,5x5</<item name="config_desktopCellsOptionItems" reset="true">4x6,4x5,4x4,5x4,5x5,5x6</g; s/<item name="config_IconTitleSize">12</<item name="config_IconTitleSize">9</g' /product/etc/xml/hw_launcher_default_config.xml
Any idea where to put this code into my magisk module ?
How should I'll be able to replace, via terminal cmds, files on /product & /cust (oreo huawei device)

oslo83 said:
Hi,
It's nice you do not have to mod .prop files with Magisk module's system.prop .
But how do you mod .xml files ?
I'm struggling here...
Here is the bash I'd like to run, but it will need RW rights on /cust and /product
Code:
cp /cust/hw/eu/xml/hw_defaults.xml /cust/hw/eu/xml/hw_defaults.xml.BACKUP && cp /product/etc/xml/hw_launcher_default_config.xml /product/etc/xml/hw_launcher_default_config.xml.BACKUP && sed -ie 's/<integer settings.global.hw_4g_show="0" reset="true"/<integer settings.global.hw_4g_show="1" reset="true"/g; s/<string app_name_two_lines="false"/<string app_name_two_lines="true"/g; s/<string hw_add_4g_only="250"/<string hw_add_4g_only="208"/g; s/<string hw_data_roam_option="26006,27211"/<string hw_data_roam_option="ALL"/g' /cust/hw/eu/xml/hw_defaults.xml && sed -ie 's/<item name="config_desktopCellsOptionItems" reset="true">4x5,4x4,5x4,5x5</<item name="config_desktopCellsOptionItems" reset="true">4x6,4x5,4x4,5x4,5x5,5x6</g; s/<item name="config_IconTitleSize">12</<item name="config_IconTitleSize">9</g' /product/etc/xml/hw_launcher_default_config.xml
Any idea where to put this code into my magisk module ?
How should I'll be able to replace, via terminal cmds, files on /product & /cust (oreo huawei device)
Click to expand...
Click to collapse
Hello,
If you are already aware that these modifications will be in the actual filesystems and not masked by Magisk, you can put that code into config.sh as a function and call that from update-binary.
Regards.

Thanks
JayminSuthar said:
If you are already aware that these modifications will be in the actual filesystems and not masked by Magisk
Click to expand...
Click to collapse
I am aware it will mod the actual files but i'm not sure how with magiskmodule I could mod some files AND THEN straighly use them to mask the originals.
JayminSuthar said:
, you can put that code into config.sh as a function and call that from update-binary.
Click to expand...
Click to collapse
You kind of lost me
I previously tried with post-fs-data.sh but i think my problem is i can't mod these file but i can make temporary copies somewhere (need to find where) then erase originals and then move temporary copies where originals where.
Instead of just should use something like:
Code:
sed -e 's/. /. /g' originalfile > /tmp/file.bak
rm originalfile
mv /tmp/file.bak originalfile

If I understand you correctly, /cust and /product are directly in the root of your device, not in /system? In that case you can't use Magisk to Magic Mount the files. That can only be done to /system or /vendor.
You should be able to edit the files in place though, you'll just have to mount the partitions as rw (and then back to ro when you're done). Something like this (but check the command syntax first, I don't know it fully from memory):
Code:
mount -o rw,remount /cust
<Do your thing here>
mount -o ro,remount /cust

Didgeridoohan said:
If I understand you correctly, /cust and /product are directly in the root of your device, not in /system? In that case you can't use Magisk to Magic Mount the files. That can only be done to /system or /vendor.
You should be able to edit the files in place though, you'll just have to mount the partitions as rw (and then back to ro when you're done). Something like this (but check the command syntax first, I don't know it fully from memory):
Code:
mount -o rw,remount /cust
<Do your thing here>
mount -o ro,remount /cust
Click to expand...
Click to collapse
You caught it up, I forgot about the rootfs being ro

I'll try and report.

It worked, thank you very much.
Now I'm facing some problem to make a module submission...
Code:
Bad Request:*https://github.com/oslo83/EMUI_Tap2wake*is not a valid Magisk Module!
Reason:*module.prop*does not exist on*masterbranch
....

Related

Wifi Fix for updater script to flash ROMs

Just got done chatting with Hashcode about the wifi not working when flashing a ROM using SS3.
Here's the fix:
Change the line in the updater script that reads:
"/system/lib/modules/wlan.ko"
To this:
" /system/lib/modules/prima/prima_wlan.ko"
Done!
What exactly does this mean? Is wifi now working on the razr hd rom?
Sent from my Motorola Atrix HD MB886
Aman27deep said:
What exactly does this mean? Is wifi now working on the razr hd rom?
Sent from my Motorola Atrix HD MB886
Click to expand...
Click to collapse
If you edit the updater script as mentioned above it should according to hashcode
Actually, the exact fix for wifi if you already have the ROM installed is (doing this from adb):
su
mount -o remount,rw /system
rm /system/lib/modules/wlan.ko
ln -s /system/lib/modules/prima/prima_wlan.ko /system/lib/modules/wlan.ko
mount -o remount,ro /system
exit
Or if you want to fix the updater-script in the flash.zip:
Change the following line:
symlink("/system/lib/modules/prima/prima", "/system/lib/modules/wlan.ko");
to:
symlink("/system/lib/modules/prima/prima_wlan.ko", "/system/lib/modules/wlan.ko");
If someone could confirm that wifi is working on the AHD after this fix, that would be great! Thanks.
Hashcode said:
Actually, the exact fix for wifi if you already have the ROM installed is (doing this from adb):
su
mount -o remount,rw /system
rm /system/lib/modules/wlan.ko
ln -s /system/lib/modules/prima/prima_wlan.ko /system/lib/modules/wlan.ko
mount -o remount,ro /system
exit
Or if you want to fix the updater-script in the flash.zip:
Change the following line:
symlink("/system/lib/modules/prima/prima", "/system/lib/modules/wlan.ko");
to:
symlink("/system/lib/modules/prima/prima_wlan.ko", "/system/lib/modules/wlan.ko");
If someone could confirm that wifi is working on the AHD after this fix, that would be great! Thanks.
Click to expand...
Click to collapse
I didn't feel the need to put the entire line in, as if they couldn't figure out which line it was from what I posted, they had no business editing an updater script lol
Thanks for the fix for installed ROMs as well Hash!
Here's your quote from the page:
"So there's a symlink wrong for /system/lib/modules/wlan.ko it needs to point to: /system/lib/modules/prima/prima_wlan.ko
(I typo'd this in the script to: /system/lib/modules/prima/prima)
I'll rebuild the ROM and upload a corrected version "
http://www.droidrzr.com/index.php/t...ock-for-safestrap/page__p__136918#entry136918
Hashcode said:
Actually, the exact fix for wifi if you already have the ROM installed is (doing this from adb):
su
mount -o remount,rw /system
rm /system/lib/modules/wlan.ko
ln -s /system/lib/modules/prima/prima_wlan.ko /system/lib/modules/wlan.ko
mount -o remount,ro /system
exit
Or if you want to fix the updater-script in the flash.zip:
Change the following line:
symlink("/system/lib/modules/prima/prima", "/system/lib/modules/wlan.ko");
to:
symlink("/system/lib/modules/prima/prima_wlan.ko", "/system/lib/modules/wlan.ko");
If someone could confirm that wifi is working on the AHD after this fix, that would be great! Thanks.
Click to expand...
Click to collapse
Confirmed working!
Hashcode said:
Actually, the exact fix for wifi if you already have the ROM installed is (doing this from adb):
su
mount -o remount,rw /system
rm /system/lib/modules/wlan.ko
ln -s /system/lib/modules/prima/prima_wlan.ko /system/lib/modules/wlan.ko
mount -o remount,ro /system
exit
Or if you want to fix the updater-script in the flash.zip:
Change the following line:
symlink("/system/lib/modules/prima/prima", "/system/lib/modules/wlan.ko");
to:
symlink("/system/lib/modules/prima/prima_wlan.ko", "/system/lib/modules/wlan.ko");
If someone could confirm that wifi is working on the AHD after this fix, that would be great! Thanks.
Click to expand...
Click to collapse
A more detailed explanation is ALWAYS the best, thanks hash.
It leads to less people borking things up and being ignored due to asking "inane" questions...
Sent from my MotoAHD
The fix does not work for me Atrix HD ATT
HELP
Hashcode said:
Actually, the exact fix for wifi if you already have the ROM installed is (doing this from adb):
su
mount -o remount,rw /system
rm /system/lib/modules/wlan.ko
ln -s /system/lib/modules/prima/prima_wlan.ko /system/lib/modules/wlan.ko
mount -o remount,ro /system
exit
Or if you want to fix the updater-script in the flash.zip:
Change the following line:
symlink("/system/lib/modules/prima/prima", "/system/lib/modules/wlan.ko");
to:
symlink("/system/lib/modules/prima/prima_wlan.ko", "/system/lib/modules/wlan.ko");
If someone could confirm that wifi is working on the AHD after this fix, that would be great! Thanks.
Click to expand...
Click to collapse
Hello and thanks for the info. But howw exactly do I put the code on adb? Im not a pro in this and I wanna test it, and yes I'm a little late
On what rom you want to try this?

How to get root access from kernel, with no busybox and not building any sources

Hi folks,
On my way trying to get 10 usefull posts to access the developers forums, I have writen this easy tutorial. xD
THIS IS FOR S5830i DEVICES. init.rc used belongs to S5830i ramdisk
Whats all about? Well, in this tutorial I will so you how to get root access directly from Kernel only modifing init.rc and adding su to tmp folder.
THIS IS NOT UNSECURING THE BOOT.IMG TUTORIAL
Question: Axyllum why are you posting this, if there are so many tutorials on how to do this for other devices?
Answer: Simple, as you all ready imagine, partition for boot.img is just 5MB Oh my god.
Then, if my boot image is all ready 4.28MB, how can I use a busybox thats 836KB (I compiled a busybox with mount, cp, mkdir, chmod and chown that is the minimum to get root: image = 836MB). Cant use this beacuse I exceed total mounting point size.
Kernel + ramdisk = 4.28MB if you pull stock boot.img from your device.
Minimum busybox explained before = 836KB
SU image 25KB to 86KB depending on the su image you use.
This makes a total of: 5.2MB. Try to flash it. It fails? Yes, you exceeded the mounting point size.
And the solution? Follow my tutorial.
Abilites you will need to follow the turotrial:
Know how to: Un pack & repack boot.img
Know how to: Decompress Ramdisk and compress it back. (to get the famous newramdisk in many many tutorials) newramdisk is just a name, you can compress back to any name, for example axyllumramdisk or yourramdisk or how ever you want to call it.
Asuming you know how to do the explained above and after my wierd chat, lets gooooo:
1. Open init.rc in your favourite text editor.
2. Go to this line in init.rc:
mount rfs /dev/stl9 /system check=no
You should see this:
mount rfs /dev/stl9 /system check=no
mount rfs /dev/stl9 /system ro remount
Got it? lets go to step 3.
3. Overwrite both lines with this:
mount rfs /dev/stl9 /system check=no
mkdir /system/xbin
copy /tmp/su /system/xbin/su
chown root root /system/xbin/su
chmod 06755 /system/xbin/su
mount rfs /dev/stl9 /system ro remount
Make sure you are not overwriting other lines or your ramdisk could not work.
4. Paste SU image file to tmp folder. Make sure SU image has execute permissions.
5. Compress back ramdisk (the famous newramdisk).
6. Repack boot.img
7. Flash it.
8. Restart device.
9. Download superuser.apk and busybox form market and.... there you go you made your kernel with root access and no need of a busybox.
Ok, this was simple, but i imagine more than one will like to know what we did.
I'll explain:
As we cant add a busybox, how the hell am i going to mount system rw, mkdir xbin, cp su from tmp to xbin, chmod / chown permissions?
I started reading the init.rc file (i was bored and my wife wanted to go shopping --> no way i have an init.rc file to mess up with), and I saw many mkdir, copy, chmod etc... commands. (Opened a beer)
So i thought, great, there is all ready a busybox with the least i need to make this. Then why dont i use this preinstalled commands?
And i did this:
mount rfs /dev/stl9 /system check=no --> first I checked this, this instruction is where init.rc mounts system. At this point system is mounted RW.
mkdir /system/xbin --> Then as system is rw, I will create xbin folder. how? with mkdir comand.
copy /tmp/su /system/xbin/su --> Great I did not find a cp command, but found a "copy" command someware in init.rc. Search for it, you will see its used. Then why dont I use it to copy SU in tmp folder to the just created xbin folder? It worked.
chown root root /system/xbin/su --> Owner of su in xbin is: yes, root.
chmod 06755 /system/xbin/su --> Set the right permission to su. You need to chmod with 06755. --> 09364, 66666, 83823 will not work looooolll just a joke i imagine you all ready know what setting permissions is all about.
mount rfs /dev/stl9 /system ro remount --> Remount system with ro (this is the read only remount command).
I dont know if there are any other tutorials doing this, this way, i just did it my self. I Found tutorials on doing the same, but busybox, and .sh script and su were needed. To much for our small boot.img partition.
Enjoy.
Tip, dont mess your init.rc if you do not understand it.

[Pixel 3 android P ] how to use magisk to move file into /vendor partition

Hi everyone,
in pixel 2, I can get super su for adb shell, and can remount the system, /vendor partition
mount -o rw,remount -t auto /vendor
mount -o rw,remount -t auto /system
but in pixel 3 with magisk 18 or 19, I always fail to remount /vendor
blueline:/ # mount -o rw,remount -t auto /vendor
mount: '/dev/block/dm-1'->'/vendor': I/O error
I need to modify some file under/vendor/etc
I've disable Preserve AVB 2.0/dm-verity and Preserve forceencryption in advanced Settings from Magisk, unfortunately do no avail,
any idea is appreciated
misslebulletttttt said:
Hi everyone,
in pixel 2, I can get super su for adb shell, and can remount the system, /vendor partition
mount -o rw,remount -t auto /vendor
mount -o rw,remount -t auto /system
but in pixel 3 with magisk 18 or 19, I always fail to remount /vendor
blueline:/ # mount -o rw,remount -t auto /vendor
mount: '/dev/block/dm-1'->'/vendor': I/O error
I need to modify some file under/vendor/etc
I've disable Preserve AVB 2.0/dm-verity and Preserve forceencryption in advanced Settings from Magisk, unfortunately do no avail,
any idea is appreciated
Click to expand...
Click to collapse
This isn't working for me either. Tried with TWRP and regular module install. My changes to files on /vendor/etc just get overwritten. On magisk 18 and Pie.
If there's a Magisk mask active (modules magic mounting files) you might have issues if you want to do something other than systemless modifications.
The real partitions are found in /sbin/.magisk/mirror, you can try editing that. Or, editing in recovery (TWRP) should always work, since Magisk isn't active then.
loserinru said:
This isn't working for me either. Tried with TWRP and regular module install. My changes to files on /vendor/etc just get overwritten. On magisk 18 and Pie.
Click to expand...
Click to collapse
so do I, want to move some file to /vendor/etc, adb push definitely not working, so copy to /sdcard,
mount -o rw,remount -t auto /vendor
cp /sdcard/XXX /vendor,
however
mount -o rw,remount -t auto /vendor
always show mount: '/dev/block/dm-1'->'/vendor': I/O error,
tried with the movement in TWRP, but after booting into system, it's gone,
any other method to overcome ?
Didgeridoohan said:
If there's a Magisk mask active (modules magic mounting files) you might have issues if you want to do something other than systemless modifications.
The real partitions are found in /sbin/.magisk/mirror, you can try editing that. Or, editing in recovery (TWRP) should always work, since Magisk isn't active then.
Click to expand...
Click to collapse
Hi, I've copied the new file to sdcard, boot into TWRP, in TWRP do the file movement from sdcard to /vendor/etc with success, however, every time after booting into system, the modification is gone, same as the guy replied in the second thread,
any method for the movement is pretty appreciated
Magisk is not active in TWRP, so there's something else going on... Check /sbin/.magisk/mirror/vendor/etc if the modification is there, and take a look at the Magisk log (you'll need the Canary debug build for more verbose logging) if anything shows there.
Didgeridoohan said:
Magisk is not active in TWRP, so there's something else going on... Check /sbin/.magisk/mirror/vendor/etc if the modification is there, and take a look at the Magisk log (you'll need the Canary debug build for more verbose logging) if anything shows there.
Click to expand...
Click to collapse
I solved this by modifying the install script of Magisk,
if [ -z $KEEPVERITY ]; then
if $SYSTEM_ROOT; then
- KEEPVERITY=true
+ KEEPVERITY=false
ui_print "- System-as-root, keep dm/avb-verity"
else
KEEPVERITY=false
fi
fi
and install Magisk again in TWRP
this can help to disable dm-verity completely, now I can remount /vendor without I/O error
Didgeridoohan said:
If there's a Magisk mask active (modules magic mounting files) you might have issues if you want to do something other than systemless modifications.
The real partitions are found in /sbin/.magisk/mirror, you can try editing that. Or, editing in recovery (TWRP) should always work, since Magisk isn't active then.
Click to expand...
Click to collapse
Riiii I always do system edits threw twrp instead of Un mounting modules like viper and air audio plug-in and do systemless system edits threw the OS
Sent from my SM-J327P using Tapatalk

Question Fork Magisk for Vivo Devices

This post seeks attention of Senior XDA developers who are contributors of Magisk:
I have been struggling to fix Magisk mount and SU execution on VIVO devices.
Magisk issue #5148
VIVO/iQOO kernel restictions: "Operation not permitted" when executing `su` or mounting to `/system`, or bootloops if rooted · Issue #5148 · topjohnwu/Magisk
Device: iQOO Z1/VIVO X70 PRO/iQOO NEO3, and more Android version: N/A Magisk version name: N/A Magisk version code: N/A, but more serious since 24302 Magisk fails to mount /system on some Vivo/iQOO...
github.com
I am ready to work together to the best of my technical capacity.
I will pay for your test device and a special bounty for your hard work and development efforts.
Interested developers please reach out to me.
Actual problem is on Vivo devices only. Tested on Vivo Y33s and Y21.
When you call su, it returns: "Operation not permitted"
Trying to run /dev/xxxx/Magisk --daemon: "No daemon is currently running"
Previous attempts:
Problem seems to be SELinux policy, if you attempt to manually run from android debug builds, then the daemon is properly loaded.
2109:/dev/9Lgz # ./supolicy --magisk
Load policy from: /sys/fs/selinux/policy
2109:/dev/9Lgz # magisk --daemon
2109:/dev/9Lgz # magisk --path
/system/bin
2109:/dev/9Lgz # su
2109:/dev/9Lgz # id
uid=0(root) gid=0(root) groups=0(root),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),1078(ext_data_rw),1079(ext_obb_rw),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc),3011(uhid) context=u:r:magisk:s0
With this solution, the problem is that we need to run this from "adb root" shell after every boot.
Is there any way to run this locally on a the device having debug build?
Where should I post this thread to find the right developers to solve this problem?
I would highly appreciate some help here.
Maybe you can try change 'su' to 'suu' or 'timesu', as the [ref](http://bbs.ydss.cn/thread-1528844-1-1.html) said.
Good luck and success to you!
JuanLv said:
Maybe you can try change 'su' to 'suu' or 'timesu', as the [ref](http://bbs.ydss.cn/thread-1528844-1-1.html) said.
Good luck and success to you!
Click to expand...
Click to collapse
I tried but no luck (
Looking for developers who have good knowledge of Magisk mount and magiskinit.
NextGenMagisk said:
Looking for developers who have good knowledge of Magisk mount and magiskinit.
Click to expand...
Click to collapse
The developer has made restrictions in the kernel as ref
| https://github.com/topjohnwu/Magisk/issues/5148#issuecomment-1167697477
Maybe we can make a workaround by kernel patch.
I'm not too familiar with these.
Do you have any idea?
JuanLv said:
The developer has made restrictions in the kernel as ref
| https://github.com/topjohnwu/Magisk/issues/5148#issuecomment-1167697477
Maybe we can make a workaround by kernel patch.
I'm not too familiar with these.
Do you have any idea?
Click to expand...
Click to collapse
Thanks for the update. Looks like this issue is not easy to fix and it depends on access to kernel sources for each device model. I am not familiar with Kernel patching.
My ideas are focused around leveraging debug builds to execute SU locally and then make it persist across reboots.
NextGenMagisk said:
Is there any way to run this locally on a the device having debug build?
Click to expand...
Click to collapse
vivo y31, LineageOS 19.1, userdebug
magisk 24.3 can inject code in init.rc, can't mount /system /vendor /oem
magisk >24.3 can't inject code, because magisk switched to new method wich requires mounting /system. Zygisk is broken since 2431*
If you want to have adb root, then you can use phh-su(if you use gsi) and execute in termux
su -c setprop service.adb.root 1
su -c setprop service.adb.tcp.port 5555
su -c stop adbd
su -c start adbd
adb wait-for-device
adb shell whoami
Without phh-su you would need to split screen [termux + developer options/wifi debugging] and pair with code
one time in termux
adb pair localhostort code
no need to split screen anymore
then off -on wifi debugging
adb connect localhost:newport
adb root
off-on wifi debugging again
adb kill-server
adb connect localhost:newnewport
gz! you're root
Another way is to edit init.rc. Just look at magiskrc.inc from the source code.
I have no problems with zygisk and modules on 24.3 magisk. I just mounting overlayfs on top of /system and then just copy all modules into /system.
Here is my .rc script which I pushed in boot.img like this
./magiskboot unpack boot.img
./magiskboot cpio ramdisk.cpio 'add 0644 overlay.d/ofs.rc ofs.rc'
./magiskboot repack boot newboot.img
script
on load_persist_props_action
exec u:r:su:s0 -- /system/bin/mount -t overlay overlay -o lowerdir=/system,upperdir=/data/system/ou,workdir=/data/system/ow /system
on zygote-start
exec u:r:su:s0 -- /system/bin/mount /sbin/.magisk/zygisk/app_process32 /system/bin/app_process32
exec u:r:su:s0 -- /system/bin/mount /sbin/.magisk/zygisk/app_process64 /system/bin/app_process64
Then just create two folders
/data/system/ou
/data/system/ow
And copy modules files in upper layer(real system will not be modified)
su -c cp -r /sbin/.magisk/modules/*/system/* /system
If you need to revert changes then you can delete two folders and create them again. Or you can delete module files like this
cd /sbin/.magisk/modules/{Module Name}/system/
find -exec rm /system/{} \;
cd /data/system/ou
find . -type d -empty -delete
If you want to boot with real /system then just rename two folders
mount -t overlay
overlay on /system type overlay (rw,seclabel,relatime,lowerdir=/system,upperdir=/data/system/ou,workdir=/data/system/ow)
mount | grep " / "
/dev/block/dm-0 on / type ext4 (ro,seclabel,nodev,relatime,discard)
Pervokur said:
mount -t overlay
overlay on /system type overlay (rw,seclabel,relatime,lowerdir=/system,upperdir=/data/system/ou,workdir=/data/system/ow)
mount | grep " / "
/dev/block/dm-0 on / type ext4 (ro,seclabel,nodev,relatime,discard)
Click to expand...
Click to collapse
This is extremely helpful and has given me a very clear path to solve problems with Vivo root. I will implement these suggestions. Thanks a lot.
NextGenMagisk said:
This is extremely helpful and has given me a very clear path to solve problems with Vivo root. I will implement these suggestions. Thanks a lot.
Click to expand...
Click to collapse
Another tip from me. There is a way to have system rw for magisk root. At least it works for me on LOS19.1 userdebug gsi, vndklite variant, magisk24.3
Normaly
magisk-su: mount -o rw,remount /
operation not permitted
adb root:mount -o rw,remount /
ok
but / is still ro for magisk-su
Then I just kill surfaceflinger which leads to zygote restart(aka soft reboot)
su -c killall surfaceflinger
After booting / is rw for magisk-su and you can work with partition in file manager like Total Commander.
Pervokur said:
Another tip from me. There is a way to have system rw for magisk root. At least it works for me on LOS19.1 userdebug gsi, vndklite variant, magisk24.3
Normaly
magisk-su: mount -o rw,remount /
operation not permitted
adb root:mount -o rw,remount /
ok
but / is still ro for magisk-su
Then I just kill surfaceflinger which leads to zygote restart(aka soft reboot)
su -c killall surfaceflinger
After booting / is rw for magisk-su and you can work with partition in file manager like Total Commander.
Click to expand...
Click to collapse
Again a great tip, thanks!
I am currently testing your previous suggestions to inject custom init script on Y33s.
you can test this with adb root without editing boot.img or init.rc
NextGenMagisk said:
Again a great tip, thanks!
I am currently testing your previous suggestions to inject custom init script on Y33s.
Click to expand...
Click to collapse
adb shell
mount -t overlay overlay -o lowerdir=/system,upperdir=/data/system/ou,workdir=/data/system/ow /system
mount /sbin/.magisk/zygisk/app_process32 /system/bin/app_process32
mount /sbin/.magisk/zygisk/app_process64 /system/bin/app_process64
then restart zygote
killall surfaceflinger
zygote will restart, but mounts will still be there
Pervokur said:
you can test this with adb root without editing boot.img or init.rc
adb shell
mount -t overlay overlay -o lowerdir=/system,upperdir=/data/system/ou,workdir=/data/system/ow /system
mount /sbin/.magisk/zygisk/app_process32 /system/bin/app_process32
mount /sbin/.magisk/zygisk/app_process64 /system/bin/app_process64
Click to expand...
Click to collapse
mount overlay is working when executed from adb root.
but i cant get past the second step:
2109:/data/system/ow # mount /sbin/.magisk/zygisk/app_process32 /system/bin/app_process32
mount: '/sbin/.magisk/zygisk/app_process32'->'/system/bin/app_process32': No such file or directory
1|2109:/data/system/ow #
1|2109:/data/system/ow # mount /sbin/.magisk/zygisk/app_process64 /system/bin/app_process64
mount: '/sbin/.magisk/zygisk/app_process64'->'/system/bin/app_process64': No such file or directory
what must be causing this?
NextGenMagisk said:
mount overlay is working when executed from adb root.
but i cant get past the second step:
2109:/data/system/ow # mount /sbin/.magisk/zygisk/app_process32 /system/bin/app_process32
mount: '/sbin/.magisk/zygisk/app_process32'->'/system/bin/app_process32': No such file or directory
1|2109:/data/system/ow #
1|2109:/data/system/ow # mount /sbin/.magisk/zygisk/app_process64 /system/bin/app_process64
mount: '/sbin/.magisk/zygisk/app_process64'->'/system/bin/app_process64': No such file or directory
what must be causing this?
Click to expand...
Click to collapse
you didn't activate zygisk in magisk settings, so there are no files /sbin/.magisk/zygisk/app_process32
/sbin/.magisk/zygisk/app_process64
Pervokur said:
you didn't activate zygisk in magisk settings, so there are no files /sbin/.magisk/zygisk/app_process32
/sbin/.magisk/zygisk/app_process64
Click to expand...
Click to collapse
I cant enable it because Magisk daemon does not run at boot. Superuser tab in the app is greyed out.
testing this on a Vivo PD2147F debug build with Magisk patched boot and ofs.rc entry included.
NextGenMagisk said:
I cant enable it because Magisk daemon does not run at boot. Superuser tab in the app is greyed out.
testing this on a Vivo PD2147F debug build with Magisk patched boot and ofs.rc entry included.
Click to expand...
Click to collapse
even with magisk 24.3?
Pervokur said:
even with magisk 24.3?
Click to expand...
Click to collapse
Yes, patched magisk 24306. tmp dir with random name under /dev is created with root rights but the magic mount fails and hence the superuser tab is greyed out.
Magisk issue #5148
VIVO/iQOO kernel restictions: "Operation not permitted" when executing `su` or mounting to `/system`, or bootloops if rooted · Issue #5148 · topjohnwu/Magisk
Device: iQOO Z1/VIVO X70 PRO/iQOO NEO3, and more Android version: N/A Magisk version name: N/A Magisk version code: N/A, but more serious since 24302 Magisk fails to mount /system on some Vivo/iQOO...
github.com
Then you should manually add something like this to the end of init.rc
on load_persist_props_action
exec u:r:su:s0 -- /system/bin/mount -t overlay overlay -o lowerdir=/system,upperdir=/data/system/ou,workdir=/data/system/ow /system
on zygote-start
exec u:r:su:s0 -- /system/bin/mount /sbin/.magisk/zygisk/app_process32 /system/bin/app_process32
exec u:r:su:s0 -- /system/bin/mount /sbin/.magisk/zygisk/app_process64 /system/bin/app_process64
on post-fs-data
start logd
rm /dev/.magisk_unblock
start mqVxwb7J
wait /dev/.magisk_unblock 40
rm /dev/.magisk_unblock
service mqVxwb7J /sbin/magisk --post-fs-data
user root
seclabel u:r:magisk:s0
oneshot
service DC83jQtNHiJDw8 /sbin/magisk --service
class late_start
user root
seclabel u:r:magisk:s0
oneshot
on property:sys.boot_completed=1
start Zaw2TLXyH
service Zaw2TLXyH /sbin/magisk --boot-complete
user root
seclabel u:r:magisk:s0
oneshot

Question Renaming a system file?

I have a rooted Pixel 7 and It was suggested that I rename a system file to prevent the system from updating itself (despite my having turned off all such options). My first attempt was to merely try renaming the file, but that didn’t work because the file systems in mounted RO.
I did some looking around, and the common approach to dealing with this issue is to remount the file system. Following is a ‘screen grab’ of my abd session:
Code:
cheetah:/ $ su
cheetah:/ $ ls /product
app etc fonts framework lib lib64 lost+found media overlay priv-app tts usr wallpaper
(this has the directory I want, so this file system)
cheetah:/ $ mount | grep product
/dev/block/dm-15 on /product type ext4 (ro,seclabel,relatime)
(this is a mounted file system)
cheetah:/ # mount -o rw,remount /product
'/dev/block/dm-15' is read-only
cheetah:/ # mount -o rw,remount -t ext4 /product
'/dev/block/dm-15' is read-only
cheetah:/ # mount -o rw,remount /dev/block/dm-15 /product
'/dev/block/dm-15' is read-only
(three attempts to remount – all failed)
So, now what should I try?
groston said:
I have a rooted Pixel 7 and It was suggested that I rename a system file to prevent the system from updating itself (despite my having turned off all such options). My first attempt was to merely try renaming the file, but that didn’t work because the file systems in mounted RO.
I did some looking around, and the common approach to dealing with this issue is to remount the file system. Following is a ‘screen grab’ of my abd session:
Code:
cheetah:/ $ su
cheetah:/ $ ls /product
app etc fonts framework lib lib64 lost+found media overlay priv-app tts usr wallpaper
(this has the directory I want, so this file system)
cheetah:/ $ mount | grep product
/dev/block/dm-15 on /product type ext4 (ro,seclabel,relatime)
(this is a mounted file system)
cheetah:/ # mount -o rw,remount /product
'/dev/block/dm-15' is read-only
cheetah:/ # mount -o rw,remount -t ext4 /product
'/dev/block/dm-15' is read-only
cheetah:/ # mount -o rw,remount /dev/block/dm-15 /product
'/dev/block/dm-15' is read-only
(three attempts to remount – all failed)
So, now what should I try?
Click to expand...
Click to collapse
I haven't used this, but maybe it can help you.
Lughnasadh said:
I haven't used this, but maybe it can help you.
Click to expand...
Click to collapse
Thank you. Seems like this might work, but after reading several pages, I am not sure how to install/use overlayfs. I have a Windows system - any chance you could point me to something that provides some guidance?
groston said:
Thank you. Seems like this might work, but after reading several pages, I am not sure how to install/use overlayfs. I have a Windows system - any chance you could point me to something that provides some guidance?
Click to expand...
Click to collapse
I've never used this before but I believe once you flash the module it makes the /system RW so you can start making modifications. There's a README that provides some information. I don't know of any other guides besides the information on that Github page.
Checking out the thread below might reveal a solution and/or give a clue or hint...
Pixel 7 Pro Stuck in read only mode (rooted with magisk 26.1) Am I missing something? HELP
Everything ive tried in FX Explorer fails. No matter what I try, for example editing build.prop or anything else, it constantly says read only. i cannot use any method to allow write access. Did i miss something when i rooted with Magisk? I dont...
forum.xda-developers.com
simplepinoi177 said:
Checking out the thread below might reveal a solution and/or give a clue or hint...
Pixel 7 Pro Stuck in read only mode (rooted with magisk 26.1) Am I missing something? HELP
Everything ive tried in FX Explorer fails. No matter what I try, for example editing build.prop or anything else, it constantly says read only. i cannot use any method to allow write access. Did i miss something when i rooted with Magisk? I dont...
forum.xda-developers.com
Click to expand...
Click to collapse
Good suggestion. I installed FX File Explorer, gave it the appropriate permissions, but was unable to change the /product filesystem to read/write.
groston said:
Good suggestion. I installed FX File Explorer, gave it the appropriate permissions, but was unable to change the /product filesystem to read/write.
Click to expand...
Click to collapse
When you say "gave it the appropriate permissions", just to confirm -- that doesn't mean that you changed the security permissions on the folder & files, correct? I hope it means you did not do what the OP in that thread had done and actually did enable root access particularly (hoping that's what you meant on "gave it appropriate permissions").
Because, in certain cases, I've changed permissions on files/folders vs. simply enabling root access mode....
Apologies in advanced if my inquiry seems fairly obvious (to the point of insulting maybe; it is not meant to be), but you never know and many foolish things has been done/assumed on this site that missed many (obvious) things because it wasn't confirmed....

Categories

Resources