Velocity is Like OpenTable on Steroids

We all enjoy a night out with friends or our significant other from time to time. However, there is … more

Android Lollipop Lands for the Sony Xperia Z Ultra

The undisputed king of the beasts–at least in Sony’s current stable,is the … more

Android 5.0 Lollipop in 3D–EVO 3D, That Is!

It is that time of the year once again. Flowers bloom (or snow falls, depending on which … more

Gaming Console with Lollipop? Ouya Gets an Android TV Port

Android is a very flexible platform, and it can be used on a large variety of … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[FIXED] full r/w access via overlay filesystem

OP antweb

7th August 2010, 08:23 PM   |  #1  
OP Junior Member
Thanks Meter: 0
 
24 posts
Join Date:Joined: Jan 2010
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 01:08 AM.
7th August 2010, 08:27 PM   |  #2  
Senior Member
Thanks Meter: 5
 
223 posts
Join Date:Joined: Jul 2010
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, 08:47 PM   |  #3  
Member
Thanks Meter: 2
 
69 posts
Join Date:Joined: Nov 2008
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, 09:34 PM   |  #4  
Senior Member
Flag Dubai
Thanks Meter: 61
 
398 posts
Join Date:Joined: Mar 2010
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 09:36 PM.
7th August 2010, 10:58 PM   |  #5  
OP Junior Member
Thanks Meter: 0
 
24 posts
Join Date:Joined: Jan 2010
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, 06:38 AM   |  #6  
Senior Member
Flag Dubai
Thanks Meter: 61
 
398 posts
Join Date:Joined: Mar 2010
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, 10:27 AM   |  #7  
Member
Thanks Meter: 2
 
69 posts
Join Date:Joined: Nov 2008
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, 11:10 AM   |  #8  
Senior Member
Flag Dubai
Thanks Meter: 61
 
398 posts
Join Date:Joined: Mar 2010
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, 06:35 PM   |  #9  
Senior Member
Flag Dubai
Thanks Meter: 61
 
398 posts
Join Date:Joined: Mar 2010
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, 06:49 PM   |  #10  
Senior Member
Flag Worthing
Thanks Meter: 190
 
4,274 posts
Join Date:Joined: Apr 2010
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