[HOW-TO][TUTORIAL]ROOT, DEODEX, BUILD KERNEL, BUILD CUSTOM ROM and MORE

Is this thread useful and want it to be sticky?


  • Total voters
    365
Search This thread

sengab1991

Senior Member
Dec 6, 2011
450
343
make: *** No targets specified and no makefile found. Stop.
this appear for me when I type make any ideas how to solve that :S :S
 

herinmo

New member
Mar 27, 2012
1
0
I like this thread very much and building/running a custom kernel was no problem.

My question is to how to build AOSP which results in a system.img with the right file system.

This is what I have done.
I can build AOSP (2.3.3_r1) in combination with Samsung Galxy SII platform code (GT_I9100_platform.tar.gz).
This results in 3 images.

system.img
ramdisk.img
userdata.img

I know that system.img is the file system and open this you can remove and add applications.
I can download this image to device but when device reboots after downloading installation is aborted because of error E:Error in /cache/recovery/sec_csc.zip
I think that the image has the wrong file system unyaffs instead of ext4fs (this is what Samsung need). How can I build AOSP which result in a system.img with ext4fs file system


Any help will be appreciate
 
Last edited:

dankmoe

Senior Member
Nov 27, 2011
91
13
This thread is epic and OP helped the i1900G users big time! Screw doing a tut for i9100 users , you guys have all the Custom Rom's in the world , however were stuck here on GB while almost the entire world is enjoying ICS.

Please go ahead and finish on how to make custom ROM , i personally have never made a custom ROM before but im giving it a go for my phone.

Thank you
Keep it up
 

albuquerque13

New member
Mar 23, 2012
1
0
make t1_defconfig

using make t1_defconfig should be easier than copying the file manually and renaming to .config

Just my 2 cents.
 

susashva

Member
Apr 7, 2012
7
0
How do we go to origi_app folder and delete apk and odex files of Maps, PhoneSky and VoiceSearch.
 

halfbytecode

Senior Member
Apr 11, 2012
511
210
After deodexing I'm missing Maps, VoiceSearch, Latitude and Places apps. Any specific reason the former 2 apps weren't deodexed and is it possible to get them back?

EDIT: Nevermind I ended up getting them from Google Play.
 
Last edited:

brightivan

Senior Member
Dec 4, 2011
85
15
Somewhere on earth
d1lwy.tk
Hey, thanks for the tutorial! But i've got a few questions:

1) First of all, after I've deodex my phone (fyi I'm running options 1-4 manually, then I exit), I'm not sure whether it's fully deodexed or not because in /system/app there are still files with .odex. And I've wiped cache but not wipe data coz i don't want to lose my files.
2) adb is not a recognized command. How to fix this?
3) If i don't want to build my own kernel and want to based on other kernels, what should i do?

Thanks in advance!

:confused::confused::confused::confused::confused::confused:
 

ad_ek

Senior Member
Feb 25, 2012
263
36
Johor
same problem here. i cant seem to deodex my jplc1.

it keeps giving me the same error.

when i use the command rm /system/app/*.odex

it will say. cant remove filesaccountandsettings.odex : read only file system...

when type this command : busybox cp /sdcard/done_app/* /system/app/

cant create file xxx , : file already exist.

---------- Post added at 11:08 PM ---------- Previous post was at 10:42 PM ----------

the deodex guide is not really well written, and its not newbie friendly bro
 

superatmos

Retired Recognized Developer
Mar 29, 2011
493
1,202
Bangalore
same problem here. i cant seem to deodex my jplc1.

it keeps giving me the same error.

when i use the command rm /system/app/*.odex

it will say. cant remove filesaccountandsettings.odex : read only file system...

when type this command : busybox cp /sdcard/done_app/* /system/app/

cant create file xxx , : file already exist.

---------- Post added at 11:08 PM ---------- Previous post was at 10:42 PM ----------

the deodex guide is not really well written, and its not newbie friendly bro

Did you read the deodex section properly? Did you read "What you need to have" under "deodexing" section?? You need to have a rooted kernel first..

secondly, after having rooted kernel, you need to follow the "code" (steps mentioned) under "deodexing" section exactly.. /system is remounted as "rw" before you even delete or copy /system/app.....

Read the instructions properly ....
 

ad_ek

Senior Member
Feb 25, 2012
263
36
Johor
Did you read the deodex section properly? Did you read "What you need to have" under "deodexing" section?? You need to have a rooted kernel first..

secondly, after having rooted kernel, you need to follow the "code" (steps mentioned) under "deodexing" section exactly.. /system is remounted as "rw" before you even delete or copy /system/app.....

Read the instructions properly ....

bro, yes i read it 100x over and over again. and yes i had everything ready before starting.i was rooted,jdk installed,xultimate etc all done well. im not saying this in a rude manner. i just wanted to let you know froma newbie point of view, the command prompt instruction hopefully can be elaborated further.

anyway the cause of my problems were that the done_app and done_framwork had to be mounted using root explorer and had to change the commands without /sdcard and it worked perfectly.

another thing is, after all is done, go into the system app and framework folder to double confirm if all odex files is deleted. just to ensure its deodexed properly.

and to download vending.apk, copy file directly into system/app to have market again.

thats all bro...im grateful for your guide. and manage to deodex my rom by my self thanks to you.

one last question,how do i pull and save this deodex rom? so that next time i can just flash it, instead of deodex again?

thanks again superatmos.
 

superatmos

Retired Recognized Developer
Mar 29, 2011
493
1,202
Bangalore
bro, yes i read it 100x over and over again. and yes i had everything ready before starting.i was rooted,jdk installed,xultimate etc all done well. im not saying this in a rude manner. i just wanted to let you know froma newbie point of view, the command prompt instruction hopefully can be elaborated further.

anyway the cause of my problems were that the done_app and done_framwork had to be mounted using root explorer and had to change the commands without /sdcard and it worked perfectly.

another thing is, after all is done, go into the system app and framework folder to double confirm if all odex files is deleted. just to ensure its deodexed properly.

and to download vending.apk, copy file directly into system/app to have market again.

thats all bro...im grateful for your guide. and manage to deodex my rom by my self thanks to you.

one last question,how do i pull and save this deodex rom? so that next time i can just flash it, instead of deodex again?

thanks again superatmos.

Use the below command :

Code:
adb pull /system system/
 

Kingspp

Senior Member
Apr 10, 2012
704
275
Mysore
Trying to deodex GT I9100g...
M on stock ics 4.0.3 with a rooted lp7 kernel+ busybox.....
Did the first two steps correctly..
Couldn find maps.apk and maps.odex.!!
Found only phonesky.apk and voicesearch.apk...deleted it!!.
Then when i try to do option 3...n enter i.e deodex system/app

it gives:

"Error! Something happened?? FIX IT!!
press any key to continue..."

can ny 1 provide a solution??
 

Kingspp

Senior Member
Apr 10, 2012
704
275
Mysore
Cnt use v6 supercharger for odex roms..plz help me ou..

Sent from my GT-I9100G using xda premium
 

sakindia123

Inactive Recognized Developer
May 6, 2011
4,043
9,548
Noida
.....
  • Make sure USB debugging is ON and connect your device to the PC.
  • Open command prompt on your windows PC and go to CustomROM folder path.
  • Type adb devices. You should be able to see the device detected. (If not check environmental variables whether adb is in system path or not. If not present, add the adb path.)
  • Type the below command to get the dump of system folder.

Code:
adb pull /system system/

.....[/SIZE][/B]

1) u should do "make t1_defconfig" instead of copying and renaming as .config,the compiler fixes mistakes directly and u have sort of a backup
2)if u use adb to pull /system,u will end up with a lot of un-necessary binaries.
Better way it to download the firmware to your computer,mount system.img and extract the files u need
 

neutronz

Senior Member
Jul 16, 2011
170
14
/system/
there is any flashable deodex app and framework that i can flash thru CWM? or maybe someone can make it.. it would be great :D
 

Top Liked Posts

  • There are no posts matching your filters.
  • 57
    Hi all,

    In this thread, I will try to share the knowledge I have on deodexing, making custom ROMs, modifying initramfs, building kernel and much more.

    Please check the below posts for each of these tutorials.

    Hope this opens doors to many new ROM and Kernel developers.

    NOTE: THESE TUTORIALS ARE WRITTEN FOR I9100G. WILL NOT WORK ON OTHER DEVICES. I DON'T TAKE ANY RESPONSIBILITY IF YOU MESS UP AND BRICK YOUR DEVICE OR ANYTHING ELSE. USE AT YOUR OWN RISK.
    33
    Building Kernel

    Okay. Let's learn how to build kernel for our I9100G. There are many ways to build. I am just presenting here the way I build and make kernel.

    NOTE 1: Follow the instructions exactly.
    NOTE 2: Kernel is opensource. If you make any changes to it, you're expected to share your source. (Usually people share it over github :))
    NOTE 3: FLASHING KERNEL IS RISKY AND DANGEROUS. BE CAREFUL. BUILD AND FLASH ON YOUR OWN RISK.

    What you need to have:

    • Ubuntu 10.04 and above (I use 10.04 :))
    • ARM tool chain (Download HERE. Click on IA32 GNU/Linux TAR under Advanced Packages)
    • Samsung's opensource kernel for I9100G (Download HERE. Go to Mobile->Mobile Phone-> Select I9100G and download the zip)

    Setting up toolchain:

    • Extract the tar you downloaded(Suggestion: Extract to one folder where you can have everything. In my case /home/superatmos/build_kernel).
    • After extracting, you'll see a folder named arm-2010q1. Inside there will be many folders (ex. bin, lib and so on.)

    Folder structure will be: /home/<your_name>/build_kernel/arm-2010q1

    Setting up kernel:

    • Extract the zip you've downloaded from samsung's opensource.
    • You'll find two zips.
    • Extract GT-I9100G_Kernel.tar.gz to /home/<your_name>/build_kernel/

    Folder structure: /home/<your_name>/build_kernel/GT-I9100G_Kernel

    Setting up initramfs:

    Samsung's zImage is divided into two parts: Opensource kernel (which you downloaded from samsung's website) and initramfs (which is root file system to boot up the device).

    • I am providing my initramfs HERE. (You can use it as it is or modify it. But give credits to me. :))
    • Extract the downloaded zip and copy it to /home/<your_name>/build_kernel/

    Folder structure: /home/<your_name>/build_kernel/initramfs

    Now the entire setup is ready. Let's start modifying kernel configuration. :)

    Setting up kernel config:

    • Go to /home/<your_name>/build_kernel/GT-I9100G_Kernel/arch/arm/configs folder.
    • Copy t1_defconfig file and paste it in kernel root folder (/home/<your_name>/build_kernel/GT-I9100G_Kernel/).
    • Rename t1_defconfig to .config in kernel root folder.
    • Now open Makefile which is in your kernel root folder(/home/<your_name>/build_kernel/GT-I9100G_Kernel/).
    • Modify the below lines (I guess line 195 and 196).

    Code:
    ARCH            ?= arm
    CROSS_COMPILE   ?= /home/<your_name>/build_kernel/arm-2010q1/bin/arm-none-linux-gnueabi-

    • Save and close.

    Modifying kernel configuration:

    Now open .config file(which you renamed). If its not seen, it might be hidden. ;) Go to View->Show hidden files and there you go. :)

    Do the below things:

    Adding local version:

    Change CONFIG_LOCALVERSION=" " to anything you like. I add this way:

    CONFIG_LOCALVERSION="-I9100G-superatmos" :cool:

    Adding initramfs path:

    You need to let kernel know the path from which it needs to take initramfs.

    Change CONFIG_INITRAMFS_SOURCE=" " to ../initramfs (In this tutorial it's the path. If you had copied anywhere else, give the path properly).

    Enough for now. Once you get experience, you can modify many configurations as per your liking and save. This configuration can be changed by GUI too with the command make menuconfig.

    The Important part: Building the kernel: :)

    • Open terminal.
    • Go to path /home/<your_name>/build_kernel/GT-I9100G_Kernel/
    • Type make.

    THAT'S ALL. YOUR zImage is ready and is available in /home/<your_name>/build_kernel/GT-I9100G_Kernel/arch/arm/boot/zImage. :)

    Install the zImage on the device:
    Go to the path where zImage is present and type the below line in command line.

    Code:
    tar cvf I9100G_kernel.tar zImage

    Flash the tar using odin.


    DONE. CONGRATULATIONS. NOW YOU'VE YOUR OWN KERNEL. :)

    Other references:

    Building Kernel by bedalus

    How to compile your first Nexus Kernel by djjonastybe

    Give me your feedback so that I can improve this tutorial. And post here about how your build went. All the best. :)
    31
    Deodexing Stock Rom

    For GINGERBREAD ROMS:

    What you need to have:

    • xUltimate v2.3.3 - you can download it HERE (Thanks and Credits to Xeudoxus for this awesome app)
    • Rooted kernel with busybox
    • JDK installed on your Windows system
    • If adb is not available in your windows PC, in xUltimate folder open "jar" folder. You'll find adb there. :)
    Extract stock app & framework folders and Deodex:

    • Connect your device to computer.
    • Start xUltimate (double-click on Main.exe)
    • Select option 1. (Pull /system/app)
    • Once option is done, select option 2. (Pull /system/framework)
    • In the same folder, now you'll see two new folders (origi_app, origi_frame)
    • For I9100G, go to origi_app folder and delete apk and odex files of Maps, PhoneSky and VoiceSearch.
    • Select option 3 in Main menu (Deodex /system/app)
    • Once its done, select option 4 in Main menu (Deodex /system/framework)
    • DONE!!
    Now you'll see two new folders done_app and done_frame.

    Push deodexed app and framework to device:

    • Connect your device to PC in USB debugging mode.
    • Copy done_app and done_frame folders to root of sdcard (/sdcard).
    • Open Windows command prompt and type the below commands.

    Code:
    [LIST]
    [*]adb shell
    [*]su
    [*]stop
    [*]mount -o remount,rw /dev/block/mmcblk0p9 /system
    [*]rm /system/app/*.odex
    [*]rm /system/framework/*.odex
    [*]busybox cp /sdcard/done_app/* /system/app/
    [*]busybox cp /sdcard/done_frame/* /system/framework/
    [*]chmod 644 /system/app/*
    [*]chmod 644 /system/framework/*
    [*]mount -o remount,ro /dev/block/mmcblk0p9 /system
    [*]sync
    [*]reboot recovery
    [/LIST]

    In Recovery, Wipe Cache and Wipe Data/Factory reset.
    Reboot.

    Now you've deodexed app and framework. :)

    For ICS ROMS:

    For ICS Roms, the process is quite easy. (Thanks and Credits to jaydvn.)




    • Download the attached zip file.
    • Extract it on your windows PC.
    • Copy your /system/app to _app folder
    • Copy your /system/framework to _framework folder.
    • Run AutoDEOToolMain.bat
    • Follow the instructions.
    • deodexed jars and apks will be found in deodexed_APK and deodexed_JAR.
    Push deodexed app and framework to device:

    • Connect your device to PC in USB debugging mode.
    • Copy deodexed_APK and deodexed_JAR folders to root of sdcard (/sdcard).
    • Open Windows command prompt and type the below commands.

    Code:
    [LIST]
    [*]adb shell
    [*]su
    [*]stop
    [*]mount -o remount,rw /dev/block/mmcblk0p9 /system
    [*]rm /system/app/*.odex
    [*]rm /system/framework/*.odex
    [*]busybox cp /sdcard/deodexed_APK/* /system/app/
    [*]busybox cp /sdcard/deodexed_JAR/* /system/framework/
    [*]chmod 644 /system/app/*
    [*]chmod 644 /system/framework/*
    [*]mount -o remount,ro /dev/block/mmcblk0p9 /system
    [*]sync
    [*]reboot recovery
    [/LIST]


    In Recovery, Wipe Cache and Wipe Data/Factory reset.
    Reboot.

    Done. :)

    Other references:

    How to deodex ICS roms by samyam2002000

    Enjoy. :)
    25
    Making custom ROM

    Let's move on to make a custom ROM. :)

    Inputs/Feedback/Suggestions are more than welcome. Lets improve this tutorial together for the betterment of the android community. :)

    Steps involved in making a custom ROM:

    • Getting the system dump from the device.
    • Deodexing app and framework folders.
    • Creating various mods by modifying framework and system files.
    • Modifying build.prop and adding tweaks.
    • Making META-INF folder and writing an updater-script (edify scripting).
    • Signing the ROM and making a flashable zip.
    Folder Structure:
    Before going forward, let's follow the below structure folder to make the tutorial more understandable. :)

    Let our ROM name be CustomROM. The folder structure will be C:\Users\<your name>\CustomROM.

    Let's move step by step. Are you ready??


    <b>
    Getting the system dump from the device:


    </b>

    • Make sure USB debugging is ON and connect your device to the PC.
    • Open command prompt on your windows PC and go to CustomROM folder path.
    • Type adb devices. You should be able to see the device detected. (If not check environmental variables whether adb is in system path or not. If not present, add the adb path.)
    • Type the below command to get the dump of system folder.
    Code:
    adb pull /system system/

    Now inside the folder CustomROM, you should be able to see system folder with many folders like app, etc, framework etc inside.

    Done with first step. :)


    <b>
    Deodexing app and framework folders:


    </b>

    Look HERE how to deodex app and framework folders. Copy the app and framework folders to xUltimate folder, rename them to origi_app and origi_frame and follow the given link to deodex.

    NOTE: After deodexing, merge origi_app folder with app folder under C:\Users\<your name>\CustomROM\system\app and origi_frame with framework folder under C:\Users\<your name>\CustomROM\system\framework.


    <b>
    Creating various mods by modifying framework and system files


    </b>

    Okay. This the section where your hardwork, innovation and talent comes in. :) You can use the mods available already, create your own mods, port various mods from other devices and so on.

    Below is a list of various mods which can be ported on to I9100G. All the credits go these respective thread owners. Thanks to them. :)

    NOTE: Let me know more mods with links so that I can add here. :)


    <b>
    Modifying build.prop and adding tweaks


    </b>

    Okay. This is one of those files where you name your ROM(to be visible in settings. ;)) and add many tweaks.

    To name your ROM (to be visible in settings), change the below code.

    Code:
    ro.build.display.id=CustomROM v1.0

    Check the below links for many other tweaks. All credits go to respective thread owners. Thanks to them.

    <b>
    Making META-INF folder and writing an updater-script (edify scripting)


    </b>

    Once you're done with all the modifications, mods and additions, its time to create META-INF folder and make the updater script. Once the user flashes the ROM zip, this is the script that runs and does everything written inside the script. PLEASE BE CAREFUL WITH THIS. TAKE REFERENCE FROM OTHER (SAME DEVICE) ROMS' UPDATER-SCRIPT. (In this case, take reference from other GT-I9100G roms.)

    Check the below links for tutorial and how-to on writing edify script and making updater script. All credits go to respective owners of the threads. Thanks to them.

    Edify Scripting, Making Flashable ZIPs, ZIP Signing & Key Creation
    Edify Scripting Notes
    How to Write an Updater-Script with Edify Code
    Edify Installation Script Syntax's

    NOTE: system folders path, boot/kernel partition path, modem partition path and so on are COMPLETELY DIFFERENT for DIFFERENT DEVICES. Check the partitions for your device properly, carefully and then work on updater-script. TAKE HELP OR REFERENCE FROM OTHER ROM DEVELOPERS FOR YOUR DEVICE.

    Lets move on to last step. Making a signing and making a flashable zip. :)


    <b>
    Signing the ROM and making a flashable zip


    </b>

    Make sure, now you should be able to find two folders (META-INF and system) inside C:\Users\<your name>\CustomROM.

    Check in THIS thread for test signing your ROM. It WORKS with GT-I9100G. TESTED. :)

    or Check THIS thread to create your own signing key and certificate.


    Now you're done with making a custom ROM. Hope to see more custom ROMs from many users. :)

    For porting ROMs, refer THIS tutorial. (thanks and credits to ayushrox)

    Give me your feedback so that I can improve this tutorial. And post here about how your custom ROM making went. All the best. :)
    8
    Root and busybox

    If you don't want to modify anything else except to have root and busybox for the stock rom, Check the below link.

    How to ROOT/UNROOT your I9100G via Stock Recovery (Credits: Ryuinferno)