Building a kernel

sellers86

Well-known member
Jul 21, 2011
1,837
617
0
I haven't been able to find a decent guide on this, and I'd like to try it out. So how would I go about building a kernel from lgs, bobs, etc source?

Any help would be appreciated

INSTRUCTIONS BY TVALL:
To compile a kernel you need:
- A Linux box
- a toolchain (use one from an android repo, or use linaro)
- the kernel source

To get the source and build:
Code:
$ git clone https://github.com/tvall43/android_kernel_thunderc.git
$ cd android_kernel_thunderc
(Get a toolchain if you don't already have one)
$ ARCH=arm CROSS_COMPILE=<path to toolchain>/bin/arm-eabi- (or for linaro, arm-linux-gnueabi-) make -j4

Change the address you are cloning from to the one you want. Or for lg's, go to http://opensource.lge.com

thanks so much tvall!
 
Last edited:
Good guides for this are kinda hard to find. I'm going to write a guide to build my rom and kernel on my xda thread, but I'm not good at that so it'll probably be pathetic.

To compile a kernel you need:
- A Linux box
- a toolchain (use one from an android repo, or use linaro)
- the kernel source

To get the source and build:
Code:
$ git clone https://github.com/tvall43/android_kernel_thunderc.git
$ cd android_kernel_thunderc
(Get a toolchain if you don't already have one)
$ ARCH=arm CROSS_COMPILE=<path to toolchain>/bin/arm-eabi- (or for linaro, arm-linux-gnueabi-) make -j4

Change the address you are cloning from to the one you want. Or for lg's, go to [URL]http://opensource.lge.com[/URL]
 
Last edited:
Another good recommendation would be to find some of the better kernel builders and see if they hang out on IRC chat channels and pop in and see what is going down. Maybe ask if they have any guides to refer out.
 
  • Like
Reactions: sellers86
Good guides for this are kinda hard to find. I'm going to write a guide to build my rom and kernel on my xda thread, but I'm not good at that so it'll probably be pathetic.

To compile a kernel you need:
- A Linux box
- a toolchain (use one from an android repo, or use linaro)
- the kernel source

To get the source and build:
Code:
$ git clone https://github.com/tvall43/android_kernel_thunderc.git
$ cd android_kernel_thunderc
(Get a toolchain if you don't already have one)
$ ARCH=arm CROSS_COMPILE=<path to toolchain>/bin/arm-eabi- (or for linaro, arm-linux-gnueabi-) make -j4

Change the address you are cloning from to the one you want. Or for lg's, go to [URL]http://opensource.lge.com[/URL][/QUOTE]

Thanks. Where do I get linaro

Sent from my LG-VM670 using Tapatalk
 
Another good recommendation would be to find some of the better kernel builders and see if they hang out on IRC chat channels and pop in and see what is going down. Maybe ask if they have any guides to refer out.

No offense to you or any moderators at all, but arent you guys the ones that recommend publicly posting everything to benefit the community as a whole?
 
Last edited:
Good guides for this are kinda hard to find. I'm going to write a guide to build my rom and kernel on my xda thread, but I'm not good at that so it'll probably be pathetic.

To compile a kernel you need:
- A Linux box
- a toolchain (use one from an android repo, or use linaro)
- the kernel source

To get the source and build:
Code:
$ git clone https://github.com/tvall43/android_kernel_thunderc.git
$ cd android_kernel_thunderc
(Get a toolchain if you don't already have one)
$ ARCH=arm CROSS_COMPILE=<path to toolchain>/bin/arm-eabi- (or for linaro, arm-linux-gnueabi-) make -j4

Change the address you are cloning from to the one you want. Or for lg's, go to [URL]http://opensource.lge.com[/URL][/QUOTE]

Thanks! I just got my first kernel to start compiling after reading this. I did have to edit one line in the makefile to point it at my newly downloaded toolchain

Sent from my LG-VM670 using Tapatalk 2
 
  • Like
Reactions: sellers86
Thanks! I just got my first kernel to start compiling after reading this. I did have to edit one line in the makefile to point it at my newly downloaded toolchain

Sent from my LG-VM670 using Tapatalk 2

What line did you edit? I cant find it
 
What line did you edit? I cant find it

CROSS_COMPILE after cloning tvall git It was pointing at his home cm9 toolchain which I obviously didn't have. Use search/find for cm9 in the file and you should pick it up.

Sent from my LG-VM670 using Tapatalk 2
 
CROSS_COMPILE after cloning tvall git It was pointing at his home cm9 toolchain which I obviously didn't have. Use search/find for cm9 in the file and you should pick it up.

Sent from my LG-VM670 using Tapatalk 2

Didn't clone tvalls got lol. He got me past what I did wrong though. But I'm getting other errors. Ill try again sometime this week, or maybe ill try a different toolchain.

Sent from my LG-VM670 using Tapatalk
 
For the record, even though I haven't cooked a custom kernel in years, Slackware is awesome for development like that. Almost everything you need is always installed by default, making compiling your source a snap. Like, almost obscenely easy. :D I haven't dabbled with deving for Android, but I did for Linux in the late '90's and early 2000's. These days, I just make eye candy.
 
isn't this missing a step??

scripts/kconfig/conf -s arch/arm/Kconfig
***
*** You have not yet configured your kernel!
*** (missing kernel config file ".config")
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
make: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'. Stop.
make: *** Waiting for unfinished jobs....
CHK include/linux/version.h
 
isn't this missing a step??

scripts/kconfig/conf -s arch/arm/Kconfig
***
*** You have not yet configured your kernel!
*** (missing kernel config file ".config")
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
make: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'. Stop.
make: *** Waiting for unfinished jobs....
CHK include/linux/version.h

Just run "make menuconfig and save, it well be saved has .config which is used to tell make files what the kernel is the have.
 
Why is the .config that works right not included in the repos? ???

Sent from my Optimus M

in mrg666's repo you can find it in \arch\arm\configs\vm670_config
in tvall's repo I think they can be found in arch\arm\configs\ though I don't know which one would be for an Optimus M. May be wise just to pull the one from your phone
 

Trending Posts

Forum statistics

Threads
956,928
Messages
6,970,690
Members
3,163,659
Latest member
Jokerman