Best Alarm App for Android?

There are tons of choices to choose from when looking for a great alarm app for Android. While the stock … more

Unofficial CM12.1 Available for Moto E 2014

While Motorola is yet to release a final 5.0.2 build for the Moto E 2014, XDA Senior … more

Pinsy Brings Social Sketching To Your Watch & Phone

Did you watch Apple’s VP draw on his wrist during the Apple Watch announcement … more

CyanogenMod 12.1 for Samsung Galaxy S5

Android 5.1 is slowly putting its mark in the custom ROM world. CyanogenMod 12.1 is available to … 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
 
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 12:08 AM.
7th August 2010, 07: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, 07: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, 08: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 08:36 PM.
7th August 2010, 09: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, 05: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, 09: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, 10: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, 05: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, 05:49 PM   |  #10  
Senior Member
Flag Worthing
Thanks Meter: 195
 
4,371 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