FORUMS
Remove All Ads from XDA

[Tutorial] Build CM10.1 / CM10 for i9001

1,002 posts
Thanks Meter: 3,773
 
By Xistance, Senior Member on 1st October 2012, 09:56 PM
Post Reply Email Thread
I thought that this would get the development of JB for our device a bit faster. I am going to be explaining for Ubuntu 12.04 and up.
If you get any errors use pastebin and link it here. Good luck



Requirements
  • 64bit Ubuntu
  • You will need 25GB (or more) free to complete a single build, and up to 80GB (or more) for a full set of builds.
  • JDK 6
    Code:
    sudo apt-get install openjdk-6-jdk
  • Python 2.4--2.7
    Code:
    sudo apt-get install python
  • Git 1.7 or newer
    Code:
    sudo apt-get install git-core




Installing Android SDK
  • Download the SDK here: http://developer.android.com/sdk/index.html
  • Extract the SDK and place it in your home directory.
  • I renamed my SDK to android-sdk to make it easier to navigate to.
  • Go to your home folder, press Ctrl+H to show hidden files, and open up your .bashrc file.
  • Add these lines at the bottom of the file(Change path according to your SDK dir):
Code:
# Android tools
export PATH=${PATH}:~/android-sdk/tools
export PATH=${PATH}:~/android-sdk/platform-tools
export PATH=${PATH}:~/bin
  • Find your .profile file and add this at the bottom of the file:
Code:
PATH="$HOME/android-sdk/tools:$HOME/android-sdk/platform-tools:$PATH"
  • Check for updates by entering this in terminal:

Code:
android
Install required packages(12.04)
Code:
sudo apt-get install git gnupg flex bison gperf build-essential \
  zip curl libc6-dev libncurses5-dev x11proto-core-dev \
  libx11-dev libreadline6-dev libgl1-mesa-glx \
  libgl1-mesa-dev g++-multilib mingw32 tofrodos \
  python-markdown libxml2-utils xsltproc zlib1g-dev
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

Configure your USB
Code:
gksudo gedit /etc/udev/rules.d/51-android.rules
Inside of the blank text file insert :
Code:
#Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666"

#ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666"

#Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"

#Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"

#Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"

#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"

#HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"

#Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"

#K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666"

#KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666"

#Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"

#Lenevo
SUBSYSTEM=="usb", ATTR{idVendor}=="17EF", MODE="0666"

#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"

#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"

#NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666"

#Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666"

#Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"

#OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666"

#Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"

#Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666"

#PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666"

#Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"

#SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666"

#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"

#Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"

#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"

#Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666"

#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"
Save the file and enter this into the terminal :

Code:
sudo chmod a+r /etc/udev/rules.d/51-android.rules

Install repo

Code:
mkdir -p ~/bin
mkdir -p ~/android-sdk
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
Initialize the repo(use "-b jellybean" for CM10)

Code:
mkdir WORKING_DIRECTORY
cd WORKING_DIRECTORY
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
  • When asked for, enter your real name and email.


Sync your repo

Enter this into terminal. This will take a while according to your connection.
Code:
repo sync -j16

Quote:

NOTE: According to your connection change the -j16. I use -j16 with a 100Mbit connection. Drop to -j8 if you have 10Mbit connection or even less if you have a slower connection or you will get connection errors.

Add i9001 to the device list
  • Change your directory to where you will clone the device tree:

Code:
cd WORKING_DIRECTORY/device
mkdir samsung
cd samsung
  • Clone the device tree from remote to local (Change git to whatever you want, I used the ADC team as an example) :
Code:
git clone git://github.com/AriesVE-DevCon-TEAM/android_device_samsung_ariesve.git -b cm-10.1 ariesve
NOTE: Use -b jb-3.0 for CM10
  • Now cd to ariesve :
Code:
cd ariesve
  • Connect your phone to your computer and make sure debugging is open and adb is set up.
  • Get vendor files :


Code:
cd ~/WORKING_DIRECTORY/vendor
mkdir samsung
cd samsung
git clone git://github.com/ivendor/android_vendor_samsung_ariesve.git -b jellybean ariesve
  • Get extra files
Code:
~/WORKING_DIRECTORY/vendor/cm/get-prebuilts
  • Go back to your home dir to build :

Code:
cd ~/WORKING_DIRECTORY
Get some needed files

FOR CM10.1:
You can either fetch from a dev's git or just download frameworks/av and frameworks/native completely and replace it with your own if you find that easier. I'll just do the latter for the sake of simplicity:
Code:
cd frameworks
rm -rf av
rm -rf native
git clone https://github.com/camcory/android_frameworks_av.git -b cm-10.1 av
git clone https://github.com/camcory/android_frameworks_native.git -b cm-10.1 native
cd ..
FOR CM10:
Download this script and give it permission to execute in settings and open it. Choose to run from terminal and follow the script. This should fix any errors you get while compiling. Credits to blackmambazzz for the script.

Build CM
  • Prepare to compile :

Code:
. build/envsetup.sh
  • Now compile for device
Code:
brunch ariesve -j#
Quote:

Change # according to your CPU cores. It should usually be CPU cores+1.
If you wish to be able to see the errors despite it being very slow enter -j1.




Fixes for some errors
If you are running into issues such as:

Code:
Which would you like? [full-eng] 5
build/core/product_config.mk:209: *** No matches for product "ariesve".  Stop.
Device ariesve not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Repository for shooter not found in the CyanogenMod Github repository list. If this is in error, you may need to manually add it to your local_manifest.xml.
build/core/product_config.mk:209: *** No matches for product "ariesve".  Stop.

** Don't have a product spec for: 'ariesve'
** Do you have the right repo manifest?
What you need to do is to edit your blob to match the PRODUCT_NAME to the file name. For example with mine I have full_ariesve.mk therefore in this file I need to have PRODUCT_NAME to match it. Whatever error it is looking for you just need to change the PRODUCT_NAME line to match what the error shows.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

If you run into issues with Java being the incorrect version here is the fix:
Make sure Java 6 JDK is installed by typing in:
Code:
java -version
Open the file main.mk in build/core and delete this line from the java error code section:
Code:
$(error stop)

Credits
arco68
ivendor
Doomsday94
dastin1015
camcory

This tutorial is based off of this one : http://forum.xda-developers.com/show....php?t=1762641

This is my first time making a tutorial so please tell me if I missed something . I wish you guys luck on your builds.

Here is an example of what happens if it builds correctly :

Attached Thumbnails
Click image for larger version

Name:	Screenshot_2012-10-30-21-53-59.jpg
Views:	3817
Size:	28.6 KB
ID:	1444286  
The Following 64 Users Say Thank You to Xistance For This Useful Post: [ View ] Gift Xistance Ad-Free
 
 
1st October 2012, 11:55 PM |#2  
XeLLaR*'s Avatar
Senior Member
Flag DevConnection
Thanks Meter: 4,734
 
More
Nice tutorial dude!
Really easy to understand and well wrote.
Keep up the good work!
2nd October 2012, 03:07 AM |#3  
yabbandroid's Avatar
Senior Member
Thanks Meter: 23
 
More
Thumbs up
Thank you so much I bookmarked this thread and I might really try it. Have been wondering about this already but I m not a programmer of profession, though I have a bit of experience in it.. will see.. thank you !
2nd October 2012, 10:04 AM |#4  
crybert's Avatar
Senior Member
Thanks Meter: 2,025
 
Donate to Me
More
Instead of the combination
Code:
lunch # && make -j# otapackage
you also can use simply

Code:
brunch ariesve
which will do the same.
The Following User Says Thank You to crybert For This Useful Post: [ View ] Gift crybert Ad-Free
2nd October 2012, 11:12 AM |#5  
UpGado's Avatar
Senior Member
Flag Berlin
Thanks Meter: 215
 
More
Thank You Very Much ,, I'm Now in repo sync, When it finishes , i'll see if it builds well ( hopefully )
2nd October 2012, 11:24 AM |#6  
jiteshkudekar's Avatar
Member
Flag Thane
Thanks Meter: 43
 
More
Nice guide...now at office...will try after going home.

Sent from my GT-I9001 using xda premium
2nd October 2012, 01:27 PM |#7  
Xistance's Avatar
OP Senior Member
Thanks Meter: 3,773
 
Donate to Me
More
Quote:
Originally Posted by crybert

Instead of the combination

Code:
lunch # && make -j# otapackage
you also can use simply

Code:
brunch ariesve
which will do the same.

Yeah I guess but you need to add ariesve to the brunch list. I thought this would be easier or do I know it wrong? Thanks for your suggestion

Edit: Ahaha, sorry crybert. I had tried before but the device wasn't in the list so I thought we had to add it there. After checking again it's there

Sent from my GT-I9001 using xda premium
The Following User Says Thank You to Xistance For This Useful Post: [ View ] Gift Xistance Ad-Free
2nd October 2012, 07:30 PM |#8  
UpGado's Avatar
Senior Member
Flag Berlin
Thanks Meter: 215
 
More
Quote:
Originally Posted by Xistance

Enter toolchain path to .bashrc in your home dir. Use ctrl+h to see it. Enter your username where needed.

Is the toolchain in android sdk ??
The Following User Says Thank You to UpGado For This Useful Post: [ View ] Gift UpGado Ad-Free
2nd October 2012, 07:42 PM |#9  
Xistance's Avatar
OP Senior Member
Thanks Meter: 3,773
 
Donate to Me
More
Quote:
Originally Posted by UpGado

Is the toolchain in android sdk ??

Yeah, fixed that. Sorry for the wrong path :S
The Following 2 Users Say Thank You to Xistance For This Useful Post: [ View ] Gift Xistance Ad-Free
3rd October 2012, 06:10 PM |#10  
Xistance's Avatar
OP Senior Member
Thanks Meter: 3,773
 
Donate to Me
More
After getting a PM I noticed I got some paths wrong. I fixed them all now and it should be fully okay. Sorry if anyone couldn't build it correctly before this .

Edit : Please follow the steps starting with the repo init. Before, since I made you guys cd to the wrong folder to init repo the sync also went to the wrong folder. CD to the working dir and init repo again and then sync. If you don't want to wait that long again for it to sync again since I probably made you sync to the wrong folder, use Ctrl+H at where you synced and copy paste the .repo folder to the WORKING_DIRECTORY folder and sync again.
The Following 2 Users Say Thank You to Xistance For This Useful Post: [ View ] Gift Xistance Ad-Free
3rd October 2012, 08:43 PM |#11  
Senior Member
Thanks Meter: 2,265
 
More
Perhaps an stupid and noob question, but why Ubuntu x64? And not x32?
The Following User Says Thank You to mrjraider For This Useful Post: [ View ] Gift mrjraider Ad-Free
Post Reply Subscribe to Thread

Tags
build, cm10, i9001, tutorial

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes