Jump to content
funtoo forums
  • 0
Sign in to follow this  
bluephoenix

[Solved] How to customize kernel in Funtoo?

Question

I have read an article about how to compile a kernel in Funtoo from its wiki. But I am still not clear at all.

I can only understand I can choose to compile the kernel based on different arch by using "config-extract" . 

But if I still want to do some fine-tune based on this arch, how should I do? Where is the config file should I edit and what command should I use to re-compile it and how to install the new kernel to "/boot"? There is no detail manual to refer.

Who can help me to give a hint? Thanks a lot!

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

After I read this article: https://www.funtoo.org/Funtoo_Linux_Kernels

I cannot understand this sentence: "It is necessary to name the kernel configuration file something other than ".config" to avoid errors with genkernel. After using config-extract, run make oldconfig and accept all default options by hitting Enter at all prompts."

Why should I rename the kernel rather than ".config"? What is the error with genkernel? If I follow gentoo's guide, like make && make install, grub-mkconfig -o /boot/grub/grub.cfg, what will happen?

Share this post


Link to post
Share on other sites
  • 0
8 hours ago, bluephoenix said:

After I read this article: https://www.funtoo.org/Funtoo_Linux_Kernels

This page describes the process for using genkernel. Especially using config-extract which works with debian-sources.

When you manually install e.g gentoo-sources, you don't use config-extract or genkernel. You do that with make, make install, make modules_install and then modify grub.cfg.

Share this post


Link to post
Share on other sites
  • 0

Why should I rename the kernel config file something other than ".config"?

It seems that genkernel is an integrated tool for auto-excute "make, make install and etc". But if this is the only difference between genkernel and the seperated commands, so why do yo emphasize "rename the kernel config file something other than '.config'"? What is the fallback if I just overwrite the default ".config"?

Share this post


Link to post
Share on other sites
  • 0

The only one stating that you should rename .config is the page you linked to. Which describes the process using genkernel and especially genkernel with debian-sources. And the rename is only necessary there because the tool config-extract would overwrite an existing .config file. But config-extract does only work with debian-sources:

I never renamed .config in any way and also never used genkernel, as I don't really see any benefit for me by using it. But you could probably use it for gentoo-sources as well.You could read up on the usage of genkernel at https://wiki.gentoo.org/wiki/Genkernel

Share this post


Link to post
Share on other sites
  • 0
5 hours ago, jhan said:

The only one stating that you should rename .config is the page you linked to. Which describes the process using genkernel and especially genkernel with debian-sources. And the rename is only necessary there because the tool config-extract would overwrite an existing .config file. But config-extract does only work with debian-sources:

I never renamed .config in any way and also never used genkernel, as I don't really see any benefit for me by using it. But you could probably use it for gentoo-sources as well.You could read up on the usage of genkernel at https://wiki.gentoo.org/wiki/Genkernel

Sorry, jhan,

I have to ask again about my confuse.

I am not so familiar with genkernel tool as I neither use it when I use gentoo (I only use make && make install in gentoo and get everything done). But now when I turn to funtoo, when I read its document, this tool is proposed. My understanding about genkernel is ONLY a combination of "make, make install and some other small pieces of function". But genkernel will still use .config relative with the specific source, like /usr/src/linux-debian-sources-4.14.12 and nothing else to be its configuration. So if I use config-extract without "-o" option to generate the default .config, that will be  just what I want. And then according to the guide, I could use 

genkernel --kernel-config=.config all

to get everything done and enjoy the new kernel.

So I still don't understand why I should AVOID to use the default .config when I generate config file by using config-extract command. Leaving the default .config file for what? Is there any other tool will use it for some other purpose? 

And I tried to use "make && make install" directly in the debian kernel folder and refreshed the Grub menu by using grub-mkconfig, like what I did to gentoo before. But I fail to reboot the new kernel. So I doubt this DEFAULT .config is not the one which is really used by funtoo. Am I wrong? 

Share this post


Link to post
Share on other sites
  • 0

Maybe I am the wrong person about debian-sources because I have never used them. I only use gentoo-sources and install the new kernel manually.

 

But so far I understand the use of debian-sources, you would use the tool config-extract to create a generic .config file if you don't already have one. And the only reason I can think of, why you should rename the config file would be something along the line of this warning

 Warning
One has to be aware, that each time genkernel is run, with the --save-config genkernel option set, the configuration file in /etc/kernels is overridden. Thus, it is highly recommended to copy this file under a new name before running genkernel in order to preserve it.

I would assume that it is just to make sure that your kernel configuration does not get overwritten unintentionally. But I think that there are enough debian-source users in this forum that could probably explain it.

And if you new kernel did compile without errors when you used make && make install, then the compilation with the .config file should be OK. I would need more info (like e.g. error messages) to tell you why you could not boot the new kernel.

Share this post


Link to post
Share on other sites
  • 0

I suddenly somehow understand why we should NOT use the default .config when we make our customized kernel.

It is because "emerge kernel" or "emerge  auvDN world" will overwrite the default .config file in which case we will lose our previous work of customization.

So I will close this topic session. Thanks everybody!

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...