[TUTORIAL]Setting up and compiling CM9/CM10 from source - Samsung Galaxy Nexus

Since I’ve seen many questions on how to build cyanogenmod 9 (CM9) from source for the Galaxy Nexus, but there isn’t a proper guide, I will attempt to write a small how-to. There already is a very good guide how to build ICS from source, but there are a few extra things you’ll have to do for CM9. I hope it will be useful, and if not, well, at least I’ve tried
LATEST UPDATE: August 20th - also added CM10
SETTING UP THE BUILD ENVIRONMENT
I highly recommend Ubuntu 12.04 64 bit for development or Linux Mint 13. It is possible to build on different linux distro’s, but I cannot cover all exceptions. (If you don’t have linux installed or are afraid to set up a dual boot, it is possible to build in a virtual environment –e.g. virtualbox-. Building in a virtual environment however, can be very slow. Also, 64 bit is recommended.)
Make sure java is installed! At the end of this post, I have written a small guide how to install java.
Set up adb and create proper udev rules
I will not write these steps down, but rather point you to some very nice and easy guides. It would be best to do this first, however, it is not completely necessary if you just want to build a fully functioning rom.
1) set up adb (follow this excellent guide)
2) set up udev rules which allow you to start adb without having to use sudo (follow this terrific tutorial)
Installing all necessary packages and set up repo (source)
Open a terminal and copy the following code:
Code:
sudo 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
WARNING: run the following commands as user (NOT as root) unless stated otherwise (e.g., when it explicitly shows ‘sudo’ before a command)!!!
Next, you’ll have to install repo to download the source. First we’re going to create a bin folder (1) in our home directory and include it in our path (2). Also, download the repo script (3) and make it executable (4). All from the command line:
Code:
mkdir ~/bin
PATH=~/bin:$PATH
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
Okay, we’re done with the first part. So far it’s been similar to building pure AOSP.For CM, there will be some additional things you’ll have to do.
DOWNLOADING THE CM SOURCE
Create a directory (CM9 -or CM10-) for your working files:
Code:
mkdir CM9
cd CM9
and then initialize the main CM repo (For CM10, just replace ics with jellybean):
Code:
repo init -u git://github.com/CyanogenMod/android.git -b ics
Good, now you’re ready to download the source. This can take a couple of hours!! Run the following command from the terminal (Run the following commands in the terminal from the root of the directory that contains the source, e.g., ~/CM9/):
Code:
repo sync
Okay, the majority of the files needed to build CM are now on your computer. However, device specific files are needed. To get them, issue the following command in your terminal:
Code:
source build/envsetup.sh
lunch
After the lunch command, choose your device. If you have a GSM version, choose cm_maguro, if you have the CDMA version, choose cm_toro. Additional files needed for your device are being downloaded right now.
Before you can actually build the rom, you’ll need to run two more commands to get some proprietary files.
1) Open a terminal and go to CM9/vendor/cm/. Run the following command:
Code:
./get-prebuilts
This will download term.apk and rommanager.apk. You will need these files otherwise you’ll get an error while building.
2) Now we need to grab some files from your phone. Make sure you have a working build cyanogenmod version (just install a nightly) on your phone. Make sure adb is setup properly (see beginning of this post)!
Connect your phone to the pc. Open a terminal and go to CM9/device/samsung/(Maguro OR Toro)/. Run the following command:
Code:
sh extract-files.sh
BUILDING CM9/CM10
The building part is very easy. It just requires two simple commands:
Code:
source build/envsetup.sh
brunch
After the brunch command, choose your device. Again, if you have a GSM version, choose cm_maguro, if you have the CDMA version, choose cm_toro. Depending on your computer, hopefully you’ll have a fully functioning CM9 or CM10 in 30minutes-2hours (or even longer) . You can find the rom in: /out/target/product/(Maguro OR Toro)/
Next time you build, first clean your working directory. Enter the following command in the terminal:
Code:
make clobber
This will completely remove your output directory!
To update the source, before each build just run:
Code:
repo sync
ADDITIONAL INFO
Install Java
Installing java is very easy in Ubuntu 12.04. Java 6 is recommended. To install it in Ubuntu 12.04 or Linux Mint 13, download the most recent Java 6 SDK from HERE. To install, open a terminal and run the following commands:
Code:
$ chmod +x jdk-6u34-linux-x64.bin
$ sudo ./jdk-6u34-linux-x64.bin
$ sudo mv jdk1.6.0_34 /usr/lib/jvm/
$sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_34/bin/java 1
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_34/bin/javac 1
$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_34/bin/javaws 1
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config javaws
NOTE: after each 'update-alternative'-command, choose the correct (new) java version!
To check if you have the correct java version, type in a terminal:
Code:
java –version
I also added JAVA_HOME to my path; I don’t know if it is still necessary, but it doesn’t hurt either. First, check where java is located. In a terminal type:
Code:
which java
In my case the output shows /usr/bin/java, but it could be located somewhere else. Write down the path minus '/java'. Then open /home/USERNAME/.bashrc and add the following line to the bottom of the file:
Code:
export JAVA_HOME=/usr/bin
Of course replace /usr/bin with your path. Then save and close, and in a terminal run:
Code:
source ~/.bashrc
Odexed version
Some people like their rom to be odexed. There are multiple ways to achieve this (special thanks to Planet X for helping me with this):
1)Instead of ‘brunch’ do the following (if you are building for toro, replace maguro with toro):
Code:
source /build/envsetup.sh
lunch cm_maguro-user
make –j4
(Note:
taken from source.android.com: GNU make can handle parallel tasks with a -jN argument, and it's common to use a number of tasks N that's between 1 and 2 times the number of hardware threads on the computer being used for the build. E.g. on a dual-E5520 machine (2 CPUs, 4 cores per CPU, 2 threads per core), the fastest builds are made with commands between make -j16 and make -j32.)
2)If you want to build an odexed version every time and just want to use the brunch command, do the following:
-Open build/core/main.mk
-Comment out (place a # at the beginning of the line) lines 240, 241, 245, and 246. Thus, replace:
ifneq (true,$(DISABLE_DEXPREOPT))
ifeq ($(user_variant),user)
Ifeq ($(HOST_OS),linux)
WITH_DEXPREOPT := true
Endif
endif
endif
Click to expand...
Click to collapse
# ifneq (true,$(DISABLE_DEXPREOPT))
# ifeq ($(user_variant),user)
Ifeq ($(HOST_OS),linux)
WITH_DEXPREOPT := true
Endif
# endif
# endif
Click to expand...
Click to collapse
Now you can use the brunch command to build an odexed version with insecure boot image.
Hopefully this guide will benefit some people, if not, it kept me busy for a while. Enjoy building!!
(btw, I'm not a native english speaker, so excuse me if I made errors in grammar )

Wow great work. These tutorials keep getting better making it so easy to compile your own rom!

So what does that "brunch" command actually do?
Is it just a script that does the make otapackage commands and stuff?

Infra said:
So what does that "brunch" command actually do?
Is it just a script that does the make otapackage commands and stuff?
Click to expand...
Click to collapse
Indeed! Brunch is actually a combination of 'lunch' and 'make'. Using the 'lunch-part' you choose your build (in our case the maguro or toro). Next, the 'make-part' actually gets things going. The nice thing using brunch is that it automatically detects the maximum number of threads it can use so that it will run at maximum speed.

Finally set my computer up to compile CM9 last night for the first time and after a few tries I finally got it going. The only problem is that I am now getting an error very close to this one.
http://forum.xda-developers.com/showpost.php?p=25452343&postcount=3093
That poster says that it has been happening for a few days now. Is this a known issue with compiling CM9 or is this just user error? I have tried twice compiling now and have had no luck. Is it working for anyone else?
---------- Post added at 02:05 PM ---------- Previous post was at 01:19 PM ----------
Here is the exact error that Im getting. I tried it again today just to see if it anything had changed.
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/mark/CM9/kernel/samsung/tuna'
make: *** [TARGET_KERNEL_BINARIES] Error 2
make: *** Waiting for unfinished jobs....

Thanks for this guide. I just built my first CM9 kang. Getting ready to flash it. Now to find a guide on what I can and can't change and recompile or do I just remove stuff and use 7-zip to zip it back up?

housry23 said:
Thanks for this guide. I just built my first CM9 kang. Getting ready to flash it. Now to find a guide on what I can and can't change and recompile or do I just remove stuff and use 7-zip to zip it back up?
Click to expand...
Click to collapse
Glad to hear you succeeded building your first kang. I don't really understand what you want to do next? If you want to remove stuff from the zip, you can. I for instance always remove stk.apk. But you can also modify the build files so that only things you want will be built. You can play around with the source code and things like that. Anyway, most of the answers you will find using google. I also very much like the development board on Rootzwiki; people are really helpful and friendly there. So if you have any specific questions, i recommend that forum as well!

mbroeders said:
Glad to hear you succeeded building your first kang. I don't really understand what you want to do next? If you want to remove stuff from the zip, you can. I for instance always remove stk.apk. But you can also modify the build files so that only things you want will be built. You can play around with the source code and things like that. Anyway, most of the answers you will find using google. I also very much like the development board on Rootzwiki; people are really helpful and friendly there. So if you have any specific questions, i recommend that forum as well!
Click to expand...
Click to collapse
Okay thanks. I was asking just what you answered. I want to be able to remove and/or add stuff to the zip for starters. I found the answer through Google, but I do appreciate you taking the time to answer. I'll definitely be visiting the Rootzwiki dev board. Thanks for the suggestion.

I have successfully compiled cm9 from source but have never tried to cherry pick or Kang anything yet. Could you quickly explain how you cherry pick with cm9?
Sent from my Galaxy Nexus using Tapatalk 2

SupWiz17 said:
I have successfully compiled cm9 from source but have never tried to cherry pick or Kang anything yet. Could you quickly explain how you cherry pick with cm9?
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
Check out this link it may be helpful
http://rootzwiki.com/index.php?/topic/13189-[TUTORIAL]-Everything-you-ever-wanted-to-know-about-GIT#entry322735
Sent from my GT-S5360 using Tapatalk 2

That's a very useful link, thanks! In addition, if you want to cherry pick commits that haven't been merged yet -specific CM commits, such as navbar customization-, have a look here: http://review.cyanogenmod.com/#/q/branch:ics,n,z
Now let's say you see something interesting that you want to add. Then look at that commit and you'll see a 'download' command, such as "git fetch http://review.cyanogenmod.com/CyanogenMod/android_frameworks_base refs/changes/06/13306/15 && git checkout FETCH_HEAD". Just run that command and if everything works, you have succesfully cherry picked a commit. -of course, because these are not yet merged, there is the chance that no everything will work as it should-

There are also some GUI programs to manage git. I'm just about to try gitgui by all accounts it is very good.
Sent from my GT-S5360 using Tapatalk 2

Maybe it is a noobish question, but does this line:
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > /bin/repo
miss a ~?
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo

UncleDan said:
Maybe it is a noobish question, but does this line:
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > /bin/repo
miss a ~?
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
Click to expand...
Click to collapse
Not noobish at all! You're absolutely right. It's not necessary when you're already in your home folder, but to be sure I've changed it in the guide. Thanks for letting me know!

Sticky!!!!!
Thanks dude
Sent from my Galaxy Nexus using Tapatalk 2

im sorry for noobish...at this step
1) Create an empty file in ~/CM9/.repo
in home i have dir CM9 but its empty...i havent a folder call .repo
java its installed and adb work perfectly
this is my terminal output:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 20774 100 20774 0 0 35679 0 --:--:-- --:--:-- --:--:-- 56604
[email protected]:~$ chmod a+x ~/bin/repo
[email protected]:~$ cd CM9
[email protected]:~/CM9$ repo init -u git://github.com/CyanogenMod/android.git -b ics
Your Name [loris]: loris
Your Email : my email
Your identity is: loris
is this correct [y/N]? y
repo initialized in /home/llo/CM9
[email protected]:~/CM9$
and nothing...
SOLVED

Hey mate any idea why my camera never works after a build... I know I'm missing something but I'm not sure what. I have all the proprietary files for my maguro etc but I just can't get camera to work... everytime
Sent from my Galaxy Nexus using Tapatalk 2

CdTDroiD said:
Hey mate any idea why my camera never works after a build... I know I'm missing something but I'm not sure what. I have all the proprietary files for my maguro etc but I just can't get camera to work... everytime
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
And you flash gapps everytime?
Sent from my GT-I9300 using Tapatalk 2

Infra said:
And you flash gapps everytime?
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Sorted it out was just missing a few important files under /system/vendor thanks
Sent from my Galaxy Nexus using Tapatalk 2

CdTDroiD said:
Sorted it out was just missing a few important files under /system/vendor thanks
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
Glad it worked out! Seems there have been a few changes lately, so I will add some more info soon.
Sent from my SGS3

Related

Building cm9 for the Kindle Fire

BUILDING CM9 FROM SOURCE FOR THE KINDLE-FIRE
This is a guide to help with building a rom from Hashcodes source for the kindle fire.
I am no Dev so please go easy, and if you see any mistakes let me know and I will amend them, It took me a week of reading and asking numerous questions (to proper :angelev's:angel with lot's of mistakes to build my first rom.
Below is what worked for me in the end, (but from what I have learnt, every setup is different).
I'm posting this guide hoping it may help in someway, but please read and research as much as possible before starting
Please follow this guide at your own risk.
Please don't blame me if anything in this thread messes with your system.
I tried lot's of things and in the end I installed a new ubuntu 11.10 x64bit on a external 500gb hdd, (the nice thing now is that all my building etc is all done on a external hdd so I can not mess up my pc AGAIN
I tried 32 bit (but java didn't like that)
I tried ubuntu 12.04 (which is what I dual boot on my laptop)
and the one that worked for the following info was ubuntu 11.10 x64bit.
So here goes.
First you need the following installed.
sun-java6-jdk
android sdk (adb etc) (setup as normal for the kindle fire).
eclipse classic.
Then you set up extra build-essentials
Install the Build Packages
sudo apt-get install*git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool
sudo apt-get install*g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib
Install the repo
mkdir -p $HOME/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > $HOME/bin/repo
Then add the following to your path (e.g. in $HOME/.bashrc)
export PATH=$HOME/bin:$PATH
Then onto the build setup.
mkdir -p $HOME/otter/cm9
cd $HOME/otter/cm9
repo init -u https://github.com/CyanogenMod/android.git -b ics
download the local_manifest to .repo
curl -L -o .repo/local_manifest.xml -O -L https://raw.github.com/KFire-Android/android_local_manifest/ics/local_manifest.xml
at this point you should have a folder called otter inside your home folder and inside this a folder called cm9.
If you show hidden folders in cm9 you should also find a folder called .repo, inside you should have your local manifest, open with a text editor (ie. gedit) and make sure it looks like this.
(hashcodes manifest as of 07/03/2012)
**
****
****
****
****
****
****
****
**
Then sync your repo
repo sync -j4 (duel core)
(this can take a while (mine took 6 hours) (I have a laptop with dual core but only 1.3ghz).
this script uses ccache which will make subsequent builds at least two times faster.
Code:
#!/bin/bash
if [ -z "$1" ]; then
echo "usage: build.sh "
exit 1
fi
device=$1
# ensure ccache is in the path
export PATH="$PATH:$PWD/prebuilt/$(uname|awk '{print tolower($0)}')-x86/ccache"
setup()
{
USE_CCACHE=1
CCACHE=ccache
CCACHE_BASEDIR="$PWD"
CCACHE_DIR="$PWD/.ccache"
#export CCACHE_COMPRESS=1
export USE_CCACHE CCACHE_DIR CCACHE_BASEDIR
if [ ! "$(ccache -s|grep -E 'max cache size'|awk '{print $4}')" = "10.0" ]; then
ccache -M 10G
fi
source build/envsetup.sh
#lunch cm_$1-userdebug
}
setup $device
LOGFILE=build_${device}_$(date +%Y%m%d_%H%M).log
START=$(date +%s)
#make -j`cat /proc/cpuinfo| grep processor | wc -l` bacon 2>&1 | tee $LOGFILE
brunch $device 2>&1 | tee $LOGFILE
END=$(date +%s)
ELAPSED=$((END - START))
E_MIN=$((ELAPSED / 60))
E_SEC=$((ELAPSED - E_MIN * 60))
printf "Time to compile: " >> $LOGFILE
[ $E_MIN != 0 ] && printf "%d min(s) " $E_MIN >> $LOGFILE
printf "%d sec(s)\n" $E_SEC >> $LOGFILE
grep "Time to compile" $LOGFILE
copy/paste the text in a file called $HOME/build.sh, make it executable (chmod 775 build.sh). The script also saves the build output to a file called build_otter_.log.
then onto the build.
cd vendor/cm
./get-prebuilts
cd ../../
then onto buiding
source build/envsetup.sh
then this is the build command
brunch otter (this starts build)
Enjoy
To start over and wipe "out" folder
(from within /otter/cm9)
make clobber
or
rm -rf out/target
build.sh otter
(this can take awhile (mine took another 6 hours)
I had a few things missing and at various times throughout the setup/build I had to download some missing libs. etc (I was prompted all the way through, it would tell me I had so & so file missing and I just used the software centre to dl the missing files).
By all means ask me questions but don't be offended if I answer back “sorry I don't know” as I've already mentioned I am learning myself.
Cheers
Steve
:good:Thanks to Twa_priv & Hashcode with helping me with my rom and this guide:good:
If there are any mistakes/updates to change/modify please let me know.
PLEASE PRESS THE THANKS BUTTON IF YOU FOUND THIS THREAD HELPFULL AND HAPPY ROM BUILDING
helpful links (if you want to add a different guide let me know)
Ubuntu usb install
[B]http://www.ubuntu.com/download/help/create-a-usb-stick-on-ubuntu[/B]
Ubuntu iso
[B]http://releases.ubuntu.com/11.10/[/B]
another build guide (ubuntu 12.04) Thank SBlood86 for this one https://github.com/KFire-Android/and..._manifest/wiki
I can only find the Ubuntu 12.4 on their website, I am running windows 7. If it's not too much can you put links to where the software is downloaded from. Thanks Lovejoy.
TahrirSquare said:
I can only find the Ubuntu 12.4 on their website, I am running windows 7. If it's not too much can you put links to where the software is downloaded from. Thanks Lovejoy.
Click to expand...
Click to collapse
http://lmgtfy.com/?q=ubuntu+11.10+download
Links added ^^^^^^^^^^^^^^^
I think you should add downloading the repo script:
mkdir -p $HOME/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > $HOME/bin/repo
Then add the following to your path (e.g. in $HOME/.bashrc)
export PATH=$HOME/bin:$PATH
twa_priv said:
http://lmgtfy.com/?q=ubuntu+11.10+download
Click to expand...
Click to collapse
Wow what was that, First time I see such a link. cool. Thanks
Thanks Twa_priv (info added to op)
(would not get very far without that
what does this bit do? cd ../../
You should add the build.sh script in there that twa-priv provided us with when we made our builds
Other than that looks great
Sent from my Amazon Kindle Fire using xda app-developers app
lovejoy777 said:
Thanks Twa_priv (info added to op)
(would not get very far without that
what does this bit do? cd ../../
Click to expand...
Click to collapse
This gets you back to the base directory so that "source build/envsetup.sh" works.
all above notes added to op
Thanks guy's
Incidentally the build instructions for Ubuntu 12.04 are here...
https://github.com/KFire-Android/android_local_manifest/wiki
I never put the instructions for older versions on there because they were on the Google and CM pages... Either way, very nice write up
SBlood can I put your guide in the op as well
Sent from my Galaxy Nexus using xda premium
lovejoy777 said:
SBlood can I put your guide in the op as well
Sent from my Galaxy Nexus using xda premium
Click to expand...
Click to collapse
Go for it; if you'd like to see anything added to the wiki shoot me an email.
Please change editor to gedit not gimp
Thanks
thanks, oops
Sent from my Galaxy Nexus using xda premium
Just wondering, does it have to be Sun JDK 6? Will it work with Sun JDK 7 or OpenJDK?
I did a clean install of Ubuntu and the PPA I used to download JDK 6 doesn't work anymore
Only JDK 6 .
Envoyé depuis mon GT-I9000 avec Tapatalk
Trojan38 said:
Only JDK 6 .
Envoyé depuis mon GT-I9000 avec Tapatalk
Click to expand...
Click to collapse
Dang ok. Now I have to figure out how to install JDK 6. lol :silly:
Sorry I can't thank you. I ran out of thanks
---------- Post added at 07:02 PM ---------- Previous post was at 06:21 PM ----------
It's not letting me install JDK 6 at all. What do I do...?
EDIT: Found a way to install. Thanks for the help. http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/
veeman did you not have it before?
Sent from my Galaxy Nexus using xda premium

[Guide] How to compile and install CM10 for Samsung i9000

This guide is an adaptation/update of the following guides to CM10:
http://wiki.cyanogenmod.com/wiki/Samsung_Galaxy_S:_Compile_CyanogenMod_(Linux)
http://forum.xda-developers.com/showthread.php?t=1505006
http://forum.xda-developers.com/showthread.php?t=1533711
DISCLAMER
Although the procedures in this guide were tested on 2012-08-03 and produced a working build on the i9000, I take no responsibility for any consequences derived from their use.
Thanks:
stbenz
rycus86
kasper_h
gmhafiz
Requirements:
Linux - Ubuntu 12.04 - 64bit (AFAIK, a 64 bit host is needed to compile JB)
An i9000 with cm10 already installed - Get the latest nightly here: http://get.cm/?device=galaxysmtd
About 14GB of storage for the repository plus about 15GB for building
If you're using Windows or another OS, grab Virtual Box and install Ubuntu on a VM. It makes a nice development environment.
(Give the VM enough resources - A few cores and 2-4GB of RAM)
Building in other Linux distributions?
Here are some contibutions from fellow members:
Arch Linux: Replace steps 1 to 3 with gmhafiz's instructions
________________________________________________________________________________________________________
1 - Install Ubuntu Packages
1.1 - In terminal:
Code:
sudo apt-get install git-core gnupg flex bison python rar original-awk gawk p7zip-full gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev pngcrush schedtool
sudo apt-get install libc6-dev x11proto-core-dev libx11-dev libgl1-mesa-dev mingw32 tofrodos python-markdown libxml2-utils
sudo apt-get install g++-multilib lib32z1-dev ia32-libs lib32ncurses5-dev lib32readline-gplv2-dev gcc-multilib g++-multilib xsltproc
2 - Install JAVA
NOTE: Must be JDK 1.6 - Don't use other versions.
2.1 - Download Java JDK for Linux 64-bit from Java site: (http://www.oracle.com/technetwork/java/javase/downloads/index.html)
Correct file will be something like: jdk-6u##-linux-x64.bin , where ## is the version number and will change with updates.​
2.2 - Move jdk-6u##-linux-x64.bin to your home directory
2.3 - Remove any other java packages from system:
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
2.4 - Install Java JDK:
Code:
sudo mkdir -p /opt/java/64/
sudo cp jdk-6u##-linux-x64.bin /opt/java/64
sudo su -
cd /opt/java/64
chmod +x jdk-6u##-linux-x64.bin
./jdk-6u##-linux-x64.bin
exit
2.5 - Add JDK PATH to .bashrc:
Code:
vi ~/.bashrc
Add these lines to .bashrc:​
Code:
# Java PATHs
export JAVA_HOME=/opt/java/64/jdk1.6.0_##
export PATH=$PATH:$JAVA_HOME/bin
3 - Install Android SDK
3.1 - Setup directories:
Code:
cd ~
mkdir android
cd android
mkdir sdk
3.2 - Download Android SDK from http://developer.android.com/sdk/index.html
3.3 - Extract SDK contents to ~/android/sdk
3.4 - Add Android SDK Path:
Code:
vi ~/.bashrc
Enter the Following:​
Code:
#Android PATH
export PATH=$PATH:~/android/sdk
export PATH=$PATH:~/android/sdk/platform-tools
export PATH=$PATH:~/android/sdk/tools
3.5 - Add Extra Path For Device:
Code:
sudo vi /etc/udev/rules.d/99-android.rules
Enter this:​
Code:
#Samsung
SUBSYSTEM==usb, SYSFS{idVendor}==04e8, MODE=0666
SUBSYSTEM=="usb", ATTRS{idVendor}=="####:####", SYMLINK+="android_adb", MODE="0666" GROUP="plugdev"
TEST=="/var/run/ConsoleKit/database", \
RUN+="udev-acl --action=$env{action} --device=$env{DEVNAME}"
Save/close file and run:​
Code:
sudo chmod +x /etc/udev/rules.d/99-android.rules
3.6 - Close and open new terminal.
3.7 - Install Android SDK Tools
Code:
android
Check Android SDK Tools and Android SDK platform-tools and Install them​
4 - Install Repository
4.1 - Download Repo:
Code:
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
4.2 - Add Repo Path:
Code:
vi ~/.bashrc
Enter the following:​
Code:
export PATH=$PATH:~/bin
4.3 - Close and open new terminal.
4.4 - Initialize Repository & Sync:
Code:
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
repo sync -j16
NOTE: If you have trouble syncing due to connection issues, try repo sync -j1. It's slower but some ISPs have issues with -j16
Want to make sure you didn't get any connection errors and have the complete repository? Just run the repo sync command again. It can't give you ANY errors.​Go get a beer. And another. And another...​
4.5 - Get Device Specific Repos:
Code:
. build/envsetup.sh && breakfast galaxysmtd
Get more beer...​
4.6 - Extract files from phone:
NOTE: You need to have cm10 installed on the phone.
Connect phone to pc and in terminal type:​
Code:
adb root
cd ~/android/system/device/samsung/galaxysmtd/
./extract-files.sh
4.7 - Download Extra Files:
Code:
~/android/system/vendor/cm/get-prebuilts
4.8 - Add Toolchain PATH:
Code:
vi ~/.bashrc
Enter the following:​
Code:
#Android Toolchain PATH
export ARCH=arm
export CCOMPILE=$CROSS_COMPILE
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:/home/YOUR-USERNAME/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin
4.9 - Close and open new terminal.
5 - Building Android
Code:
cd ~/android/system
. build/envsetup.sh && brunch galaxysmtd
Go get a beer. And another. And another...​
6 - Install on Phone
6.1 - Copy your .zip file from ~/android/system/out/target/product/galaxysmtd/cm-10-XXXXXXXXX-UNOFFICIAL-galaxysmtd.zip to the root of the SD card.
6.2 - Optional: Download Google Apps for Jelly Bean from http://goo.im/gapps and place it on the root of the SD card.
6.3 - Flash both of these .zip files from recovery.
Call your mother. She misses you.​
...and that's it.
________________________________________________________________________________________________________
How to update?
Code:
cd ~/android/system
repo sync -j16
make installclean
find ./out/ -name 'build.prop' | xargs rm
find ./out/ -name 'cm_galaxysmtd-target_files-eng.*.zip' | xargs rm
NOTE: If you have trouble syncing due to connection issues, try repo sync -j1. It's slower but some ISPs have issues with -j16​
...get beer, build and install.
Want to go "Steve Jobs" on the Android build? (Warning: Will take a gazillion years to re-build everything again)
Run:
Code:
make clobber
________________________________________________________________________________________________________
Want to customize the kernel?
Look here: [Guide] How to customize the CM10 i9000 kernel
.
will try this soon... thankx
Can you also write a small paragraph where you explain how compile a single application like Mms, Phone...
Thank you
a0a0 said:
Can you also write a small paragraph where you explain how compile a single application like Mms, Phone...
Thank you
Click to expand...
Click to collapse
You get all the application apks in the produced build.
From there you can extract any single one you want...
Sent from my GT-I9000 using Tapatalk 2
Yes but if i will try a small change in a code i must compile every time all the rom
a0a0 said:
Yes but if i will try a small change in a code i must compile every time all the rom
Click to expand...
Click to collapse
Not really.
Only changed files are compiled (and affected dependencies)
Sent from my GT-I9000 using Tapatalk 2
With mmm you can build single apk files, see the cm9 compile thread for details...
Verstuurd van mijn GT-I9000
Thanks man
Verstuurd van mijn GT-I9000
Requirements:
Linux - Ubuntu 12.04...
Click to expand...
Click to collapse
Does it have to be Ubuntu, provided I can find all listed packages for CentOS, for example?
Also, do you recommend the desktop or the server version?
elitevet said:
Does it have to be Ubuntu, provided I can find all listed packages for CentOS, for example?
Also, do you recommend the desktop or the server version?
Click to expand...
Click to collapse
Doesn't have to be Ubuntu, as long as you can find the equivalent packages.
It can be the desktop or server version, as long as you have X in it.
The android SDK setup uses a GUI. (but perhaps there's a way to run it from the CLI)
Sent from my GT-I9000 using Tapatalk 2
Thanks!
Already built it from the info from the CM9 thread, but this is always welcome
and very useful! Great +++++
Is step 4.5 (Setup Manifest) really required? Can't test it at the moment, but I know, it isn't required for building CM9 anymore, despite it is mentioned in the guide for building CM9. As I understand it, its a relict from when the Galaxy S specific sources weren't yet merged to the CyanogenMod repository.
stbenz said:
Is step 4.5 (Setup Manifest) really required? Can't test it at the moment, but I know, it isn't required for building CM9 anymore, despite it is mentioned in the guide for building CM9. As I understand it, its a relict from when the Galaxy S specific sources weren't yet merged to the CyanogenMod repository.
Click to expand...
Click to collapse
It's not needed.
Gesendet von meinem GT-I9000 mit Tapatalk 2
stbenz said:
Is step 4.5 (Setup Manifest) really required? Can't test it at the moment, but I know, it isn't required for building CM9 anymore, despite it is mentioned in the guide for building CM9. As I understand it, its a relict from when the Galaxy S specific sources weren't yet merged to the CyanogenMod repository.
Click to expand...
Click to collapse
The local manifest is still needed to download the device specific files & kernel source (also for CM9).
The thing not needed for CM9 after some time was using the teamhacksung buildscript.
---------- Post added at 05:27 PM ---------- Previous post was at 05:27 PM ----------
DerTeufel1980 said:
It's not needed.
Gesendet von meinem GT-I9000 mit Tapatalk 2
Click to expand...
Click to collapse
Sure? I don't see the device-files in the default.xml manifest file...
DerTeufel1980 said:
It's not needed.
Gesendet von meinem GT-I9000 mit Tapatalk 2
Click to expand...
Click to collapse
It shouldn't be, if it is like that, but I didn't get those sources until I added the manifest.
Perhaps a quirk, but that's how it worked.
The thing is, I had to put in the guide, as it was the way it worked, starting from a fresh, completely clean system.
Sent from my GT-I9000 using Tapatalk 2
Thanks again!
I was looking for something like this for quite a while now. Now I can finally compile my own builds
I compiled a build using this exact method 2 days ago, flashed the build to the phone and it went into constant pre-recovery bootloops. I had to flash GB with Odin to get back.
One thing was that I compile on a seperate box at home and transferred the file using scp. Maybe that corrupted, so I'm gonna try again tomorrow.
Could it be possible that the codebase itself was broken when I compiled? :-/
Did anybody have anythign similar? :S
K****iz_Indian said:
Could it be possible that the codebase itself was broken when I compiled? :-/
Did anybody have anythign similar? :S
Click to expand...
Click to collapse
Don't think so. The repo is not left with a broken code base.
The thing is, sometimes users get into the boot loop state even when installing the (un)official cm10 builds, so other factors cause them.
Sent from my GT-I9000 using Tapatalk 2
Could anyone refer me to a good guide about commit picking, please?
elitevet said:
Could anyone refer me to a good guide about commit picking, please?
Click to expand...
Click to collapse
http://forum.xda-developers.com/showpost.php?p=23715982&postcount=64

[Tutorial] How to compile your first Nexus Kernel

If you see mistakes please contact me. If you think something can be shorter, easier, feel free to suggest.
I have spent a lot of time figuring this out. Not to mention making this guide.
I DO NOT RESPOND TO PRIVATE MESSAGES. EVERYTHING YOU NEED IS IN HERE.
If this guide helped you feel free to donate.
There is more to come, using different toolchains, important files, adding overclocking etc.
Setting up the environment & building the kernel for the first time
Ubuntu 12.04 64-Bit
Linux Mint 13 64-Bit
Compiling Jelly Bean AOSP ROMs with these 2 is possible WITHOUT ADDITIONAL WORK.
If you want to use virtualization software, do NOT use Virtualbox. You can run into networking issues and so on. I suggest using VMWare Player instead, which is available for free on http://www.vmware.com
Installing latest updates & reboot.
$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ sudo reboot
Click to expand...
Click to collapse
Now we will download and install the latest Java 6 JDK from here. Look for Java 6 SE Update 33 or a later update version. Don't download Java 7 JDK. I am downloading the file below for this guide.
Linux x64 68.69 MB jdk-6u33-linux-x64.bin
Click to expand...
Click to collapse
This guide assumes you have downloaded the file in the folder
~/Downloads
Click to expand...
Click to collapse
$ cd ~/Downloads
$ sudo chmod +x jdk-6u33-linux-x64.bin
$ ./jdk-6u33-linux-x64.bin
$ sudo mkdir /usr/lib/jvm
$ sudo mv jdk1.6.0_33 /usr/lib/jvm/jdk1.6.0_33
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_33/bin/javac 1
$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_33/bin/java 1
$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_33/bin/javaws 1
$ sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.6.0_33/bin/jar 1
$ sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk1.6.0_33/bin/javadoc 1
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javaws
$ sudo update-alternatives --config jar
$ sudo update-alternatives --config javadoc
$ java --version
$ ls -la /etc/alternatives/java*
Click to expand...
Click to collapse
Now reboot is optional but welcome. Let's play safe.
$ sudo reboot
Click to expand...
Click to collapse
Install all required packages to play with Android.
Ubuntu 12.04
$ sudo apt-get update
$ sudo 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-glx:i386 libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 git
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
$ sudo reboot
Click to expand...
Click to collapse
Configure USB ports.
$ sudo gedit /etc/udev/rules.d/51-android.rules
Click to expand...
Click to collapse
This file should get the contents:
# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<username>"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="<username>"
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<username>"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<username>"
# adb protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="70a9", MODE="0600", OWNER="<username>"
# fastboot protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="708c", MODE="0600", OWNER="<username>"
# adb protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="<username>"
# fastboot protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e30", MODE="0600", OWNER="<username>"
# adb protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d101", MODE="0600", OWNER="<username>"
# fastboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d022", MODE="0600", OWNER="<username>"
# usbboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d00f", MODE="0600", OWNER="<username>"
# usbboot protocol on panda (PandaBoard ES)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d010", MODE="0600", OWNER="<username>"
Click to expand...
Click to collapse
Don't forget to replace the red marked text with your username from Ubuntu or Linux Mint.
When building a kernel, you only need to start from here. Pick the appropriate branch from the git manually. My example below shows how to download the required files to build a Jelly Bean kernel. What I did was visiting the git repository each time and picked the appropriate branch.
https://android.googlesource.com/device/samsung/maguro
$ mkdir ~/Documents/kernel
$ cd ~/Documents/kernel
$ git clone https://android.googlesource.com/device/samsung/maguro -b jb-release
Click to expand...
Click to collapse
Again pick the right branch from https://android.googlesource.com/kernel/omap.git
$ cd maguro
$ git clone https://android.googlesource.com/kernel/omap.git -b android-omap-tuna-3.0-jb-pre1
Click to expand...
Click to collapse
Ensure the toolchain is in your path.
Default, Easy solution
$ git clone https://android.googlesource.com/platform/prebuilt -b jb-release
$ export PATH=$(pwd)/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH
Click to expand...
Click to collapse
$(pwd) is a variable holding the current working directory.
Bandwidth-friendly solution
You can also download the toolchain to another directory. Bit first write down the directory you are working at.
mkdir ~/Documents/toolchain
cd ~/Documents/toolchain
$ git clone https://android.googlesource.com/platform/prebuilt -b jb-release
export PATH=~/Documents/toolchain/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH
Click to expand...
Click to collapse
Instead of specifying the location of the toolchain with a relative path, we must specify the absolute path here.
Now we go back to where we were working.
cd ~/Documents/kernel/maguro
Click to expand...
Click to collapse
I hope you understand why I mentioned the bandwidth-friendly solution. With little insight you could have come up with it yourself.
Now let's build the kernel
$ cd omap
$ export ARCH=arm
$ export SUBARCH=arm
$ export CROSS_COMPILE=arm-eabi-
$ make tuna_defconfig
$ make
Click to expand...
Click to collapse
[*]Now you need to put it in a flashable zip.
Possible issues, things to avoid, FAQ
- Avoid downloading the kernel sources to directories which might require root/superuser access. This is one of the reasons I downloaded all sources to '~/Documents'. This will save a lot of time messing with chmod or chown commands.
- What is 'tuna', shouldn't this be maguro? No, actually not. Tuna is the board name, while maguro is the codename of the Nexus. Something you might want to remember when building kernels.
Interesting files and locations
<kernel_directory>/samsung/arch/arm/mach-s5pv210/cpu-freq.c
Overclocking
Voltages
Links to mods, source code, ...
Only do these when you are in the omap directory
Getting access to Ezekeel's work
git remote add ezekeel https://github.com/Ezekeel/GLaDOS-nexus-prime.git
git fetch ezekeel
Click to expand...
Click to collapse
If you want to change the text marked in red make sure to change the other one as well. You can think of this as a nickname for the remote repository.
Example of cherry-picking CUSTOM VOLTAGE
1. Go here: https://github.com/Ezekeel/GLaDOS-nexus-prime/commits/customvoltage_JB
2. Copy the SHA of the commit
3.
git cherry-pick 05ab84fa9bc1fa86e5a99c54266873e433ff15e2
Click to expand...
Click to collapse
template
git cherry-pick <SHA>
Click to expand...
Click to collapse
When encountering conflicts, you are on your own. I figured most of this out on my own. So if I can do it you can too.
Getting access to Francisco Franco's work
git remote add franco https://github.com/franciscofranco/Tuna_JB_pre1.git
git fetch franco
Click to expand...
Click to collapse
Getting access to http://www.kernel.org
git remote add kerneldotorg git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
git fetch kerneldotorg
Click to expand...
Click to collapse
red 2 days ago yours guide linked in sig.you sad that with ubuntu 12.10 aosp rom are impossible to compile,it's fine only for kernel and for aosp rom should use version 10.xx.now instead you say 12.xx is good for kernel and rom compiling,but from JB and so on.(Compiling AOSP ROMs with these 2 is possible. Only Jelly Bean and later though will compile without additional work)
after that,i think (after reading yours words)that until iCS 12.xx doesn't compile and from jb a so on 12.xx works good?i'm right or i I misunderstood?i'm totally noob on this things,compiled my fist rom 15 days ago,begin with JB but compiled already in mint mate 13,mint cynnamon 13,ubuntu 10.10 and 12.04\10.
very thanks for this guide man,it's very usefull and having already the environment setted it's very fast also.followed instruction in yours sig days ago and with no luck.now i retry with this!on mint 13 cynnamon 64bit now.regards cherrypicking...what you wrote is all we have to known for or is a base?
rated 5 stars and thanked.like this 3ads aims to help everyone begin do things yourselves on android
Good tutorial. Thanks for taking the time to write this.
How many gigs do I need to compile the kernel? I only have a 120gb ssd and 75gb free.
Sent from my Galaxy Nexus using Tapatalk 2
you are safe..
Serious_Beans said:
How many gigs do I need to compile the kernel? I only have a 120gb ssd and 75gb free.
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
They are enough
For kernel compiling we don't need any version of java
Inviato dal mio Galaxy Nexus con Tapatalk 2
sert00 said:
red 2 days ago yours guide linked in sig.you sad that with ubuntu 12.10 aosp rom are impossible to compile,it's fine only for kernel and for aosp rom should use version 10.xx.now instead you say 12.xx is good for kernel and rom compiling,but from JB and so on.(Compiling AOSP ROMs with these 2 is possible. Only Jelly Bean and later though will compile without additional work)
after that,i think (after reading yours words)that until iCS 12.xx doesn't compile and from jb a so on 12.xx works good?i'm right or i I misunderstood?i'm totally noob on this things,compiled my fist rom 15 days ago,begin with JB but compiled already in mint mate 13,mint cynnamon 13,ubuntu 10.10 and 12.04\10.
very thanks for this guide man,it's very usefull and having already the environment setted it's very fast also.followed instruction in yours sig days ago and with no luck.now i retry with this!on mint 13 cynnamon 64bit now.regards cherrypicking...what you wrote is all we have to known for or is a base?
rated 5 stars and thanked.like this 3ads aims to help everyone begin do things yourselves on android
Click to expand...
Click to collapse
ICS didn't compile here on Ubuntu 12.04. I believe I needed to do some additional work. ICS was also released before Ubuntu 12.04 was released. Jelly Bean will compile just fine.
The only thing that was difficult to figure out was how to setup the Java 6 JDK properly which I had to figure out by trial and error.
The cherry-picking is handy when you want to 'steal' someone else his work. Let's say 99% of the developers do this all the time here on XDA. I wanted to explain how to cherry-picking because it's useful to know. I spent a long time getting here.
Serious_Beans said:
How many gigs do I need to compile the kernel? I only have a 120gb ssd and 75gb free.
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
I think 4-5GB if you download everything. If you only download the Jelly Bean things by only downloading the branch you need you will use about maybe 1GB I am not sure. Try it out.
Download the toolchain to a separate directory. This will save lots of bandwidth in the future.
Good job on this guide. I learnt this ages ago though
Sent from my Galaxy Nexus using xda premium
i'm interesting about linaro but i don't know how set it up,can you say something about this?
Sent from my Galaxy Nexus
dxdiag32 said:
i'm interesting about linaro but i don't know how set it up,can you say something about this?
Sent from my Galaxy Nexus
Click to expand...
Click to collapse
Linaro is easy.
Google to download the linaro toolchain from their website. And then it's a bit trial and error to fill in:
CROSS_COMPILE line
it's not arm-eabi- anymore buy gnu-arm-eabi or something similar. It has to do with the directory structure or the filenames.
If you get a compile error about vfp or something you must correct this in a make file.
Take a look in francisco franco's github account or AIR Kernel. They have commit which describe what they did if they ran into compile errors. Normally you won't have to change anything I think.
Thanks OP. Maybe when I'm free I'll give this a try. I always wanted to try to make a stock kernel + colour tweaks + trinity contrast + 384 GPU for my own use. As this is considered I am "stealing" work, I wouldn't bother uploading this kernel I have compiled stock AOSP 4.0.4 (referring a guide) for the galaxy nexus. Except I didn't test out the rom as I didn't own a nexus back then.
Sent from my Galaxy Nexus using Tapatalk 2
thanks OP, but why apt-get install openjdk after manually install JDK 6? it is nothing about kernel compile but fail on the whole aosp compile.
Sent from my Galaxy Nexus
Thanks a lot for this tuto.
I'm trying to compile GlaDos kernel with Ubuntu 12.10 and i have this error :
Code:
[email protected]:~/android/kernel/GLaDOS-nexus-prime$ make
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: « include/generated/mach-types.h » est à jour.
CC kernel/bounds.s
cc1: error: unrecognized command line option "-mno-unaligned-access"
kernel/bounds.c:1: warning: switch -mcpu=cortex-a9 conflicts with -march= switch
make[1]: *** [kernel/bounds.s] Erreur 1
make: *** [prepare0] Erreur 2
Do you have an idea where it may come from ?
What is the version of your toolchain?
Sent from my Galaxy Nexus using xda app-developers app
anarkia1976 said:
What is the version of your toolchain?
Sent from my Galaxy Nexus using xda app-developers app
Click to expand...
Click to collapse
I took the one in the 1st post :
Code:
git clone https://android.googlesource.com/platform/prebuilt -b jb-release
It's arm-eabi-4.4.3
I tried with Ubuntu 12.04 to be exactly in the same conditions as described in the 1st post but I have exactly the same error...
That is really weird... Any ideas ?
Remove from makefile this:
-mno-unaligned-access
Otherwise you can use new toolchain from my github:
https://github.com/anarkia1976/AK-linaro
anarkia1976 said:
Remove from makefile this:
-mno-unaligned-access
Otherwise you can use new toolchain from my github:
https://github.com/anarkia1976/AK-linaro
Click to expand...
Click to collapse
Thanks anarkia1976 !
I've been able to compile with the last version of your toolchain. :good:
No problem .. if I can help it is a pleasure.
anarkia1976 said:
No problem .. if I can help it is a pleasure.
Click to expand...
Click to collapse
I noticed JZO54K has a crashing camera bug. I checked several times, redownloaded everything on different devices being maguro and grouper.
Has anyone managed to build CM10 or AOSP on Ubuntu 12.10 ? When installing the same packages I notice everything crashes. It's unclear if it's actually the packages or Google Chrome. I suspect one of the packages being the culprit.
I am going one by one through the packages in Ubuntu 12.10. Those willing to help me let me know. just install each package one by one.

[PORT] [ROM] WebOS Port - Build Setup

Overview
The following steps will help you to setup a complete build environment for the webos-ports project.
WE DO NOT CURRENTLY SUPPORT webos-image PLEASE BUILD webos-dev-image
Setup the build environment
Code:
$ sudo apt-get install gawk
$ sudo apt-get install diffstat
$ sudo apt-get install chrpath
$ sudo apt-get install texinfo (if not on Ubuntu or Debian it will be makinfo instead of texinfo)
$ cd into-your-build-directory
$ mkdir webos-ports && cd webos-ports
$ wget https://raw.github.com/openwebos/build-webos/master/scripts/prerequisites.sh
$ sudo sh prerequisites.sh
$ wget https://raw.github.com/webOS-ports/webos-ports-setup/master/Makefile
$ make setup-webos-ports
Before you can build, you will need some tools. If you try to build without them, bitbake will fail a sanity check and tell you about what's missing, but not really how to get the missing pieces.
This has been tested on Gentoo (shr-chroot) and Ubuntu-12.04 amd64 and should work almost everywhere where valid toolchain is provided.
You need a lot of RAM to link webkit-webos, make sure you have at least 6GB (it's OK when some of that is swap, because it's used only for short part of build).
Webkit needs so much ram to link because it's linking with debug symbols (huge files) which are stripped later in do_package after creating -dbg packages.
You can add extra 2GB of swap file like this:
Code:
$ dd if=/dev/zero of=swap_2gb.img bs=1024k count=2048
$ mkswap swap_2gb.img
$ sudo swapon swap_2gb.img
If you want it permanently add it to your /etc/fstab.
Building
To configure to build for tuna (notice '.' which is actually bash 'source' command):
Code:
$ cd into-your-build-directory/webos-ports/webos-ports
$ . ./setup-env
To update metadata
Code:
$ make update
# or if it shows warning about different bblayers.conf or layers.txt
$ make update-conffiles && make update
# you can also add UPDATE_CONFFILES_ENABLED = 1 to config.mk
# if you never want to have any uncommited changes in your checkouts RESET_ENABLED = 1 in config.mk
To build the webos-image for the gnex device:
Code:
$ MACHINE=tuna bb webos-ports-image
# or for the webos development image
$ MACHINE=tuna bb webos-ports-dev-image
If you get an error about missing qmake-palm, try this:
Code:
$ MACHINE=tuna bitbake -c cleansstate -f qt4-webos
If you get an error about missing QtWebKit #261, try this:
Code:
$ MACHINE=tuna bitbake -c cleansstate -f webkit-webos
If you get an error "The BBPATH variable is not set", then you forgot to call:
Code:
$ . setup-env
After the build completes, you will find your image in <build env>/tmp-eglibc/deploy/images/tuna/
==Speeding up the build==
You can tune bitbake to use more of your processor. Edit webos-ports/conf/local.conf and uncomment the PARALLEL_MAKE and BB_NUMBER_THREADS lines. PARALLEL_MAKE should be set to the number of processor cores you have (or the number you have made available to the VM in the case of a VM) and BB_NUMBER_THREADS can be set from one to two times that, depending upon RAM, processor speed, other tasks running and Hyper-threading support. Example values:
Code:
PARALLEL_MAKE = "-j 4"
BB_NUMBER_THREADS = "4"
I'm not in charge of this port. This thread is just here to help you, and discuss about this port made by team WEBOS-PORT.
Thanks for their work.
Installing and running the image
Once you have built the image, you'll likely want to install it and run it on your Nexus. See Testing Gnex for further details on that process.
Source and updates : http://webos-ports.org/wiki/Galaxy_Nexus_Build_Setup
Videos
Pictures
More Pictures : http://webos-ports.org/wiki/Galaxy_Nexus
Thanks for this, just having a go at this now
Edit: Damn it seems it doesn't like Ubuntu 10.10
Suppose I needed an excuse to update........
It would be pretty cool to have web os as a port for the Nexus. Wish you all the best
Sent from my Galaxy Nexus using Tapatalk 2
Nice, I hope webOS will be a succes on our Galaxy Nexuses!
Good luck!
nice work there ...
Really excited about this. Can't wait for a relatively stable port of the WebOS
So awesome, can't wait to see how this progresses.
Sent from my Galaxy Nexus using Tapatalk 2
The source was specified for Gnex, wasn't it?
Sent from my Galaxy Nexus using xda app-developers app
woot woot. niceeeee
Sound good....
Sent from my Galaxy Nexus using xda app-developers app
Awesome dude! Can't wait for a release. Hopefully in the future we can get this to dual boot with android, that would be awesome!
possibly to get instructions for toro?
waiting this on my gnex
New video added to post #2
exciiting stuff
Ok, this may be very embarrassing. I was able to follow the process to build the image but I cannot find the image nor how-to flash it on my Nexus. Any help like links, keywords to search for is very appreciated.
#1 updated with Latest revision as of 23:58, 10 October 2012
sounds interesting.. cant wait for build that i can flash
Bread Pitta said:
Ok, this may be very embarrassing. I was able to follow the process to build the image but I cannot find the image nor how-to flash it on my Nexus. Any help like links, keywords to search for is very appreciated.
Click to expand...
Click to collapse
Same here. Finally got it to build without errors, but no clue what to do next. My best Google sleuthing couldn't find any hints either

[GUIDE] Compiling your own AOKP (ICS Branch) from Source

Hi! Here's a complete guide for people who want to develop AOKP from source. I havent compiled any ROM from source because my internet connection is too slow. This guide will work, as far as I know. So lets start off by seeing the requirements.
Requirements :
Code:
1. A 64-bit environment. (64-bit is necessary for android 4.0 and plus builds)
2. Ubuntu 12.04 or 12.10 (with 64-bit architecture)
3. 2Ghz Dual Core Processor
4. 2GB Minimum ram
5. 50GB File Space (For only one rom source)
The device tree can be found here : Link. (thanks to whitexp for the device tree and percy_g2 to provide the correct links in the replies.
Now Open the terminal (CRTL+ALT+T) and go ahead as follows :
1. Update your OS
Code:
$ sudo apt-get update
$ sudo apt-get upgrade
2. Download the required packages :
2A. Installing JDK:
Code:
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java6-installer
Once its installed check weather its installed properly or not.
Code:
$ java -version
The output should be like this :
Code:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
2B. Installing required packages.
Code:
apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev libncurses5-dev x11proto-core-dev \
libx11-dev libreadline6-dev libgl1-mesa-dev tofrodos python-markdown \
libxml2-utils xsltproc pngcrush gcc-multilib lib32z1 schedtool
2C. LibGL shortcut issue solver:
Code:
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
3. Setup installing repo
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
4. Create the working folder
Code:
$ mkdir aokp_ics
$ cd aokp_ics
5A. Making the directory for downloading the source
Code:
mkdir -p ~/rom/android/system
Now go into that folder by :
Code:
cd ~/rom/android/system
PATH=~/bin:$PATH
5B. Downloading the AOKP source:
Code:
$ repo init -u https://github.com/AOKP/platform_manifest.git -b ics
6. Sync repository:
Code:
$ repo sync
** Please note that this will take a long time. You need fast connection because the size repositories is 8 ~ 12 GB.
7. Setting up the source folder
Once the sync finishes without breaking all the folders will appear in rom/android/system folder, Execute :
Code:
mkdir -p ~/rom/android/system/device/samsung/totoro
and then for vendor, execute this :
Code:
mkdir -p ~/rom/android/system/vendor/samsung/totoro
8. Compiling
Code:
. build/envsetup.sh
lunch cm_totoro-eng
brunch cm_totoro-eng
** Your build will be located at /rom/android/system/out
All the best.. ​
And how will this work again?
Without proper source implementations from the device?
This post is in compliance with the national potato safety regulation.
[Galaxy S 4 LTE]
---------- Post added at 12:23 AM ---------- Previous post was at 12:19 AM ----------
Hmmm,
We can't even compile a stable ics build.
I'm not sure how well this works.
Can any senior GY devs verify this?
This post is in compliance with the national potato safety regulation.
[Galaxy S 4 LTE]
Good thread
deathnotice01 said:
And how will this work again?
Without proper source implementations from the device?
This post is in compliance with the national potato safety regulation.
[Galaxy S 4 LTE]
---------- Post added at 12:23 AM ---------- Previous post was at 12:19 AM ----------
Hmmm,
We can't even compile a stable ics build.
I'm not sure how well this works.
Can any senior GY devs verify this?
This post is in compliance with the national potato safety regulation.
[Galaxy S 4 LTE]
Click to expand...
Click to collapse
i am not an expert in this so I have said that this will work "as far as i know". I have gone till the step in which you have to sync repo. So I thought that this will surely work even ahead of that step.
Ya sure. Some senior GY dev must verify this.
There is a file called default.xml in repo/manifests. You have to change it according to your needs.
LoLz... Let CM9 get stable! AOKP and other ICS based source compiled roms come after!!
Also PPA no longer exists! Java won't install with the method given in the guide!
EDIT:
Also, If you haven't tried on your own you can't say it works -_-
And you didn't mention which device config to be used -_- People aren't pros like you #LOL
@prototype-U @percy_g2 @Deadly
EDIT:
Also the source is not 8-12GB its less than 8GB :silly:
EDIT 3:
More people need to see this :v
@gadgetroid
Arnav.G said:
LoLz... Let CM9 get stable! AOKP and other ICS based source compiled roms come after!!
Also PPA no longer exists! Java won't install with the method given in the guide!
EDIT:
Also, If you haven't tried on your own you can't say it works -_-
And you didn't mention which device config to be used -_- People aren't pros like you #LOL
@prototype-U @percy_g2 @Deadly
EDIT:
Also the source is not 8-12GB its less than 8GB :silly:
EDIT 3:
More people need to see this :v
@gadgetroid
Click to expand...
Click to collapse
Exactly.
The device tree is of most importance
This post is in compliance with the national potato safety regulation.
[Galaxy S 4 LTE]
deathnotice01 said:
Exactly.
The device tree is of most importance
This post is in compliance with the national potato safety regulation.
[Galaxy S 4 LTE]
Click to expand...
Click to collapse
Yeah, CM is AOSP with Major Modifications in Google AOSP Source for Performance!
Also instead of compiling ICS based roms you should first compile CM7/GingerBread roms! Coz if you directly start off with CM9/ICS I am sure you are going to get frustrated of the big big errors you are going to face!
This thread ironic! lol
deathnotice01 said:
Exactly.
The device tree is of most importance
This post is in compliance with the national potato safety regulation.
[Galaxy S 4 LTE]
Click to expand...
Click to collapse
AOKP or any aosp builds based on cm9 can be compiled but it will have same bugs like CM 9 and device tree can be found https://github.com/Whitexp/android_device_samsung_totoro/tree/ICS here for SGY .
Its useless until RIL is fixed
Also compiling isn't that tough!
But writing proper HAL's and fixing the bugs is tough!!
hmm thread is not a bit useful in this forum
aokp on galaxy y5360
make me laugh
we can dream for cm7.2 aosp is a milestone that cant be achieve
I am new here and not a professional.
I have tried this. But i didnt make the final build because my internet is too slow(256K modem). but i have reached the sync repo step successfully and so i thought i would share it. But now i see that sharing it was waste.
And yes, @Arnav.G its not a rule that CM must be maintained first and AOKP after that. Anyone can start the work of AOKP simultaneously. I was seeing your profile and i saw that you also have posted a guide on compiling CM, AOKP and all. I sincerely think that the guide is not so noob friendly, you should make it more simpler by separating the commands which you have pressed into one.
greetings.
robowarrior1377 said:
I am new here and not a professional.
I have tried this. But i didnt make the final build because my internet is too slow(256K modem). but i have reached the sync repo step successfully and so i thought i would share it. But now i see that sharing it was waste.
And yes, @Arnav.G its not a rule that CM must be maintained first and AOKP after that. Anyone can start the work of AOKP simultaneously. I was seeing your profile and i saw that you also have posted a guide on compiling CM, AOKP and all. I sincerely think that the guide is not so noob friendly, you should make it more simpler by separating the commands which you have pressed into one.
greetings.
Click to expand...
Click to collapse
Why bringing my guide here? lol
Also do you want to kang my guide!?
Ok.
So OP what device tree did you use to be exact?
This post is in compliance with the national potato safety regulation.
[Galaxy S 4 LTE]
AOKP and Galaxy Y look so funny together!
Btw you missed the major steps:
Setting up vendor
Setting up device tree
Setting up kernel source
And obtaining cm_totoro.mk
Anyways, its worth the try.. atleast you guys would be able to see AOKP
Subscribed to thread xD
Lets see what is his next reply
robowarrior1377 said:
I havent compiled any ROM from source because my internet connection is too slow.
Click to expand...
Click to collapse
makes a guide for something he doesn't know or has never done
robowarrior1377 said:
Requirements :
2. Ubuntu 12.04 or 12.10 (with 64-bit architecture)
Click to expand...
Click to collapse
I'm sure I built it on 11.10
robowarrior1377 said:
3. 2Ghz Dual Core Processor
Click to expand...
Click to collapse
1ghz single core
robowarrior1377 said:
4. 2GB Minimum ram
Click to expand...
Click to collapse
yawn. 512mb with a bit of swap
robowarrior1377 said:
5. 50GB File Space (For only one rom source)
Click to expand...
Click to collapse
20gb
robowarrior1377 said:
Now Open the terminal (CRTL+ALT+T) and go ahead as follows :
Click to expand...
Click to collapse
isn't working on debian. had to map my own shortcut
robowarrior1377 said:
1. Update your OS
Code:
$ sudo apt-get update
$ sudo apt-get upgrade
Click to expand...
Click to collapse
Isn't necessary
2. Download the required packages :
robowarrior1377 said:
2A. Installing JDK:
Code:
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java6-installer
Click to expand...
Click to collapse
can be problems for new distros. please use my method
cybojenix said:
first we download the required binary:
Code:
wget --no-check-certificate --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin"
then we need to run the binary, and move it to a shared location
Code:
chmod +x jdk-6u45-linux-x64.bin
sudo ./jdk-6u45-linux-x64.bin
sudo mv jdk1.6.0_45 /usr/lib/jvm/
finally, all the needed java binaries need to be installed, and given the highest priority. This will override any other java versions you have
Code:
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_45/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_45/bin/javac 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_45/bin/javaws 1
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.6.0_45/bin/jar 1
sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk1.6.0_45/bin/javadoc 1
now check that jdk1.6.0_45 is selected on these
Code:
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
sudo update-alternatives --config jar
sudo update-alternatives --config javadoc
Click to expand...
Click to collapse
robowarrior1377 said:
5A. Making the directory for downloading the source
Code:
mkdir -p ~/rom/android/system
Click to expand...
Click to collapse
no comment.
robowarrior1377 said:
Code:
PATH=~/bin:$PATH
Click to expand...
Click to collapse
you'd be better off adding this to ~/bash.rc
robowarrior1377 said:
7. Setting up the source folder
Once the sync finishes without breaking all the folders will appear in rom/android/system folder, Execute :
Code:
mkdir -p ~/rom/android/system/device/samsung/totoro
and then for vendor, execute this :
Code:
mkdir -p ~/rom/android/system/vendor/samsung/totoro
Click to expand...
Click to collapse
WOOOOTTTT building with empty device folders. you must be a genius
robowarrior1377 said:
8. Compiling
Code:
brunch cm_totoro-eng
Click to expand...
Click to collapse
hmm. brunch totoro
robowarrior1377 said:
** Your build will be located at /rom/android/system/out
Click to expand...
Click to collapse
LOOOL
~/aokp-ics/rom/android/system/out/target/product/toroto
that's if you insist on using your directory.
I hope this helped you. trollojenix
cybojenix said:
makes a guide for something he doesn't know or has never done
I'm sure I built it on 11.10
1ghz single core
yawn. 512mb with a bit of swap
20gb
isn't working on debian. had to map my own shortcut
Isn't necessary
2. Download the required packages :
can be problems for new distros. please use my method
no comment.
you'd be better off adding this to ~/bash.rc
WOOOOTTTT building with empty device folders. you must be a genius
hmm. brunch totoro
LOOOL
~/aokp-ics/rom/android/system/out/target/product/toroto
that's if you insist on using your directory.
I hope this helped you. trollojenix
Click to expand...
Click to collapse
Ahahahhahahahahahhahahahahahha... xD Can't stop laughing
Trololololjenix xD

Categories

Resources