FORUMS
Remove All Ads from XDA

[MOD] full r/w access via overlay filesystem (any ROM)

1,552 posts
Thanks Meter: 572
 
By BlaY0, Retired Recognized Developer on 3rd September 2010, 10:41 AM
Post Reply Email Thread
OK, here we go. Following the model from Desire thread, I made this one for Legend too.


Backgroud:

If I sum up some key points from this thread... there is no way of writing to system partition (Legend, Desire...) even if it is mounted in read-write mode. The only way of writing to system partition is via recovery mode (if you have already rooted your Legend) which makes a process of updating/testing a pain... you have to reboot your phone into recovery mode each time you want to change something on system partition. So guys at Desire subforum came up with an idea to put a writable overlay over the /system directory. This principle is very well known from live CD distros of Linux and Asus also introduced this on their EEE systems running Linux.

This method can be used not only on system partition (so we can "write" to it) but also on data partition which brings us really a neat way of point-in-time backup. Basically one could make overlay of an entire system just after the system was installed and set-up (with all software and custom settings). Then when anything goes wrong after this point, all one has to do is to wipe the directory/partition where writes were being made - no need to factory reset (wiping data partition), setting things up and installing all the apps all over again. This method can well be a better alternative of nandroid backup, because restoring from nandroid backup wipes out all partitions and restore data to them from images. And we all know that frequent repetition of this process really deteriorates non-removable NAND flash chips in our phones.


Contents:
  • shell script that does the actual /system overlay
  • statically compiled mount (for compatibility reasons)
  • auplink utility for flushing pseudo-links to writable device (not used atm)

Shell script that does the overlay is made so it can use any (first) ext2/3 partition on your sdcard. That means you can use your a2sd partition for overlay too. If a2sd is not active but you still have ext2/3 partition on your sdcard, it will be mounted and used for overlay. If you don't have ext2/3 partition on your sdcard, then internal data partition will be used instead. In this case you will have to be careful not to fill it up entirely.


Requirements:
  • rooted Legend of course
  • any kernel with built-in aufs support
  • busybox
  • run-parts integrated in init.rc script (/etc/init.d)
  • a2sd script should run before the overlay script (only if you use a2sd)

(When I mention a2sd in this post I mean any a2sd; a2sd, a2sd+, apps2sd, DarkTremor, LightSabre, GoldenThrone )


Quote:

Installation

Boot to recovery mode (ClockworkMod) and apply this update. After applying it (re)boot your phone. At this point overlay is not yet enabled. You have to issue:

Code:
adb shell aufs --enable
...to enable it and reboot your phone afterwards for changes to take effect.


Configuration

If you want to enable/disable overlay later on, issue:

Code:
adb shell aufs --disable
...to disable overlay or:

Code:
adb shell aufs --enable
...to enable overlay again. Reboot your phone for changes to take effect.

Be advised that after wiping (Factory data reset) overlay is disabled so you will have to enable it again.


Troubleshooting

Make logcat of boot process and check for errors in 1st 50 or so lines.

Quote:

Warning!!!

Please, do not even try to flash this "update" if you don't know what you are doing or what things I mentioned above mean!!!

Attached Files
File Type: zip aufs_no_kernel.zip - [Click for QR Code] (189.1 KB, 800 views)
The Following 6 Users Say Thank You to BlaY0 For This Useful Post: [ View ] Gift BlaY0 Ad-Free
 
 
3rd September 2010, 10:51 AM |#2  
BlaY0's Avatar
OP Retired Recognized Developer
Flag Medvode
Thanks Meter: 572
 
More
Changelog
0.7 (December 16, 2010)
  • compatibility enhancements
  • some minor changes

0.6.1 (December 2, 2010)
  • script is now calling e2fsck or e2fsck_recvy

0.6 (December 1, 2010)
  • dropped auplink binary
  • some more error handling
  • changed installation script

0.5.1 (October 4, 2010)
  • minor change in installation script

0.5 (October 4, 2010)
  • added enable/disable ability (dumfaq was here also)
  • improved error handling

0.4 (September 30, 2010)
  • updated aufs script to check if aufs support is already on
  • added statically compiled mount to support mount-move on any ROM

0.3 (September 28, 2010)
  • updated aufs script to check presence of /data/local/dosysoverlay file (to enable/disable)

0.2 (September 20, 2010)
  • updated aufs script to check availability of ext partition on SD card (thanks to dumfaq)

0.1 (September 3, 2010)
  • initial release
The Following User Says Thank You to BlaY0 For This Useful Post: [ View ] Gift BlaY0 Ad-Free
3rd September 2010, 12:51 PM |#3  
Senior Member
Flag Genova
Thanks Meter: 2
 
More
Wow impressive..
I'll try to include into my rom!

Thank you so much!
3rd September 2010, 01:20 PM |#4  
Senior Member
Flag Odense
Thanks Meter: 59
 
Donate to Me
More
This sounds very good... But please enlighten me...

Will this only work on stock/modified stock roms.. or will this work on CM6 roms also? (Azure 1.0 etc.)
3rd September 2010, 01:24 PM |#5  
BlaY0's Avatar
OP Retired Recognized Developer
Flag Medvode
Thanks Meter: 572
 
More
Hey Neon, this would certainly overwrite your OC kernel.

But you can always build your own with aufs support and use my overlay script (maybe you'll find some glitch in it ).

I would just ask you to consider putting init.d into /data/local (making symlink in /system/etc). That would ease up adding/removing/chmoding scripts inthere. I think this approach is very handy.

I have put together a little script that would look for init.d link or directory in /system/etc (or directory in /data/local) and then decide to make /data/local/init.d directory or not.

Quote:
Originally Posted by whitetigerdk

This sounds very good... But please enlighten me...

Will this only work on stock/modified stock roms.. or will this work on CM6 roms also? (Azure 1.0 etc.)

It would work on CM6 too, but you would have to copy WiFi module from stock ROM, because I didn't include it in this update. But bare in mind that CM6 is based on kernel 2.6.32 and above and we are talking 2.6.29 here!
3rd September 2010, 01:34 PM |#6  
BlaY0's Avatar
OP Retired Recognized Developer
Flag Medvode
Thanks Meter: 572
 
More
Ahh one more thing. CM6 kernel should already contain AUFS support (if I'm not mistaken) so you could use just my overlay loading script and auplink binary.
3rd September 2010, 03:51 PM |#7  
Learners Lisence's Avatar
Senior Member
Thanks Meter: 4
 
More
Blayo, an alternative way for nandroid backup sounds really interesting. if included in the rom along with a few further instructions Im sure it could be brought down to the level of no-obs. Ill wait till puppy is 100% tested
3rd September 2010, 04:10 PM |#8  
Senior Member
Flag Odense
Thanks Meter: 59
 
Donate to Me
More
Quote:
Originally Posted by Learners Lisence

Blayo, an alternative way for nandroid backup sounds really interesting. if included in the rom along with a few further instructions Im sure it could be brought down to the level of no-obs. Ill wait till puppy is 100% tested

Oh.. you can't wait.. you are the one who is ment to be doing the testing .. so the rest of us are waiting for your result.

Sent from my Legend using XDA App
5th September 2010, 05:50 AM |#9  
cryshop's Avatar
Senior Member
Flag Ho Chi Minh
Thanks Meter: 100
 
Donate to Me
More
So...basically, this will helps installing Ad-free and OpenVPN on our Legend, right?
6th September 2010, 06:49 PM |#10  
Junior Member
Thanks Meter: 2
 
More
Quote:
Originally Posted by BlaY0

Ahh one more thing. CM6 kernel should already contain AUFS support (if I'm not mistaken) so you could use just my overlay loading script and auplink binary.

The CM6 port from Ali Baba (Azure 1.0) contains a 2.6.29 kernel and no AUFS module... So it should work with your zip. Great work BlaY0!!!
8th September 2010, 08:09 PM |#11  
Senior Member
Thanks Meter: 3
 
More
Just to be sure.
This should work with Azure 1.0, right? What was that thing about the wifi?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes