LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 01-01-2018, 06:27 AM   #1
nejnej25
Member
 
Registered: Dec 2017
Location: Asia
Distribution: Slackware 14.2,CentOS 7, Ubuntu, Debian
Posts: 116

Rep: Reputation: Disabled
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.
 
Old 01-01-2018, 06:54 AM   #2
Mill J
Senior Member
 
Registered: Feb 2017
Location: @127.0.0.1
Distribution: Mint, Void, MX, Haiku, PMOS, Plasma Mobile, and many others
Posts: 1,258
Blog Entries: 2

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
Try the kernel section in LFS http://www.linuxfromscratch.org/lfs/
 
Old 01-01-2018, 07:07 AM   #3
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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/
 
Old 01-01-2018, 07:51 AM   #4
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
Linux Kernel in a Nutshell
 
Old 01-01-2018, 12:52 PM   #5
cirosantilli
LQ Newbie
 
Registered: Nov 2012
Posts: 4

Rep: Reputation: Disabled
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
 
Old 01-03-2018, 10:00 AM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,672
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
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.)

Last edited by sundialsvcs; 01-03-2018 at 10:02 AM.
 
Old 01-04-2018, 06:20 AM   #7
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware kernel compiling guide? flashingcurser Slackware 3 02-06-2011 10:31 PM
Good but sorta easy guide to Kernel compiling/Re-Compiling? linus72 Linux - General 1 07-13-2009 01:37 PM
Newbie Guide To Compiling A Kernel! DrOzz Linux - General 318 08-20-2008 05:21 AM
I'm interested in compiling a 2.6.x kernel, is this is a decent guide? Erik_the_Red Linux - Newbie 7 08-14-2005 06:03 AM
Kernel compiling guide for newbies... DaOne Slackware 127 04-17-2005 04:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 06:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration