yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Grand Quattro] Arinio:
Vikas,

You are welcome to show developments in Windows. In-fact personally I feel that we can approach mass if Window is used as the development platform as newbies are much more accustomed with Window OS.

Also let me share my plan for this tutorial.

I started with ADB, the first step to connect Android based Smartphones to any OS based Workstation where Android environment is created. Then I discussed about Repo, the prime base for Android development.

Now the future plans are as following:

1. How to built a Device Tree for any new devices.

2. How to built CWM.

3. How to built Cyanogen Mod.

4. Tutorial about Eclipse.

5. Android Kitchen Setup.

6. Building Custom ROM.

The only condition is that all these steps must be shown in details for newbies in a step by step approach and it must be a generalized approach so that any devices developement can be done through these set of tutorials.
[Samsung Galaxy Grand Quattro] vikasjangra:
Thanks for cooperation sir give me 7-10 days and I will start development work because I truly want to learn something in android and if a support from expert side than definitely it will be more helpful.

I will start my dev from windows and very soon I will install all recommended files from tutorial and report u by pm.:thumbup::thumbup::thumbup::thumbup:
[Samsung Galaxy Grand Quattro] goldbeard:
Very useful guide...thanks for the initiative..appreciate the efforts..
[Samsung Galaxy Grand Quattro] Arinio:
You are welcome to post here.

Regards
[Samsung Galaxy Grand Quattro] jihadjefry:
nice info..

i just want to ask a question,

how do we compile android kernel by cygwin?

since dsixda kitchen are working flawlesly,but i wonder

why kernel seems not even compiling a kernel.

it say total errors...

i hope someone can make a clear instructions "how to"

cause ive came across all TUT in xda and i think something is missing in their TUT
[Samsung Galaxy Grand Quattro] Arinio:
Dear Jefry,

Though the kernel compilation shows error why don't you share the steps, code you have used etc. so we can all learn through it? Let it be wrong, we all will go through the coded lines, if needed search net, consult between us and then again try.

Hope you understand.

Regards
[Samsung Galaxy Grand Quattro] Arinio:
How To Connect Your Android Phone/Tablet With Your PC For Developement

Follow Post #2 i.e. 'How To Setup Android Development Environment on Ubuntu 13.10'

Now in a terminal window type the command

$ adb devices

The output will be something similar to:

List of devices attached

f9eru809279 device

If by any case this command fails to work, you may need to add some udev rules.

For example, here is a

51-android.rules file that will handle the devices from a handful of manufacturers:

SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

SUBSYSTEM=="usb", SYSFS{idVendor}=="22b8", MODE="0666"

SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="0c01",

MODE="0666", OWNER="[me]"

SUBSYSTEM=="usb", SYSFS{idVendor}=="19d2", SYSFS{idProduct}=="1354", MODE="0666"

SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", SYSFS{idProduct}=="681c", MODE="0666"

Open gedit and copy the above codes, then put the file in /etc/udev/rules.d directory and reboot the system.

Note that the CyanogenMod project uses these udev rules.
[Samsung Galaxy Grand Quattro] Arinio:
How To Find The Complete File System Of Galaxy Grand Quattro

Before you begin follow post no #2 and follow accordingly.

Now issue the command:

arinio@ubuntu:~$ adb devices

arinio@ubuntu:~$ adb shell

shell@android:/ $ su -

root@android:/ # ls -R /

Move this find.txt from internal to external sdcard with the command:

root@android:/ # ls -R / > /sdcard/filesystem.doc

You can now transfer this file to your computer.

The file system of Galaxy Grand Quattro (GT-I8552) is as below: (Total 4253 pages of a MSWord doc)

[FONT=&quot]/:

acct

cache

charger

config

d

data

default.prop

dev

efs

etc

factory

fstab.delos3g

fstab.msm7627a

fstab.qcom

init

init.goldfish.rc

init.qcom.class_core.sh

init.qcom.class_main.sh

init.qcom.rc

init.qcom.ril.path.sh

init.qcom.sh

init.qcom.unicorn-dpi.sh

init.qcom.usb.rc

init.qcom.usb.sh

init.rc

init.target.rc

init.trace.rc

init.usb.rc

initlogo.rle

initlogo_swa.rle

lpm.rc

mnt

persist

preload

proc

res

root

sbin

sdcard

storage

sys

system

ueventd.goldfish.rc

ueventd.qcom.rc

ueventd.rc

vendor[/FONT]

.

.

.

..........(4253 pages)
[Samsung Galaxy Grand Quattro] Arinio:
The /proc/partitions Table Of Galaxy Grand Quattro

root@android:/sdcard # cat /proc/partitions

[FONT=&quot]

[/FONT]

[FONT=&quot]major minor #blocks name[/FONT]

[FONT=&quot] [/FONT]

[FONT=&quot] 179 0 7634944 mmcblk0[/FONT]

[FONT=&quot] 179 1 20 mmcblk0p1[/FONT]

[FONT=&quot] 179 2 175 mmcblk0p2[/FONT]

[FONT=&quot] 179 3 20480 mmcblk0p3[/FONT]

[FONT=&quot] 179 4 1 mmcblk0p4[/FONT]

[FONT=&quot] 179 5 1000 mmcblk0p5[/FONT]

[FONT=&quot] 179 6 1000 mmcblk0p6[/FONT]

[FONT=&quot] 179 7 2000 mmcblk0p7[/FONT]

[FONT=&quot] 179 8 12288 mmcblk0p8[/FONT]

[FONT=&quot] 179 9 3072 mmcblk0p9[/FONT]

[FONT=&quot] 179 10 3072 mmcblk0p10[/FONT]

[FONT=&quot] 179 11 4096 mmcblk0p11[/FONT]

[FONT=&quot] 179 12 8192 mmcblk0p12[/FONT]

[FONT=&quot] 179 13 12288 mmcblk0p13[/FONT]

[FONT=&quot] 179 14 4096 mmcblk0p14[/FONT]

[FONT=&quot] 179 15 4096 mmcblk0p15[/FONT]

[FONT=&quot] 179 16 12288 mmcblk0p16[/FONT]

[FONT=&quot] 179 17 24576 mmcblk0p17[/FONT]

[FONT=&quot] 179 18 4096 mmcblk0p18[/FONT]

[FONT=&quot] 179 19 512 mmcblk0p19[/FONT]

[FONT=&quot] 179 20 2048 mmcblk0p20[/FONT]

[FONT=&quot] 179 21 1228800 mmcblk0p21[/FONT]

[FONT=&quot] 179 22 737280 mmcblk0p22[/FONT]

[FONT=&quot] 179 23 102400 mmcblk0p23[/FONT]

[FONT=&quot] 179 24 5443168 mmcblk0p24[/FONT]

[FONT=&quot] 179 32 31166976 mmcblk1[/FONT]

[FONT=&quot] 179 33 31165952 mmcblk1p1[/FONT][FONT=&quot]

[/FONT]
[Samsung Galaxy Grand Quattro] Arinio:
The /proc/partitions Table Of Galaxy Grand Quattro In Structured Format

Please view attachment.
[Samsung Galaxy Grand Quattro] Arinio:
The /proc/partitions Table Of Galaxy Grand Quattro After Decimal To Hex Convertion

Here we have the /proc/partitions table after converting the values to hexadecimal.

Samsung no more provides the file /proc/mtd for make the developers work easy.

I want all to emphasis on this table structure as for building recovery and CWM this table structure is invaluable.

However still the name of the partitions are not known to us in desired format like boot, recovery etc.

We will do further research in the upcoming tutorial.
[Samsung Galaxy Grand Quattro] goldbeard:
You have been simple superb so far...no other dev would care to go into all these details...thanks a lot for your efforts..

im learning android a bit :)
[Samsung Galaxy Grand Quattro] k2wl:
we can also unpack kernel and recovery with android kitchen ...and it is better also because it gives you all the ramdisk extracted in the folder ...

actually this is all developers choice how to do the things...

by the way your posts are nice!!

but nobody seems to be interested in developing...

nevertheless...keep the good work!!
[Samsung Galaxy Grand Quattro] k2wl:
i have just posted cyanogenmod 10.2 for our device you can check the thread in original android development.:)
[Samsung Galaxy Grand Quattro] Arinio:
k2wl

Heartiest Congratulation on behalf of me.

Please post me what features the MOD contains. Tested?

Reply me ASAP. I am extremely proud of you dear friend.

Regards
[Samsung Galaxy Grand Quattro] Arinio:
Investigating The Ramdisk

In our last tutorial we discussed about 'How To Unpack Recovery Image' and at the end we got two files the kernel i.e. zImage file and a file with somewhat odd extension initramfs.cpio.gz. We mentioned that initramfs.cpio.gz is the ramdisk file.

Now the last extension is somewhat like zip or rar compression, however what about the .cpio extension?

Let me explain you in details.

In Linux world the cpio is used to strung all the contained files together into a big sized single file without compressing them. You can say that all the files are concatenated into an archive.

Here this process is applied and later on the archive file is again compressed.

So in this case our policy will be first to unzip the ramdisk with the help of gunzip command and later on deal with the .cpio extension.

However with extremely powerful Linux command we will overcome both the steps in one shot.

Let us first create a folder named quattroramdisk and then put the ramdisk file there before using the powerful combo command (Here 'combo' is not a name for any Linux command, it rather means combination of two commands).

In a terminal window let us browse to the directory where the ramdisk is currently residing. Then we will create the folder named quattroramdisk, cut-paste the ramdisk file there and then we will use the above mentioned powerful command.

arinio@ubuntu:~$ cd /home/arinio/quattro/

arinio@ubuntu:~/quattro$ ls

boot.img recovery.img unmkbootimg

initramfs.cpio.gz recoveryoutput.txt zImage

arinio@ubuntu:~/quattro$ mkdir quattroramdisk

arinio@ubuntu:~/quattro$ mv initramfs.cpio.gz /home/arinio/quattro/quattroramdisk/

arinio@ubuntu:~/quattro$ cd quattroramdisk/

arinio@ubuntu:~/quattro/quattroramdisk$ ls

initramfs.cpio.gz

Now let us use the powerful combo command which will first unzip the ramdisk file and then split ramdisk files into smaller files.

arinio@ubuntu:~/quattro/quattroramdisk$ gunzip -c initramfs.cpio.gz | cpio -i

3069 blocks

arinio@ubuntu:~/quattro/quattroramdisk$ ls

charger initlogo_swa.rle proc

data init.qcom.class_core.sh res

default.prop init.qcom.class_main.sh sbin

dev init.qcom.ril.path.sh sys

etc init.qcom.sh system

fstab.delos3g init.qcom.unicorn-dpi.sh tmp

fstab.msm7627a init.qcom.usb.sh ueventd.goldfish.rc

fstab.qcom initramfs.cpio.gz ueventd.qcom.rc

init init.rc ueventd.rc

initlogo.rle lpm.rc

So, actually in the terminal window you will observe nine folders (blue colour coded), eight files (white colour coded) and eleven executable files (green colour coded). A total combination of Twenty Eight files and folders.

So ultimately we have reached our goal by successfully peeping inside the ramdisk.

In our next tutorial we will cover some of this file contains to acquire further knowledge.
[Samsung Galaxy Grand Quattro] Arinio:
Few Valuable Notes over Ramdisk Files

I will be brief in this section as these discussions are slightly off the track and mostly concerned to Senior Developers.

In default.prop do not edit the line ro.secure=1 to 0 to gain root access. It is an useless effort.

.rc files are standard config files found in all roms. Do not remove them.

The ‘rc’ suffix goes back to Unix's grandparent, CTSS.It had a command-script feature called "runcom". Early Unixes used ‘rc’ for the name of the operating system's boot script, as a tribute to CTSS runcom.

ueventd.rc is the android equvivalent of udev rules, but it scope is very limited. It mentions the permissions and the owner of the newly added file in the system.

dsixda's Android Kitchen can be used in Windows environment to edit all these files. Most developers prefer that approach.
[Samsung Galaxy Grand Quattro] Arinio:
The init.rc File Inside Ramdisk

The init.rc file is one of the most important file for the entire Android OS.

The file looks like:

on early-init

start ueventd

on init

export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin

export ANDROID_ROOT /system

export ANDROID_DATA /data

export EXTERNAL_STORAGE /sdcard

mkdir /sdcard

mkdir /sdcard1

mkdir /system

mkdir /data

mkdir /cache

mkdir /preload

mkdir /efs

mount /tmp /tmp tmpfs

chown root shell /tmp

chmod 0775 /tmp

on early-fs

wait /dev/block/mmcblk0p11

wait /dev/block/mmcblk0p12

wait /dev/block/mmcblk0p13

wait /dev/block/mmcblk0p20

wait /dev/block/mmcblk0p22

symlink /dev/block/mmcblk0p14 /dev/block/param

symlink /dev/block/mmcblk0p19 /dev/block/pit

symlink /dev/block/mmcblk0p20 /dev/block/md5

exec check_emmc_checksum

on boot

ifup lo

hostname localhost

domainname localdomain

class_start default

write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "userspace"

write /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed "1008000"

service ueventd /sbin/ueventd

critical

service recovery /sbin/recovery

service adbd /sbin/adbd recovery

enable

# Always start adbd on userdebug and eng builds

on property:ro.debuggable=1

setprop adb.recovery 1

on property:adb.recovery=1

write /sys/class/android_usb/android0/enable 0

write /sys/class/android_usb/android0/idVendor 04e8

write /sys/class/android_usb/android0/idProduct 6860

write /sys/class/android_usb/android0/functions adb

write /sys/class/android_usb/android0/enable 1

write /sys/class/android_usb/android0/iManufacturer $ro.product.manufacturer

write /sys/class/android_usb/android0/iProduct $ro.product.model

write /sys/class/android_usb/android0/iSerial $ro.serialno

start adbd

# Restart adbd so it can run as root

on property:service.adb.root=1

write /sys/class/android_usb/android0/enable 0

restart adbd

write /sys/class/android_usb/android0/enable 1

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

This file is only for Senior Developers. By any means do not try to modify this file.
[Samsung Galaxy Grand Quattro] Arinio:
The mount Command

Inside the adb shell one can use the mount command to have an idea of the file system without opening the recovery.img. However this only gives a vague idea.

In a terminal window you can try:

arinio@ubuntu:~$ adb devices

List of devices attached

1fd***** device

arinio@ubuntu:~$ adb shell

shell@android:/ $ mount

rootfs / rootfs ro,relatime 0 0

tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0

devpts /dev/pts devpts rw,relatime,mode=600 0 0

proc /proc proc rw,relatime 0 0

sysfs /sys sysfs rw,relatime 0 0

none /acct cgroup rw,relatime,cpuacct 0 0

tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0

tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0

none /dev/cpuctl cgroup rw,relatime,cpu 0 0

/dev/block/mmcblk0p23 /preload ext4 ro,nosuid,nodev,noatime,data=ordered 0 0

/dev/block/platform/msm_sdcc.3/by-num/p21 /system ext4 ro,relatime,data=ordered 0 0

/dev/block/platform/msm_sdcc.3/by-num/p24 /data ext4 rw,nosuid,nodev,relatime,discard,journal_checksum,journal_async_commit,noauto_da_alloc,data=ordered 0 0

/dev/block/platform/msm_sdcc.3/by-num/p22 /cache ext4 rw,nosuid,nodev,relatime,data=ordered 0 0

/dev/block/platform/msm_sdcc.3/by-num/p12 /persist ext4 rw,nosuid,nodev,relatime,data=ordered 0 0

/dev/block/platform/msm_sdcc.3/by-num/p16 /efs ext4 rw,nosuid,nodev,relatime,data=ordered 0 0

/dev/fuse /storage/sdcard0 fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0

none /sys/kernel/debug debugfs rw,relatime 0 0

/dev/block/vold/179:33 /storage/extSdCard vfat rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime,uid=1000,gid=1023,fmask=0002,dmask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

/dev/block/vold/179:33 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime,uid=1000,gid=1023,fmask=0002,dmask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

tmpfs /storage/extSdCard/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0

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

This is extremely helpful as we come to know which partition is loaded with what permissions.

I am grateful to k2wl for directing my attention towards this issue.

We will later on discuss about Linux filesystem permissions in details.
[Samsung Galaxy Grand Quattro] Arinio:
Different Partitions Supported By Android

Basically Android device have three types of partitions these are NAND, mtd, and mmcblck. Reputed brand devices have NAND and mtd, some China brand device have mmcblk, which means OS stored in mmc (memory card) card. But in the memory card you can’t find the init.rc file and you can see other files except init.rc if you takeout the mmc and connect to your PC over card reader.

If you are further interested, you can follow the below link:

http://elinux.org/File_Systems
[Samsung Galaxy Grand Quattro] coolkoushik07:
Bro can u explain how can we take efs backup in quattro? As there are no prooven and working method I have found over internet for this phone.
[Samsung Galaxy Grand Quattro] k2wl:
it is very much helpful...

look at the parameters your partitions are loading ...

this is very important...

it shows to us that which partition loads with what parameters, this is also important for making recovery.fstab version 2 for our device which is compatible with newer cwm(like my 6.0.4.5 mine is already having version 2)

also "dev/block/vold/179:33" shows to us that 33 partition is external sd which is managed by vold.
[Samsung Galaxy Grand Quattro] Arinio:
Very much thank you for directing my attention towards the permission issue.

Please do contribute through tutorial.

Regards
[Samsung Galaxy Grand Quattro] Arinio:
Koushik,

Thanks for asking me a solution for this issue.

However till now I haven't venture the efs backup issue.

For now please follow these links and revert back to me if they helped you or if those methods failed.

http://xdaforums.com/showthread.php?t=2298104

http://www.xda-developers.com/android/easily-backup-the-efs-partition-on-the-samsung-galaxy-note-3/

http://www.android.gs/backup-restore-efs-from-any-android-samsung-device/

Regards
[Samsung Galaxy Grand Quattro] coolkoushik07:
Thanks bro but I have already gone through those topic and i found none of them working for quattro.
[Samsung Galaxy Grand Quattro] Arinio:
Thanks for informing me Koushik.

Tomorrow I will try my best to resolve this issue.

Regards
[Samsung Galaxy Grand Quattro] Arinio:
Dear Koushik,

From my post #29 you will find that:

/efs ext4 /dev/block/mmcblk0p16

In adb shell I tried dd and cp, however failed. I think you also surely tried those.

DisappointinglyI used root@android:/dev/block # cat /dev/block/mmcblk0p16 > /sdcard/efs.txt

However I think this is not the solution.

Please revert back to me.

Regards

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

As this is somewhat of the topic let me explain others what me and Koushik tries to find and why this topic is extremely important.

From Civatos post:

EFS folder is the very sensitive system folder that contains Phone-specific information such as the IMEI, wireless devices MAC addresses, product code, and much more. If this thing not handled properly, can turn your device completely useless as it will no longer be recognized by your carrier. Problem is, flashing Custom ROMs sometime can corrupt contains within EFS folder. That’s why backing up EFS folder is very important if you love to flash new ROM.
[Samsung Galaxy Grand Quattro] coolkoushik07:
Bro i saw in a thread of other device that the command used in terminal emulator to take backup is as below

su

dd if=/dev/block/mmcblk0p3 of=/storage/extSdCard/efs.img bs=4096

This command works but the block is different. So if i use the block mentioned by u, will it work? I mean will it really take backup. As that previous thread author told that the output file size should be of 20mb
[Samsung Galaxy Grand Quattro] Arinio:
Backing Up EFS Partition

Dear Koushik,

I tried this command without the bs argument:

dd if=/dev/block/mmcblk0p3 of=/storage/extSdCard/efs.img

However it fails.

Please do spare me some time so that I can test this command with the block parameter.

Regards
[Samsung Galaxy Grand Quattro] coolkoushik07:
With the bs parameter the code works but its not giving output file of 20mb. Thats why i asked u.
[Samsung Galaxy Grand Quattro] Arinio:
EFS Continuation........

Koushik,

I tried this way:

arinio@ubuntu:~$ adb shell

shell@android:/ $ su -

shell@android:/ $ dd if=/dev/block/mmcblk0p16 of=/sdcard/mmcblk0p16.img bs=1024

12288+0 records in

12288+0 records out

12582912 bytes transferred in 2.012 secs (6253932 bytes/sec)

I also used the below command:

root@android:/ # df /dev/block/mmcblk0p16

Filesystem Size Used Free Blksize

/dev/block/mmcblk0p16 422M 76.0K 422M 4096

Again tried:

adb shell

shell@android:/ $ su -

root@android:/ # dd if=/dev/block/mmcblk0p16 of=/sdcard/mmcblk0p16.img bs=4096

3072+0 records in

3072+0 records out

12582912 bytes transferred in 1.029 secs (12228291 bytes/sec)

and last but not the least:

adb shell

shell@android:/ $ su -

root@android:/ # dd if=/dev/block/mmcblk0p16 of=/sdcard/mmcblk0p16.img bs=512

24576+0 records in

24576+0 records out

12582912 bytes transferred in 3.276 secs (3840937 bytes/sec)

The output is always 12 MB. Hopefully yours also the same.

Waiting for your comment.

Regards
[Samsung Galaxy Grand Quattro] coolkoushik07:
yes bro its same for me but how to be confirmd?
[Samsung Galaxy Grand Quattro] Arinio:
File Owner Types Abbreviation

Abbreviation Meaning

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

u................. Owner (user)

g................. Group

o................. Others

a................. All
[Samsung Galaxy Grand Quattro] Arinio:
Types Of Permissions

There are THREE fundamental permissions:

Read (r) : The file can be read but not altered or deleted.

Write (w) : The file can be altered or deleted.

Execute (x) : The file can be executed, if it is a program or script.

Permissions can vary for file owners, group users and others. For example, the file owner may have read and write permission, while group users are restricted to read permission, and others are denied access completely.
[Samsung Galaxy Grand Quattro] Arinio:
Difference Bettween File And Folder Permissions

For directories the meaning of permissions differs from that of files.

The execute (x) controls whether the specified user can list and search the filenames within the directory.

To access the contents of a directory, a given user must possess the read (r) and execute (x) permission.

Write (w) permission is required to alter or delete files within the directory.
[Samsung Galaxy Grand Quattro] Arinio:
Setting Permissions : The SYMBOLIC Mode

To specify permissions for a given file or group of files the chmod command is used.

This chmod command requires to specify permissions using either of the two possible permission description modes : SYMBOLIC or NUMERIC.

For beginners here we will use the symbolic mode. As experience gains we will learn how to use the numeric mode.
[Samsung Galaxy Grand Quattro] Arinio:
Important Android Commands You Need To Learn

Ubuntu OS supports more than 1000 commands and even Linux System Administrators (I myself one of the fortunate/unfortunate guy) need to consult books time to time (hopefully other Admins will agree with me). To execute these commands as most of them supports more than one attributes (some supports 10/15) the whole thing becomes...............well, best to stop here.

Fortunately for Android users we need to learn few commands (less than 15) as by default Android OS supports very few commands by default.

The list of commands you need to learn are:

cd

ls

mkdir

su

cat

dd

adb

chmod

cp

echo

For a beginners this will be enough to work in adb shell of Android OS.