How to compile your own kernel.

Discussion in 'Tech Guides for root users' started by adrynalyne, Mar 16, 2010.

  1. teddyearp

    teddyearp Senior Member

    Joined:
    Jan 13, 2010
    Messages:
    1,808
    Likes Received:
    12
    Trophy Points:
    83
    Location:
    Pinetop, AZ
    Ratings:
    +13
    Current Phone Model:
    Motorola XT1103 (Nexus 6)
    Well, I'm not sure how you would download the kernel only files for gingerbread; basically the kernel for gingerbread and froyo are the same as it was coming from eclair to froyo that the kernel version was changed, here's an educated guess:
    Code:
    git checkout --track -b android-omap-2.6.32-froyo origin/android-omap-2.6.32-froyo
    Now that is a guess only. If you want to download the whole gingerbread source, that is another story and I am pretty sure I know where to find the proper command for that.

    good luck
     
  2. ljbaumer

    ljbaumer Member

    Joined:
    Apr 2, 2010
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Unicorn Land
    Ratings:
    +0
    Awesome, I'll try that when I get a chance, do you have instructions for getting all of the froyo stuff? Like just using the eclair commands but with froyo?


    Thanks,
    ljbaumer
     
  3. teddyearp

    teddyearp Senior Member

    Joined:
    Jan 13, 2010
    Messages:
    1,808
    Likes Received:
    12
    Trophy Points:
    83
    Location:
    Pinetop, AZ
    Ratings:
    +13
    Current Phone Model:
    Motorola XT1103 (Nexus 6)
  4. n8loller

    n8loller New Member

    Joined:
    Apr 27, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    Solution

    I do believe I have found the proper solution.

    Froyo:

    Code:
    git checkout --track -b android-omap-2.6.32 origin/archive/android-omap-2.6.32
    Eclair:

    Code:
    git checkout --track -b android-omap-2.6.29-eclair origin/archive/android-omap-2.6.29-eclair
    To find what heads (branches) are being called at any point in time check the bottom of the page at android.git.kernel.org Git - kernel/omap.git/summary for the "heads" section. Today the 5th item down is "archive/android-omap-2.6.32", which made the branch we put in the "git checkout" command "origin/archive/android-omap-2.6.32".

    I haven't pushed any further into the guide than this step yet, but I will post updates if/when I finish to let everyone know if it still works.
     
  5. n8loller

    n8loller New Member

    Joined:
    Apr 27, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    So, I figured the other branches might be out of date as well. In general, it seems the way to make sure you are pulling the right branch is to go to the main web site (android.git.kernel.org Git) and find the '.git' that you want to check out. Then when you click on that package, go to the bottom of the page and check the heads (maybe tags as well?).

    example - platform/system/wlan/ti:

    android.git.kernel.org Git - platform/system/wlan/ti.git/summary

    Active heads are:

    • froyo
    • froyo-plus-aosp
    • froyo-release
    • gingerbread
    • gingerbread-release
    • master
    • tools_r7
    ...

    I left the end out because you should get the point.

    Here is what I used for the other two packages:

    Code:
    git checkout --track -b froyo origin/froyo
    I am trying to build froyo, of course. There were also froyo-release and froyo-plus-aosp, but I have no idea which one I should use.
     
  6. n8loller

    n8loller New Member

    Joined:
    Apr 27, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    So, I made it further, but still some problems. I thought I'd document them in case others see the same thing later.

    Code:
    nate@my_comp:~/android/android-kernel/droid1/omap$ make
    make: /home/nate/android/android-kernel/droid1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-gcc: Command not found
    ...
    make[1]: *** [kernel/bounds.s] Error 127
    make: *** [prepare0] Error 2
    So this error arose when I tried to 'make' the kernel. Keep in mind that although the OP doesn't use it, you can still use "make -j<num>" where <num> is 1 or 2 times the number of threads your CPU has (or any other number). I have an Intel i7 980x, so my system is x86_64 and I use "-j24".

    Anyways, I recently re-installed Ubuntu, and hadn't set up my development environment completely. I forgot to make sure that I had a proper 32-bit build environment set up.

    Instructions on doing this are at http://source.android.com/source/initializing.html:

    Code:
    sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev
    Especially:

    Code:
    sudo apt-get install gcc-multilib g++-multilib libc6-i386 libc6-dev-i386
    I stopped on making the wifi driver because of this error:

    Code:
    make -C /home/nate/kernel/droid/omap M=`pwd` ARCH=arm CROSS_COMPILE=/home/nate/android/android-kernel/droid1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- modules
    make: Entering an unknown directory
    make: *** /home/nate/kernel/droid/omap: No such file or directory.  Stop.
    make: Leaving an unknown directory
    make[1]: *** [../../../stad/build/linux/libestadrv.a] Error 2
    make[1]: Leaving directory `/home/nate/android/android-kernel/droid1/ti/wilink_6_1/stad/build/linux'
    make: Entering an unknown directory
    ...and I'm back, and this error was because I put the source code in a different directory than this guide instructed us to... I guess I should keep that in mind when setting the environment variables, haha. I just needed to run:

    Code:
    export KERNEL_DIR=~/<path to omap directory>
    then try make again
     
    #42 n8loller, Apr 27, 2011
    Last edited: Apr 28, 2011
  7. zoomy942

    zoomy942 Member

    Joined:
    Mar 3, 2011
    Messages:
    305
    Likes Received:
    1
    Trophy Points:
    18
    Ratings:
    +1
    So here is a question.

    Can you work backwards?

    What I mean is, I'm using a RZ 125/800 low volt kernel right now, but I want to change it to 125/600 low volt. basically the exact same, but max it at 600. Is there a way to do that?
     
  8. davros

    davros Premium Member
    Premium Member Developer

    Joined:
    Jun 7, 2010
    Messages:
    2,836
    Likes Received:
    31
    Trophy Points:
    113
    Location:
    Worcester MA
    Ratings:
    +33
    Setcpu or build a kernel 125-600 lv using the correct voltages

    Sent from my Droid using DroidForums
     
  9. zoomy942

    zoomy942 Member

    Joined:
    Mar 3, 2011
    Messages:
    305
    Likes Received:
    1
    Trophy Points:
    18
    Ratings:
    +1
    Will do. I'm trying to avoid using setcpu is possible so I'll dl Ubuntu and see how it goes.
     
  10. raidzero

    raidzero n00b.
    Theme Developer Premium Member Developer

    Joined:
    Apr 15, 2010
    Messages:
    1,054
    Likes Received:
    3
    Trophy Points:
    38
    Ratings:
    +3
    I made a set of scripts and kernel source code, check my forum for Kernel Studio if you are interested. I mean if you are going to go all the way and install a new OS.. why not check it out ? :D
     
  11. some

    some New Member

    Joined:
    May 8, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    Hi.
    I am new user and I have a problem. When I compile ti wlan driver ti message appearing:
    Code:
     CC [M]  /home/sb/Desktop/andro/ti/wilink_6_1/platforms/os/linux/build/../../../../platforms/os/linux/src/WlanDrvIf.o
    /home/sb/Desktop/andro/ti/wilink_6_1/platforms/os/linux/build/../../../../platforms/os/linux/src/WlanDrvIf.c: In function 'wlanDrvIf_UpdateDriverState':
    /home/sb/Desktop/andro/ti/wilink_6_1/platforms/os/linux/build/../../../../platforms/os/linux/src/WlanDrvIf.c:236: error: 'struct net_device' has no member named 'hard_start_xmit'
    /home/sb/Desktop/andro/ti/wilink_6_1/platforms/os/linux/build/../../../../platforms/os/linux/src/WlanDrvIf.c: In function 'wlanDrvIf_Open':
    /home/sb/Desktop/andro/ti/wilink_6_1/platforms/os/linux/build/../../../../platforms/os/linux/src/WlanDrvIf.c:638: error: 'struct net_device' has no member named 'hard_start_xmit'
    /home/sb/Desktop/andro/ti/wilink_6_1/platforms/os/linux/build/../../../../platforms/os/linux/src/WlanDrvIf.c: In function 'wlanDrvIf_SetupNetif':
    /home/sb/Desktop/andro/ti/wilink_6_1/platforms/os/linux/build/../../../../platforms/os/linux/src/WlanDrvIf.c:735: error: 'struct net_device' has no member named 'validate_addr'
    /home/sb/Desktop/andro/ti/wilink_6_1/platforms/os/linux/build/../../../../platforms/os/linux/src/WlanDrvIf.c:742: error: 'struct net_device' has no member named 'open'
    /home/sb/Desktop/andro/ti/wilink_6_1/platforms/os/linux/build/../../../../platforms/os/linux/src/WlanDrvIf.c:743: error: 'struct net_device' has no member named 'stop'
    /home/sb/Desktop/andro/ti/wilink_6_1/platforms/os/linux/build/../../../../platforms/os/linux/src/WlanDrvIf.c:744: error: 'struct net_device' has no member named 'hard_start_xmit'
    /home/sb/Desktop/andro/ti/wilink_6_1/platforms/os/linux/build/../../../../platforms/os/linux/src/WlanDrvIf.c:745: error: 'struct net_device' has no member named 'get_stats'
    /home/sb/Desktop/andro/ti/wilink_6_1/platforms/os/linux/build/../../../../platforms/os/linux/src/WlanDrvIf.c:747: error: 'struct net_device' has no member named 'do_ioctl'
    make[3]: *** [/home/sb/Desktop/andro/ti/wilink_6_1/platforms/os/linux/build/../../../../platforms/os/linux/src/WlanDrvIf.o] Błąd 1
    make[2]: *** [_module_/home/sb/Desktop/andro/ti/wilink_6_1/platforms/os/linux/build] Błąd 2
    make[2]: Opuszczenie katalogu `/home/sb/Desktop/andro/omap'
    make[1]: *** [../../../../platforms/os/linux/build/tiwlan_drv_stub.o] Błąd 2
    make[1]: Opuszczenie katalogu `/home/sb/Desktop/andro/ti/wilink_6_1/platforms/os/linux/build'
    make: *** [../../../platforms/os/linux/build/tiwlan_drv_stub.o] Błąd 2
    
    So it mean that the kernel have another values in structure net_device than driver expect.
    I don't know if is patch for the driver. I download another source of this driver but there are appearing another bugs...

    Can someone help? Thanks.
     
    #47 some, May 8, 2011
    Last edited: May 8, 2011
  12. TehTech

    TehTech New Member

    Joined:
    Mar 2, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    Hi there!
    New member here & posting because I have a problem that has halted my progress and I am so annoyed as I have got so far already!
    I am stuck on Part 2: Setting up Git and kernel source

    The bit is: git clone git://android.git.kernel.org/kernel/omap.git to which i get the error:

    android.git.kernel.org[0: 149.20.4.77]: errno=Connection refused
    fatal: unable to connect a socket (Connection refused)

    I have a clean install of Ubuntu & has all updates installed, WHY am I getting this error and more importantly; HOW to I fix this as I am really keen to get this project moving!

    Thanks all in advance,

    Arty.
     
Search tags for this page
android build mkbootimg
,
build android kernel
,
decompile android kernel windows
,
how to compile a kernel for android
,
how to make an overclock kernel android
,
how to make oc kernel
,
how to make overclock kernel android
,
make: arm-eabi-gcc: command not found make: *** [cpu/omap3/s
,

mkbootimg

,
mkbootimg ubuntu