[Q] data folder changes permissions to ro - Android Software/Hacking General [Developers Only]

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.

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] question: super user access denied?

I am sorry if this has been covered someplace. ive searched for a while but cant find any answers that help me out.
also, i would like to thank the android developer community. you guys stinking rock. i love looking at all the stuff you have worked on and released. its cool that android users are willing to put in a lot of hard work and help other users out.
Problem: any app that requires super user to work has stopped working. my wireless tether wont start. shoot me wont work. type fresh wont either.
it worked about an hour ago. i did a nandroid. flashed a font. realized i couldnt use my root apps. restored just now and still cant use them. it seems odd that it suddenly stopped. could messing with the fonts damage something someplace?
i am thoroughly confused. i am a relative noob with all this developing stuff, but i have worked thru some problems on my own, with the help of guides and searches on here. i am comfortable with adb and all, but this confuses me pretty good.
any help or suggestions?
thanks in advance!
edit: ok, i did this
adb shell
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cd /system/bin
cat sh > su
chmod 4755 su
in adb. that restored wireless tether and shootme, but i still cant use type fresh. have i done something weird? and did flashing a font cause all that?
When you restored did you wipe everything first? it may have saved permissions that were changed when you installed the font... I would try a complete wipe and then restore (assuming you have a nandroid backup or something like it).

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

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.

[Completed] [Q] Modify build.prop

I have a Nexus 6 developer edition non rooted phone (build LRX210, phone from Google unsubsidized and not a carrier version). All my other Nexus phones I have rooted and put on a custom rom but this one I am trying to understand more about Android. I am a programmer but I have only done small test programs since I don't have any projects developing for a phone otherwise I would know more... Thanks in advance.
My questions are :
1) I want to modify the build.prop (or any file that is r/o) file but the file I assume is r/o and I can not modify it. How do I modify it? I have the developer tools installed and I have not tried to run "adb shell mount -o remount rw /system" to mount the drive to allow edit access.
2) I just don't understand the purpose of the rooting, etc unless you are putting a custom rom on etc. Am I missing something? A lot of people have said that they have rooted to gain access but I don't see the purpose. Can someone tell me why (besides enhancements in the operating system/roms)?
Thanks in advance
flaalh said:
I have a Nexus 6 developer edition non rooted phone (build LRX210, phone from Google unsubsidized and not a carrier version). All my other Nexus phones I have rooted and put on a custom rom but this one I am trying to understand more about Android. I am a programmer but I have only done small test programs since I don't have any projects developing for a phone otherwise I would know more... Thanks in advance.
My questions are :
1) I want to modify the build.prop (or any file that is r/o) file but the file I assume is r/o and I can not modify it. How do I modify it? I have the developer tools installed and I have not tried to run "adb shell mount -o remount rw /system" to mount the drive to allow edit access.
2) I just don't understand the purpose of the rooting, etc unless you are putting a custom rom on etc. Am I missing something? A lot of people have said that they have rooted to gain access but I don't see the purpose. Can someone tell me why (besides enhancements in the operating system/roms)?
Thanks in advance
Click to expand...
Click to collapse
Rooting Enables User To Access System Files. You Can Do Anything With System.
If You Want To Make Changes In Build.prop You Need To Root Your Phone , Install SuperUser And Then Make Changes

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.

Categories

Resources