[HOW TO] Compile and Deploy a Kernel

doomboss

Senior Member
Jan 17, 2013
252
47
You're going to need Linux. The guide focuses on Ubuntu (and its derivatives), but of course you can compile the code with any Linux box. It's very simple -- just a few 'make' (build) commands. The source is text, so that can be opened with any editor or IDE. The source is packaged in a tar file, I believe, which can be extracted with commands that should be standard with the Linux distros. It sounds like you don't have a Linux machine though. That's no problem -- I run Linux Mint (based on Ubuntu) in a virtual machine on my Windows box with software called VMware Player. It's all very easy to setup and use.

Take a look at this page: Linux Mint on VirtualBox?Linux Mint on VMWare?Best Run Linux on Windows Tutorial. The important part starts at Running Linux on Windows and ends with Linux Mint on VirtualBox. It's a piece of cake -- trust me. Write back and let me know where you stand and any and all questions you have. PS This is how I got started, maybe just two months or so ago.

I hope my school network does not consider the link as illegal download link... Finally have some free time to discover it :(

Ohh by the way, when i was trying to download the Linux Mint, there are a few options though. Is it matter for which one i choose? (For example linuxmint-14.1-mate-dvd-32bit.iso and linuxmint-14.1-cinnamon-dvd-32bit.iso)
 
Last edited:

FloRider

Senior Member
Dec 2, 2012
358
111
I hope my school network does not consider the link as illegal download link... Finally have some free time to discover it :(

Ohh by the way, when i was trying to download the Linux Mint, there are a few options though. Is it matter for which one i choose? (For example linuxmint-14.1-mate-dvd-32bit.iso and linuxmint-14.1-cinnamon-dvd-32bit.iso)

Those are the front-ends. I use Cinnamon and like it, but don't have much to compare it to. By the way, try to reserve 30-40gb for your partition if possible. You're going to hate life if you run out of space -- I don't think you can enlarge the partition. I think you can add another partition, but I wouldn't bet on it.

PS Nothing illegal about downloading Linux(!), and VMware Player is free.
 
Last edited:

doomboss

Senior Member
Jan 17, 2013
252
47
Those are the front-ends. I use Cinnamon and like it, but don't have much to compare it to. By the way, try to reserve 30-40gb for your partition if possible. You're going to hate life if you run out of space -- I don't think you can enlarge the partition. I think you can add another partition, but I wouldn't bet on it.

PS Nothing illegal about downloading Linux(!), and VMware Player is free.

Alright i finally ended up installing Ubuntu because i have the ISO file and used it before :D I have 30gb partition exclusively for my Ubuntu system and hopefully its enough XD So i just need to follow your instruction on the Terminal right? Do i need to install something else? Sorry that i just keep asking you :(

Question again: what do you mean by Open a terminal in /A2109N_GPL_kernel_570 and type??
 
Last edited:

FloRider

Senior Member
Dec 2, 2012
358
111
Alright i finally ended up installing Ubuntu because i have the ISO file and used it before :D I have 30gb partition exclusively for my Ubuntu system and hopefully its enough XD So i just need to follow your instruction on the Terminal right? Do i need to install something else? Sorry that i just keep asking you :(

Question again: what do you mean by Open a terminal in /A2109N_GPL_kernel_570 and type??

Oh, I usually navigate to a directory with the file explorer and open a terminal window from there. Basically, you need to type commands in whichever directory I specify. I'm not a Linux guy, so I'm sorry if I'm using the wrong terminology. Just navigate to that directory with a command-line interface (terminal window) and type the commands.

Sent from my IdeaTabA2109A using Tapatalk HD
 

doomboss

Senior Member
Jan 17, 2013
252
47
Oh, I usually navigate to a directory with the file explorer and open a terminal window from there. Basically, you need to type commands in whichever directory I specify. I'm not a Linux guy, so I'm sorry if I'm using the wrong terminology. Just navigate to that directory with a command-line interface (terminal window) and type the commands.

Sent from my IdeaTabA2109A using Tapatalk HD

Ahh i figured out how to do it now. Actually I just need to navigate into the file direction. so I typed in "cd /home/(your username)/Development/A2109N_GPL_kernel_570" for the direction, and then just type in those code that you provides :)


Oh also, how come when i type "
make oldconfig", there are a lot of question showing up about the kernel? Is that supposed to happen?? Or it should be blank and then i can enter the next statement which is "make -j5"?
 
Last edited:

FloRider

Senior Member
Dec 2, 2012
358
111
Ahh i figured out how to do it now. Actually I just need to navigate into the file direction. so I typed in "cd /home/(your username)/Development/A2109N_GPL_kernel_570" for the direction, and then just type in those code that you provides :)


Oh also, how come when i type "
make oldconfig", there are a lot of question showing up about the kernel? Is that supposed to happen?? Or it should be blank and then i can enter the next statement which is "make -j5"?

Yes. I don't understand why those haven't been specified in the old .config. The defaults should be fine. I don't really understand the relationship between the Kconfigs, the defconfig, and the final .config file. That's one problem I'm having now when I add new parameters to the code. You should be able to breeze through the questions -- just remember to follow my directions about the config file. Rename it to .config, place it in the source root, and then execute make oldconfig. "Oldconfig" uses that .config file, so that will have to be present. It's a system file, so it's normally hidden.
 

doomboss

Senior Member
Jan 17, 2013
252
47
I think i just found a better way to do the kernel, but oh well i am still trying to figure it out. But here is the link: How to Edit Android Kernels in Ubuntu | eHow.com It is probably for Ubuntu.
Too excited to explain how i changed the path, but yeah just letting you know and maybe you can help me to verify that this way works. :D :D :D
 

doomboss

Senior Member
Jan 17, 2013
252
47
Ahh, i see what i did. So instead of use oldconfig, i use menuconfig. That way i can change the kernel setting more easy. :)
 

FloRider

Senior Member
Dec 2, 2012
358
111
I think i just found a better way to do the kernel, but oh well i am still trying to figure it out. But here is the link: How to Edit Android Kernels in Ubuntu | eHow.com It is probably for Ubuntu.
Too excited to explain how i changed the path, but yeah just letting you know and maybe you can help me to verify that this way works. :D :D :D

There's no way that guide will work for our kernel. It's written specifically for the HTC EVO, and mine is specifically for the A2109 (thus there are a few details missing).

Sent from my IdeaTabA2109A using Tapatalk HD
 

FloRider

Senior Member
Dec 2, 2012
358
111
Ahh, i see what i did. So instead of use oldconfig, i use menuconfig. That way i can change the kernel setting more easy. :)

You will need to start with oldconfig and the .config file. There are too many settings that are different between the stock config and the menuconfig defaults. I thought I mentioned this in the guide, but you can run menuconfig after oldconfig. I think you have to specifically tell it to load the .config file once you are inside the application. I could be wrong, but I think otherwise it ignores it and loads the defaults from the defconfig.

So, feel free to mess around with menuconfig, but I expect you'll have to use the config file from your A2109. Oh, now that I think about it, it's probably unnecessary to use oldconfig. Sorry - just load the config file into menuconfig. But don't use the menuconfig defaults.

Sent from my IdeaTabA2109A using Tapatalk HD
 

doomboss

Senior Member
Jan 17, 2013
252
47
You will need to start with oldconfig and the .config file. There are too many settings that are different between the stock config and the menuconfig defaults. I thought I mentioned this in the guide, but you can run menuconfig after oldconfig. I think you have to specifically tell it to load the .config file once you are inside the application. I could be wrong, but I think otherwise it ignores it and loads the defaults from the defconfig.

So, feel free to mess around with menuconfig, but I expect you'll have to use the config file from your A2109. Oh, now that I think about it, it's probably unnecessary to use oldconfig. Sorry - just load the config file into menuconfig. But don't use the menuconfig defaults.

Sent from my IdeaTabA2109A using Tapatalk HD

Ok I loaded the config from our tablet first before messing with any setting. Right now i am just trying to see how the setting looks like, and i am not good enough to edit any code yet. :) :) :)
 

vampirefo.

Senior Member
Developer
Nov 8, 2011
3,836
1,394
Once you guys get good at kernel building, you might want to try your hand at toolchain building, this is very hard, consider building a kernel a warm up.

to get info about your kernel, including the toolchain used to build the kernel.

adb shell

cat /proc/version

My current kernel displays.

root@android:/ # cat /proc/version
Linux version 3.1.10 (vampirefo@vampirefo-GA-MA78GM-US2H) (gcc version 4.7.3 20130102 (prerelease) (crosstool-NG hg+default-20f2459b97bf) ) #1 SMP PREEMPT Sun Feb 3 13:00:51 EST 2013
 
Last edited:
Top