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

Search This thread

The_Wolf91

Senior Member
Feb 15, 2012
466
700
if you can't fix, compile rom and use or share it with another kernel

I would have liked to share ROM with Mackay Kernel included, so a couple of day ago I asked him how to do it and I choose to replace the boot.img & kernel modules in the ROM zip instead of "get the mackay kernel branch & device aries-common device tree and build with it", because the second method gave me some errors (and I'm not completely sure on what to add in local_manifest to include Mackay Kernel in my ROM). It booted regularly and worked well, BUT I tried to flash an update.zip of Titanium Backup, which had to install a backed up app. It seemed that all went good, but when I tried to reboot system I got a bootanimation's loop (really don't know why..). The strange thing is that if I compile the ROM with stock kernel and then flash Mackay Kernel, it works well (also tested flashing an "update.zip" in recovery).
 

driodmaster92

Senior Member
Jan 10, 2012
1,451
3,436
Chennai
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S: Assembler messages:
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S:42: Error: ARM register expected -- `ldr r6,[ r5,#0x00 ]'
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S:42: Error: ARM register expected -- `ldreq r6,[ lr,#0x00 ]'
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S:42: Error: ARM register expected -- `ldreq r6,[ lr,#0x00 ]'
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S:42: Error: ARM register expected -- `ldreq r6,[ lr,#0x00 ]'
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S:42: Error: ARM register expected -- `ldr r6,[ r5,#0x00 ]'
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S:42: Error: ARM register expected -- `ldreq r6,[ lr,#0x00 ]'
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S:42: Error: ARM register expected -- `ldreq r6,[ lr,#0x00 ]'
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S:42: Error: ARM register expected -- `ldreq r6,[ lr,#0x00 ]'
make[3]: *** [arch/arm/kernel/entry-armv.o] Error 1
getting this with cm and semaphore kernel both
 

DerTeufel1980

Inactive Recognized Developer
Jul 31, 2011
10,368
27,668
Remove the spaces in your [ something ]

Edit: you are building with 4.8 toolchain, aren't you? You also should take a look at memset fixes (from linux 3.9 I believe), or use slab memory allocator instead of slub (not recommended), to make the kernel boot

Gesendet von meinem GT-N7105 mit Tapatalk 2
 
Last edited:

rodman01

Inactive Recognized Contributor / Themer
Apr 25, 2012
5,770
9,564
Allgäu
Code:
  LZMA    arch/arm/boot/compressed/piggy.lzma
/bin/sh: lzma: not found
Looks like you don't have lzma installed.[/QUOTE]

OK compiling again with lzma;)
Thank you!

EDIT:
thanks man the error doesn't appears anymore!

EDIT2:
SUCSESSFULLY COMPILED!!! THANKS ALL!!!!!!!
I have this lzma error message too, but cannot find how and were to install the lzma...can someone please help me to the right way :confused:?

The for me strage thing is that I already got my rom compiled a few days ago. But then i mixed up something and "destroyed" my working tree. Now I did a complete new repo sync and that twice...but still the same error: lzma:command not found...
 

kasper_h

Inactive Recognized Developer
Oct 8, 2010
5,308
16,087
Xiaomi Mi Mix 2S
Samsung Galaxy A52 4G
Code:
  LZMA    arch/arm/boot/compressed/piggy.lzma
/bin/sh: lzma: not found
Looks like you don't have lzma installed.


I have this lzma error message too, but cannot find how and were to install the lzma...can someone please help me to the right way :confused:?

The for me strage thing is that I already got my rom compiled a few days ago. But then i mixed up something and "destroyed" my working tree. Now I did a complete new repo sync and that twice...but still the same error: lzma:command not found...

sudo apt-get install lzma
 
  • Like
Reactions: rodman01

rodman01

Inactive Recognized Contributor / Themer
Apr 25, 2012
5,770
9,564
Allgäu
WOW I finally got it fixed a couple of minutes ago :good:...I repaired the volume of my pc and the permissions with board tools and now the build process went through without errors and I have the rom.zip again. So lzma was already installed, but for some reasons and all my tries, I must have messed up some files and permissions.
Code:
n-x86/framework/signapk.jar -w build/target/product/security/testkey.x509.pem build/target/product/security/testkey.pk8 /var/folders/52/h2pwpg6n72z8kc5gmt7ll2z00000gn/T/tmpfSCHcx /Volumes/myandroid/android/system/out/target/product/galaxysmtd/cm_galaxysmtd-ota-0daaf82983.zip
done.
Package Complete: /Volumes/myandroid/android/system/out/target/product/galaxysmtd/cm-10.2-20131006-UNOFFICIAL-galaxysmtd.zip
 
  • Like
Reactions: DerTeufel1980

yadavjpr

Senior Member
Jun 7, 2011
276
246
Pune
Hello,

I am trying to build CM11 on my machine but build failed. Here is logs:

http://pastebin.com/cCss4k3L

I see adb: not found logs when I run extract-files.sh script. See below logs:
http://pastebin.com/dKb5GAeb

Thanks in advance.

copy from any SGS rom modem.bin into out/target/product/galaxysmtd/

Thanks, after some googleing, I found that I need to create a symlink of adb in /usr/local/bin/
Now working fine :)
 

jayc137

Senior Member
Sep 5, 2012
1,815
865
Mumbai
Code:
  Kernel: arch/arm/boot/Image is ready
  AS      arch/arm/boot/compressed/head.o
  CC      arch/arm/boot/compressed/misc.o
  CC      arch/arm/boot/compressed/decompress.o
/bin/sh: 1: Syntax error: ";" unexpected
make[2]: *** [arch/arm/boot/compressed/piggy.] Error 2
make[2]: *** Waiting for unfinished jobs....
  CC      crypto/md4.mod.o
  CC      drivers/char/broadcom/gist.mod.o
  CC      drivers/char/broadcom/sigmorph.mod.o
  CC      drivers/char/frandom/frandom.mod.o
  CC      drivers/net/wireless/bcmdhd/dhd.mod.o
  CC      fs/cifs/cifs.mod.o
  LD [M]  crypto/md4.ko
  LD [M]  drivers/char/broadcom/gist.ko
  LD [M]  drivers/char/broadcom/sigmorph.ko
  LD [M]  drivers/char/frandom/frandom.ko
  LD [M]  drivers/net/wireless/bcmdhd/dhd.ko
  LD [M]  fs/cifs/cifs.ko
make[1]: *** [arch/arm/boot/compressed/vmlinux] Error 2
make: *** [zImage] Error 2

Getting this when compiling using XZ Compression,

Never mind guys solved it by modifying my arch/arm/boot/compressed/Makefile

Had to add
Code:
suffix_$(CONFIG_KERNEL_XZ) = xzkern
 
Last edited:
  • Like
Reactions: DerTeufel1980

Blue59

Senior Member
Jul 31, 2013
59
61
Tekirdag
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S: Assembler messages:
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S:42: Error: ARM register expected -- `ldr r6,[ r5,#0x00 ]'
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S:42: Error: ARM register expected -- `ldreq r6,[ lr,#0x00 ]'
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S:42: Error: ARM register expected -- `ldreq r6,[ lr,#0x00 ]'
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S:42: Error: ARM register expected -- `ldreq r6,[ lr,#0x00 ]'
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S:42: Error: ARM register expected -- `ldr r6,[ r5,#0x00 ]'
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S:42: Error: ARM register expected -- `ldreq r6,[ lr,#0x00 ]'
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S:42: Error: ARM register expected -- `ldreq r6,[ lr,#0x00 ]'
/home/aditya/illu/kernel/samsung/aries/arch/arm/kernel/entry-armv.S:42: Error: ARM register expected -- `ldreq r6,[ lr,#0x00 ]'
make[3]: *** [arch/arm/kernel/entry-armv.o] Error 1
getting this with cm and semaphore kernel both

hey how did you fix it? Anyone can help me please? i can't solve that same error hastebin.com/zowigaxewo.vbs
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 80
    This guide is an adaptation/update of the following guides to CM10:

    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:

    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:


    ________________________________________________________________________________________________________



    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

    .
    6
    For my first build 2 days ago i've got cm-10-20120806-UNOFFICIAL-galaxysmtd.zip, and today i've done a repo sync and rebuild and i'm still getting cm-10-20120806-UNOFFICIAL-galaxysmtd.zip

    Have I missed something ?

    You have to clean your /out directory, otherwise lots of files are reused and filename is not updated.

    I use the following script to clean my out directory:
    Code:
    #!/bin/bash
    
    out=~/android/system/out/target/product/galaxysmtd
    
    #****************************************************************
    ## Clean environment:
    make installclean
    rm $out/system/build.prop
    rm $out/obj/PACKAGING/target_files_intermediates/cm_galaxysmtd-target_files-eng.kasper.zip
    rm $out/obj/PACKAGING/target_files_intermediates/cm_galaxysmtd-target_files-eng.kasper/SYSTEM/build.prop

    Off course you have to adapt it if your username is not kasper :)
    4
    Guys. Can I move system dalvik on to my data partition (with the right perms/ownership of course)? Can data dalvik and system dalvik occupy the same space? I want to make my /system bigger but if I squeeze my cache it won't hold system dalvik....
    I'm talking OLD partitions here - /system & /cache on iNand, /data on OneNand etc

    Probably.
    I mean, on the cm10 lvm layout under testing, the /cache has been shrunk to 18MB and is basicaly unused (I think it's used only in recovery)

    cm10_lvm.png
    3
    I'm getting this error when I'm trying to do a repo sync. Can anyone help me out?

    Code:
    nick@nick-System-Product-Name:~$ cd ~/android/system/
    nick@nick-System-Product-Name:~/android/system$ repo sync -j16
    Fetching projects:  99% (309/312)  remote: Counting objects: 19, done.
    remote: Compressing objects: 100% (6/6), done.
    remote: Total 13 (delta 10), reused 10 (delta 7)
    Unpacking objects: 100% (13/13), done.
    From git://github.com/CyanogenMod/android_system_core
       6934c8f..92c3874  jellybean  -> github/jellybean
    Fetching projects: 100% (312/312), done.  
    Traceback (most recent call last):
      File "/home/nick/android/system/.repo/repo/main.py", line 385, in <module>
        _Main(sys.argv[1:])
      File "/home/nick/android/system/.repo/repo/main.py", line 365, in _Main
        result = repo._Run(argv) or 0
      File "/home/nick/android/system/.repo/repo/main.py", line 137, in _Run
        result = cmd.Execute(copts, cargs)
      File "/home/nick/android/system/.repo/repo/subcmds/sync.py", line 469, in Execute
        project.Sync_LocalHalf(syncbuf)
      File "/home/nick/android/system/.repo/repo/project.py", line 1049, in Sync_LocalHalf
        lost = self._revlist(not_rev(revid), HEAD)
      File "/home/nick/android/system/.repo/repo/project.py", line 1791, in _revlist
        return self.work_git.rev_list(*a, **kw)
      File "/home/nick/android/system/.repo/repo/project.py", line 1936, in rev_list
        p.stderr))
    error.GitError: CyanogenMod/android_system_core rev-list ('^92c3874861402821ac5d2ce94ef9e5c7310b05ca', 'HEAD', '--'): fatal: bad object 92c3874861402821ac5d2ce94ef9e5c7310b05ca
    
    nick@nick-System-Product-Name:~/android/system$

    what version of repo do you have
    Code:
     ~/android/system repo --version
    This is a relatively common error and an occurence was recently fixed in repo version 1.10.2

    If you're not already on 1.10.2 then try to update with
    Code:
    curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
    chmod a+x ~/bin/repo
    3
    Yeah, I gave up after 4 days of repeatedly trying to sync over 4.5M ADSL. Always an error at some point. Git should switch to torrent for first time sync or something...

    Really frustrating :'(

    sent from CM10 powered SGS

    I know what you mean.
    One suggestion for people who get problems like that: do the syncs with -j1
    It takes longer but it gets around some ISPs behaving badly when handling repos with multiple threads.
    I've witnessed this first hand.