LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Compiling Kernel Guide Request (https://www.linuxquestions.org/questions/linux-kernel-70/compiling-kernel-guide-request-4175620646/)

nejnej25 01-01-2018 06:27 AM

Compiling Kernel Guide Request
 
Please give me some good tutorial how to compile a kernel. I want to learn it so if something is missing like drivers or module I am ready and know how to fix that stuff.

Mill J 01-01-2018 06:54 AM

Try the kernel section in LFS http://www.linuxfromscratch.org/lfs/

Shadow_7 01-01-2018 07:07 AM

There's a ./Documentation/ path in the kernel source tree that should outline the process fairly well. If you want to bundle it as a package for a distro, most distros have a guide too.

https://www.kernel.org/

Teufel 01-01-2018 07:51 AM

Linux Kernel in a Nutshell

cirosantilli 01-01-2018 12:52 PM

Compiling the kernel is easy, the harder part is getting a suitable userland.

This automate everything with Buildroot: https://github.com/cirosantilli/linu...l-module-cheat

sundialsvcs 01-03-2018 10:00 AM

I am especially careful and systematic when compiling kernels:
  1. I make a separate, named, non-hidden copy of every hidden .config file, read-only in a subdirectory that's well out of the way.
  2. Before compiling the kernel, I rename the .config file out of the way, then do make distclean, then rename it back.
  3. If I have to repeat the process, I repeat the entire process, including the making of yet-another copy of the config.
In this way, I always know the exact set of configuration-options that were used for every kernel that I made or attempted to make, and I can diff to reliably see the exact set of differences between any one and any other. (Also, I can't futz-up the configuration by accident such that I cannot reliably and instantly get back to any other prior known-good state.) I also know that everything has been re-compiled, all at the same time. (The kernel is actually not a particularly-large program. It doesn't take long.)

Shadow_7 01-04-2018 06:20 AM

I just copy the distros config from /boot/ and make oldconfig. Plus maybe make menuconfig to tweak a couple things, like timings for a more responsive / realtime-ish audio needs. Even though it's technically slower for certain workloads.


All times are GMT -5. The time now is 01:47 PM.