• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
Search This thread

Shaaan

Inactive Recognized Developer
May 6, 2011
2,387
4,716
Mumbai
Hi. I am creating this guide because i did not find any particular functional guide with details.

You must be running a 64 or 32 bit version of Ubuntu. Please note that i wont be going in the details on how to setup a build environment and sync sources as there are many guides for that.



Step 1 :
Install the required packages



Step 2 :
Setup the build environment and sync the sources for the required CWM. CWM source comes bundled with the CyanogenMod source.
Code:
CWM 5 - Gingerbread
CWM 6 - Jellybean




Step 3 :
Now we come to the actuall compiling part. Make sure you have synced the latest source using the "repo sync" command.
Change directory to your source.
Issue this command :
Code:
make -j4 otatools


Step 3.5 :
Do this step if your device is not officially supported by CM10.
Using terminal emulator on your device, issue the command
Code:
dump_image boot /sdcard/boot.img
This will dump the boot image to your sdcard. Transfer it to your home directory.

To build Android from source for a new device, you need to set up a board config and its makefiles. This is generally a long and tedious process. Luckily, if you are only building recovery, it is a lot easier. From the root of your Android source directory (assuming you've run envsetup.sh), run the following (substituting names appropriately):
Code:
build/tools/device/mkvendor.sh device_manufacturer_name device_name /your/path/to/the/boot.img
For example if you are having the Samsung Galaxy Ace device, the command will go as follows :
Code:
build/tools/device/mkvendor.sh Samsung cooper ~/boot.img

Please note that Cooper is the device name. Only use "~/boot.img" if you have the boot image in your home directory. Or else please specify the correct path.

You will receive the confirmation "Done!" if everything worked. The mkvendor.sh script will also have created the following directory in your Android source tree:

manufacturer_name/device_name

Step 3.5 ends here.




Step 4 :
Now that you have the device config ready, proceed.
Type the following code in your terminal in the source directory.
Code:
. build/envsetup.sh
This will setup the build environment for you to work.

Now launch the command
Code:
lunch full_device_name-eng

This will set the build system up to build for your new device. Open up the directory in a file explorer or IDE. You should have the following files: AndroidBoard.mk, AndroidProducts.mk, BoardConfig.mk, device_.mk, kernel, system.prop, recovery.fstab, and vendorsetup.sh.

The two files you are interested in are recovery.fstab and kernel. The kernel in that directory is the stock one that was extracted from the boot.img that was provided earlier. For the most part, recovery.fstab will work on most devices that have mtd, emmc, or otherwise named partitions. But if not, recovery.fstab will need to be tweaked to support mounts and their mount points. For example, if your /sdcard mount is /dev/block/mmcblk1p1, you would need the following lines in your BoardConfig.mk

/sdcard vfat /dev/block/mmcblk1p1


Once the recovery.fstab has been properly setup, you can proceed to the next step.




Step 5 :
Now we build the actual recovery.
Code:
make -j4 recoveryimage
This command builds the recovery image

You can use the command
Code:
make -j4 recoveryzip
to make a fakeflash recovery i.e. a temporary recovery to test out on the actual device.

Your recovery can then be found at "your_source_directory/OUT/target/product/device/recovery.img" and the temporary fakeflash zip in the utilities folder at the same location.

If everything works out well, you will have a working recovery.

Once you have working builds, notify "koush", on Github and he can build official releases and add ROM Manager support!


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



Some tips :

  • If you want to compile CWM 6, sync the jellybean branch using the command :
    Code:
    repo init -u git://github.com/CyanogenMod/android.git -b jellybean
    
    repo sync


  • If you want to compile CWM 6 on a 32 bit system, you need to sync THIS source too. Instructions are given in the readme.

  • Run "make clobber" between builds if you change the BoardConfig.mk, or the change will not get picked up.


Credits :
Koush for this guide.
 
Last edited:

dsb9938

Inactive Recognized Developer
Sep 17, 2010
1,748
3,125
53
Edison, NJ
Okay, I'm problly stupid, but.

repo init -u git://github.com/CyanogenMod/android.git -b jellybean

seems to work fine, but

repo sync does this:

Code:
fatal: '../CyanogenMod/android_abi_cpp.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
error: Cannot fetch CyanogenMod/android_abi_cpp
What did I screw up, or not have prepared correctly?

I have built AOSP and currently build kernels on this box, so I know git and all that is setup correctly.

D

.
 
Last edited:

einstein.frat

Senior Member
Mar 7, 2012
830
1,847
what's this ?

Hey guys, i present to you a new updated version of CyanogenMod Recovery a.k.a CWM 6.0.1.3. The current version that we use is 5.0.2.6

Edit : As you guys know, i bricked my ace while trying to get CWM working. The bootloader is lost. So there is no way i can get it working back. This is the end of developing for me for now atleast. I will have to replace the motherboard or get a new device. Any dev wanting to take over the project, please feel free. Contact me for help and i will try my best. But if you use my sources, please give credits to me and TeamCooper.

My sources are here.

Edit : You can refer my guide on compiling a recovery here.

now afraid to do it on my own :rolleyes:
 
  • Like
Reactions: haiviet

[email protected]

Senior Member
Nov 7, 2011
244
89
Can jou tell a bit more about run "envsetup.sh"thats what i mis in this guide and the original guide. and most other guides.

The file "dump_image" needs to be placed on the phone. Can be put on the sd of the phone and than place on a place you like.(Folder bin/xbin ore some other) Use terminal on the phone. (any from google store play) cd to the dir the dump_image is than run the command.

How do i find the device name for my phone/tablet. I know the name of the tablet i bought.. But still. samsung ace hase device name cooper? Where did you find it?
Thx by the way. This guide is a bit more clear than the original.
 
Last edited:

shabbypenguin

Inactive Recognized Developer
May 30, 2010
4,896
5,364
34
Can jou tell a bit more about run "envsetup.sh"thats what i mis in this guide and the original guide. and most other guides.

The file "dump_image" needs to be placed on the phone. Can be put on the sd of the phone and than place on a place you like.(Folder bin/xbin ore some other) Use terminal on the phone. (any from google store play) cd to the dir the dump_image is than run the command.

How do i find the device name for my phone/tablet. I know the name of the tablet i bought.. But still. samsung ace hase device name cooper? Where did you find it?
Thx by the way. This guide is a bit more clear than the original.

dump_image would be on the phone, it was for MTD devices now a days ytou want to use DD on mmcblk devices
 

dany547

Senior Member
Feb 8, 2008
1,386
939
Iași
www.geekchronicles.ro
i solved the font problem, you need to edit the Anndroid.mk from bootable/recovery, but now i got messed up Graphics in the recovery and i cannot boot back into the OS.:confused: ideeas? thanks
PS: i think that the graphics.c may be the problem. but for booting, i really have no clue.
 

Phil3759

Inactive Recognized Developer
May 30, 2012
9,577
33,054
This will give you a non touch version of CWM

Any idea if the touch modifications are also available opensource to modify code?
 

[email protected]

Senior Member
Nov 7, 2011
244
89
Thx for the answar on my question.:good:

I have a nother question:silly: For example, my recovery.fstab hase: /sdcard mount is /dev/block/mmcblk1p1
What lines do i ad in my BoardConfig.mk:

? what is here? /sdcard vfat /dev/block/mmcblk1p1
just adding /sdcard vfat /dev/block/mmcblk1p0 does not seem to work..

my recovery.fstab:
# mount point fstype device [device2]

/boot mtd boot
/cache yaffs2 cache
/data yaffs2 userdata
/misc mtd misc
/recovery mtd recovery
/sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0
/system yaffs2 system
/sd-ext ext4 /dev/block/mmcblk0p2

My vold.fstab hase:
# External NAND Storage
dev_mount sdcard /mnt/sdcard auto /devices/virtual/block/ndda

# External SD card
dev_mount ext_sd /mnt/ext_sd auto /devices/platform/tcc-sdhc

# External USB storage
dev_mount usb_sda /mnt/usb_sda1 all /devices/platform/dwc_otg /devices/platform/tcc-ohci /devices/platform/tcc-ehci
dev_mount usb_sdb /mnt/usb_sdb1 all /devices/platform/dwc_otg /devices/platform/tcc-ohci /devices/platform/tcc-ehci

Some other info i found..:
/dev/block/platform/tcc-sdhc0.0/mmcblk0

if i use mount in terminal i get this:
/dev/block/vold/179:0 /mnt/ext_sd vfat ...
/dev/block/vold/240:0 /mnt/sdcard vfat ...

cat /proc/mtd
geeft:
dev: size: erasersize: name:
mtd0 00a00000 00100000 ¨boot¨
mtd1 00500000 00100000 ¨kpanic¨
mtd2 12c00000 00100000 ¨system¨
mtd3 00400000 00100000 ¨plash¨
mtd4 09600000 00100000 ¨cache¨
mtd5 40000000 00100000 ¨userdata¨
mtd6 00a00000 00100000 ¨recovery¨
mtd7 00100000 00100000 ¨misc¨
mtd8 00100000 00100000 ¨tcc¨

partitions /proc/partitions:
major: minor: #blocks name:
7 0 16664 loop0
31 0 10240 mtdblock0
31 1 5120 mtdblock1
etc/ sow on
179 0 15339520 mmcblk0
240 0 2392064 ndda
240 1 2392064 ndda1
240 0 16663 dm-0

My boot.img files on github. + some adding ...(/device/YG/m805_892x) https://github.com/Frank77GLD/Telechip_tcc892x
(just testing a github for fun...)

Hope you could give me some advice?:D
 

zilan

Senior Member
Sep 9, 2008
814
520
can someone please make an english working cwm for samsung galaxy young cdma ich-509 please?
 
Porting to a new "unknown" device

Hi folks. I`m trying to start to develop some stuff to an chinese tablet and, of course, my first need is the cmw ...
Then. I only can have it using the fakeflash method(locked bootloader). My problem that it`s kinda new stuff to me.
I have some files built by utkanos to start the job. But now I dont know where to go to ...
Theere appears do be no documentation in what files in what folders I have to edit/add to get it fully functional.
When i flash the zip and the cwm load there`s no partition table. It loads a lot of errors on the screen saying no /dev/block* ...
I little help will be much appreciated here. Even just a start point .. anything that can help!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 128
    Hi. I am creating this guide because i did not find any particular functional guide with details.

    You must be running a 64 or 32 bit version of Ubuntu. Please note that i wont be going in the details on how to setup a build environment and sync sources as there are many guides for that.



    Step 1 :
    Install the required packages



    Step 2 :
    Setup the build environment and sync the sources for the required CWM. CWM source comes bundled with the CyanogenMod source.
    Code:
    CWM 5 - Gingerbread
    CWM 6 - Jellybean




    Step 3 :
    Now we come to the actuall compiling part. Make sure you have synced the latest source using the "repo sync" command.
    Change directory to your source.
    Issue this command :
    Code:
    make -j4 otatools


    Step 3.5 :
    Do this step if your device is not officially supported by CM10.
    Using terminal emulator on your device, issue the command
    Code:
    dump_image boot /sdcard/boot.img
    This will dump the boot image to your sdcard. Transfer it to your home directory.

    To build Android from source for a new device, you need to set up a board config and its makefiles. This is generally a long and tedious process. Luckily, if you are only building recovery, it is a lot easier. From the root of your Android source directory (assuming you've run envsetup.sh), run the following (substituting names appropriately):
    Code:
    build/tools/device/mkvendor.sh device_manufacturer_name device_name /your/path/to/the/boot.img
    For example if you are having the Samsung Galaxy Ace device, the command will go as follows :
    Code:
    build/tools/device/mkvendor.sh Samsung cooper ~/boot.img
    
    Please note that Cooper is the device name. Only use "~/boot.img" if you have the boot image in your home directory. Or else please specify the correct path.

    You will receive the confirmation "Done!" if everything worked. The mkvendor.sh script will also have created the following directory in your Android source tree:

    manufacturer_name/device_name

    Step 3.5 ends here.




    Step 4 :
    Now that you have the device config ready, proceed.
    Type the following code in your terminal in the source directory.
    Code:
    . build/envsetup.sh
    This will setup the build environment for you to work.

    Now launch the command
    Code:
    lunch full_device_name-eng

    This will set the build system up to build for your new device. Open up the directory in a file explorer or IDE. You should have the following files: AndroidBoard.mk, AndroidProducts.mk, BoardConfig.mk, device_.mk, kernel, system.prop, recovery.fstab, and vendorsetup.sh.

    The two files you are interested in are recovery.fstab and kernel. The kernel in that directory is the stock one that was extracted from the boot.img that was provided earlier. For the most part, recovery.fstab will work on most devices that have mtd, emmc, or otherwise named partitions. But if not, recovery.fstab will need to be tweaked to support mounts and their mount points. For example, if your /sdcard mount is /dev/block/mmcblk1p1, you would need the following lines in your BoardConfig.mk

    /sdcard vfat /dev/block/mmcblk1p1


    Once the recovery.fstab has been properly setup, you can proceed to the next step.




    Step 5 :
    Now we build the actual recovery.
    Code:
    make -j4 recoveryimage
    This command builds the recovery image

    You can use the command
    Code:
    make -j4 recoveryzip
    to make a fakeflash recovery i.e. a temporary recovery to test out on the actual device.

    Your recovery can then be found at "your_source_directory/OUT/target/product/device/recovery.img" and the temporary fakeflash zip in the utilities folder at the same location.

    If everything works out well, you will have a working recovery.

    Once you have working builds, notify "koush", on Github and he can build official releases and add ROM Manager support!


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



    Some tips :

    • If you want to compile CWM 6, sync the jellybean branch using the command :
      Code:
      repo init -u git://github.com/CyanogenMod/android.git -b jellybean
      
      repo sync


    • If you want to compile CWM 6 on a 32 bit system, you need to sync THIS source too. Instructions are given in the readme.

    • Run "make clobber" between builds if you change the BoardConfig.mk, or the change will not get picked up.


    Credits :
    Koush for this guide.
    8
    I would like to ask if someone could compile CMW Recovery for my device Samsung GT-S7710 running JB? I do not know much about linux :/
    I can provide the necessary files, and of course 30 euros donation via PayPal for working recovery :)

    This is orginal revocery: http://www.mediafire.com/?was97s3r2wo97wk
    orginal boot: http://www.mediafire.com/view/?st3aj5854r4l1sg

    if you need some other files, please write :)
    4
    Tried, atlast found this:
    Code:
    make -j4 out/host/linux-x86/bin/unpackbootimg
    It in turn shows
    Code:
    unpackbootimg is up-to-date

    then I again try with

    Code:
    build/tools/device/mkvendor.sh lge p500 ~/boot.img

    But still the same error as posted earlier :/

    Umm.. Weird.
    Grab the unpackbootimg binary from out/host/linux-x86/bin/unpackbootimg and paste it to /usr/bin. Reboot.
    Then run the make command again.
    2
    Nice.
    Will come in handy ;)
    2
    but "make -j4 otatools "run ok

    Didn't tell me any wrong.

    Can I port the rec from ics source to my device with 2.3.5?

    Sent from my XT316 using xda premium

    If make otatools executed successfully the files should be there. But since they are not there, it didn't succeed!
    Recovery and rom are two separate things. You can run any version of recovery on any version of a ROM.

    ___________XDA Premium__________
    Don't be a noob. Be a newbie..!!
    Details here.
    ____________________________________