[DEV] Building CM from scratch (the easy way)! - *nix Shell Script

Search This thread

nicandris

Inactive Recognized Developer
Jan 5, 2009
1,141
215
Amsterdam
plus.google.com
<BACON>

This will Allow you to build CM7-Nightlies or "Kangs" at any time you please.

Compatible with Ubuntu or rpm distros

It's a bash/sh script for automation, as simple as a double click.

it's downloading and installing all files/repos/sdk/adb/fastboot and compiles. (If you already have some of this installed, it prompts before installing)

-------

Please test it, and report bugs here (files attached)
No donations wanted, just click that THANKS button ;)

Github: https://github.com/nicandris/CM-from-scratch


Screenshot-1.png


-------


new build.sh menu
Screenshot-Terminal.png


just unzip on ubuntu/linux and run ./douchebuild.sh
if ./douchebuild.sh is not recognized as an executable, just
Code:
sudo chmod 775 douchebuild.sh
You will be asked for sudo pass (since you edit repos and add adb in bin) and some info for git.

after completing you can always create a fresh build from the Desktop shortcut build.sh

ofcourse i don't take any credits for cm, all credit goes to cyanogen and teamdouche. the script is just a shell compilation of the cm wiki.

</BACON>
 

Attachments

  • androidmake_2.5.3.zip
    9.1 KB · Views: 1,054
  • androidmake_2.5.4.zip
    9.4 KB · Views: 393
  • androidmake_2.7.1.zip
    9.8 KB · Views: 2,899
Last edited:

nicandris

Inactive Recognized Developer
Jan 5, 2009
1,141
215
Amsterdam
plus.google.com
Reserved

If you want to set only udev try this script
View attachment udev.zip
unzip and
Code:
chmod 755 udev.sh

-----

If you already used the main script and want to have the new build.sh menu, run this script
View attachment buildshcreator.zip
-----

if you don't want all the files for all the devices to be synced, follow this!
 
Last edited:

nicandris

Inactive Recognized Developer
Jan 5, 2009
1,141
215
Amsterdam
plus.google.com
Reserved

CHANGELOG

v1
Supporting only Nexus One (initial release)

v2
Supporting all cyanogenmod official devices. Added menu selection for device

v2.0.1
Fixed some nohup issues. Changed some code lines. fixed an if statement

v2.0.2
HD2/Leo support added

v2.1
Various Bugfixes
New build menu

v2.2
Few bug fixes
Some name changes
MORE options in build.sh!!

v2.3
Minor Bug Fixes

Added new devices:
Motorola Cliq XT
LG G2x
LG Optimus 2X
Samsung Captivate
Samsung Vibrant
Barnes & Noble - Nook Color support

Added udev support for Nook Color


v2.3.2

Fixed selection list
Added HTC Incredible 2 Support

v2.4.1
Added Samsung Galaxy S II and Fascinate support
Added Motorola Droid X support
udevs fixed

v2.4.3
Added HTC Tattoo

v2.5.1
Updated Android SDK to v13
Forced repo to sync from github and not from kernel.org (since kernel.org is down for maintenance)
Bugfix


v2.5.2
Added Nexus S 4G

v2.5.3/2.5.4
minor bugfix x4 :p
changed repo fetch URL


v2.7.1
RPM compatibility
Small bugfix
 
Last edited:

Geo411m

Inactive Recognized Developer
Jan 3, 2009
1,064
658
Bartow Florida
guys i made a small shell script for automation. tried it twice on clean ubuntu builds and it works just fine!

it's downloading and installing all files/repos/sdk/adb/fastboot and compiles. if anyone has a clean installation (or has the time to create a new vbox to test it try it)

http://dl.dropbox.com/u/6751304/androidmake

just unzip on ubuntu/linux and run ./androidmake

if you are on x64 run this first:
Code:
sudo apt-get update && sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev sun-java6-jdk gitg qt3-dev-tools libqt3-mt-dev eclipse valgrind pngcrush && sudo update-java-alternatives -s java-6-sun

after completing you can always create a fresh build from the Desktop shortcut build.sh
Thanks. this should come in handy since I just reinstalled my linux desktop. I'll try it out later tonight.
 

prettyboy85712

Senior Member
Jun 28, 2007
1,050
48
Tucson, AZ
guys i made a small shell script for automation. tried it twice on clean ubuntu builds and it works just fine!

it's downloading and installing all files/repos/sdk/adb/fastboot and compiles. if anyone has a clean installation (or has the time to create a new vbox to test it try it)

http://dl.dropbox.com/u/6751304/androidmake

just unzip on ubuntu/linux and run ./androidmake

if you are on x64 run this first:
Code:
sudo apt-get update && sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev sun-java6-jdk gitg qt3-dev-tools libqt3-mt-dev eclipse valgrind pngcrush && sudo update-java-alternatives -s java-6-sun

after completing you can always create a fresh build from the Desktop shortcut build.sh

ofcourse i don't take any credits for cm, all credit goes to cyanogen and teamdouche. the script is just a shell compilation of the cm wiki.

I was planning to do a GUI or text-based version with more options (more phone support etc) but i don't have the time. if anyone wants to do it the script is there have fun ;)

Thanks. I'll give it a shot tonight.
 

willverduzco

User Experience Admin
Staff member
Apr 30, 2010
6,040
3,995
Manassas, VA
Excellent work, and thanks for sharing. This will be very useful for others. I modified the title and stickied this.
 

craigacgomez

Senior Member
Jan 29, 2010
2,215
3,924
Tustin
Sweet... great job... nice to have some shortcuts... now I'm gonna use this to schedule sync and build... thanks a million
 

nicandris

Inactive Recognized Developer
Jan 5, 2009
1,141
215
Amsterdam
plus.google.com
glad to see that this is helping you guys. if anyone has another phone (except N1) it would be really helpful to send me the proprietary files so i can make this for other devices also (i can do it without but it's easier for users if i have the files) i can explain how to obtain them.
 

electrostat

Senior Member
Aug 10, 2010
53
1
Is this working for you on a x86*nix build? I get a warning when I start building that only x64 is supported.
 

drigerott

Senior Member
Jan 1, 2010
335
72
36
Torino
all works perfectly on ubuntu x64 but one thing: how can i build always latest nightly? repo ar different? i must change this? git://github.com/CyanogenMod/android.git -b gingerbread
what is the repo for latest merge? thank you very much thi topic is fantastic
 

nicandris

Inactive Recognized Developer
Jan 5, 2009
1,141
215
Amsterdam
plus.google.com
all works perfectly on ubuntu x64 but one thing: how can i build always latest nightly? repo ar different? i must change this? git://github.com/CyanogenMod/android.git -b gingerbread
what is the repo for latest merge? thank you very much thi topic is fantastic

well this is the latest merge :) just use the buils.sh shortcut from your desktop
 

drigerott

Senior Member
Jan 1, 2010
335
72
36
Torino
mmmm but the latest merge aren't on rom (like profiles on power down screen etc.)

with this repo we build rc1? or nightly? ^_^

and... build.sh doesn't work properly... i modified like this:

cd ~/android/system/;
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread;
repo sync;
cd;
cd ~/android/system/vendor/cyanogen/;
./get-rommanager;
cd ~/android/system/;
. build/envsetup.sh;
lunch cyanogen_passion-eng;
make -j`grep 'processor' /proc/cpuinfo | wc -l` bacon;
cp ~/android/system/out/target/product/passion/update*.zip ~/Scrivania/update-cm7-N1-$(date +%d_%m-%H.%M.%S).zip
echo -e [=-This is an ALPHA-test version of whatever this is-=];



instead of

repo sync ;
cp ./vendor/cyanogen/products/cyanogen_passion.mk ./buildspec.mk;
. build/envsetup.sh;
lunch cyanogen_passion-eng;
make -j`grep 'processor' /proc/cpuinfo | wc -l` bacon;
cp ~/android/system/out/target/product/passion/update*.zip ~/Desktop/update-cm7-N1-$(date +%d_%m-%H.%M.%S).zip


is correct? ^^

thanks for you're replay)
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 107
    <BACON>

    This will Allow you to build CM7-Nightlies or "Kangs" at any time you please.

    Compatible with Ubuntu or rpm distros

    It's a bash/sh script for automation, as simple as a double click.

    it's downloading and installing all files/repos/sdk/adb/fastboot and compiles. (If you already have some of this installed, it prompts before installing)

    -------

    Please test it, and report bugs here (files attached)
    No donations wanted, just click that THANKS button ;)

    Github: https://github.com/nicandris/CM-from-scratch


    Screenshot-1.png


    -------


    new build.sh menu
    Screenshot-Terminal.png


    just unzip on ubuntu/linux and run ./douchebuild.sh
    if ./douchebuild.sh is not recognized as an executable, just
    Code:
    sudo chmod 775 douchebuild.sh
    You will be asked for sudo pass (since you edit repos and add adb in bin) and some info for git.

    after completing you can always create a fresh build from the Desktop shortcut build.sh

    ofcourse i don't take any credits for cm, all credit goes to cyanogen and teamdouche. the script is just a shell compilation of the cm wiki.

    </BACON>
    12
    Reserved

    If you want to set only udev try this script
    View attachment udev.zip
    unzip and
    Code:
    chmod 755 udev.sh

    -----

    If you already used the main script and want to have the new build.sh menu, run this script
    View attachment buildshcreator.zip
    -----

    if you don't want all the files for all the devices to be synced, follow this!
    12
    Reserved

    CHANGELOG

    v1
    Supporting only Nexus One (initial release)

    v2
    Supporting all cyanogenmod official devices. Added menu selection for device

    v2.0.1
    Fixed some nohup issues. Changed some code lines. fixed an if statement

    v2.0.2
    HD2/Leo support added

    v2.1
    Various Bugfixes
    New build menu

    v2.2
    Few bug fixes
    Some name changes
    MORE options in build.sh!!

    v2.3
    Minor Bug Fixes

    Added new devices:
    Motorola Cliq XT
    LG G2x
    LG Optimus 2X
    Samsung Captivate
    Samsung Vibrant
    Barnes & Noble - Nook Color support

    Added udev support for Nook Color


    v2.3.2

    Fixed selection list
    Added HTC Incredible 2 Support

    v2.4.1
    Added Samsung Galaxy S II and Fascinate support
    Added Motorola Droid X support
    udevs fixed

    v2.4.3
    Added HTC Tattoo

    v2.5.1
    Updated Android SDK to v13
    Forced repo to sync from github and not from kernel.org (since kernel.org is down for maintenance)
    Bugfix


    v2.5.2
    Added Nexus S 4G

    v2.5.3/2.5.4
    minor bugfix x4 :p
    changed repo fetch URL


    v2.7.1
    RPM compatibility
    Small bugfix
    5
    You'll actually need to edit android/default.xml and copy your modified file to .repo/manifests/default.xml. Next repo sync, you should see less projects. Mine is now down to 198 from 234.

    WARNING:
    If CM team does make any changes to upstream manifest (add or remove new/obsolete projects), these changes will not be synced to your machine, since default.xml has been modified. To force re-sync with upstream manifest, you'll have to do this ...
    $ cd android
    $ git reset --hard
    $ cd ..
    $ cp android/default.xml .repo/manifests/default.xml
    $ repo sync

    In fact, to discard ALL changes you've made to ALL projects/repositories, do this ...
    $ repo forall -c git reset --hard
    $ repo sync

    5
    Very useful guide! Appreciate hard work!