[Q] Any way to overcome write protection of /system? - HTC Butterfly

I unlocked bootloader, flashed recovery, flashed root. Things looked almost sweet and colorful, but here suddenly appears ugly bug (or feature?)
It is not possible to write anything to /system partition.
Ok, not exactly "impossible". It is possible. You remount partition for rw access and can write files, delete files, rename files. You can do whatever you want. But once you reboot, all changes magically disappear.
Which is pretty cool on the one hand, since nothing can write to system even after getting root access.
On the other hand, even if I want to write there, I have to reboot into recovery for that.
Does anyone know how to change this behavior?

SamePaul said:
I unlocked bootloader, flashed recovery, flashed root. Things looked almost sweet and colorful, but here suddenly appears ugly bug (or feature?)
It is not possible to write anything to /system partition.
Ok, not exactly "impossible". It is possible. You remount partition for rw access and can write files, delete files, rename files. You can do whatever you want. But once you reboot, all changes magically disappear.
Which is pretty cool on the one hand, since nothing can write to system even after getting root access.
On the other hand, even if I want to write there, I have to reboot into recovery for that.
Does anyone know how to change this behavior?
Click to expand...
Click to collapse
You need to flash a kernel with /system write enabled. There are stock kernels in the Development section that will help you.

Related

/ as rw all the time, is this a big deal?

I'm a big linux enthusiast and have done a lot of neato stuff with my phone, including installing JF 1.31! This forum is great! I have a question though ... in /init.rc, would it be a bad idea to comment out "mount rootfs rootfs / ro remount" to make / writable on boot? I don't see a reason why not besides the obvious you'll-fark-something-up deal, but I would presume that as long as you're not piddying in root all the time, no problem (just like on a "desktop" linux system). Or ... is Android really not designed at all to have / rw, so there's exterior security vulnerabilities, chances the native UI could render data loss, etc.?
synthead said:
I'm a big linux enthusiast and have done a lot of neato stuff with my phone, including installing JF 1.31! This forum is great! I have a question though ... in /init.rc, would it be a bad idea to comment out "mount rootfs rootfs / ro remount" to make / writable on boot? I don't see a reason why not besides the obvious you'll-fark-something-up deal, but I would presume that as long as you're not piddying in root all the time, no problem (just like on a "desktop" linux system). Or ... is Android really not designed at all to have / rw, so there's exterior security vulnerabilities, chances the native UI could render data loss, etc.?
Click to expand...
Click to collapse
You can make / all you like. You can even change all the files in / all you like. But once you reboot, all changes will be lost.
The / filesystem is stored as a .cpio.gz file in boot.img. When android boots, it loads this root filesystem into memory. Any changes afterwards are in memory only.
If you want to change any of the files in /, you have to extract the boot partition, extract the .cpio.gz image, unpack, modify, re .cpio.gz, repackage into a boot.img, then flash it to your phone.
See this thread for details.
edit: something like what he said
beartard said:
I wouldn't do it for the simple reason that you don't know what 3rd party apps are programmed to do if they find a writeable root. Yes, there is a whitelist, but you can't be too careful. It's not too much trouble to remount it when you want to mess around.
Click to expand...
Click to collapse
Heck, let applications change / all they won't. Someone should write a file system monitor that tracks any changes in /, just to be able to laugh at the applications that are trying to change it.
JesusFreke said:
You can make / all you like. You can even change all the files in / all you like. But once you reboot, all changes will be lost.
The / filesystem is stored as a .cpio.gz file in boot.img. When android boots, it loads this root filesystem into memory. Any changes afterwards are in memory only.
If you want to change any of the files in /, you have to extract the boot partition, extract the .cpio.gz image, unpack, modify, re .cpio.gz, repackage into a boot.img, then flash it to your phone.
See this thread for details.
Click to expand...
Click to collapse
Really! Bizarre! Wow ... I would have never guessed that. That really saves ass on data loss/corruption for dumb things I suppose, but ... WEIRD! It doesn't sound all that hard to modify things even still, but damn. Well, you answered my question. Thanks!

[Q] data folder changes permissions to ro

I'm trying to unbrick my a200. I've tried all the roms I could, but to no avail. One of the things I've been able to notice, is that if anything is done to /data (like mkdir) the rw permissions get changed to ro. This impedes anything that has to be pushed into the /data folder. This also means that I can't get a complete OS installed on the tab. Am I doing something wrong? Is there something I could do? Help on this subject would be very, very appreciated.

Question about recovery in twrp.

Have a question about the mount settings in my recovery. I know that target box means it is mounted/RW and untagged is unmounted/Ro. But my /system partition keeps getting set to Ro and when i need to flash things it needs to be on RW. Is that bc my device is Samsung and thereforth has protected bootloader set? I'v been reading trough script files and think i can adjust some of them so they mount as RW instead of Ro. I know that /system is set to RO bc of safe against accidental alteration/removement. But it would be much easier to flash or install updates/programs/apps/etc that way. Hope anyone can give some advice for me.
P.S. i use the ROM Toolbox Lite Scripter bc it has a lot standard scripts already and changing them is easy. And u can just copy that script into an Terminal Emulgator thats rooted and then run it to alter/install it so u can read back whats been changed?
A. Nieveen said:
Have a question about the mount settings in my recovery. I know that target box means it is mounted/RW and untagged is unmounted/Ro. But my /system partition keeps getting set to Ro and when i need to flash things it needs to be on RW. Is that bc my device is Samsung and thereforth has protected bootloader set? I'v been reading trough script files and think i can adjust some of them so they mount as RW instead of Ro. I know that /system is set to RO bc of safe against accidental alteration/removement. But it would be much easier to flash or install updates/programs/apps/etc that way. Hope anyone can give some advice for me.
P.S. i use the ROM Toolbox Lite Scripter bc it has a lot standard scripts already and changing them is easy. And u can just copy that script into an Terminal Emulgator thats rooted and then run it to alter/install it so u can read back whats been changed
Click to expand...
Click to collapse
Usually, the ROM updater script will mount/unmount system. I do not know if that is the case here.

Serious issues rooting!

Man, TWRP just refuses to flash root to my phone (L29c567b190) I've been able to get twrp on there with no issues, but I can't seem to get /system write access.
Flashing SuperSU reboots halfway through the process, and phh's Superuser simply fails with error 1.
Flashing an unencrypted boot img gets me a bootloop.
I've formatted data and reinstalled data files many a time, and no matter what I do, I can't seem to get the root to take.
I'm fairly happy with stock EMUI, It's nice. I just want the root for simple little things like forcing immersive mode, but mainly I want root on principle! It's my pocket computer and I WILL have administrator rights, you know?
Anyway, I've always had Samsung products and have a little experience in HTC stuff, but this issue is really throwing me for a loop!
dm-verity and decrypting my partitions are all new to me... What am I missing here?
Afaik, phhSuperUser method works by following algorithm.
- When installing it unpacks current boot image, makes changes in fstab, copies su binary, then repacks boot and flashes it onto the phone.
Script doesn't have checks. If you have modified boot already, script will fail. So you have to flash original boot before trying to get root/system writable.
Another note, Huawei can change something in boot in new versions of ROM, so script may fail where did not fail before.
Additionally, script works with one TWRP and fails with other.
So I actually got it using the files from this thread:
forum... xda---developers.. .com/mate-9/how-to/hacking-customizing-managing-huawei-t3589996
I had to downgrade twrp from 3.0.3-1 to 3.0.2-2, and it took the binaries from this person's Dropbox. I guess it was just a matter of finding the right files.
So, yeah, I guess you're absolutely right. Failed with one and not the other.

Magisk and /Systempartition rw???

Hey, thank you!
Yes, I really have some very important questions for someone who knows their stuff!
So: I have an almost unknown smartphone, a Beafon X5. With Android 7.0.
A great device, just for one.. "Modder" like me, a bit problematic, because absolutely no custom software can be found for it...
But now I've managed to trying Rootaccess For the device.. With your Awesome app, Mtk Easy root and magisk.
My questions :
# can I somehow change the /system/ directory to rwx 7777 for me? Because now it doesn't work, just because of the systemless root. (at least I think) The chown/chmod commands Not working.
It will be" read-only file system" every time printed. I just want to replace the boot animation.
# Question 2:
Why can I only use after every reboot, mtk-Easy-root again from new, to activate magisk?? Why didnt work magisk, Although the SU is insatlled? Only if the mtk script has been run before, I can use the superuser in the magisk Manager Serve.
Have you an idea for this Problem?
Thank you, and best wishes from germany!
by Felix
Rootbbit said:
Hey, thank you!
Yes, I really have some very important questions for someone who knows their stuff!
So: I have an almost unknown smartphone, a Beafon X5. With Android 7.0.
A great device, just for one.. "Modder" like me, a bit problematic, because absolutely no custom software can be found for it...
But now I've managed to trying Rootaccess For the device.. With your Awesome app, Mtk Easy root and magisk.
My questions :
# can I somehow change the /system/ directory to rwx 7777 for me? Because now it doesn't work, just because of the systemless root. (at least I think) The chown/chmod commands Not working.
It will be" read-only file system" every time printed. I just want to replace the boot animation.
# Question 2:
Why can I only use after every reboot, mtk-Easy-root again from new, to activate magisk?? Why didnt work magisk, Although the SU is insatlled? Only if the mtk script has been run before, I can use the superuser in the magisk Manager Serve.
Have you an idea for this Problem?
Thank you, and best wishes from germany!
by Felix
Click to expand...
Click to collapse
For question 1:
Android as a system (linux-like) mounts the system partition as ro (Read-only) by default when booting. In order to be able to modify it, you need to remount the desired partition as rw (read-write) as follows:
While being a root user (#) enter this command in adb or terminal on your phone:
Code:
mount -o rw,remount /system
To revert back to ro (you should do it after you're done), use:
Code:
mount -o ro,remount /system
For question 2:
That app is based on Mtk-su exploit. You can read an article from xda here. Basically, your device's bootloader stays locked, but root resets every reboot, because the attained privileges are only temporary. (su gets to run from /data/local/tmp).
Remember!!! You Bootloader is still locked, meaning AVB and dm-verity are still active. If you modify system (changing the total checksum), you will brick your device!!! And if you unlock the Bootloader, then what's the point of Mtk-su ..........
Hope I helped you somehow.
Schlank K:
Thank you, but I'm not a complete noobThank you, but I'm not a complete noob Thanks, really. But I tried these methods ed for a long time...
The same thing still happens, I mounted, there is no contradiction, but then nothing actually happened either...
Individual blocks can be mounted in the main directory, but not specifically the system/block. I actually only planned to do this stupid boot animation from the system/media folder. Delete/replace/rename/move zip, whatever, to finally get rid of the thing for my own ani...
And there it started. I've already spent several hours on the net to find a way. There are many options, but none have worked for me so far..
Looks like dm-verity is in effect. Disable it and then mount should work.
xXx yYy said:
Looks like dm-verity is in effect. Disable it and then mount should work.
Click to expand...
Click to collapse
Hey, thanks
I've already tried that. Detects my system Not.
AVB ( dm-verity ) is bootloader related. You typically use Fastboot to disable it.
Rootbbit said:
Hey, thanks
I've already tried that. Detects my system Not.
Click to expand...
Click to collapse
Rootbbit said:
Hey, thanks
I've already tried that. Detects my system Not.
Click to expand...
Click to collapse
In addition
xXx yYy said:
AVB ( dm-verity ) is bootloader related. You typically use Fastboot to disable it.
Click to expand...
Click to collapse
I've already tried that. My fastboot gets the same message. I have already tried the system block mounting, via dev/blocks/ but there I also get the read-only message.
Or mounting via busybox, I've already done everything.
I've googled a lot about it, and found nothing else that helps , otherwise I wouldn't have asked here on xda.
There are these read-only ROMs, how do I recognize them? Is ext4 not also read-only from manufacturer from
Thanks, guys
is your bootloader unlocked!?
you know disable-verity is adb applet, don't you?
you have been warned don't do this on locked bootloader. happy bricking..
btw there is such thing like magisk modules no need to modify system partition at all. just read the Magisk Developer Guides Module Tricks section

Categories

Resources