Compiling Clockwork Mod From Source

Discussion in 'Android Hacks and Help' started by brando56894, Dec 20, 2010.

  1. brando56894
    Offline

    brando56894 New Member

    Joined:
    Mar 9, 2010
    Messages:
    1,217
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    New Jersey
    Edit: It seems like I forgot a major requirement: you need to have Ubuntu (or a variant of it) installed

    After two days and countless hours spent I finally figured out how to make a custom version of ClockworkMod Recovery for the OG Droid. Everything will easily be done by two bash scripts.

    The first script will set up the build environment by pulling the source tree from Cyanogens github and pulling proprietary files from your phone.

    The second script will compile the source code and automatically flash the recovery you just built, then reboot into it for you to test it out.

    The attached zip file has both of these scripts plus ADB. All you have to do is extract them, execute setup.sh, change whatever you want, execute flash_recovery.sh and then bask in your creation! warning: the scripts above are newer, use those

    Note: the setup.sh only needs to be run once, each successive time just run flash_recovery.sh

    Or if you want to take the easy way out heres the image I compiled. Put it on your sdcard and acquire root access in a terminal then type flash_image recovery /sdcard/recovery.img thats it! It doesn't like to flash some zip files for some reason.

    Changes from stock
    1. Removed Factory Default option and replaced with a complete phone wiping option
    1. Wipe all but sdcard does what it says, wipe is done twice to ensure a clean partition.
    2. Removed all the extra "No's" from the confirmation screens

    Known Bugs
    1. Wont flash certain zips, namely those that use the amend scripting language, which is no longer supported.

    Attached Files:

  2. brando56894
    Offline

    brando56894 New Member

    Joined:
    Mar 9, 2010
    Messages:
    1,217
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    New Jersey
    Anyone? I know I have to set up a vendor system or something (I know koush has one that everyone uses for roms but Ive never built a custom rom) but no idea how to go about it. Once I get it to work Ill upload it for everyone.
  3. Nerotoxen
    Offline

    Nerotoxen New Member

    Joined:
    May 28, 2010
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
    I wish I had the know how to do this stuff... I got linux installed, just need to start reading more! If you can't find any help here check out xda developers forum for some Q&A. Those guys have some good faq's to check out. I'm sure someone on here has the knowledge to help out though!

    GL and keep us updated!
  4. brando56894
    Offline

    brando56894 New Member

    Joined:
    Mar 9, 2010
    Messages:
    1,217
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    New Jersey
    Someone on here (I forget who ATM) made a custom SPR so at least one person has to know how to do it, I'm sure its not that much different (if at all!).
  5. brando56894
    Offline

    brando56894 New Member

    Joined:
    Mar 9, 2010
    Messages:
    1,217
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    New Jersey
    I just learned Java and IIRC the code isnt java.
  6. jeffv2
    Offline

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    south jersey
    i posted on here earlier but didn't fully understand your question.. but could you post the source code or a link to where you found it? I've been looking all over for it
  7. droidzone
    Offline

    droidzone New Member

    Joined:
    Sep 24, 2010
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    India
    So does anyone else know how to compile the code and convert it into an .img file?
  8. jeffv2
    Offline

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    south jersey
    give me a link to the source code and ill figure it out
  9. brando56894
    Offline

    brando56894 New Member

    Joined:
    Mar 9, 2010
    Messages:
    1,217
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    New Jersey
    I dont remember where I got it from originally, but heres my modified version. I probably have the original archive somewhere on my ext4 partition but im in windows right now.

    I'd like to add an option in there that says "Wipe All" which will do double passes on /boot, /cache, /data and /system. But thats going to take a little figuring out. So far all I did was remove all the annoying "No's" and made it wipe everything twice.

    BTW the source code is written in C.
  10. droidzone
    Offline

    droidzone New Member

    Joined:
    Sep 24, 2010
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    India
  11. brando56894
    Offline

    brando56894 New Member

    Joined:
    Mar 9, 2010
    Messages:
    1,217
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    New Jersey
    Im thinking maybe gcc since the majority of android is compiled on linux and gcc is the linux C compiler. The confusing thing is that there isnt a configure script or a make file so Im at a loss of what to do. I think this is where the vendor setup comes into play.
  12. droidzone
    Offline

    droidzone New Member

    Joined:
    Sep 24, 2010
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    India
    Ok. If you manage to compile it, please do post here.
  13. jeffv2
    Offline

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    south jersey
    hah, i didn't realise it was under cyanogen mods github

    ill try to figure it out
  14. jeffv2
    Offline

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    south jersey
    download cyanogens full source code then run make after setting up your devices build environment.... the recovery.img will be located at ~/android/system/out/target/product/yourdevice/recovery.img
  15. jeffv2
    Offline

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    south jersey
    hope i helped... now ill be doing this for my self=]
  16. pc747
    Offline

    pc747 DF Administrator Staff Member Rescue Squad

    Joined:
    Dec 23, 2009
    Messages:
    17,530
    Likes Received:
    1,057
    Trophy Points:
    113
    May I suggest asking Koush.
  17. brando56894
    Offline

    brando56894 New Member

    Joined:
    Mar 9, 2010
    Messages:
    1,217
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    New Jersey
    Download the full source code of what? android_vendor_cyanogen? android_device_motorola_sholes? can you explain how to set it up? Thats the part where I'm lost....
  18. jeffv2
    Offline

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    south jersey
    download the entire cyanogen source tree.. follow this Compile CyanogenMod for Sholes - CyanogenMod Wiki ... run command "make" after your vendor setup and your recovery.img will be in /out/target/product/sholes/recovery.img
  19. jeffv2
    Offline

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    south jersey
    like this.

    [​IMG]
  20. brando56894
    Offline

    brando56894 New Member

    Joined:
    Mar 9, 2010
    Messages:
    1,217
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    New Jersey
    Cool Thanks, I'll try it out.
Search tags for this page
build android bootable recovery
,
build clockworkmod from source
,
clockwork mod source
,
clockworkmod github
,

clockworkmod recovery source

,
clockworkmod recovery source code
,

clockworkmod source

,

clockworkmod source code

,
clockworkmod source code download
,
cwm recovery source code
,
how to build clockworkmod recovery from source
,
how to compile clockworkmod recovery