[Galaxy S II General] RagingHarry:
Ok the way do it or learned how to set it up working (using root as user to build):

But don't know if you running this on a VM and it is safe to unlock the root userlogin and set that one to default and auto login (since nearly everwhere on the internetz you'll see them screaming that it isn't save to do ;)

If it is just a home building rig that just is on for building CM or you are on a VM you could ignore those comments about being safe, and all is to get that building up.

If it is rig for daily use or server rig, it's not really wise to do.

But if isn't for daily use or a live server you are using and only for building.

Login to the Ubuntu you installed.

Open terminal and run: sudo passwd root

Give it a password twice and root login is now available from the login screen

Since you are not that well know with Ubuntu/Linux, a more userfriendly UI is gnome shell.

To install gnome shell, run in terminal the command: sudo apt-get install gnome-shell

When done with the above you can make it a auto login by editing lightdm.conf.

And now run in terminal: gksudo gedit /etc/lightdm/lightdm.conf

And copy past this into it, then save it an close it.

[SeatDefaults]
autologin-user=root
autologin-user-timeout=0
user-session=gnome-shell
greeter-session=unity-greeter

Now restart Ubuntu and if all went well, you should be automatic logged into Ubuntu as root.

From here we get to installing all stuff as root, so no more sudo commands needed ;)

Note before start, if you use terminal and use a wget to download the SDK (last one available) you can use "ls -l" to view all files and folders available in terminal and then copy paste the SDK filename as you would do in any txt program, and then extract it instead of typing everything.

Use this guide to install the android SDK properly: http://www.howtoforge.com/setting-u...ith-eclipse-android-sdk-phonegap-ubuntu-11.04 Just page 1

But keep in mind that you need to use .bashrc and not .profile (as mentioned in the guide for installing the SDK).

And that the last line of .bashrc will be (since they forgot the ~/bin in the PATH):

PATH="$HOME/android-sdk-linux/tools:$HOME/android-sdk-linux/platform-tools:~/bin:$PATH"

If you want the udev stuff added, see this post and section 3 and 4 then you'll have all devices available added: http://xdaforums.com/showthread.php?t=1762641

You wil need to install these:

apt-get update
apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev:i386 \
g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown \
libxml2-utils xsltproc zlib1g-dev:i386

And:

apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils xsltproc

If you get an error that says that a certain package isn't available anymore (which could happen) read good what is written at that error message, cause it will probably the package that comes in it's place so you will need to change the install command and remove old/overdue packagename and add the one that should replace it.

When not sure you installed enough, http://xdaforums.com/showthread.php?t=1762641 has @ point 2 a few more packages added for building.

If you did all the above the CM9 part comes.....

If you use this: http://teamhacksung.org/wiki/index.php/CyanogenMod9:How_to_build

and then not the easy part (which won't install properly on ubuntu 12.04), but from "Howto get sources"

You only should need to do the " chmod a+x ~/bin/repo" command in terminal after "curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo" (isn't mentioned in the guide but you will find it in the link to build.sh when you read through it.).

Here might a restart be needed to get the repo properly working

Then:

cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b ics

@ create ~/android/system/.repo/local_manifest.xml

Give in terminal "gedit ~/android/system/.repo/local_manifest.xml"

Add now in local_manifest (with the line thracemerin mentioned includes for the props, used myself the extract-files.sh) (the one from pastie.com misses the "revision=ics" from the kernel project).

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="CyanogenMod/android_device_samsung_galaxys2" path="device/samsung/galaxys2" remote="github" />
<project name="CyanogenMod/android_kernel_samsung_smdk4210" path="kernel/samsung/smdk4210" remote="github" revision="ics" />
<project name="teamhacksung/buildscripts" path="buildscripts" remote="github" revision="ics">
<copyfile dest="build.sh" src="samsung/build.sh" />
</project>
<project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" />
<project name="TheMuppets/proprietary_vendor_samsung" path="vendor/samsung" revision="ics" />
</manifest>

Save the file with gedit and close it.

Then always make sure you run the commands from ~/android/system/ which stands for /home/youaccount/android/system/

Then it just should be:

Howto build

cd ~/android/system
repo sync -j16
./build.sh galaxys2 (builds full android incl. bootimage )

./build.sh galaxys2 kernel (bootimage only )

When building your 2nd 3rd 4th etc etc, always start with ./build.sh clean to clean the old files of previous build.

Then repo sync -j16 to sync all new patches.

Then ./build.sh galaxys2 to make you're homebuild CM9, can take a while (on core i7 920 @3,8Ghz and 12GB mem, it can take 30min.)

Then in the end the rom and kernel files will be in ~/android/system/out/target/product/galaxys2/

Of which you only need the build rom which is name something like "cm-9-20120716-UNOFFICIAL-galaxys2"