yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] nicandris:
<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

-------

new build.sh menu

just unzip on ubuntu/linux and run ./douchebuild.sh

if ./douchebuild.sh is not recognized as an executable, just

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>
[Android Software/Hacking General [Developers Only]] nicandris:
Reserved

If you want to set only udev try this script

View attachment 573388

unzip and

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 619473

-----

if you don't want all the files for all the devices to be synced, follow this!
[Android Software/Hacking General [Developers Only]] nicandris:
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
[Android Software/Hacking General [Developers Only]] Geo411m:
Thanks. this should come in handy since I just reinstalled my linux desktop. I'll try it out later tonight.
[Android Software/Hacking General [Developers Only]] prettyboy85712:
Thanks. I'll give it a shot tonight.
[Android Software/Hacking General [Developers Only]] rori~:
can´t test it anymore, as I got all setup..but for future, just great! :cool:
[Android Software/Hacking General [Developers Only]] nicandris:
well take the ./build.sh only :P it's helpfull (for me that i'm bored to type the make bacon)
[Android Software/Hacking General [Developers Only]] willverduzco:
Excellent work, and thanks for sharing. This will be very useful for others. I modified the title and stickied this.
[Android Software/Hacking General [Developers Only]] Lultima:
Sounds Good i'm on testing...
[Android Software/Hacking General [Developers Only]] nicandris:
thanx for sticking this up ;)

guys please test and if you find anyth wrong msg me to check it out.
[Android Software/Hacking General [Developers Only]] Lultima:
After 3 hours i have a compiled Kang-update.zip !!! Thanks ;)
[Android Software/Hacking General [Developers Only]] craigacgomez:
Sweet... great job... nice to have some shortcuts... now I'm gonna use this to schedule sync and build... thanks a million
[Android Software/Hacking General [Developers Only]] electrostat:
Trying on Debian right now (commented out the sources update ;)) Will post back with results.
[Android Software/Hacking General [Developers Only]] nicandris:
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.
[Android Software/Hacking General [Developers Only]] electrostat:
Is this working for you on a x86*nix build? I get a warning when I start building that only x64 is supported.
[Android Software/Hacking General [Developers Only]] nicandris:
i tried it twice on a x86 and it was fine. AOSP or tmobile's theme engine is not compiling on x86 but cm7 is. i think i twitted abt this a couple of days ago.

http://twitpic.com/43mezo
[Android Software/Hacking General [Developers Only]] electrostat:
Sweet. It's building right now, don't care much about tmobile's theme anyway :)
[Android Software/Hacking General [Developers Only]] drigerott:
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
[Android Software/Hacking General [Developers Only]] nicandris:
well this is the latest merge :) just use the buils.sh shortcut from your desktop
[Android Software/Hacking General [Developers Only]] drigerott:
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:

instead of

is correct? ^^

thanks for you're replay)
[Android Software/Hacking General [Developers Only]] nicandris:
@crachel go to ~/android/system and run this commands.

make clean
make clobber
[Android Software/Hacking General [Developers Only]] crachel:
Thanks nicandris, that fixed it when I run your script, no more "RC2"

It does however still throw errors about the mecha when I just type "repo sync" in the android/system dir, but I don't really care about that.. just unclear as to why
[Android Software/Hacking General [Developers Only]] Futbolista:
great post! definitely useful
[Android Software/Hacking General [Developers Only]] nicandris:
go to ~/android/system and post the output of

repo diff
[Android Software/Hacking General [Developers Only]] crachel:
crachel@[snip]:~/android/system$ repo diff
crachel@[snip]:~/android/system$
[Android Software/Hacking General [Developers Only]] jazi1:
thank for sticking this up
[Android Software/Hacking General [Developers Only]] Desert Storm:
I'll try on my Arch Linux build, when I have the time.
[Android Software/Hacking General [Developers Only]] Sarkie:
Hi,

Had issues with the script being behind a proxy at work, to fix it, I changed the git:// to http:// maybe ask when booting?

Also tried doing the stuff manually in the script but doesn't seem to work. "doing it wrong" probably.
[Android Software/Hacking General [Developers Only]] Sarkie:
Well fix it, near enough followed most of the instructions off this.

http://thanhpt25.wordpress.com/2010/11/05/android-first-step-download-and-build/

Then read the script and did some stuff manually, maybe at the beginining of the script

"Use git:// or http://"

Then edit your downloads and edit the repo script once you've downloaded it to change the REPO_URL.
[Android Software/Hacking General [Developers Only]] nicandris:
can you send me the edited script? i would like to take a look at it and if needed i'm gonna incorporate it :P thx
[Android Software/Hacking General [Developers Only]] Sarkie:
Still working through issues ! :) not updated it, just going through the commands manually.

Need to update the manifest.xml to point to http:// too! :)
[Android Software/Hacking General [Developers Only]] Sarkie:
Grr, didn't know I need an x64 system to build it! :) Well got all the way to it, had an issue with

repo sync -j16

though, had to do it 4 times to finally complete, so maybe a while loop in there might help.

"Did the Repo sync correctly?"

Thank you for the _vendor, _device, _udev_v stuff!!! very useful, don't really know bash, but can you include other scripts? Since I think that's a useful script we can call, then the community can use it?

I'll look into the bash stuff and hopefully up the git, i'll ask for a pull request.
[Android Software/Hacking General [Developers Only]] nicandris:
-well i build in x86 so i dont think x64 is necessary

-gonna include it (had more requests)

-what other scripts do you have in mind?
[Android Software/Hacking General [Developers Only]] Sarkie:
Just think you should extract the code for the udev stuff to another script, since that's probably the hardest thing to do.

So if someone wants to just set up that, they can run that script on its own?

Regarding x86, it says "As of Froyo, you need x64 to build"
[Android Software/Hacking General [Developers Only]] nicandris:
x86 is just fine :)

abt the udev script, check this out
[Android Software/Hacking General [Developers Only]] crachel:
thats for building AOSP, CM has removed the requirement
[Android Software/Hacking General [Developers Only]] Sarkie:
Well the last line is

edit: whole log file from stdout stderr

http://paste.pocoo.org/show/375138/

The stlport directory is empty...
[Android Software/Hacking General [Developers Only]] nicandris:
hey guys! added a new menu for the build script and some fixes (repo sync check etc) v2.1 is in the front post!

If you already used this script before you dont need to run it from the begining, just run the buildshcreator.sh from post 2
[Android Software/Hacking General [Developers Only]] Sarkie:
So i'll put this here, don't mean to be offtopic but I had to revert this change

https://github.com/CyanogenMod/andr...492d7bb6730e1d881be98278#commitcomment-351911

In order for it compile, currently making now.
[Android Software/Hacking General [Developers Only]] nicandris:
good catch. we have not seen nighlties for 4days in a row, so i guess the guys are up to smth?
[Android Software/Hacking General [Developers Only]] stellarwu:
闲来无事 下载下来试一试
[Android Software/Hacking General [Developers Only]] Sarkie:
I think the build was broken so wasn't my end. I've got my VM to before, so going to update the bash script, add some grep / replace code since it'll need to update the files on the fly then see what you think. My first bash script, so I'll need to learn the syntax first :)

Keep you posted. Sarkie.
[Android Software/Hacking General [Developers Only]] ibrahim68:
ThanksThanks
[Android Software/Hacking General [Developers Only]] nicandris:
Anyone would like the new features in the menu?
[Android Software/Hacking General [Developers Only]] harmohn:
Hell yes!! :)
[Android Software/Hacking General [Developers Only]] 007nites:
Yep!!!!Nice
[Android Software/Hacking General [Developers Only]] Mattix724:
Looks promising. I will give this a try. Can I run this with cygwin on my x64 7 machine?
[Android Software/Hacking General [Developers Only]] lilflip21:
Looks good.. when is this coming out?
[Android Software/Hacking General [Developers Only]] nicandris:
as soon as i have some spare time ;) any other features that you wanna see here?
[Android Software/Hacking General [Developers Only]] de_annere:
Thanks for your great script!

Just a small note, the script echos the wrong name for the ZTE Blade:

But udev gets set up the right way, and works great, just like the rest :)

Only thing I had problems with was repo init. It just timed out, needed to remove the directory android/system and try again. After 10 times getting problems through this step it worked, and it's building atm.
[Android Software/Hacking General [Developers Only]] denis9908:
thx a lot bro...:)
[Android Software/Hacking General [Developers Only]] de_annere:
How about

cd ~android/system
. build/envsetup.sh
lunch 1
make
emulator

for the java coders? :)
[Android Software/Hacking General [Developers Only]] bikooo3878:
that sound cool !
[Android Software/Hacking General [Developers Only]] lilflip21:
any updates nicandris :) thanks
[Android Software/Hacking General [Developers Only]] nicandris:
i have an examination tomorrow. when i finish it will get a lot of sleep and will post an update as soon as i can ;)
[Android Software/Hacking General [Developers Only]] lilflip21:
Thank you!! and good luck on the exam
[Android Software/Hacking General [Developers Only]] nicandris:
adding the code now. that's just it? noth else needed?
[Android Software/Hacking General [Developers Only]] nicandris:
well... as promised ;)

androidmake v2.2 on the first post (minor changes)

if you already used androidmake and want the new menu, use the file from the second post!
[Android Software/Hacking General [Developers Only]] Matt Devo:
the main douchebuild.sh script in 2.2 is missing ';;' in between lines 296/297
[Android Software/Hacking General [Developers Only]] nicandris:
whoops :P forgot to upload the corrected one. it's already in github. i use a windows pc and it gives me EOF errors if i copy-paste the script here, so i will do it as soon as i get home ;)

**edit: fixed - reuploaded 2.2.1

hmmmmmmmmm more devices added to CM...

i guess i will have to make a v2.3
[Android Software/Hacking General [Developers Only]] xsteven77x:
Gonna try this, have no clue what i'm doing so here goes!
[Android Software/Hacking General [Developers Only]] nicandris:
well give it a try and let me know if you need any help :P it's actually pretty easy :)
[Android Software/Hacking General [Developers Only]] TheKiD075:
This is by far the greatest tool ever. It makes it so easy to create your own CM7 "nightlies". Thank you Nic you are a scholar and a genius!

Sent from my Cyanmodded Incredible.
[Android Software/Hacking General [Developers Only]] jivany:
yes indeed. is ther a way to use this to compile aosp?
[Android Software/Hacking General [Developers Only]] aitorTheRed:
To compile AOSP you can check the source.android.com page.

You have first to initialize the environment http://source.android.com/source/initializing.html

Then download the source http://source.android.com/source/downloading.html

and finally, build the project http://source.android.com/source/building.html

:)
[Android Software/Hacking General [Developers Only]] dttung80:
Thanks for share. :)
[Android Software/Hacking General [Developers Only]] aoooz:
+ 1 from me !
[Android Software/Hacking General [Developers Only]] heybobitsme:
Reading the op, this tool installs everything. As I already have the sdk installed and adb and fastboot with the udev rules, will this tool skip those as they are already there, or will it replace these? It looks like I just need the repos.

Edit: Nvm. Ran the script and found it asks if the sdk is installed. Nice. :)
[Android Software/Hacking General [Developers Only]] nicandris:
;) i'm one step ahead of you :P haha
[Android Software/Hacking General [Developers Only]] nicandris:
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

*edit* updated buildshcreator.zip with new devices
[Android Software/Hacking General [Developers Only]] MAster224:
Begin learning to Code (Check)
[Android Software/Hacking General [Developers Only]] heybobitsme:
Hi! Noob here!

What am I doing wrong here?

Select Option(1-13): 1
/home/rob/Desktop/Builds/build.sh: 165: [[: not found
/home/rob/Desktop/Builds/build.sh: 165: 1: not found

Cleaning build files...
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.4
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GINGERBREAD
============================================
mkdir: cannot create directory `out': Permission denied
/bin/bash: out/target/product/generic/clean_steps.mk: No such file or directory
mkdir: cannot create directory `out': Permission denied
Checking build tools versions...
mkdir: cannot create directory `out': Permission denied
/bin/bash: out/casecheck.txt: No such file or directory
/bin/bash: out/CaseCheck.txt: No such file or directory
cat: out/casecheck.txt: No such file or directory
build/core/main.mk:91: ************************************************************
build/core/main.mk:92: You are building on a case-insensitive filesystem.
build/core/main.mk:93: Please move your source tree to a case-sensitive filesystem.
build/core/main.mk:94: ************************************************************
build/core/main.mk:95: *** Case-insensitive filesystems not supported. Stop.

All I did was choose Make Clean to see how this runs and this was my output.
[Android Software/Hacking General [Developers Only]] nicandris:
emmmmm try option 4: Clobber/Clean/Build... i never had this issue... if not working try

sudo ./build.sh

since it gives permission errors
[Android Software/Hacking General [Developers Only]] heybobitsme:
Ok, that got rid of the permissions errors, but now 2 things: I'm still getting this error:

./Builds/build.sh: 165: [[: not found
./Builds/build.sh: 165: 4: not found

But the file is there.

Second:

Select Option(1-13): 4
./Builds/build.sh: 165: [[: not found
./Builds/build.sh: 165: 4: not found

Cleaning build files and output directory...
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.4
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GINGERBREAD
============================================
Cleaning out/target/product/generic...
Cleaning out/target/common...
Clean.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.4
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GINGERBREAD
============================================
Entire build directory removed.
Building...
./Builds/build.sh: 165: repo: not found
build/envsetup.sh: 1: Syntax error: "(" unexpected

I'm confused as to why I'm getting a Syntax error After running clean/clobber/build.
[Android Software/Hacking General [Developers Only]] nicandris:
ok a couple of things to try.

download buildshcreator.zip from the second post and run it

if you still have this issues, place the build.sh in your ¬/android/system folder and try again
[Android Software/Hacking General [Developers Only]] heybobitsme:
I downloaded and ran buildshcreator.sh earlier this morning and ran it. I followed your second suggestion and am still getting the syntax error on Build and it actually kicks me out of the menu.

Also I tried to repo sync and

Repo Syncing...
error: cannot open /home/rob/android/system/.repo/manifests.git/FETCH_HEAD: Permission denied

error: cannot open /home/rob/android/system/.repo/repo/.git/FETCH_HEAD: Permission denied

error: Cannot fetch repo

I have no idea why it wouldn't have permission as the whole system folder is root. Correct?
[Android Software/Hacking General [Developers Only]] nicandris:
i don't know... tried searching but no particular answers.

try:

sudo rm -rf ~/android/system/.repo
curl http://android.git.kernel.org/repo > ~/bin/repo
chmod a+x ~/bin/repo
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
repo sync -j16

this will reinitialize the repo but your files will remain there... if still no success, delete the whole ~/android dir and begin again
[Android Software/Hacking General [Developers Only]] heybobitsme:
I'll try that. Thanks for your patience.
[Android Software/Hacking General [Developers Only]] crachel:
Hey guys,

Koush has several (maybe all) of the proprietary vendor files available on his Git https://github.com/koush

I had some issues building for my DZ not too long ago where somehow my proprietary files weren't up to date, so what I want to do is initialize Koush's git for the vendors I build for in

~/android/system/vendor/htc

~/android/system/vendor/samsung

etc...

When I clone the directory down to my server, it puts it in a dir called "/proprietary_vendor_htc" not simply "htc".

Ideally, when I run my scripts to build for a particular device, I would like for it to sync the proprietary folders as well, how can this be done?
[Android Software/Hacking General [Developers Only]] nicandris:
well this is pretty useful ;) thanx for sharing

i will incorporate it in version 3. Will take some time though, flying to Berlin on Monday and then Amsterdam on Saturday :P i will try not to burn a lot of brain sells (unlikely) and i will finish it when i'll be back
[Android Software/Hacking General [Developers Only]] crachel:
Just figured out how to clone into the correct folder

git clone git://github.com/koush/proprietary_vendor_htc.git htc

now, if it would just sync upon every build..
[Android Software/Hacking General [Developers Only]] nicandris:
well if i am not mistaken, you just have to cd to yout htc direcory and use the repo sync command. so it should be smth like

cd ~/android/system/vendor/htc
repo sync
cd ~/android/system
[Android Software/Hacking General [Developers Only]] .droid:
build.sh

Urmm, after using douchebuild.sh, there was no build.sh on my desktop. How do I get build.sh? :confused:
[Android Software/Hacking General [Developers Only]] nicandris:
did u get any errors from douchebuild? if not download buildsdcreator from the second post
[Android Software/Hacking General [Developers Only]] Multiburatino:
thanks thanks a lot. so nice!
[Android Software/Hacking General [Developers Only]] nicandris:
you know there is a thanx button dont you? :P kiding
[Android Software/Hacking General [Developers Only]] Imperticus:
I keep getting this error, can anyone tell me whats wrong please.. i'm trying to compile ROM for LG O2X on Mac OSX.

sed: illegal option -- r

usage: sed script [-Ealn] [-i extension] [file ...]

sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
[Android Software/Hacking General [Developers Only]] bruce2728:
Hi

Is there any way i can mod the script to get the last stable source?

I need the stable as I'm porting to a non-android device and the nightly build has some graphical glitches that the stable doesn't.

Hope you can help, thanks

Dont worry, i found it, thanks for this usefull script
[Android Software/Hacking General [Developers Only]] bruce2728:
I had this problem with ubuntu 11, i downgraded to ubuntu 10 and the problem went away
[Android Software/Hacking General [Developers Only]] brian.houaiss:
How can I use it to create for another device not listed? Is there any way? Thx
[Android Software/Hacking General [Developers Only]] synergye:
Run through to the device select screen, close it ctrl-c, then run source build/envsetup.sh and brunch device -j4 bacon from ~/android/system. I think this should work.

...Now if someone can help me build on my laptop. I can still build on my fedora desktop, chose kubuntu for my laptop because of this script, and can't get it to build.
[Android Software/Hacking General [Developers Only]] crachel:
I tried to repo init -u git://github.com/koush/proprietary_vendor_htc.git

but it didn't work, and now "repo sync" doesn't work.. I can still build for each individual device, but once again repo is screwed up and I can't seem to revert that errant init command (i tried deleting the .git dir to no avail)

Edit: scratch that, after typing this out it donned on me to cd to /android/system and re-initialize my repo there with "repo init -u git://github.com/CyanogenMod/android.git -b gingerbread" .. all is well again
[Android Software/Hacking General [Developers Only]] bikooo3878:
This is perfect when i test it i'll post the results..

and thnx for sharing
[Android Software/Hacking General [Developers Only]] milesxd:
Thank you for this!
[Android Software/Hacking General [Developers Only]] Zerrax:
How can I implement sensors in building cm?
[Android Software/Hacking General [Developers Only]] nightwolfmilan:
Thanxxx

Thank you.............