CM10 Building guide + Linux + troubleshooting

Search This thread

mnm1992

Senior Member
Nov 25, 2011
52
34
31
EIndhoven
Guide to build cm10 for the n7000. It works for sure on linux.
If you want to build for another samsung phone replace all n700's with the new model number
First of all u need to:
Initialize you're build environment.
Follow the steps descibed here: Linux is at the top.
http://source.android.com/source/initializing.html //if you're on ubuntu 12.04 or higher skip the Installing the JDK part

Now do sudo apt-get install libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools pngcrush schedtool

Setting up android tools:
cd ~
mkdir android-SDK
cd android-SDK
wget http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz
tar -xvzf android-sdk_r20.0.3-linux.tgz
cd tools
./android update sdk -u --filter platform-tools,android-16,extra-android-support
export PATH=$PATH:~/android-SDK/android-sdk-linux/platform-tools
export PATH=$PATH:~/android-SDK/android-sdk-linux/tools
Now add the 2 lines above to ~/.bashrc using your favourite text editor

Getting the source:
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
export PATH=$PATH:~/bin
Now add the line above to ~/.bashrc using your favourite text editor
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
create ~/android/system/.repo/local_manifest.xml using this content: //If you want the latest kernel read the bottum of post 3 or read the comments.

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

cd ~/android/system/
repo sync -j16
cd ~/android/system/device/samsung/n7000/
Connect your galaxy note to the PC
./proprietary-files.sh
If you want to change the boot animation to the CM10 one or a different one read the last lines of post 3.

Building:
If you want to built android with a costum kernel you can use: export TARGET_PREBUILT_KERNEL=<path to zImage>/zImage
cd ~/android/system
repo sync -j16
./build.sh n7000

updating source:
repo sync -j16
 
Last edited:

mnm1992

Senior Member
Nov 25, 2011
52
34
31
EIndhoven
Troubleshooting

Possible problems:
error: project –j16 not found

The – is a non unicode character. You can type the command by hand on you're keyboard instead of copy-pasting to fix this.
If that doesn't work use repo sync

Repo sync general error fix:
rm -r the directory it complains about
cd ~/android/system
repo sync -d -j16

Error nvram_net.txt_AU is missing or just in general and nvram_net.txt_ file:
open the file vendor/samsung/n7000/n7000-vendor-blobs.mk
and remove these lines:
vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_AU:system/etc/wifi/nvram_net.txt_AU \
vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_IL:system/etc/wifi/nvram_net.txt_IL \
vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_SG:system/etc/wifi/nvram_net.txt_SG \
vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_TN:system/etc/wifi/nvram_net.txt_TN \

vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_murata_AU:system/etc/wifi/nvram_net.txt_murata_AU \
vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_murata_IL:system/etc/wifi/nvram_net.txt_murata_IL \
vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_murata_SG:system/etc/wifi/nvram_net.txt_murata_SG \
vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_murata_TN:system/etc/wifi/nvram_net.txt_murata_TN \

Also open the file
device\samsung\n7000/proprietary-n7000-files.txt
and remove all lines containing:
nvram_net.txt_murata_*
nvram_net.txt_*
 
Last edited:

mnm1992

Senior Member
Nov 25, 2011
52
34
31
EIndhoven
Tips & Trics

Removing CM apps:
To remove roms manager terms or torch:
Edit the file: vendor\cm\config\common.mk
And remove
vendor/cm/proprietary/<App Name>.apk:system/app/<App name>.apk \

Removing other apps:
Edit the file : build\target\product\core.mk
Edit the file : build\target\product\full_base.mk
Edit the file : build\target\product\generic_no_telephony.mk

To change the name of the zip and some info:
Edit the file: vendor\cm\config\common.mk
And change the else part in the file:

ifdef CM_RELEASE
CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(CM_BUILD)
else
CM_VERSION := <Enter new zip name here>
endif

Editing LCD density:
Edit the file device\samsung\n7000\n7000.mk
And change ro.sf.lcd_density to whatever you like.
a hint 320 is default
213 is nexus 7 mode
160 is tablet mode

Editing Trebuchet Settings:
Edit the file packages\apps\Trebuchet\res\values\config.xml

Edditing normal Settings:
Edit the file packages\apps\Settings\res\values\bools.xml

Finding out what went wrong:
./build.sh n7000 2> error.log
This means all errors and warnings will be logged to error.log
To find the actual error, you could use "grep -ins error error.log"

Moving the source:
Copy all the files to there new location.
This can be done with cp -rf old location new loaction
The force option is to avoid can't find .git errors
Warning the next part requires to be done all together without interuptions!!!
On the new loaction use rm -rf to remove the files. // I know this will delete the files. Force option is to avois sym link errors.
Now curl the repo to the new location using the steps in the first post.
Repo init as described in the first post.
Repo sync -j16 //The tric is it will restore all files that are still usable and redownload all corrput files

Changing to new kernel thanks to utacka:
local_manifest.xml - to use the latest 9100 kernel update // this file can be found in the .repo dir
change from teamhacksung/android_kernel_samsung_smdk4210 to teamhacksung/android_kernel_samsung_smdk4210_new
Also you may temporarily need to remove it from cm.dependencies in device/samsung/n7000, it'll do weird stuff (like syncing two different kernel repos to the same place) if you don't make that change.

Changing bootanimation:
Copy your new bootanimation zip file to: vendor\cm\prebuilt\common\bootanimation\<Your zip file>
Now make this change in vendor/cm/config/common.mk: //this wil be around line 46
PRODUCT_COPY_FILES += \
vendor/cm/prebuilt/common/bootanimation/<Your zip file>:system/media/bootanimation.zip
endif

The Cm10 bootanimation can be found here: http://goo.gl/x2KC8
 
Last edited:

mnm1992

Senior Member
Nov 25, 2011
52
34
31
EIndhoven
Building time

My building time just to give you a heads up on what to expect:

System spec:
6 GB ddr3 ram
Core i5-2500 processor
2tb SATA6 samsung HDD
128GB vertex 2 SSD
Motherboard DH67CL intel
Graphic crad Radeon HD 6870 extreme edtion

VM-Ware workstation Ubuntu 12.04 64 bit headless with image on hdd and workstation on SSD with 4.5 GB ram and windows 8 release preview 64 bit as host OS.
Building after clean 53 min
Building after update 6 min.

Native Lubuntu 12.04 64 bit installed on HDD:
Building after clean 58 min
Building after update 12 min.
 
Last edited:

madbuda

Member
Oct 25, 2010
7
0
Just curious if you have any tips on building on OSX?? I have tried several times and cm10 just will not compile..

I commented out the quemu stuff.. but I still end up failing somewhere along the road. No problems at all on ubuntu VM, just takes 150+ minutes :crying:
 

mnm1992

Senior Member
Nov 25, 2011
52
34
31
EIndhoven
Just curious if you have any tips on building on OSX?? I have tried several times and cm10 just will not compile..

I commented out the quemu stuff.. but I still end up failing somewhere along the road. No problems at all on ubuntu VM, just takes 150+ minutes :crying:

I can't really help if i don't know the issue. The problem is most likely related to missing packages.
Could you try building with ./build.sh n7000 2> error.log
And then uploading/posting the contents of the error.log file.
The 2 means log all errors and warnings to the error.log file.

Some VM advise for the best speed:
Use a headless ubuntu server. Login trough ssh. \\The ssh part does not increase speed, but it allows copy pasting.
Give it all you're cores and a lot of memory in the VM settings.
Finally don't use the computer while building it slows the building down :)
 
Last edited:
  • Like
Reactions: madbuda

madbuda

Member
Oct 25, 2010
7
0
Thanks, didn't even think about how many CPUs I gave to my VM.

Clean built in less than an hour now :)

Sent from my SCH-I535 using xda app-developers app
 

mundano

Senior Member
Thanks for the guide.. It was really helpfull to me, but I faced some problems, so I think it need an update in the following areas:

1 - Your config builds using the old Kernel... To build with the new one (Preview#4), you need to edit local_manifest.xml , and change teamhacksung/android_kernel_samsung_smdk4210 to teamhacksung/android_kernel_samsung_smdk4210_new . You also need to edit cm.dependencies in device/samsung/n7000 , the same way...

2 - Sun Java is no longer in Ubuntu repositories, so the instructions in: http://source.android.com/source/initializing.html will not work properly, and by following them you will end up building with OpenJDK, It will probably work, but is highly experimental and can result in inexpected problems.
 

mnm1992

Senior Member
Nov 25, 2011
52
34
31
EIndhoven
Thanks for the guide.. It was really helpfull to me, but I faced some problems, so I think it need an update in the following areas:

1 - Your config builds using the old Kernel... To build with the new one (Preview#4), you need to edit local_manifest.xml , and change teamhacksung/android_kernel_samsung_smdk4210 to teamhacksung/android_kernel_samsung_smdk4210_new . You also need to edit cm.dependencies in device/samsung/n7000 , the same way...

2 - Sun Java is no longer in Ubuntu repositories, so the instructions in: http://source.android.com/source/initializing.html will not work properly, and by following them you will end up building with OpenJDK, It will probably work, but is highly experimental and can result in inexpected problems.

Thats the official building manual from google which also states that openJDK is not expermental for ICS and JB (different page).
This is also confirmed in the android-building group ...
Also OpenJDK 6 builds CM10 without any issues.
The sun java 6 can't be installed headless (if not in repository) because you need to click accept at the official download side....

Kernel is at 3th post bottum (Tips and Trics):
It will not be in the official manual because if it gets stable enough it will get merged in the CM10 repo
 
Last edited:
  • Like
Reactions: mundano

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Building time

    My building time just to give you a heads up on what to expect:

    System spec:
    6 GB ddr3 ram
    Core i5-2500 processor
    2tb SATA6 samsung HDD
    128GB vertex 2 SSD
    Motherboard DH67CL intel
    Graphic crad Radeon HD 6870 extreme edtion

    VM-Ware workstation Ubuntu 12.04 64 bit headless with image on hdd and workstation on SSD with 4.5 GB ram and windows 8 release preview 64 bit as host OS.
    Building after clean 53 min
    Building after update 6 min.

    Native Lubuntu 12.04 64 bit installed on HDD:
    Building after clean 58 min
    Building after update 12 min.
    2
    Guide to build cm10 for the n7000. It works for sure on linux.
    If you want to build for another samsung phone replace all n700's with the new model number
    First of all u need to:
    Initialize you're build environment.
    Follow the steps descibed here: Linux is at the top.
    http://source.android.com/source/initializing.html //if you're on ubuntu 12.04 or higher skip the Installing the JDK part

    Now do sudo apt-get install libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools pngcrush schedtool

    Setting up android tools:
    cd ~
    mkdir android-SDK
    cd android-SDK
    wget http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz
    tar -xvzf android-sdk_r20.0.3-linux.tgz
    cd tools
    ./android update sdk -u --filter platform-tools,android-16,extra-android-support
    export PATH=$PATH:~/android-SDK/android-sdk-linux/platform-tools
    export PATH=$PATH:~/android-SDK/android-sdk-linux/tools
    Now add the 2 lines above to ~/.bashrc using your favourite text editor

    Getting the source:
    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
    export PATH=$PATH:~/bin
    Now add the line above to ~/.bashrc using your favourite text editor
    cd ~/android/system/
    repo init -u git://github.com/CyanogenMod/android.git -b jellybean
    create ~/android/system/.repo/local_manifest.xml using this content: //If you want the latest kernel read the bottum of post 3 or read the comments.

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

    cd ~/android/system/
    repo sync -j16
    cd ~/android/system/device/samsung/n7000/
    Connect your galaxy note to the PC
    ./proprietary-files.sh
    If you want to change the boot animation to the CM10 one or a different one read the last lines of post 3.

    Building:
    If you want to built android with a costum kernel you can use: export TARGET_PREBUILT_KERNEL=<path to zImage>/zImage
    cd ~/android/system
    repo sync -j16
    ./build.sh n7000

    updating source:
    repo sync -j16
    2
    Troubleshooting

    Possible problems:
    error: project –j16 not found

    The – is a non unicode character. You can type the command by hand on you're keyboard instead of copy-pasting to fix this.
    If that doesn't work use repo sync

    Repo sync general error fix:
    rm -r the directory it complains about
    cd ~/android/system
    repo sync -d -j16

    Error nvram_net.txt_AU is missing or just in general and nvram_net.txt_ file:
    open the file vendor/samsung/n7000/n7000-vendor-blobs.mk
    and remove these lines:
    vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_AU:system/etc/wifi/nvram_net.txt_AU \
    vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_IL:system/etc/wifi/nvram_net.txt_IL \
    vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_SG:system/etc/wifi/nvram_net.txt_SG \
    vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_TN:system/etc/wifi/nvram_net.txt_TN \

    vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_murata_AU:system/etc/wifi/nvram_net.txt_murata_AU \
    vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_murata_IL:system/etc/wifi/nvram_net.txt_murata_IL \
    vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_murata_SG:system/etc/wifi/nvram_net.txt_murata_SG \
    vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_murata_TN:system/etc/wifi/nvram_net.txt_murata_TN \

    Also open the file
    device\samsung\n7000/proprietary-n7000-files.txt
    and remove all lines containing:
    nvram_net.txt_murata_*
    nvram_net.txt_*
    2
    Tips & Trics

    Removing CM apps:
    To remove roms manager terms or torch:
    Edit the file: vendor\cm\config\common.mk
    And remove
    vendor/cm/proprietary/<App Name>.apk:system/app/<App name>.apk \

    Removing other apps:
    Edit the file : build\target\product\core.mk
    Edit the file : build\target\product\full_base.mk
    Edit the file : build\target\product\generic_no_telephony.mk

    To change the name of the zip and some info:
    Edit the file: vendor\cm\config\common.mk
    And change the else part in the file:

    ifdef CM_RELEASE
    CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(CM_BUILD)
    else
    CM_VERSION := <Enter new zip name here>
    endif

    Editing LCD density:
    Edit the file device\samsung\n7000\n7000.mk
    And change ro.sf.lcd_density to whatever you like.
    a hint 320 is default
    213 is nexus 7 mode
    160 is tablet mode

    Editing Trebuchet Settings:
    Edit the file packages\apps\Trebuchet\res\values\config.xml

    Edditing normal Settings:
    Edit the file packages\apps\Settings\res\values\bools.xml

    Finding out what went wrong:
    ./build.sh n7000 2> error.log
    This means all errors and warnings will be logged to error.log
    To find the actual error, you could use "grep -ins error error.log"

    Moving the source:
    Copy all the files to there new location.
    This can be done with cp -rf old location new loaction
    The force option is to avoid can't find .git errors
    Warning the next part requires to be done all together without interuptions!!!
    On the new loaction use rm -rf to remove the files. // I know this will delete the files. Force option is to avois sym link errors.
    Now curl the repo to the new location using the steps in the first post.
    Repo init as described in the first post.
    Repo sync -j16 //The tric is it will restore all files that are still usable and redownload all corrput files

    Changing to new kernel thanks to utacka:
    local_manifest.xml - to use the latest 9100 kernel update // this file can be found in the .repo dir
    change from teamhacksung/android_kernel_samsung_smdk4210 to teamhacksung/android_kernel_samsung_smdk4210_new
    Also you may temporarily need to remove it from cm.dependencies in device/samsung/n7000, it'll do weird stuff (like syncing two different kernel repos to the same place) if you don't make that change.

    Changing bootanimation:
    Copy your new bootanimation zip file to: vendor\cm\prebuilt\common\bootanimation\<Your zip file>
    Now make this change in vendor/cm/config/common.mk: //this wil be around line 46
    PRODUCT_COPY_FILES += \
    vendor/cm/prebuilt/common/bootanimation/<Your zip file>:system/media/bootanimation.zip
    endif

    The Cm10 bootanimation can be found here: http://goo.gl/x2KC8
    1
    Just curious if you have any tips on building on OSX?? I have tried several times and cm10 just will not compile..

    I commented out the quemu stuff.. but I still end up failing somewhere along the road. No problems at all on ubuntu VM, just takes 150+ minutes :crying:

    I can't really help if i don't know the issue. The problem is most likely related to missing packages.
    Could you try building with ./build.sh n7000 2> error.log
    And then uploading/posting the contents of the error.log file.
    The 2 means log all errors and warnings to the error.log file.

    Some VM advise for the best speed:
    Use a headless ubuntu server. Login trough ssh. \\The ssh part does not increase speed, but it allows copy pasting.
    Give it all you're cores and a lot of memory in the VM settings.
    Finally don't use the computer while building it slows the building down :)