mounting the rfs

I’ve decided to give redbend_ua a rest for a little while, manily because i don’t dare to do any risky tests on my SGS due to the simple fact that I won’t have any way to restore it if/when something bad happens (reminder: i dont have Windows/odin). And besides, seems to me there are other android hackers out there testings the boundaries of redbend_ua right now (see here), so i hope they will pave the way for the rest of us with “flashing Android ROM using update.zip”.

So on we go to some filesystem browsing. some of the files contained in an (odin) update file are basically filesystem images, which we can mount. Lets do that first with the rfs files: factoryfs.rfs, dbdata.rfs, and cache.rfs.

Basically, Linux RFS (Linux Robust FAT File System) is a FAT compatible file system to use OneNAND/NAND flash memory as storage on any consumer electronic devices. As its name implies, Linux RFS runs in the Linux kernel and is fully compatible with FAT file system standards (FAT16/32). For ‘robustness’, it provides a journaling based error recovery mechanism, which guarantees that the file system runs at all times even if there is a sudden power loss. [copied from Samsung pdf]

So, we can mount them just like any other fat image using:

mount -o loop factoryfs.rfs /mnt

and viola, we can browse the filesystem. lots of interesting configuration files (looking at /etc/asound.conf i thought maybe it would be possible to create a virtual alsa device to allow full call recording. would that be possible? i wonder…) for you to look at. You can learn a lot by reading/browsing those config files (i viewed some of them already from my SGS terminal, but it wasn’t very comfortable, to say the least)

enjoy.

[TIP: to extract the initramfs.img from the zImage file, use the script from here]

Advertisements

5 Comments

  1. Very interesting .

    But how to repack/rebuild the factoryfs.rfs?

    Alt1
    mount -o loop factoryfs.rfs directory & Copy files to a new place and edit them but how to create a .rfs from that point?

    Alt2
    sudo mount -v -o rw,loop,uid=$UID factoryfs.rfs Directory
    Edit the files , umount the .rfs . Mount it again but the the changes are gone.

    How do you do it?

    1. there is not an easy way to edit the files in rfs images. i only showed how to view the files.

      however, here is a solution so you can edit the files:

      push the rfs file to your device using “adb push”
      open adb terminal using “adh shell”
      do “su”
      do a “mount -t rfs -o loop…” inside adb. you can now change the files as you like 🙂
      umount when done, and use adb again to pull the changed file back to your pc.

      a bit of a headache, but achievable, never the less.

  2. Godday mr.
    Thanks for your quick and helpful and informative answer.

    Yeah, a little bit o hedache but that is fun.

    Keep up the good work on zX

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s