Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Original Poster
Rep:
I've written the "Configuring the kernel for building" section, but I think it might still need a bit of a cleanup though and maybe a few additions/changes.
A person should invoke "make defconfig" first to get a default configuration and then use one of the options for editing it next, or comparing it against an existing one, if they have one.
I think a good start is probably to work out what kind of content and structure the new wiki article should have.
A rough draft structure could be something like this:
[*]intro/description
...
[*]preparing your system for building/prerequisites
-development tools
-development packages for kernel build
-etc
*do we have a separate section for building with LLVM/Clang?*
...
[*]configuring the kernel for building
-answering all questions from the kernel build system
-copying current kernel config over to new kernel
...
[*]steps to build new kernel
...
[*]installing the built kernel modules and kernel
...
[*]configuring the newly built kernel for use with your system
...
[*]problems/issues that might arise
*or should that be incorporated into a section above?*
...
===================
What do you think about that example structure of the new wiki article Hazel?
Thank you JSB for this great thread, it will help me to build my own kernel, the ultimate challenge for a true Linuxer!
Where do I download the source?
But, when I get back to it, or someone want to do it, I always remember I know what I am doing, but they don't necessarily, or it's their first time or tenth time or whatever.
I agree with whoever said the configuration section is the biggest one. I did not really make it complicated in my thingy, but there are so many ways to configure or pre-configure the Kernel, and these also needs an explanation so people can choose the best method for them. Like make oldconfig, localmodconfig or nodefconfig or those kind of things. That's an important thing to decide when you build your Kernel. Personally I have my own copy/paste style and use various config files and manually copy them etc, bla bla. But there are so many ways to go about this, that are useful for various purposes.
Another section I keep getting back to is prerequisites. I did not do it myself when I wrote this, only to realize even my own distro doesn't have them installed, duh. I have to keep reminding myself I'm not using Slackware. What you need to add I guess varies from distro to distro, some have this, some have that. But, a list of the general "build-essentials" would be nice to include in a wiki page. I mean, independent of distro, all of the pre-requisites. (I don't even know these myself tbh, just some/many of them).
Then you could have a section on added complexity. I only did/do the basics myself. I don't make headers and such things, and I did not explain why not or why one could/should and in what situations. Making headers is not the only thing, there are others too, and those could be included too, in a hyphenated section so to say. Like "things you can do" or "optional". initrd
...and I guess the least obvious section is actually the bootloader. If you want to build the Kernel, you best have some bootloader experience, maybe even in a guide have some basic bootloader tips.
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Original Poster
Rep:
Quote:
Originally Posted by rtmistler
A person should invoke "make defconfig" first to get a default configuration and then use one of the options for editing it next, or comparing it against an existing one, if they have one.
Nice spot RT! I forgot all about that one!
Quote:
Originally Posted by hazel
OK, I've gone over that and rearranged things a bit to make it flow better.
Very nice work once again Hazel! Do people think we should add something about make oldconfig (and perhaps and if it isn't going to make that section too long, maybe the other config options zeebra suggests?), as zeebra suggests? As personally I think it would be good for the sake of completeness if for no other reason. Assuming we are in agreement about that; could I ask you to do that since I think you could explain that better than I could, and while keeping the nice flow you've created there? Other than that, and unless anyone can think of any other improvements, I think that section hits the mark and is a winner.
Quote:
Originally Posted by zeebra
...
Another section I keep getting back to is prerequisites. I did not do it myself when I wrote this, only to realize even my own distro doesn't have them installed, duh. I have to keep reminding myself I'm not using Slackware. What you need to add I guess varies from distro to distro, some have this, some have that. But, a list of the general "build-essentials" would be nice to include in a wiki page. I mean, independent of distro, all of the pre-requisites. (I don't even know these myself tbh, just some/many of them).
Then you could have a section on added complexity. I only did/do the basics myself. I don't make headers and such things, and I did not explain why not or why one could/should and in what situations. Making headers is not the only thing, there are others too, and those could be included too, in a hyphenated section so to say. Like "things you can do" or "optional". initrd
...and I guess the least obvious section is actually the bootloader. If you want to build the Kernel, you best have some bootloader experience, maybe even in a guide have some basic bootloader tips.
I do intend on making some small changes and additions to the prerequisites section, namely listing the kernel dependencies required to build it (excluding the actual development tools themselves - as I agree with Hazel's idea about just listing some of the metapackages for the tools themselves). I've also added a statement about "package groups", in that, some distros have "package groups" that can install all of the required tools for you, without having to install individual packages - similar to metapackages.
We are going to include info about both building a kernel with and without an initrd, as well as info about adding a boot option to GRUB to boot the new kernel.
Quote:
Originally Posted by zeebra
Nice.. I would add "want to test or fix configurations" and "need the newest Kernel for reason XYZ" to the first section.
In regards to the first idea; could you perhaps post in this thread the content you're thinking of so we can have a clear idea of exactly what you're suggesting there, thanks. I think in relation to your second idea, what's already there should be enough. As Hazel said earlier on in this thread; we should try to strike a balance between providing complete info and not making the article "offputting" to people that have never attempted to build their own kernel before. And I agree with Hazel on that point.
The only concerns I have in relation to your first suggestion would be:
is it worthwhile to include such a section?
is it going to make the article too long and offputting to the readers of it?
I will admit that I'm on the fence in relation to your first idea, so I'll go with the majority opinion and be a "populist" and do a "me too" on that one.
Last edited by jsbjsb001; 12-23-2020 at 11:21 PM.
Reason: tpyo
I do intend on making some small changes and additions to the prerequisites section, namely listing the kernel dependencies required to build it (excluding the actual development tools themselves - as I agree with Hazel's idea about just listing some of the metapackages for the tools themselves). I've also added a statement about "package groups", in that, some distros have "package groups" that can install all of the required tools for you, without having to install individual packages - similar to metapackages.
On the top of my head I can remember some:
make
bison
ncurses-devel
openssl-devel
There are ofcourse many more, but I guess some common ones would be nice to list. Some distroes don't include them (and others), and it can be quite frustrating to try to figure it out.
Quote:
Originally Posted by jsbjsb001
In regards to the first idea; could you perhaps post in this thread the content you're thinking of so we can have a clear idea of exactly what you're suggesting there, thanks. I think in relation to your second idea, what's already there should be enough. As Hazel said earlier on in this thread; we should try to strike a balance between providing complete info and not making the article "offputting" to people that have never attempted to build their own kernel before. And I agree with Hazel on that point.
The only concerns I have in relation to your first suggestion would be:
is it worthwhile to include such a section?
is it going to make the article too long and offputting to the readers of it?
I will admit that I'm on the fence in relation to your first idea, so I'll go with the majority opinion and be a "populist" and do a "me too" on that one.
I meant, those are the most common reasons people want/need to build a custom Kernel. For testing some issues or changing the configuration to include something, or some people who need the newest Kernel for whatever reason, ex, ATI/Nvidia crowd. Especially the latter ones, there are many "newbs" that need to make their own Kernel for that reason.
1st idea? You mean about configuration? I dunno.. It just seems important, because if I refer someone to my brief little thing, I'm always tempted to say they can use localmodconfig for example, but usually I recommend just using the distro Kernel config as the base (as I do myself in most cases). But yeah, perhaps you are right, using localmodconfig and such things is probably not what a newbie should do. Probably the recommended way in that case is to use the distro config file from /boot aka config-uname.
So I've added Zeebra's suggestions to the introduction and a paragraph on the use of "make oldconfig". I tend to agree with jsb that we don't need to do much more with these sections.
I suggest that jsb does the step-by-step build and installation guides, and I will make a start on the bootloader section. I would also like to put something about kernel help into the tips section, because this is actually the most amazing and useful help system I have ever seen (although the LQ Wiki Style Manual forbids you to say anything like that explicitly).
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Original Poster
Rep:
Quote:
Originally Posted by zeebra
On the top of my head I can remember some:
make
bison
ncurses-devel
openssl-devel
There are ofcourse many more, but I guess some common ones would be nice to list. Some distroes don't include them (and others), and it can be quite frustrating to try to figure it out.
...
Yes, I know which packages need to be installed to build the kernel, I was only making the point that we are not going to list all of the individual development tools themselves for the same reason already mentioned and make is a development tool. Hazel has already mentioned the ncurses library in the prerequisites section, which as far as I'm aware is only needed for make menuconfig if I'm not mistaken.
I was talking about the other kernel build dependencies, which I'll explicitly list in the wiki article after I make this post. But that said, I think after that the prerequisites section will be done and no more needs, nor should be added to it. And I think the intro section is long enough and includes more than enough info now that Hazel's added the things you were talking about before.
Quote:
1st idea? You mean about configuration? I dunno.. It just seems important, because if I refer someone to my brief little thing, I'm always tempted to say they can use localmodconfig for example, but usually I recommend just using the distro Kernel config as the base (as I do myself in most cases). But yeah, perhaps you are right, using localmodconfig and such things is probably not what a newbie should do. Probably the recommended way in that case is to use the distro config file from /boot aka config-uname.
I think I misunderstood your idea and got the wrong impression, but Hazel seems to have understood it, so again, I think the intro section is complete now.
Yes, I do plan on adding something in the "Tips and tricks" section about copying the current kernel config over to a new kernel, and yes, I've already done that on my own machine, so I know exactly how to do that so there's no need to explain that to me.
Again, we have already agreed that we should be striking a balance between completeness and not discouraging people from attempting to build their own kernel by overwhelming them with too much info.
So I've added Zeebra's suggestions to the introduction and a paragraph on the use of "make oldconfig". I tend to agree with jsb that we don't need to do much more with these sections.
Actually, that's not what I meant. It was just an example. If anything I think the "configuration section" should be simplified into the most common and foolproof methods, while other options should be mentioned as an appendix. What are the most viable options for a less experienced user and how to do those.
One of the issues I was having was trying to explain some basics while trying to keep it simple. So in the end it was a bit too long and I decided to add a summary too
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Original Poster
Rep:
Quote:
Originally Posted by hazel
So I've added Zeebra's suggestions to the introduction and a paragraph on the use of "make oldconfig". I tend to agree with jsb that we don't need to do much more with these sections.
I suggest that jsb does the step-by-step build and installation guides, and I will make a start on the bootloader section. I would also like to put something about kernel help into the tips section, because this is actually the most amazing and useful help system I have ever seen (although the LQ Wiki Style Manual forbids you to say anything like that explicitly).
Actually, that's not what I meant. It was just an example. If anything I think the "configuration section" should be simplified into the most common and foolproof methods, while other options should be mentioned as an appendix. What are the most viable options for a less experienced user and how to do those.
OK, Zeebra. Which bits do you think should be moved to Tips and Tricks?
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Original Poster
Rep:
Quote:
Originally Posted by zeebra
Actually, that's not what I meant. It was just an example. If anything I think the "configuration section" should be simplified into the most common and foolproof methods, while other options should be mentioned as an appendix. What are the most viable options for a less experienced user and how to do those.
One of the issues I was having was trying to explain some basics while trying to keep it simple. So in the end it was a bit too long and I decided to add a summary too
I think the configuration section should explain the various approaches rather than just having one "simple" method. As it's important to make the point to the reader that they have the flexibility to choose from a number of approaches, not have one dictated to them. So I wouldn't be in favor of taking what's already there out and stuffing it into the "Tips and tricks" section.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.