1. Are you ready for the Galaxy S20? Here is everything we know so far!

[GUIDE] HOW To COMPILE A KERNEL 5/22/2011

Discussion in 'Android Devices' started by asadullah, May 22, 2011.

  1. asadullah

    asadullah Android Enthusiast
    Thread Starter

    Okay this is my guide on how to set up ubuntu 10.04 to build kernels. This should work on other versions of ubuntu and maybe on other linux distributions but I can't guarantee that. So if you try this guide and your on another distribution don't post complaints.

    First things first you must add these repositories
    Code (Text):
    1. [FONT=verdana]
    2. [/FONT]sudo add-apt-repository "deb http://archive.canonical.com/lucid partner" sudo add-apt-repository "deb-src http://archive.canonical.com/ubuntu lucid partner" sudo apt-get update
    next lets install the required packages
    Code (Text):
    1.  
    2. 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 libgl1-mesa-dev sun-java6-jdk

    now lets get the repo script
    Code (Text):
    1.  
    2. mkdir -p ~/bin
    3. curl http://android.git.kernel.org/repo > ~/bin/repo
    4. chmod a+x ~/bin/repo
    5.  


    now you'll have to download the cyanogen source this part right here will take awhile
    I suggest you turn off anything that can turn your computer off
    Code (Text):
    1.  
    2. mkdir -p ~/android/system cd ~/android/system repo init -u git://github.com/CyanogenMod/android.git -b gingerbread repo sync
    next you'll wanna export the cross compiling toolchain
    Code (Text):
    1.  
    2. export CCOMPILER=${HOME}/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
    now we make a directory to hold all of our kernels

    Code (Text):
    1.  
    2. mkdir android-kernel
    okay now you have to add the ccompiler to our path

    Code (Text):
    1.  
    2. CCOMPILER=${HOME}/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
    okay now lets go get the lg source code
    go here and select mobile phones in the first box and type ms690 in the second
    it will show you a link click on it then choose download
    download it to your desktop.
    unzip that file and inside will be two more zips unzip the one that says something about a kernel and place that
    in your folder that you made called android-kernel

    now lets get your config
    Code (Text):
    1.  
    2. adb pull proc/config.gz
    3.  
    unzip that and rename the file inside to .config and place it in your kernel folder
    cd into that folder and type
    Code (Text):
    1. make menuconfig
    go down to load a different config and select the config file you put in there
    then save that and exit next type make
    and you should have a zimage (kernel) in arch/arm/boot/
     


    reppard likes this.

    1. Download the Forums for Android™ app!


      Download

       
  2. asadullah

    asadullah Android Enthusiast
    Thread Starter

    I'm gonna try and prettify this a little later on.
     
  3. Wrenchin4life

    Wrenchin4life Member

    does this work with a ubuntu vm, or do you have to have just ubuntu?
     
  4. reppard

    reppard Android Enthusiast

    Great write up. Anything you compile from LGs current source will not run on phones that came with 2.2.1. We need to modify an s or v kernel until LG gets off their lazy asses
     
  5. asadullah

    asadullah Android Enthusiast
    Thread Starter

    @wrenchin4life like I said in the first post I don't know if it will work on anything but ubuntu 10.04. Very good chance it will but I don't know. Will probably be alot slower.

    @reppard thanks yeah I know the currrent kernel source won't work on 2.2.1 from lg. I'm just hoping that this will help people set up there machines and we can explore what options we have. It also will set up your machine to build cyanogen so if the optimus t rom works since they are officially supported by cyanogenmod we can use there source make our own folder and build a section for the optimus m.
     
  6. t3084

    t3084 Android Enthusiast

    @asadullah,
    this should helpful to anyone who is looking to play with android.

    @everyone else
    from slower to faster
    --------------
    1)if you are a windows user you can use ubuntu in a virtual machine

    2)if you are a windows user you can install ubuntu like a program with the ability to reboot your computer and use either windows OR ubutnu, this option is not as fast a real install, but at least you can control the system resources.

    you can also uninstall it like a program this way.

    3) install ubuntu
    --------------
    if anyone chooses to play with android I suggest not even asking for a pre-built environment. just follow the directions and learn what it is that you are doing.


    ....speaking of "prebuilt", i would assume that another option could be andLinux :)
     
  7. t3084

    t3084 Android Enthusiast

    I JUST WANT TO BE ABLE TO USE LOOPs!!!

    the possibilities are endless after that! debian on android :3
     
  8. reppard

    reppard Android Enthusiast

    @asadullah are you using 32 or 64 bit Ubuntu? I've been waiting for a 64 bit adb binary cause I've been having to vm 32 bit debian to run adb. You know if the release a 64bit version for Linux yet? Thank you so much for contributing to our community I know you don't even use the M so that's cool as shit of you.
     
  9. new optimus

    new optimus Android Expert

    you should be able to run 32bit with no problems, you should not need a virtual machine.
     
  10. t3084

    t3084 Android Enthusiast

  11. reppard

    reppard Android Enthusiast


    Thanks man, I've built multilib slack boxes before but I just don't have the resources at the moment as I am tether only at the moment :). Don't havevthe bandwidth and I can't find my 32bit slack discs just the 64 bit :/ just happy I've got virtualbox. You start that freenode channel yet?
     
  12. t3084

    t3084 Android Enthusiast

    no problem, i figure the irc can be a means of faster communitcations without the heavy resources. perfect of our 1x data streams :p

    and I have not made the channel yet.. i don't want to name it on my own :p

    at the end of the day, it's a group effort :p
     
  13. reppard

    reppard Android Enthusiast


    Well I'm on freenode. Just fired up #optimusm for the time being.
     
  14. reppard

    reppard Android Enthusiast

    Just for the hell of it I flashed an optimus s of kernel and it actually booted up....just had no display :) we should be able to port an of kernel fairly soon.
     
  15. t3084

    t3084 Android Enthusiast

    very nice! ... can you connect adb shell?

    I'll be in #optimusm for anyone who wants to join.
     
  16. t3084

    t3084 Android Enthusiast

    I just wanted to clarify the importance of ending your command with ; if you want to pass multiple commands on the same line
    Code (Text):
    1. [FONT=verdana]
    2. [/FONT]sudo add-apt-repository "deb http://archive.canonical.com/lucid partner"; sudo add-apt-repository "deb-src http://archive.canonical.com/ubuntu lucid partner"; sudo apt-get update
    also I want to mention that depending on which ubuntu distro you are using that command will be altered

    where is says lucid you would replace with the code name for your release:
    10.04 lucid
    10.10 maverick
    11.04 natty

    also you can go here to get a visual how-to for those more inclined to see what is happening.
     
  17. reppard

    reppard Android Enthusiast


    Yes I can. Well I didn't shell but I did adb logcat so I assume shell will work
     
  18. sammyz

    sammyz LG Whiz Kid

    ....now I find this old thread -_-
     
Loading...
Similar Threads - GUIDE COMPILE KERNEL
  1. Happy App Lab
    Replies:
    1
    Views:
    1,162
  2. decosoftapp
    Replies:
    1
    Views:
    853
  3. DecosoftApps
    Replies:
    1
    Views:
    517
  4. App Update
    Replies:
    2
    Views:
    776
  5. Paozi
    Replies:
    3
    Views:
    811
  6. App Update
    Replies:
    0
    Views:
    677
  7. kisame010588
    Replies:
    0
    Views:
    3,230
  8. kisame010588
    Replies:
    5
    Views:
    1,807
  9. App Update
    Replies:
    1
    Views:
    727
  10. App Update
    Replies:
    0
    Views:
    9,045

Share This Page

Loading...