FORUMS

SuperSU Beta Updates With Minor Fix For Galaxy S6

ChainFire’s root permissions app SuperSU has updated to v.2.49 to fix audits on … more

LG G4 Day Event Coverage: Specs, Features, Design & More!

LG has been teasing us with a countdown for a while now, and today it reached … more

Xposed Modules to Modify Email – XDA Xposed Tuesday

Even though we have Dropbox and other ways to share files, people still want … more

Google Teaches You to Use Wear Gestures

Now that the Watch Urbane is out with the latest firmware, we have new information regarding the … more
Post Reply Subscribe to Thread Email Thread

[FIXED] full r/w access via overlay filesystem

7th August 2010, 07:23 PM |#1  
OP Junior Member
Thanks Meter: 0
 
More
Hey guys!

Together with some others at android-hilfe.de I'm working on an overlay filesystem for the Desire.
We've chosen aufs (Another Unionfs) to implement our idea.

Basically, two filesystems are combined to a single one.
The first filesystem contains the initial data. The second one is used to overlap it.
Aufs first searches the second for files, then the first. We plan to use a fully writeable filesystem for the second and a secured filesystem for the first.
If you want to modify a file on the first partition, you can put it on the second filesystem and change it there.
So we can get indirect write access to the secured filesystem by mounting the aufs partition to the right path so that the system sees it as the original, secured filesystem.

In theory, a full r/w acces to the all partions on the phone could be possible.

Visit the project site for files and instructions.
Last edited by antweb; 24th August 2010 at 12:08 AM.
 
 
7th August 2010, 07:27 PM |#2  
Senior Member
Thanks Meter: 5
 
More
that is actually a pretty good idea... and would be awesome if it could be implemented i have no experience in android development and would therefore not be at much help there, but i could help you with testing, as i don't use my phone for any important stuff
7th August 2010, 07:47 PM |#3  
Member
Thanks Meter: 2
 
More
Quote:
Originally Posted by antweb

Hey guys!

Together with some guys at android-hilfe.de I'm working on an overlay filesystem for the Desire.
We've chosen aufs (Another Unionfs) to implement our idea.
.......
We still could use some help, as for now we are only 2 active developers.

Nice thought. Wish i could help
7th August 2010, 08:34 PM |#4  
Senior Member
Flag Dubai
Thanks Meter: 61
 
More
Great idea, and it seems it should work and will obviate the need for a eng-SPL.

Have you tried it ? You seem to have all the necessary bits (you don't really need the utils) so i'm not sure what else you need at this point. This should work with adb in normal mode (ie not recovery) as you should be able to remount the system ontop of itself like so:

adb shell

first to get to your desire root shell. Then do

insmod aufs2

Then create some persistent storage on your sdcard

mkdir /sdcard/sysrw

Then mount the dir

mount -t aufs -o br=/sdcard/sysrw=rw:/system=ro none /system

you should now be able to write to /system, so try doing a

touch /system/foo

If that works, you should be away.

Clearly your modules you provide above will be specific to a certain kernel and with so many ROMS out there i can't say it will work with the one i have so you can try and report back.

Putting the persistent storage on the sdcard means that when it is mounted via usb you will loose access to it and bad things will happen.

Also remember if this works you need to add this to your init scripts
Last edited by daveba; 7th August 2010 at 08:36 PM.
7th August 2010, 09:58 PM |#5  
OP Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by daveba

mount -t aufs -o br=/sdcard/sysrw=rw:/system=ro none /system

This step fails. All I get is
Code:
mount: No such Device
Quote:
Originally Posted by daveba

Clearly your modules you provide above will be specific to a certain kernel and with so many ROMS out there i can't say it will work with the one i have so you can try and report back.

Every ROM (with a custom kernel) will need some kernel patches anyways as otherwise many simbols are missing (and sure some other stuff, no clue what the aufs kernel patches do in detail). The attachements include a patched stock kernel. To try it out, you'll have to install the included kernel.

Quote:
Originally Posted by daveba

Also remember if this works you need to add this to your init scripts

Yep, thats the next step after I get a successful mount.
8th August 2010, 05:38 AM |#6  
Senior Member
Flag Dubai
Thanks Meter: 61
 
More
Quote:
Originally Posted by antweb

This step fails. All I get is

Code:
mount: No such Device

So it looks like the mount command doesn't accept 'none' as a non-device argument perhaps which i find strange since /proc is one of those also. Are you getting any messages from 'dmesg' or 'logcat' ?
8th August 2010, 09:27 AM |#7  
Member
Thanks Meter: 2
 
More
My basic question:

If we use more and more the SD card, i believe we will drain more and more battery.
Apps2sd, system2sd etc

Or it is not draining more battery the extended sd usage?
8th August 2010, 10:10 AM |#8  
Senior Member
Flag Dubai
Thanks Meter: 61
 
More
Quote:
Originally Posted by billias

My basic question:

If we use more and more the SD card, i believe we will drain more and more battery.
Apps2sd, system2sd etc

Or it is not draining more battery the extended sd usage?

Not much stuff gets written to /system constantly. Just a few changes so you shouldn't see much of a drain.
8th August 2010, 05:35 PM |#9  
Senior Member
Flag Dubai
Thanks Meter: 61
 
More
Ok, so it looks like this actually works. You can't put the rw partition on a VFAT sdcard partiton only. SO in theory if you make a ext{123} partition on your sdcard it should work. For now i tried with the writeable mtd /data partition on my CM nightly and all works. Look:

Code:
adb shell
modprobe aufs
lsmod (to check aufs worked)
mkdir /data/rw
mount -t aufs -o  br=/data/rw=rw:/system=ro none /system
(no errors here)
touch /system/foo (YES IT WORKED)
ls -l /system/foo 
-rw-rw-rw-    1 root     root             0 Aug  8 20:30 /system/foo
A writeable /system !!!
And here is the real data on /data/rw

Code:
 ls -l /data/rw/
-rw-rw-rw-    1 root     root             0 Aug  8 20:30 foo
In theory Metamorph, adblock and all the rest that require /system should now work as expected.
8th August 2010, 05:49 PM |#10  
Senior Member
Flag London
Thanks Meter: 196
 
More
Quote:
Originally Posted by daveba

Ok, so it looks like this actually works. You can't put the rw partition on a VFAT sdcard partiton only. SO in theory if you make a ext{123} partition on your sdcard it should work. For now i tried with the writeable mtd /data partition on my CM nightly and all works. Look:

Code:
adb shell
modprobe aufs
lsmod (to check aufs worked)
mkdir /data/rw
mount -t aufs -o  br=/data/rw=rw:/system=ro none /system
(no errors here)
touch /system/foo (YES IT WORKED)
ls -l /system/foo 
-rw-rw-rw-    1 root     root             0 Aug  8 20:30 /system/foo
A writeable /system !!!
And here is the real data on /data/rw

Code:
 ls -l /data/rw/
-rw-rw-rw-    1 root     root             0 Aug  8 20:30 foo
In theory Metamorph, adblock and all the rest that require /system should now work as expected.

could you try metamorph?
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes