• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

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

asadullah

Android Enthusiast
Aug 24, 2010
447
253
casselberry
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:
[FONT=verdana]
[/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:
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:
mkdir -p ~/bin
curl http://android.git.kernel.org/repo > ~/bin/repo 
chmod a+x ~/bin/repo


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:
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:
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:
mkdir android-kernel
okay now you have to add the ccompiler to our path

Code:
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:
adb pull proc/config.gz
unzip that and rename the file inside to .config and place it in your kernel folder
cd into that folder and type
Code:
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/
 
  • Like
Reactions: reppard
@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.
 
Upvote 0
@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 :)
 
Upvote 0
@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.
 
Upvote 0
@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.
you should be able to run 32bit with no problems, you should not need a virtual machine.
 
Upvote 0
@reppard

even if you are still using slackware, all the big distros usually have everything you need in the repos, you just need the all the 32bit libs

these aren't neccessarily how-to's for you or anyone else to follow, but they are what you need to learn about:)

slackware
slackware multilib

ubuntu
64+32 bit, multilib or chroot and why? - Ubuntu Forums


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?
 
Upvote 0
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?

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
 
Upvote 0
I just wanted to clarify the importance of ending your command with ; if you want to pass multiple commands on the same line
Code:
[FONT=verdana]
[/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.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones