Compiling Clockwork Mod From Source

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

  1. brando56894

    brando56894 Active Member

    Joined:
    Mar 9, 2010
    Messages:
    1,217
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    New Jersey
    Ratings:
    +0
    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

    brando56894 Active Member

    Joined:
    Mar 9, 2010
    Messages:
    1,217
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    New Jersey
    Ratings:
    +0
    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

    Nerotoxen Member

    Joined:
    May 28, 2010
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +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

    brando56894 Active Member

    Joined:
    Mar 9, 2010
    Messages:
    1,217
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    New Jersey
    Ratings:
    +0
    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

    brando56894 Active Member

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

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    south jersey
    Ratings:
    +0
    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

    droidzone New Member

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

    jeffv2 Developer Developer

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

    brando56894 Active Member

    Joined:
    Mar 9, 2010
    Messages:
    1,217
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    New Jersey
    Ratings:
    +0
    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

    droidzone New Member

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

    brando56894 Active Member

    Joined:
    Mar 9, 2010
    Messages:
    1,217
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    New Jersey
    Ratings:
    +0
    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

    droidzone New Member

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

    jeffv2 Developer Developer

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

    ill try to figure it out
     
  14. jeffv2

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    south jersey
    Ratings:
    +0
    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

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    south jersey
    Ratings:
    +0
    hope i helped... now ill be doing this for my self=]
     
Search tags for this page
build clockworkmod from source
,
clockwork mod source
,
clockworkmod github
,
clockworkmod recovery source
,
clockworkmod recovery source code
,

clockworkmod source

,

clockworkmod source code

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