Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,770,879 Members 43,794 Now Online
XDA Developers Android and Mobile Development Forum

[FIXED] full r/w access via overlay filesystem

Tip us?
 
antweb
Old
(Last edited by antweb; 24th August 2010 at 12:08 AM.)
#1  
Junior Member - OP
Thanks Meter 0
Posts: 24
Join Date: Jan 2010
Lightbulb [FIXED] full r/w access via overlay filesystem

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.
 
Beaverman20
Old
#2  
Senior Member
Thanks Meter 5
Posts: 222
Join Date: 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
 
billias
Old
#3  
Member
Thanks Meter 2
Posts: 68
Join Date: Nov 2008
Quote:
Originally Posted by antweb View Post
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
Hosting Juice - The juicy way of hosting
 
daveba
Old
(Last edited by daveba; 7th August 2010 at 08:36 PM.)
#4  
Senior Member
Thanks Meter 61
Posts: 398
Join Date: Mar 2010
Location: Dubai
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
 
antweb
Old
#5  
Junior Member - OP
Thanks Meter 0
Posts: 24
Join Date: Jan 2010
Quote:
Originally Posted by daveba View Post
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 View Post
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 View Post
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.
 
daveba
Old
#6  
Senior Member
Thanks Meter 61
Posts: 398
Join Date: Mar 2010
Location: Dubai
Quote:
Originally Posted by antweb View Post
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' ?
 
billias
Old
#7  
Member
Thanks Meter 2
Posts: 68
Join Date: Nov 2008
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?
Hosting Juice - The juicy way of hosting
 
daveba
Old
#8  
Senior Member
Thanks Meter 61
Posts: 398
Join Date: Mar 2010
Location: Dubai
Quote:
Originally Posted by billias View Post
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.
 
daveba
Old
#9  
Senior Member
Thanks Meter 61
Posts: 398
Join Date: Mar 2010
Location: Dubai
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.
 
Nekromantik
Old
#10  
Senior Member
Thanks Meter 189
Posts: 4,238
Join Date: Apr 2010
Location: Worthing
Quote:
Originally Posted by daveba View Post
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?

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Calc+ is a Smart and Beautiful Android Calculator

As we’ve said inthe past, there are quite a few calculators available on Android. … more

Get Better Debug Data with Crash Report SDK

Developing an application is a hard and often times ungratifying task. It also requires quite a … more

Navigate to Your Favorite Places with LocationDetector

If you’re enjoying an active way of life, you probablytravel a lot, go fishing, … more

LifeStats Automatic Journal Keeps Tabs of Your Day

Most of us live very active lives. This is after all why we’re fans of mobile … more