[Samsung Galaxy Grand Quattro] Arinio:
Folders Inside Ramdisk

Now let us venture the folders and corresponding files inside them inside the Ramdisk.

Alphabetically the folders are:

data

dev

etc

proc

res

sbin

sys

system

tmp

So total nine folders.

Lets start with the data folder.

Unfortunately or for some fortunately the folder is empty.

Next the dev folder.

Same remark as above.

Next the etc folder.

This one contains two files: recovery.fstab and recovery_nand.fstab

Lets examine the recovery.fstab

The output is:

# Copyright (c) 2011, Code Aurora Forum. All rights reserved.

#

# Redistribution and use in source and binary forms, with or without

# modification, are permitted provided that the following conditions are

# met:

# * Redistributions of source code must retain the above copyright

# notice, this list of conditions and the following disclaimer.

# * Redistributions in binary form must reproduce the above

# copyright notice, this list of conditions and the following

# disclaimer in the documentation and/or other materials provided

# with the distribution.

# * Neither the name of Code Aurora Forum, Inc. nor the names of its

# contributors may be used to endorse or promote products derived

# from this software without specific prior written permission.

#

# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED

# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT

# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS

# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR

# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF

# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR

# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,

# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE

# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN

# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# mount point fstype device [device2]

/boot emmc /dev/block/mmcblk0p8

/system ext4 /dev/block/mmcblk0p21

/data ext4 /dev/block/mmcblk0p24 length=-16384

/cache ext4 /dev/block/mmcblk0p22

/recovery emmc /dev/block/mmcblk0p13

/efs ext4 /dev/block/mmcblk0p16

/modem emmc /dev/block/mmcblk0p3

/preload ext4 /dev/block/mmcblk0p23

--------------------------------------------------------------------------------

This lines contain extremely important informations about the entire file-system, their file-system types and their mount points. We will use these informations over and over in many scenarios.

Next the recovery_nand.fstab

Lets see:

# Copyright (c) 2011, Code Aurora Forum. All rights reserved.

#

# Redistribution and use in source and binary forms, with or without

# modification, are permitted provided that the following conditions are

# met:

# * Redistributions of source code must retain the above copyright

# notice, this list of conditions and the following disclaimer.

# * Redistributions in binary form must reproduce the above

# copyright notice, this list of conditions and the following

# disclaimer in the documentation and/or other materials provided

# with the distribution.

# * Neither the name of Code Aurora Forum, Inc. nor the names of its

# contributors may be used to endorse or promote products derived

# from this software without specific prior written permission.

#

# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED

# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT

# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS

# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR

# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF

# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR

# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,

# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE

# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN

# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# mount point fstype device [device2]

/boot mtd boot

/cache yaffs2 cache

/data yaffs2 userdata length=-16384

/misc mtd misc

/recovery mtd recovery

/sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0

/system yaffs2 system

-------------------------------------------------------------------

Once again these lines contain extremely important informations about the entire file-system.

Please note the line in Red-Bold. We will need them later on.

Next the proc folder.

Lets open it to see the contains.

Once again a blank folder!

Next the res folder.

Inside this folder there is another folder namely images and two files: keys and recovery.do

Lets check the image folder.

Again this contais another folder charger and nineteen .png formatted images.

Keep in mind the location of this folder and the images you have seen. DEvelopers often use this folder for setting background image in CWM.

--------------------------------------------------

The charger folder contains eight images.

We are not interested in those.

------------------------------------------------

Now the keys file.

Lets observe:

{64,0x591f5d5d,{993403147,2102747760,2116423980,1520664856,3855775470,1301258913,603968903,889265256,600622491,1751845310,840609692,1573324314,4204631367,508645623,3865742445,2230892497,4036346813,108484070,441050656,879206535,2973613679,2996749531,1332196159,3693459404,295103755,1694818649,953021024,1565906065,1653217009,567027052,2823740415,388172039,667899318,4127285460,845857575,183315048,1364588227,3071942183,74204099,2251049126,1053270747,2187000657,1875226878,3308670371,488264117,1268587879,343694789,210601327,2650063028,2260915049,840915831,2239333325,2583858656,4012727203,1395493106,63991089,2524499563,1212266286,1137920117,2808525882,559541646,3462588047,606281757,3924946356},{3945628694,1185315627,1980939842,2613340636,3519415799,4068247955,1355350363,3713288919,3214203000,1730252395,1554951019,40926085,2963003407,276771666,2583056483,2350770080,137674418,4076947933,3345314490,2065505354,3629565996,2984671262,1340195370,2950982580,2190923881,1979384954,4073342993,1687469836,1648156331,836160036,1126134217,1363119325,2459679313,3628038041,2265540653,3479455905,3142221008,96265552,3921482948,3602791822,2530916870,1938154501,1409067644,1668428227,807082600,3779961757,3000930953,2196777208,416758534,3267905347,1192483377,2110404486,703280182,2396083583,743146620,3786184685,3159760427,382976856,4174184062,3703895702,681704461,1342389241,3001032107,3118363299}},

{64,0xf387703b,{243144461,216422862,1642900497,1707712332,1023744599,2733878131,3989106586,879201698,1497105122,4065748462,214814717,2731010625,741551934,3548851170,3726649071,107104852,302095799,1257636088,865228127,3864897697,2172843053,3062543040,1706146337,1684097221,3850651006,859289177,3266019386,3555006414,1245683488,1355532106,4284414548,3291904135,2753955601,478438920,2254565547,125581482,3221991851,2543030250,3712221344,1038046944,1431278148,2333496300,2406700938,1374522515,2203621729,1921071492,4028122582,2472461855,2620429040,2878221938,1986643920,1941023084,2541431088,613656053,1695976120,326838436,595193775,2292111266,2908481082,183978625,695474856,1706058600,2938051572,3129193607},{3348834622,2380792123,3513905449,2373206955,3346557274,2957231216,3474748132,3999517848,2094248935,2782598623,2258644277,1137125910,1808101516,3496645081,721506433,323322773,1757489509,1323232219,3397536418,2616636094,4174002174,402155169,3019886378,3385817756,3394925946,3676351374,318751598,2124524042,253695560,452837862,3871427797,3178824076,833234547,592354980,2560927862,900617320,717293431,3555869211,2552031001,2003896968,2104608758,95372396,4178753417,129154739,4169298950,2293849758,1830104774,1246321505,3999658083,15007157,48937612,2983742364,1481223563,3350417427,3668494167,4247935806,1096027665,2060263867,4176534976,3670154350,1014554914,2626288723,4024457194,2954501274}}

----------------------------------------------

For now, beyond our scope to understand. However these numbers are very important.

Next the recovery.do file.

on init-recovery

mount /system

unmount /cache

exec -f "/system/bin/e2fsck -v -y <dev_node:/cache>"

insmod -f -v /system/lib/modules/exfat_core.ko

insmod -f -v /system/lib/modules/exfat_fs.ko

mount /cache

ls /cache/recovery/

unmount /data

exec -f "/system/bin/e2fsck -v -y <dev_node:/data>"

mount /data

fcut --limited-file-size=64k -f /data/log/recovery_log.txt /tmp/recovery_backup.txt

on multi-csc

echo

echo "-- Appling Multi-CSC..."

mount /system

echo "Applied the CSC-code : <salse_code>"

cp -y -f -r -v /system/csc/common /

unmount /system

mount /system

cmp -r /system/csc/common /

cp -y -f -r -v /system/csc/<salse_code>/system /system

rm -v /system/csc_contents

ln -v -s /system/csc/<salse_code>/csc_contents /system/csc_contents

unmount /system

mount /system

cmp -r /system/csc/<salse_code>/system /system

rm -v --limited-file-size=0 /system/app/*

echo "Successfully applied multi-CSC."

on factory-out

echo "Coping medias..."

mount /preload

mount /data

mkdir media_rw media_rw 0775 /data/media

cp -y -r -v -f --with-fmode=0664 --with-dmode=0775 --with-owner=media_rw.media_rw /preload/INTERNAL_SDCARD/ /data/media/

unmount /data

mount /data

cmp -r /preload/INTERNAL_SDCARD/ /data/media/

on post-recovery

mount /data

mkdir system log 0775 /data/log

cp -y -f -v /tmp/recovery_backup.txt /data/log/recovery_log.txt

-----------------------------------------------

Extremely important file for Senior Developers.

Now the sbin folder.

Two executable files are situated here: the adbd and the recovery file. There is also one link file: ueventd.

----------------------------------------------

Senior Developers sometimes put many Linux executable files in this folder to use them in CWM, specially for the Touch Version.

Now the sys folder.

Empty folder.

-------------------------------------------

Next the system folder.

Again empty.

----------------------------------------

Last the temp folder.

This is also empty.

---------------------------------------

So our examination regarding the folders and corresponding files inside them is complete and fortunately we have collected vast amount of knowledges about the system partitions and many important aspects.

We are only left with the executable files which are beyond our scope to understand now. However out of them we will just observe the init.rc file in the next tutorial.