FORUMS
Remove All Ads from XDA

Converting cache.rfs and datafs.rfs to (ext2/4) for packaging a ROM.tar

56 posts
Thanks Meter: 64
 
By revant, Member on 11th July 2011, 02:38 PM
Post Reply Email Thread
Most of the ROMs with appropriate kernels come with ext2 for /system

and then convert the filesystems with the .convert file to data-ext4 and cache-ext2

so while i was messing around i tried this:

Required:
  • Kernel supporting filesystems,
  • factoryfs.rfs is already ext2 and has cwm recovery in it
  • stl7 and stl8 converted to desired filesystems
  • use a freshly flashed rom without any private data on /cache and /data for "dd" if you packaging it for people to download (just in case, it wont matter because it will get formatted on first boot itself)

create cache.rfs (12,45,184 bytes) and datafs.rfs (14,82,752 bytes) using terminal editor/adb

For datafs.rfs
Code:
# dd if=/dev/block/stl7 of=/sdcard/datafs.rfs bs=4096 count=362
it will create a datafs.rfs file in your sdcard which is (4096 x 362 = 14,82,752 bytes)

For cache.rfs
Code:
# dd if=/dev/block/stl8 of=/sdcard/cache.rfs bs=4096 count=304
it will create a cache.rfs file in your sdcard which is (4096 x 304 = 12,45,184 bytes)

now i packed it in a tar with a factoryfs.rfs (ext2) with recovery in it and flashed the rom

It showed CWM recovery on first boot,
Here i did a factory reset which formatted data cache and sd-ext into clean filesystems, then i fixed permissions superstitiously

This way ROM gets flashed and at the first boot itself the fs are converted to desired fs.

I don't know the quality of what i did or whether it has been done before or is it even correct..
but it worked

If you like it, thank me
if you don't, Ignore

Attached: my data (ext4) & cache (ext2) 2011-07-24
Attached Files
File Type: 7z dataEXT4-cacheEXT2.7z - [Click for QR Code] (7.0 KB, 126 views)
The Following 7 Users Say Thank You to revant For This Useful Post: [ View ] Gift revant Ad-Free
11th July 2011, 11:57 PM |#2  
Mohanshbhr's Avatar
Senior Member
Flag Mau, Lucknow
Thanks Meter: 357
 
More
Quote:
Originally Posted by revant

Most of the ROMs with appropriate kernels come with ext2 for /system

and then convert the filesystems with the .convert file to data-ext4 and cache-ext2

so while i was messing around i tried this:

Required:

  • Kernel supporting filesystems,
  • factoryfs.rfs is already ext2 and has cwm recovery in it
  • stl7 and stl8 converted to desired filesystems

create cache.rfs (12,45,184 bytes) and datafs.rfs (14,82,752 bytes) using terminal editor/adb

For datafs.rfs
Code:
# dd if=/dev/block/stl7 of=/sdcard/datafs.rfs bs=4096 count=362
it will create a datafs.rfs file in your sdcard which is (4096 x 362 = 14,82,752 bytes)

For cache.rfs
Code:
# dd if=/dev/block/stl8 of=/sdcard/cache.rfs bs=4096 count=304
it will create a cache.rfs file in your sdcard which is (4096 x 304 = 12,45,184 bytes)

now i packed it in a tar with a factoryfs.rfs (ext2) with recovery in it and flashed the rom

It showed CWM recovery on first boot,
Here i did a factory reset which formatted data cache and sd-ext into clean filesystems, then i fixed permissions superstitiously

This way ROM gets flashed and at the first boot itself the fs are converted to desired fs.

I don't know the quality of what i did or whether it has been done before or is it even correct..
but it worked

If you like it, thank me
if you don't, Ignore

Thanks a lot, i was searching the same thing for appearing cwm on first boot after flashing rom. when i flash new rom i will check it and i m sure that it will work
12th July 2011, 07:28 AM |#3  
revant's Avatar
OP Member
Flag Mumbai
Thanks Meter: 64
 
More
I dont know why the CWM is seen on first boot.
May be because of error in filesystem
the output Cache.rfs and datafs.rfs are just initial bytes of the partition, if you get whole partition cache will be 6.0+ mB and datafs around 270 mB

But with this it is somehow managing to say to cwm that the fs is bad and CWM stops for us.. CWM seems to think it is certain type of fs and formats it to same type.

If you dont format (factory reset) the phone wont boot and the logcat will show error that it cannot create anything on /data
I tried "mkdir 123" in /data with adb and it gives IO error

but after format everything works fine.

and if you accidentally reboot and miss the CWM first time and the phone doesnt boot.. Just manually go to recovery and do factory reset
30th September 2011, 04:29 PM |#4  
Senior Member
Flag California, USA
Thanks Meter: 214
 
Donate to Me
More
I used the following command to create cache.rfs as my cache.rfs is 13 MB

Code:
dd if=/dev/block/stl8 of=/sdcard/cache.rfs bs=4096 count=3344
3rd January 2020, 10:12 AM |#5  
Junior Member
Flag Brooklyn
Thanks Meter: 1
 
More
Re-packaging OTA
It's a good topic and helps very peoples like me.

Thanks for sharing
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