[GUIDE][CM10/CM10.1] ROM Building From Source for GT-i9003 SL

Search This thread

chongns

Senior Member
Aug 1, 2011
917
426
Johor Bahru
Xiaomi Mi 11 Lite 4G
@nicsptl

kind of OT, i try build CM7.0 from Dhiru source, but face this problem, search in cyanogenmod guide but nothing about this.

please help

thanks

Code:
king@Ubuntu:~/cm-7.0$ . build/envsetup.sh
[COLOR="Red"]including device/samsung/galaxysl/vendorsetup.sh
including vendor/cyanogen/vendorsetup.sh[/COLOR]
king@Ubuntu:~/cm-7.0$ brunch galaxysl
[COLOR="red"]including vendor/cyanogen/vendorsetup.sh
build/core/product_config.mk:189: *** _nic.PRODUCTS.[[vendor/cyanogen/products/cyanogen_galaxysl.mk]]: "vendor/cyanogen/products/cyanogen_galaxysl.mk" does not exist.  Stop.[/COLOR]
 

rodero95

Senior Member
Jul 11, 2012
307
1,688
Many things of the CyanogenMod build system changed since ICS, also, our code has been updated as new versions of android were released so, actually, it is now completely incompatible with gingerbread.
I think the first source code repos for our device are still somewhere in github, you can look for them and try to do something with them as you loom so interested on building cm7. Look for the codeworkx or waleedq repos, I think they were the first users that started the development on our device.
BTW, before building, don't use the ./vendor/cm/get-prebuilts command, needed to build android, but use ./vendor/cyanogen/get-rommanager instead.
Good luck!

EDIT: In theory, I think you could use an actual kernel (2.6.35 kernel, of course) for your builds, but reverting the changes made for mtd support, maybe something else needs to be reverted, but I don't know right now.

Sent from my GT-I9003 using xda premium
 
Last edited:
  • Like
Reactions: chongns

chongns

Senior Member
Aug 1, 2011
917
426
Johor Bahru
Xiaomi Mi 11 Lite 4G
Many things of the CyanogenMod build system changed since ICS, also, our code has been updated as new versions of android were released so, actually, it is now completely incompatible with gingerbread.
I think the first source code repos for our device are still somewhere in github, you can look for them and try to do something with them as you loom so interested on building cm7. Look for the codeworkx or waleedq repos, I think they were the first users that started the development on our device.
BTW, before building, don't use the ./vendor/cm/get-prebuilts command, needed to build android, but use ./vendor/cyanogen/get-rommanager instead.
Good luck!

EDIT: In theory, I think you could use an actual kernel (2.6.35 kernel, of course) for your builds, but reverting the changes made for mtd support, maybe something else needs to be reverted, but I don't know right now.

Sent from my GT-I9003 using xda premium

Rodero. Tks for the response. I just try to play with cwm and twrp. But aim for stock rom gb. Thats why i go for cm7.

Now i try to sort out why the product_config not look for porting devices..config file. I have everything in place sync from source and dhiru source.. something the build even search for htc ace make file... confused...i never initiated the build of that device.

Sent from my Galaxy Nexus
 

rodero95

Senior Member
Jul 11, 2012
307
1,688
If you are trying to include twrp support you need to make some changes in the code. Look my repo, I included support for it some days ago.

Sent from my GT-I9003 using xda premium
 
  • Like
Reactions: chongns

nicsptl

Senior Member
Jan 17, 2012
171
398
Overland Park,KS
@nicsptl

kind of OT, i try build CM7.0 from Dhiru source, but face this problem, search in cyanogenmod guide but nothing about this.

please help

thanks

Code:
king@Ubuntu:~/cm-7.0$ . build/envsetup.sh
[COLOR="Red"]including device/samsung/galaxysl/vendorsetup.sh
including vendor/cyanogen/vendorsetup.sh[/COLOR]
king@Ubuntu:~/cm-7.0$ brunch galaxysl
[COLOR="red"]including vendor/cyanogen/vendorsetup.sh
build/core/product_config.mk:189: *** _nic.PRODUCTS.[[vendor/cyanogen/products/cyanogen_galaxysl.mk]]: "vendor/cyanogen/products/cyanogen_galaxysl.mk" does not exist.  Stop.[/COLOR]

Actually I never try to build CM7. Btw, Which device and kernel branch you are using from dhiru's Repo.

This error show that Android Build is not able to find make file named cyanogen_galaxysl.mk . And i think in our device tree no file named like that exists. We use full_galaxysl.mk than inherit other make file same as other devices. As our Gingerbread device tree is outdated with upstream may be you will need made changes as per new error appear to fix build.To solve this error try to start building from lunch box combo instead 'brunch' command.may be it could solve it.

Code:
 . build/envsetup.sh
lunch

than device list will be appear, find "add_lunch_combo full_galaxysl-eng" and enter its number to start build.

EDIT :: Oops , Forget to tell you incase your build get completed on GB Device & Kernel branches than dont immidetaiely flash CM7 from CM10 or CM10.1, it boths using different partition now than older device tree. So start flashing from GB Stock ROM as usual.
 
Last edited:
  • Like
Reactions: chongns

chongns

Senior Member
Aug 1, 2011
917
426
Johor Bahru
Xiaomi Mi 11 Lite 4G
Actually I never try to build CM7. Btw, Which device and kernel branch you are using from dhiru's Repo.

This error show that Android Build is not able to find make file named cyanogen_galaxysl.mk . And i think in our device tree no file named like that exists. We use full_galaxysl.mk than inherit other make file same as other devices. As our Gingerbread device tree is outdated with upstream may be you will need made changes as per new error appear to fix build.To solve this error try to start building from lunch box combo instead 'brunch' command.may be it could solve it.

Code:
 . build/envsetup.sh
lunch

than device list will be appear, find "add_lunch_combo full_galaxysl-eng" and enter its number to start build.

EDIT :: Oops , Forget to tell you incase your build get completed on GB Device & Kernel branches than dont immidetaiely flash CM7 from CM10 or CM10.1, it boths using different partition now than older device tree. So start flashing from GB Stock ROM as usual.


thanks, i aware for that CM7 partition.

BTW, the lunch did show the full_galaxysl-eng, but it is not running, cause the make file cant find the cyanogen_full_galaxysl.mk.
so. i make a mk file under vendor/cyanogen/product by alter the cyanogen_galasysmtb and also in device/samsung/galaxysl the full_galaxysl.mk and vendorsetup.sh, change the product name from full_galaxysl to cyanogen_full_galaxysl and it work.:highfive:
 

nicsptl

Senior Member
Jan 17, 2012
171
398
Overland Park,KS
thanks, i aware for that CM7 partition.

BTW, the lunch did show the full_galaxysl-eng, but it is not running, cause the make file cant find the cyanogen_full_galaxysl.mk.
so. i make a mk file under vendor/cyanogen/product by alter the cyanogen_galasysmtb and also in device/samsung/galaxysl the full_galaxysl.mk and vendorsetup.sh, change the product name from full_galaxysl to cyanogen_full_galaxysl and it work.:highfive:

That's good. So did build get complete or not ?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 19
    (3) setup Device tree
    In terminal

    Code:
    cd ~/cm10.1/.repo

    Code:
    mkdir local_manifests && cd local_manifests
    gedit roomservice.xml


    For CM10 with Kernel 3.0 copy below manifests and save & close roomservice.xml

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <manifest>
    <project name="dhiru1602/android_device_samsung_galaxysl" path="device/samsung/galaxysl" remote="github" revision="jellybean-3.0" />
    <project name="dhiru1602/android_vendor_samsung_galaxysl" path="vendor/samsung/galaxysl" remote="github" revision="jellybean-3.0" />
    <project name="dhiru1602/android_kernel_samsung_latona" path="kernel/samsung/latona" remote="github" revision="latona-sandbox-3.0" />
    <project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" revision="jellybean"/>
    </manifest>

    For CM10.1 with kernel 3.0 copy and paste below manifest to roomservice.xml and save and close it.

    CM10 with CM10.1 with Kernel 2.6 manifests will be added soon Here.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <manifest>
    <project name="dhiru1602/android_device_samsung_galaxysl" path="device/samsung/galaxysl" remote="github" revision="cm-10.1" />
    <project name="dhiru1602/android_vendor_samsung_galaxysl" path="vendor/samsung/galaxysl" remote="github" revision="cm-10.1" />
    <project name="dhiru1602/android_kernel_samsung_latona" path="kernel/samsung/latona" remote="github" revision="cm-10.1" />
    <project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" revision="cm-10.1" />
    </manifest>

    close and ope new terminal and navigate in source folder and do again repo sync it will download device tree as per in roomservice.xml

    Code:
    cd cm10.1
    repo sync


    (4) Patching and cherry-picking


    No Patching Required for CM10 and CM10.1 with kernel 3.0

    (5) Building ROM

    Before Building New ROM every time its wise idea to update source with mainstream. You need to just sync reporosity again.
    Code:
    repo sync

    Now for Building ROM

    Code:
    . build/envsetup.sh
    brunch galaxysl

    It will take time depends on your processor and RAM of your machine & will create output in /out/target/product/galaxysl/cm-10-XXXXX-UNOFFICIAL-galaxysl.zip


    It will look like this in the End :cowboy:

    View attachment 2082696


    (6) Installing


    To install newly build ROM you need to Copy it to you SD card. Reboot into CWM Recovery Mode
    Wipe Cache and Dalvik-cache if you are on CM10/CM10.1 with Kernel 3.0 or Do full wipe and Install it.
    reboot phone and check everything is working. and than reboot again in Recovery Mode and install Gapps.

    Gapps :: http://goo.im/gapps/

    Reboot phone and Enjoy

    Happy ROM BuildinG.:laugh:
    18
    Only Intention of This Guide More and More People Learn How to Build CM from Source.

    Note ::
    New Suggestion are welcome to make this guide more easy and perfect.Post any problem related to build in this thread. I will reply as soons as possible.:fingers-crossed:



    What You will Require :-

    1) PC Running Ubuntu 12.10x64 Bit System

    2) Good Internet Connection Speed.

    3) Patience

    4) Samsung Galaxy SL :p


    I will Distribute Building CM into Several Parts for Comfortable



    (1) Setup Linux and Build Environment

    (2) Source Sync & Download Pre-builts Files

    (3) Setup Device tree

    (4) Patching and cherry-picking

    (5) Building ROM

    (6) Installing ROM




    (1) Setup Linux and Build Environment



    Setup Linux



    You will need Linux distros to build any ROM because windows system is not completely supported yet. you could possibly build ROMs on any Linux platform
    but I recommended Ubuntu 12.10 64-bit System.And also this guide is written on base of pure clean Ubuntu 12.10 system.

    You can setup dual boot with Windows.You can Google it how to Dual boot windows and Ubuntu.

    or

    you can use virtual machine like vmware player (http://www.vmware.com/products/player/ ) or Virtual Box (https://www.virtualbox.org/) they all are freeware software. But to use virtual machine you will need Higher Specification for best experience.

    You could download Ubuntu 12.10 ISO from here : http://www.ubuntu.com/download

    and make it bootable Pen Drive or CD to install it or Direct use in Virtual machine Software to Install it.

    When You complete with installing Ubuntu proceed to setup build environment.



    Build Environment


    To build ROM from any source you will need several tools

    Open Terminal,


    1) Java Development Kit 6/Java Development Kit 7


    If you are first time Installing JDK than procedded to installing step or first delete all previous version using this commands
    Code:
    sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
    sudo apt-get purge sun-java


    Method 1 :: Install Latest JDK 6
    Open terminal and type this :

    Code:
    sudo add-apt-repository ppa:webupd8team/java

    This will add the correct PPA to your system for updated builds of Java 6 JDK that are compatible with 12.10/13.04.it’s self updating, so you don’t have to redownload binaries everytime they release a new version.

    Next,install the package.

    Code:
    sudo apt-get update && sudo apt-get install oracle-java6-installer

    Follow the onscreen instructions. You have to Accept the Licensing Agreement.
    Once that is completed successfully to make sure the correct version of Java is installed, run the following at the Terminal prompt:

    You should see something like the following:
    java version “1.6.0_37″
    Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
    Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)


    Method 2 :: Install All Java tools
    Its another method to install every JDK 6 tools automatically.

    now to install JDK-6

    Code:
    mkdir ~/src
    cd ~/src
    git clone [url]https://github.com/flexiondotorg/oab-java6.git[/url]
    cd ~/src/oab-java6
    sudo ./oab-java.sh
    Then when its finished, install java:
    Code:
    sudo apt-get install sun-java6-plugin sun-java6-jre sun-java6-bin sun-java6-jdk
    You can follow the downloading process status of java package using this command in different terminal:
    Code:
    tail -f ~/src/oab-java6/oab-java.sh.log

    You can check java veriosn using
    Code:
    java -version



    2) Install dependencies


    Code:
    sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python

    Code:
    sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

    3) Android SDK (Optinal)

    Download LINK :: http://developer.android.com/sdk/index.html

    After Downloading Extract it at your desire directory as example : home/android/
    it will be extracted with name : android-sdk-linux
    Now go to that location using Terminal

    Code:
    cd ~/android/android-sdk-linux/tools
    ./android

    than install adb driver and other platform tools. No need to download any API for now eiether you want to make android app.

    To access adb command from anywhere in terminal you have to add its path to Bourne Again Shell (bash)

    use any editor from below. (nano or gedit) to modify bash.

    Code:
    sudo nano ~/.bashrc
    OR
    Code:
    sudo gedit ~/.bashrc

    Than at the end of the file add this lines.

    Code:
    export PATH=${PATH}:<sdk>/tools:<sdk>/platform-tools

    replace <sdk> with folder address.in My case i extracted it on /home directory
    Code:
     export PATH=${PATH}:/home/nics/android-sdk-linux/platform-tools/

    Save the file. Then open a new Terminal. The adb command should now be available.

    That's it. ADB (Android Debug Bridge) will have you debug ROM as well as application also.

    (2) Source Sync & Download Prebuilts


    1)Downloading Repository Binary

    The binary for repo will let you talk to git servers and download all that precious source code. That second part after the && allows it to be executable:

    Code:
    mkdir ~/bin && curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo && chmod a+x ~/bin/repo

    Use your favorite text editor to open ~/.bashrc
    use nano:

    Code:
    sudo nano ~/.bashrc

    At bottom add this line.

    Code:
    export PATH=~/bin:$PATH

    Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash:
    Code:
    source ~/.bashrc

    2) Initialize The Repository

    First Close current terminal and reopen again New

    Code:
    mkdir  ~/cm10.1      ## you can use any name on behalf cm10.1
    cd ~/cm10.1


    Now to build Jellybena 4.1.2 you need to initialize CM10 repo

    Code:
    repo init -u git://github.com/CyanogenMod/android.git -b jellybean

    or

    If you want to build Jellybean 4.2.2 initialize CM10.1 repo below.
    Code:
    repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1

    Now begin Download Source

    Code:
    repo sync
    (It will take time depending on your internet speed. Downloading Source will download around 8.2 GB approaxmatiely or mare than that)

    TIPS :: you can use "repo sync -j3" or "repo sync -j5" command also. It means it will download simantueosly 3 or 5 projects default threads are set to 16. this code are used to decreased it to whatever you want it only require when you have problem of syncin source on low speed.


    3) Download Prebuilts


    after completing repo sync Download pre-builts

    go into :: ~/cm10.1/vendor/cm

    Code:
    cd ~/cm10.1/vendor/cm/

    and run this

    Code:
    ./get-prebuilts
    11
    Source

    # frapeti's Guide for CM9 Here
    # HP touchpad CM building Guide
    # http://wiki.cyanogenmod.org/w/Template:Cm10_build
    # http://soupdawg.wordpress.com/

    Credits

    Special thanks to dhiru1602,loSconosciuto & adi_pat
    LoLaTiOn,rodero95
    alfrix,TheDarkLord1997,frapeti
    Our SL Senior Members & Recognized Contributors and every Developer who have contributed on SL Development.
    HP touchpad CM building Guide authors
    CyanogenMod Team
    11
    It is Seperate Guide for Kernel Building. Its Just Reference Guide So its require some understing. Will modify and update it to make easier when i will get time.

    Kernel Building is different than ROM building. In ROM building Kernel is already build while ROM cooking by Android Build System.You will not require CM10 or CM10.1 source for this.


    What you will Require

    1) PC with Ubuntu 12.10/13.04 x64

    2) Toolchain #Software to compile Kernel

    3) One Kernel already build.

    4) Some tools



    1) get git tool

    Code:
    sudo apt-get git

    2) Get toolchain.
    Our Dear dev adipat has put sevaral toolchain in his git repo.

    I recommand to use arm-eabi-4.4.3

    now to download toolchain.

    (1)mkdir Toolchains && cd Toolchains

    (2) git clone -b arm-eabi-4.4.3 git://github.com/AdiPat/Android_Toolchains.git


    I am showing here how to build CM10.1 Kernel 3.0 so dont get confused.
    you can build different kernel as same as here. you will require some understanding of git commands and about our Kernel Source.

    Code:
    mkdir kernel_sl     ## you can take any name instead of kernel_sl
    cd kernel_sl
    git clone -b cm-10.1 https://github.com/dhiru1602/android_kernel_samsung_latona.git  ## it will download Kernel 3.0 Source of CM10.1 branch from Dheeraj's Repo.

    after finishing go into android_kernel_samsung_latona

    Code:
    cd android_kernel_samsung_latona


    make output folder for kernel.
    default output of zimage is "arch/arm/boot/zImage" inside kernel source
    change it your desire location.


    Download build.sh.zip provided in the post and extract it and put build.sh in android_kernel_samsung_latona dir,

    open it and change path of toolchain and output directory as per your setting.

    Set it as per you prefernce.

    I am using toolchain already in cm10.1 source. you can use it if you have source. or change path as per toolchain you downloaded from upper provided repo or any other website.


    save it.

    now give it permission to execute.

    Code:
    sudo chmod +x build.sh
    to start building kernel.

    Actually build.sh is line of commands to start building Kernel by putting them in one file and by executing we dont need to run every command manually. You can also type or copy & paste command manually to learn meanings of code.

    Code:
    ./build.sh


    Now download this :: http://d-h.st/ncR
    unpack-repack tool by our dear Dev loSconosciuto.

    now make new_kernel folder into kernel_out and extract unpack-repack tools there.

    grab boot.img from our CM10.1 RoM

    put it in /home/nics/kernel_out/new_kernel/unpack-repack


    run in terminal
    Code:
    ./unpack.pl
    it will create directory named out containing boot.img and zimage.

    just replace zimage with newely builed zimage.

    and run
    Code:
    ./repack.sh
    it will create boot.img and updater-zip in out directory.

    that's it boot.img is your new kernel.

    take this boot.img and make updater.zip and flash it or replace it in CM10.1 ROM zip and flash it. that's most easiest way to flash and make Kernel.
    9
    Reserved for Patch Discussion