yashsingh1/xdaforums huggingface dataset:
[Galaxy S I9000 Android Development] gmhafiz:
Here are the steps I made to compile cm10 from scratch:

Make working directory

$ mkdir ~/android
$ cd android

Download Repo

$ mkdir -p ~/bin
$ mkdir -p ~/android/system
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Download cm source

$ cd ~/android/system
$ repo init -u git://github.com/CyanogenMod/android.git -b jellybean
$ repo sync -j16

Prepare Environment for Compile

$ source ~/android/build/envsetup.sh

Download source for galaxysmtd

$ cd ~/android/device
$ mkdir samsung
$ git clone git://github.com/CyanogenMod/android_device_samsung_galaxysmtd.git galaxysmtd

Download Proprietary files

$ cd galaxysmtd
$ sh extract-files.sh

Download Rom Manager

$ cd ~/android/vendor/cm/
$ ./get-prebuilts

Do Brunch

$ cd ~/android
$ sh build/envsetup.sh && brunch galaxysmtd

All seemed fine but after hours of compiling, I got this error:

make[1]: Entering directory `/home/user/android/kernel/samsung/aries'
target Strip: libpixelflinger (out/target/product/galaxysmtd/obj/lib/libpixelflinger.so)
target Strip: libtinyalsa (out/target/product/galaxysmtd/obj/lib/libtinyalsa.so)
target Strip: audio.primary.goldfish (out/target/product/galaxysmtd/obj/lib/audio.primary.goldfish.so)
target SharedLib: audio.usb.default (out/target/product/galaxysmtd/obj/SHARED_LIBRARIES/audio.usb.default_intermediates/LINKED/audio.usb.default.so)
target Strip: audio_policy.aries (out/target/product/galaxysmtd/obj/lib/audio_policy.aries.so)
target Strip: audio_policy.default (out/target/product/galaxysmtd/obj/lib/audio_policy.default.so)
target SharedLib: libbcc (out/target/product/galaxysmtd/obj/SHARED_LIBRARIES/libbcc_intermediates/LINKED/libbcc.so)
INSTALL crypto/ansi_cprng.ko
INSTALL drivers/media/video/gspca/gspca_main.ko
INSTALL drivers/scsi/scsi_wait_scan.ko
INSTALL fs/cifs/cifs.ko
INSTALL fs/fuse/fuse.ko
INSTALL fs/nls/nls_utf8.ko
DEPMOD 3.0.31-g8440b19
Warning: you may need to install module-init-tools
See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt
ERROR: could not open directory /home/user/android/out/target/product/galaxysmtd/obj/KERNEL_OBJ/../../system/usr/lib/modules/99.98.3.0.31-g8440b19: No such file or directory
FATAL: could not search modules: No such file or directory
make[2]: *** [_modinst_post] Error 1
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/user/android/kernel/samsung/aries'
make: *** [TARGET_KERNEL_BINARIES] Error 2
make: *** Waiting for unfinished jobs....

My system:

$ uname -a

Linux archbang 3.4.6-1-ARCH #1 SMP PREEMPT Fri Jul 20 08:21:26 CEST 2012 x86_64 GNU/Linux

module-init-tools is definitely installed. How should I tackle this missing 3.0.31-g8440b19 module?
[Galaxy S I9000 Android Development] DerTeufel1980:
I don't know, why it's failing, but as a workaround you could edit the BoardConfig.mk in your device tree, to use a prebuilt kernel. Then it just does not try to compile it. You only would need to add a kernel before flashing and take the modules folder from cm10 rom.

Gesendet von meinem GT-I9000 mit Tapatalk 2
[Galaxy S I9000 Android Development] kasper_h:
Can you post the contents of your local_manifest.xml? Did you change the kernel revision to jellybean (in OP it is set to android-3.0-ics).
[Galaxy S I9000 Android Development] gmhafiz:
The one at ~/WORKING_DIRECTORY/.git right?

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="CyanogenMod/android_device_samsung_galaxysmtd" path="device/samsung/galaxysmtd" remote="github" revision="jellybean" />
<project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" revision="jellybean" />
<project name="CyanogenMod/android_device_samsung_aries-common" path="device/samsung/aries-common" remote="github" revision="jellybean" />
<project name="CyanogenMod/android_kernel_samsung_aries" path="kernel/samsung/aries" remote="github" revision="jellybean" />
</manifest>
[Galaxy S I9000 Android Development] Perka:
Does some one want to take over this thread?

Pm me.
[Galaxy S I9000 Android Development] pmos69:
I posted an updated guide for compiling cm10 here:

http://xdaforums.com/showthread.php?t=1813924
[Galaxy S I9000 Android Development] Blue59:
hey [MENTION=3685904]ak[/MENTION] i need help. i have this error while pacman cm10.2 repo sync Error

and can i use framework base from cm?
[Galaxy S I9000 Android Development] laehtis:
Many thanks Perka! Glad you liked them:) Yeah I will:)
[Galaxy S I9000 Android Development] Perka:
I have updated OP with this part, thx scheichuwe

Now it compiles fine with kernel and flashes without problems.

Just a small fyi, no bootanimation, so if you have a black screen for a few min its ok.

Press this link http://xdaforums.com/votenews.php?topic=1533711 for news vote
[Galaxy S I9000 Android Development] Perka:
EDIT: wrong thread
[Galaxy S I9000 Android Development] malcho:
What?!don't understand
[Galaxy S I9000 Android Development] Perka:
Nvm wrong thread.
[Galaxy S I9000 Android Development] Perka:
Build Glitch Kernel for sgs

When you have cm9 synced and working.

ln -s ~/android/system ~/CM9
mkdir -p ~/CM9/kernel/samsung
cd ~/CM9/kernel/samsung
git clone https://github.com/GlitchKernel/Glitch.git
cd ~/CM9/kernel/samsung/Glitch

./initramfs.sh galaxys
./glitch.sh galaxys

Also I added profiles to my build and it works perfect

Profiles
http://review.cyanogenmod.com/#change,13169
http://review.cyanogenmod.com/#change,13170
[Galaxy S I9000 Android Development] burakgon:
That's easier than I think. Thank you!
[Galaxy S I9000 Android Development] tishfire:
Hi Perka,

This is a good thread, I've found out how to compile a cm9 rom the hard way by looking all over the places and put them together to make sense how to compile 1. You've got most of them all in 1 thread. Great work!

I'm using ubuntu 64bit for 3 months and managed to make a cm9 kang for my crespo I9020T. When I flashed, I've realized it's very basic. I would like to ask some guidance on cherry picking. My knowledge is very limited as I've just got started and no experience on linux. Hope you could help here.

Thanks.
[Galaxy S I9000 Android Development] Perka:
Cherry Picking from Gerrit:

Find your gerrit, I use cm9 as an example.

http://review.cyanogenmod.com/#q,status:open+branch:ics,n,z

and I look in open section.

find your cherry you want to pick :) this maybe?

http://review.cyanogenmod.com/#change,13511

look at the middle of the page, click cherry pick and it will give you the link to use.

copy the link that you get when you click cherry pick

then look at the project name to know where it goes in source.

in this case in terminal go to ~/android/system/frameworks/base paste the link and enter.

You have just picked your cherry ;)

Check out CNA Gerrit, also great stuff

http://review.codenameandroid.com/#/q/status:merged,n,z

as for Git cherry picking I don't know yet how to but when I do I will post.

If anyone knows pls help out and teach us. :)

SHA-1 is the way to go I think.

http://progit.org/ebook/progit.pdf

Enjoy!
[Galaxy S I9000 Android Development] Perka:
thx, when you say "You've got most of them all in 1 thread". what is missing?

If you can help with some stuff pls post and I will add it to OP.

Happy compiling.
[Galaxy S I9000 Android Development] flip360:
i have synced sources yesterday following the tutorial, today i am gonna do a test build and some cherry picking, yummu. I see that the procedure for building Glitch`s kernel is up, is it the same/simmilar building procedure with other kernels? (Devil, Semaphore)

Thanks Perka
[Galaxy S I9000 Android Development] Perka:
Great, :)

As for building kernels, I am not good at it and only know how to build Glitch.

If you or any one know how to build other kernels pls post and I will add to OP.

Happy compiling :)
[Galaxy S I9000 Android Development] tishfire:
Hi Perka,

Thank you for putting up the cherry picking guide, I will look at it, so excited.

With regards to "most of them" I'm speaking from a noob's point of view. If I had a good experience with linux, I'm sure this guide has everything in.

For example, someone who didn't use linux before dont even know how open up a terminal in 11.10 64bit, how to (dir a folder) ls, how to install files, etc etc. No to mention what the hell is SUDO? I've learnt it on the spot after googling. Its very painful.

1 of the step that

all guides

on "setting up the android environment : installing java" did not tell you to press TAB to enter the installation after the installer started at the blue screen when you read the acknowledge. I always thought I had install java until I've realise something was wrong when I couldn't compile a rom. Why I don't know is because I'm a noob at linux. Many will make the same mistake I believe.

After compiling a few times, there is 1 message that I've always get , I'm not sure for others, as I might not have a full guide on my current method of compiling. there was a message that always said " blak blak commit or make changes blah blah" and another one at the end of compiling is something like "unable to blah blah png?? something, either install ??? , ??? or ???" I forgot, gotta check later.

Anyway Perka, you had a good guide here. Thank you :)
[Galaxy S I9000 Android Development] Perka:
I only used Linux for 3 weeks ;)

Anyway as for the basics of Linux I dont see a point in adding that to this guide as you have to know it before you can use this guide.

EDIT: and there are many guides out there to help you with basic Linux.

Look here ---->> http://bit.ly/zm1whN

And for you error, well pls post and we can look at it, Probably I dont know the answer but Im sure some one can help.

So keep posting and happy compiling. :)
[Galaxy S I9000 Android Development] tishfire:
So basically is pasting the links in their respective folder? Like framework/base to framework/base , setting to setting.

Assuming I repo firstm then after pasting I assume I do not need to repo anymore? Just build ? If I want to make changes like removing a cherry, I just delete the file in the folder and after changes of adding or deleting, I just build as well?

Thanks
[Galaxy S I9000 Android Development] Perka:
I always repo sync before a build, but thats me.

As for removing a cherry pick, I am not really sure yet :p sry Im a noob to ;)

If some one knows a bit more that me, well pls post and I add it to OP :)

Come on guys I know there are some experts reading ;)

Pls help out!! :)
[Galaxy S I9000 Android Development] scheichuwe:
http://xdaforums.com/showpost.php?p=20557396&postcount=646

Pretty much the same you described in an earlier post, but this one is interesting ;)
[Galaxy S I9000 Android Development] Perka:
Im not at my laptop now, but I dont think your local changes gets over written.

I will test this when I get home.

Can some one test?
[Galaxy S I9000 Android Development] scheichuwe:
I can't test either.

But here's another link

http://xdaforums.com/showthread.php?t=1067519
[Galaxy S I9000 Android Development] scheichuwe:
I don't have a plan but I like doing things :)

Just tested this

http://review.cyanogenmod.com/#change,13526

cd to ~/android/system/packages/app/Settings

and run this command

git fetch http://review.cyanogenmod.com/p/CyanogenMod/android_packages_apps_Settings refs/changes/26/13526/1 && git checkout FETCH_HEAD

build a complete ROM or just Settings.apk (that's what I did) and you'll have something like this

(CPU info + Mem info)

After that a did a repo sync and rebuilt Settings.apk.

Seems like this is true

At least for using git checkout. I didn't try the other options (pull, cherry-pick, patch)
[Galaxy S I9000 Android Development] Perka:
Ok, great info, also made a rom with this commit.

How do you just build settings.apk?
[Galaxy S I9000 Android Development] scheichuwe:
In your working directory (~/android/system), just type in

. build/envsetup.sh
lunch cm_galaxysmtd-userdebug
make Settings
[Galaxy S I9000 Android Development] Perka:
Great, this will save us a lot of time :-)

So just remove .apk and its done.

Will test some stuff tomorrow.

Again thx!
[Galaxy S I9000 Android Development] Perka:
I did the same and have the mem and cpu in settings.

Wierd.

I did 2 repo sync.
[Galaxy S I9000 Android Development] scheichuwe:
Did you use the checkout-link?

I just tried it one time, it worked like described.

As I said before, I'm not an expert. I'm learning these things, too :)
[Galaxy S I9000 Android Development] Perka:
Erm no, whats the checkout link?
[Galaxy S I9000 Android Development] scheichuwe:
You have checkout, pull, cherry-pick (that's what you used in your guide) and patch.

I don't know the differences, but checkout is what I used...

(the link next to "Download" in the middle of the page)
[Galaxy S I9000 Android Development] Perka:
Ahh ok!!! Great! Now I get it, as you see Im a noob ;-) hehe.

So checkout is to remove the cherry pick.

So if I dont do anything just repo sync my picks will be there, and checkout to remove/revert.?

Thx, will update tomorrow.

Peace
[Galaxy S I9000 Android Development] scheichuwe:
I don't think that it will remove cherry-pick, it is just the only option I used so far.

And checkout gets reverted by report sync.

Maybe this can help

http://schacon.github.com/git/git.html
[Galaxy S I9000 Android Development] tishfire:
one of the error, not really an error while repo was

Please, commit your changes or stash them before you can switch branches.
Aborting

At the end of repo sycn i get tons of these in red

error: vendor/cm/: CyanogenMod/android_vendor_cm checkout 2de0bba2598ce7e08ff0e3c07b1a5d103c6507a4
tish@tish-zzz:~/android/system$

so I could just do away with repo sync -f -6 -d ?
[Galaxy S I9000 Android Development] tishfire:
Not sure if you guys are getting this messages, but now it is in the process of making, hope it will come out successful.

I've tried the checkout and I got this message:

tish@tish-zzz:~/android/system/packages/apps/Settings$ git fetch http://review.cyanogenmod.com/p/CyanogenMod/android_packages_apps_Settings refs/changes/26/13526/1 && git checkout FETCH_HEAD

From http://review.cyanogenmod.com/p/CyanogenMod/android_packages_apps_Settings

* branch refs/changes/26/13526/1 -> FETCH_HEAD

src/com/android/settings/profiles/ProfileConfig.java: needs merge

error: you need to resolve your current index first

When I tried cherry pick I got this:

tish@tish-zzz:~/android/system/packages/apps/Settings$ git fetch http://review.cyanogenmod.com/p/CyanogenMod/android_packages_apps_Settings refs/changes/22/13122/6 && git cherry-pick FETCH_HEAD

From http://review.cyanogenmod.com/p/CyanogenMod/android_packages_apps_Settings

* branch refs/changes/22/13122/6 -> FETCH_HEAD

fatal: 'cherry-pick' is not possible because you have unmerged files.

Please, fix them up in the work tree, and then use 'git add/rm <file>' as

appropriate to mark resolution and make a commit, or use 'git commit -a'.

tish@tish-zzz:~/android/system/packages/apps/Settings$

Building now with 1 checkout and 1 cherrypick. Hope it'll be successful so I could check the difference.
[Galaxy S I9000 Android Development] tishfire:
Edited: Wrong post
[Galaxy S I9000 Android Development] flip360:
I just built my very first KANG rom from sources :) Thanks Perka for the guide and hope to get even better in the future. As a side note, tried building Glitch kernel but exited with error 2, will re-try it, i think its my bad :P

Cheers
[Galaxy S I9000 Android Development] Perka:
Package complete: /home/perka/android/system/out/target/product/galaxysmtd/update-cm-9.0.0-RC0-galaxysmtd-KANG-signed.zip

2c5889b780cae7d2f2169831e77dc568 update-cm-9.0.0-RC0-galaxysmtd-KANG-signed.zip

Elapsed: 22 min(s) 28 sec(s)
[Galaxy S I9000 Android Development] flip360:
i guess building the first KANG is a lot longer, it took 99 mins. to build, the second one took 11 mins just now :P
[Galaxy S I9000 Android Development] Perka:
wow thats fast!

How you like profiles?

just built a new KANG today, seems theres some new stuff :D

http://review.cyanogenmod.com/#q,status:merged+branch:+ics,n,z
[Galaxy S I9000 Android Development] flip360:
yup, didnt expect it to be that fast :P
[Galaxy S I9000 Android Development] Perka:
I am now syncing Gummy source :)

http://teamgummy.com/ubuntu-linux

lets try another rom :)
[Galaxy S I9000 Android Development] flip360:
did you try stuff from CNA`s sources? i like the option to speed up UI rotation but cant seem to find the commit or its some .apk :)
[Galaxy S I9000 Android Development] Perka:
I did look at it so much.

Ask rtfpessoa in #codenameandroidsgs
[Galaxy S I9000 Android Development] scheichuwe:
Tried this one?

https://github.com/CNA/android_pack...mmit/ddd10d64c64a1fd7e46c340c3c207a3a6b01368c
[Galaxy S I9000 Android Development] flip360:
Will do :) You seen Quacktop lately? :)

Tapatalk
[Galaxy S I9000 Android Development] flip360:
Tried this one?

https://github.com/CNA/android_packa...207a3a6b01368c

Thanks buddy will try it now :)

How do you search through gerrit?

Shows errors while compiling Settings.apk, maybe i should add the dependencies? (i could be wrong though :P )

Cheers
[Galaxy S I9000 Android Development] kasper_h:
Great thread, have been building cm7 for some time now. Tried CM9 last night and was successful with the guide in the OP (didn't flash it yet).

Just an overview of how I cherry-pick commits:

>cd ~/android system

>repo sync (to be up-to-date)

>cd ~/android/system/cherrypicklocation (e.g. /frameworks/base)

>git branch --track localtesting github/ics (by tracking remote, you stay in the localtesting branch the next time you do repo sync,and keep it up-to-date)

>git checkout localtesting

>git fetch http://review.cyanogenmod.com/p/CyanogenMod/android_* && git cherry-pick FETCH_HEAD

If you do it like this, the cherry-pick will stay also when doing a repo sync. And by keeping the cherry-picks in their own branch (in the example above the branch 'localtesting'), you can always easily get back to the master branch and get rid off all the things you've done. I use the same approach if I change thing in the source code myself. When changing things in the master branch, it's easier to end up in problems/conflicts.

One thing to take care of: it can happen that a patch on review.cyanogenmod.com gets updated. In that case, I manually remove the cherry-pick and use the procedure above to download the latest patch.

If you don't have the latest patch cherry-picked, and an updated version of the patch gets merged, you will get errors upon doing a repo sync.

Two tools which I often use are qgit (to see what's happening in different branches) and meld (to compare files/folders).
[Galaxy S I9000 Android Development] Perka:
thx for sharing :)

will ad a link to this post in OP ofc :)
[Galaxy S I9000 Android Development] Perka:
PaulForde found an error in the guide, thx :)

this is the new part:

cd ~/android
git clone git://github.com/teamhacksung/buildscripts.git

Make the script executable

New terminal

cd ~/android/buildscripts/samsung
./build.sh galaxysmtd

and this :

For the next step you need to have cm9 installed.

Connect you phone to pc and in terminal type

adb shell
check so you have root:
~ $ adb shell
root@android:/ $ su
root@android:/ # <---root :p

New terminal

cd ~/android/system/device/samsung/galaxysmtd/
./extract-files.sh
[Galaxy S I9000 Android Development] DROCSID:
Thanks for the share!

Gonna build myself one too tomorrow :). Great ++++++++
[Galaxy S I9000 Android Development] Perka:
adb root :p
[Galaxy S I9000 Android Development] Perka:
So did you?
[Galaxy S I9000 Android Development] DROCSID:
Not yet, heavy working days ;).

Try this evening. Will let you know!!
[Galaxy S I9000 Android Development] kasper_h:
An alternative I used for CM7 is to change the "adb pull" to "cp" in the extract-files.sh script and make a reference to a folder where you unpacked a downloaded galaxysmtd-CM7. This way, I could build CM7 without having CM7 on my phone yet. I guess the same can be used for CM9.
[Galaxy S I9000 Android Development] Perka:
from here then?

https://github.com/koush/proprietary_vendor_samsung

can you post your moded script?
[Galaxy S I9000 Android Development] kasper_h:
See the attached file. I extract a cm9-rom to a folder called cm9 in my home dir. This script then copied the necessary files.
[Galaxy S I9000 Android Development] DROCSID:
Perka

Wanted to let you know it works like a charm.

Can build it now myself

Thnx
[Galaxy S I9000 Android Development] Perka:
Thats great :-)
[Galaxy S I9000 Android Development] Perka:
Lets see what 4.0.4 has :D

http://xdaforums.com/showpost.php?p=24160210&postcount=1655
[Galaxy S I9000 Android Development] lippol94:
Does anyone know why when I do repo sync I don't get all the updates?

In particular, I don't get commits posted in android_device_samsung_*

Maybe the local_manifest.xml needs to be updated?

Thank for everything perka :)

EDIT: Yes, as I expected it was local_manifest.xml fault :)

Change it with this:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>

<project path="device/samsung/galaxysmtd" name="CyanogenMod/android_device_samsung_galaxysmtd" />
<project path="device/samsung/aries-common" name="CyanogenMod/android_device_samsung_aries-common" />
<project path="vendor/cm" name="teamhacksung/android_vendor_cm" />
<project path="kernel/samsung-kernel-aries" name="teamhacksung/samsung-kernel-aries" remote="github" revision="android-samsung-3.0-ics" />

</manifest>

Must be a recent modification :)

Hope this will help you all guys :D
[Galaxy S I9000 Android Development] kasper_h:
Samsung branch has been merged in the mainline, so you don't need the pointers to teamhacksung anymore.
[Galaxy S I9000 Android Development] lippol94:
Ok, but the first two lines are absolutely required.

So the new local_manifest.xml will be:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>

<project path="device/samsung/galaxysmtd" name="CyanogenMod/android_device_samsung_galaxysmtd" />
<project path="device/samsung/aries-common" name="CyanogenMod/android_device_samsung_aries-common" />

</manifest>
[Galaxy S I9000 Android Development] kasper_h:
+1, good addition :)
[Galaxy S I9000 Android Development] Perka:
Thx guys, will update op asap.
[Galaxy S I9000 Android Development] lippol94:
Good :)

And please, change the build.sh location as it won't work if it stays in /android/buildscripts/samsung.

Correct procedure to make it work is:

cd ~/android/system
git clone git://github.com/teamhacksung/buildscripts.git
cp ~/android/system/buildscripts/samsung/build.sh ./

Now it works :)
[Galaxy S I9000 Android Development] Perka:
Op is updated with this manifest. thx.

and where the buildscript is.
[Galaxy S I9000 Android Development] Perka:
I did a odex build. Will flash tomorrow.
[Galaxy S I9000 Android Development] malcho:
Perka,

Thanks for great guide.Sucess on build yesterday.

This morning i synced source and i want to build it again.

Do i have to clean /out/product/galaxysmtd folder,something like make clean command?

Thanks in advance
[Galaxy S I9000 Android Development] lippol94:
I'm building cm9 with a few modifications for a month and I've never cleaned out folder.

Sent from my Samsung Galaxy S running CyanogenMod Blueberry EDITION
[Galaxy S I9000 Android Development] Perka:
You can do:

make clobber
[Galaxy S I9000 Android Development] kasper_h:
After make clobber, the build time is very long (like the first build). I never use it :)

A "make installclean" on the other hand removes only some files but reuses most files, speeding up the building process. I made my own build script which includes a "make clean"
[Galaxy S I9000 Android Development] scheichuwe:
What does your build script look like? :)