FORUMS

CloudPlayer: DIY HiFi Music Streaming Solution

In our Helpful Guide to Music Streaming Services, we mentioned several different services … more

Optimize Battery Life with This Useful App

Battery life is an important aspect of your smartphone, especially if you use it for more … more

The OnePlus 2 & The Year of Smartphone Compromises

We are very close to entering the last third of 2015, and we have now seen many of … more

OnePlus 2 Teardown, Major Android Vulnerability – XDA TV

The OnePlus 2 has been officially released. That and much more news is … more

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

1,113 posts
Thanks Meter: 204
 
Post Reply Subscribe to Thread Email Thread
26th February 2011, 07:41 PM |#21  
nicandris's Avatar
OP Recognized Developer
Flag Nicosia
Thanks Meter: 204
 
More
Quote:
Originally Posted by 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:

Code:
cd ~/android/system/;
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread;
repo sync;
cd;
wget http://dl.dropbox.com/u/6751304/htc.zip;
unzip htc.zip;
mv ~/htc/ ~/android/system/vendor/htc/;
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

Code:
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)

the repo is the official cm repo. what the nightlies buildbots compile. so it should have all the changes in there. will compile now and check if something is missing. for the edited code, you pasted 2 different things, first part from androidmake and second from build.sh. what is the problem that needed fixing?
 
 
26th February 2011, 07:44 PM |#22  
Senior Member
Flag Torino
Thanks Meter: 51
 
More
build.sh downloaded from first post, don't work...terminal :

Quote:

drigerott@drigerott:~/Scrivania$ sudo ./build.sh
[sudo] password for drigerott:
./build.sh: 1: repo: not found
cp: impossibile eseguire stat di "./vendor/cyanogen/products/cyanogen_passion.mk": File o directory non esistente
.: 3: Can't open build/envsetup.sh


infact i just copy the end of you're androidmake (the cd repo line)
Last edited by drigerott; 26th February 2011 at 07:47 PM.
26th February 2011, 07:47 PM |#23  
nicandris's Avatar
OP Recognized Developer
Flag Nicosia
Thanks Meter: 204
 
More
Quote:
Originally Posted by drigerott

build.sh downloaded from first post, don't work...terminal :

Code:
drigerott@drigerott:~/Scrivania$ sudo ./build.sh
[sudo] password for drigerott: 
./build.sh: 1: repo: not found
cp: impossibile eseguire stat di "./vendor/cyanogen/products/cyanogen_passion.mk": File o directory non esistente
.: 3: Can't open build/envsetup.sh

infact i just copy the end of you're androidmake (the cd repo line)

wow thanx for that!! you are right... one moment and i will reupload
edit* uploaded. apparently i forgot
Code:
 cd ~/android/system ;
Last edited by nicandris; 26th February 2011 at 07:53 PM.
27th February 2011, 03:08 AM |#24  
RunTimeWorld's Avatar
Senior Member
Switzerland
Thanks Meter: 28
 
More
would be nice if the script checks and skips stuff that is installed already such as the android sdk
27th February 2011, 07:14 AM |#25  
nicandris's Avatar
OP Recognized Developer
Flag Nicosia
Thanks Meter: 204
 
More
Quote:
Originally Posted by RunTimeWorld

would be nice if the script checks and skips stuff that is installed already such as the android sdk

working on that already. also options to install for other devices, create shortcuts, recognize x64 etc etc
27th February 2011, 07:48 PM |#26  
crachel's Avatar
Senior Moderator
Flag Texas
Thanks Meter: 2,863
 
More
Thanks for this

I'm gonna add this to a cron job so I can have builds in between the nightlies, while we wait for a stable release
28th February 2011, 08:32 AM |#27  
Senior Member
Flag argonay
Thanks Meter: 59
 
More
repo not found but git-core installed
HI,
first of all thxx for this great tool )))
i have try my first rom, but face a bug, when ppl call, the screen of mùy nexus one is all white for 5 sec :'(
i am trying the build.sh script, but i am having this error :

HTML Code:
[CODE]herve@android-factory:~/androdev$ sh build.sh
build.sh: 2: repo: not found
build/envsetup.sh: 1: Syntax error: "(" unexpected
herve@android-factory:~/androdev$ [/CODE]
but what is weird, git-core is installed

Code:
herve@android-factory:~/androdev$ sudo apt-get install git-core
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances       
Lecture des informations d'état... Fait
git-core est déjà la plus récente version disponible.
0 mis à jour, 0 nouvellement installés, 0 à enlever et 246 non mis à jour.
did i missed something????


thxx for your help

herve
28th February 2011, 08:38 AM |#28  
Senior Member
Flag argonay
Thanks Meter: 59
 
More
i ve fixed it.
if you have this same prob, get repo here
curl http://android.git.kernel.org/repo >~/bin/repo

chmod +x repo

++
28th February 2011, 08:46 AM |#29  
Senior Member
Flag argonay
Thanks Meter: 59
 
More
well in fact, now i have another prob :'(
any idea?

Code:
herve@android-factory:~/androdev$ sh build.sh
Fetching projects:   2% (5/225)  remote: Counting objects: 38, done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 24 (delta 17), reused 1 (delta 0)
Unpacking objects: 100% (24/24), done.
From git://github.com/CyanogenMod/android_bootable_recovery
   0b7bbf2..3d6a211  froyo      -> github/froyo
   d9fbe2f..a1f43bf  gingerbread -> github/gingerbread
Fetching projects:   4% (9/225)  remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From git://github.com/CyanogenMod/android_device_bn_encore
   170c703..5202166  gingerbread -> github/gingerbread
remote: Counting objects: 13, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 8 (delta 5), reused 0 (delta 0)
Unpacking objects: 100% (8/8), done.
From git://github.com/CyanogenMod/android_device_commtiva_z71
   379ab1b..df40873  gingerbread -> github/gingerbread
Fetching projects:  16% (36/225)  remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From git://github.com/CyanogenMod/android_device_samsung_fascinate
   706d15f..c5abaec  gingerbread -> github/gingerbread
Fetching projects:  17% (39/225)  remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From git://github.com/CyanogenMod/android_device_samsung_vzwtab
   ac23a39..1ec1fa4  gingerbread -> github/gingerbread
Fetching projects:  61% (138/225)  remote: Counting objects: 15, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 8 (delta 4), reused 0 (delta 0)
Unpacking objects: 100% (8/8), done.
From git://github.com/CyanogenMod/android_frameworks_base
   bf17157..f1df5d9  gingerbread -> github/gingerbread
Fetching projects: 100% (225/225), done.  
Syncing work tree: 100% (225/225), done.  

build/envsetup.sh: 1: Syntax error: "(" unexpected
herve@android-factory:~/androdev$
28th February 2011, 08:48 AM |#30  
Senior Member
Flag argonay
Thanks Meter: 59
 
More
well in fact, now i have another prob :'(
any idea?

Code:
herve@android-factory:~/androdev$ sh build.sh
Fetching projects:   2% (5/225)  remote: Counting objects: 38, done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 24 (delta 17), reused 1 (delta 0)
Unpacking objects: 100% (24/24), done.
From git://github.com/CyanogenMod/android_bootable_recovery
   0b7bbf2..3d6a211  froyo      -> github/froyo
   d9fbe2f..a1f43bf  gingerbread -> github/gingerbread
Fetching projects:   4% (9/225)  remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From git://github.com/CyanogenMod/android_device_bn_encore
   170c703..5202166  gingerbread -> github/gingerbread
remote: Counting objects: 13, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 8 (delta 5), reused 0 (delta 0)
Unpacking objects: 100% (8/8), done.
From git://github.com/CyanogenMod/android_device_commtiva_z71
   379ab1b..df40873  gingerbread -> github/gingerbread
Fetching projects:  16% (36/225)  remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From git://github.com/CyanogenMod/android_device_samsung_fascinate
   706d15f..c5abaec  gingerbread -> github/gingerbread
Fetching projects:  17% (39/225)  remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From git://github.com/CyanogenMod/android_device_samsung_vzwtab
   ac23a39..1ec1fa4  gingerbread -> github/gingerbread
Fetching projects:  61% (138/225)  remote: Counting objects: 15, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 8 (delta 4), reused 0 (delta 0)
Unpacking objects: 100% (8/8), done.
From git://github.com/CyanogenMod/android_frameworks_base
   bf17157..f1df5d9  gingerbread -> github/gingerbread
Fetching projects: 100% (225/225), done.  
Syncing work tree: 100% (225/225), done.  

build/envsetup.sh: 1: Syntax error: "(" unexpected
herve@android-factory:~/androdev$
here is the beguining of the script envsetup.sh

Code:
herve@android-factory:~/androdev$ sh build.sh
Fetching projects:   2% (5/225)  remote: Counting objects: 38, done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 24 (delta 17), reused 1 (delta 0)
Unpacking objects: 100% (24/24), done.
From git://github.com/CyanogenMod/android_bootable_recovery
   0b7bbf2..3d6a211  froyo      -> github/froyo
   d9fbe2f..a1f43bf  gingerbread -> github/gingerbread
Fetching projects:   4% (9/225)  remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From git://github.com/CyanogenMod/android_device_bn_encore
   170c703..5202166  gingerbread -> github/gingerbread
remote: Counting objects: 13, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 8 (delta 5), reused 0 (delta 0)
Unpacking objects: 100% (8/8), done.
From git://github.com/CyanogenMod/android_device_commtiva_z71
   379ab1b..df40873  gingerbread -> github/gingerbread
Fetching projects:  16% (36/225)  remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From git://github.com/CyanogenMod/android_device_samsung_fascinate
   706d15f..c5abaec  gingerbread -> github/gingerbread
Fetching projects:  17% (39/225)  remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From git://github.com/CyanogenMod/android_device_samsung_vzwtab
   ac23a39..1ec1fa4  gingerbread -> github/gingerbread
Fetching projects:  61% (138/225)  remote: Counting objects: 15, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 8 (delta 4), reused 0 (delta 0)
Unpacking objects: 100% (8/8), done.
From git://github.com/CyanogenMod/android_frameworks_base
   bf17157..f1df5d9  gingerbread -> github/gingerbread
Fetching projects: 100% (225/225), done.  
Syncing work tree: 100% (225/225), done.  

build/envsetup.sh: 1: Syntax error: "(" unexpected
herve@android-factory:~/androdev$
28th February 2011, 08:50 AM |#31  
Senior Member
Flag argonay
Thanks Meter: 59
 
More
here is the beguining of envsetup.sh

Code:
function help() {
cat <<EOF
Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
- croot:   Changes directory to the top of the tree.
- m:       Makes from the top of the tree.
- mm:      Builds all of the modules in the current directory.
- mmm:     Builds all of the modules in the supplied directories.
- cgrep:   Greps on all local C/C++ files.
- jgrep:   Greps on all local Java files.
- resgrep: Greps on all local res/*.xml files.
- godir:   Go to the directory containing a file.
- cmremote: Add git remote for CM Gerrit Review
- cmgerrit: Send patch request request to CyanogenMod repos
- mka:     Builds using SCHED_BATCH on all processors
- reposync: Parallel repo sync using ionice and SCHED_BATCH

Look at the source to view more functions. The complete list is:
EOF

Read More
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes