Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Understanding Distribution Kernel and sevedconfig
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
megalodon
n00b
n00b


Joined: 19 Jun 2021
Posts: 18
Location: Rio de Janeiro, Brazil

PostPosted: Wed Sep 21, 2022 8:24 pm    Post subject: Understanding Distribution Kernel and sevedconfig Reply with quote

Hi folks!

I need some help to understand how savedconfig works for gentoo-kernel, so I 'll illustrate a use case to help me explain better:

"Suppose I want to customize my kernel and start with Distribution Kernel as a base, so I almost guarantee that I have a working kernel right off the bat with minimal effort.
Also, I set USE="savedconfig".

After get the system working, I start to slowly change the kernel settings in order to fit my needs.

To edit the kernel settings, I need a .config file in the kernel folder, the type 'make menuconfig' and start editing. When finished, just emerge the package and the rebuild is done.

If everything is running ok, I can restart."

The point is: can the savedconfig functionality help me in this case (edit the kernel and recompile the same version)? If I have to have a .config file in /usr/src/linux folder is there any point in keeping a copy in savedconfig other than easier kernel upgrades?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 51161
Location: 56N 3W

PostPosted: Wed Sep 21, 2022 8:50 pm    Post subject: Reply with quote

megalodon,

If you don't keep a copy of your old working .config, how do you undow your change when you build a dud kernel.
We all do that from time to time, even Linus himself.

That brings me on to my next point. Be sure you have a working kernel to fall back on, so you don't have to find your boot media when, not if, your new kernel won't boot.
So don't rebuild the same version as in will install its binary and modules over the top of the kernel that was there.

If you know that any external kernel modules you use respect LOCALVERSION, use that to identify your kernels.
That will keep the binaries and modules separate.

Your kernel names will be like 5.19.66-gentoo-megalodon-1 ... and so on.
Read the help on the option.

Be warned that some external modules ignore LOCALVERSION, then won't work with a LOCALVERSIONed kernel.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
megalodon
n00b
n00b


Joined: 19 Jun 2021
Posts: 18
Location: Rio de Janeiro, Brazil

PostPosted: Fri Sep 23, 2022 12:29 am    Post subject: Reply with quote

NeddySeagoon wrote:
megalodon,

If you don't keep a copy of your old working .config, how do you undow your change when you build a dud kernel.
We all do that from time to time, even Linus himself.


I see. In fact I understand why do we keep a copy of the .config file. What I can't get is how the savedconfig mechanics work in the kernel case, because to edit the .config file in a practical way, we need this file close to the kernel source ( /usr/src/linux/) not far (/etc/portage/savedconfig/sys-kernel/). Do you agree? I can't run make menuconfig without copying the file back and forth.

It's very different from dwm. Though I don't know where dwm source code is, I can edit the /etc/portage/savedconfig/x11-wm/dwm-6.2 file and emerge x11-wm/dwm will build with changes.

NeddySeagoon wrote:
That brings me on to my next point. Be sure you have a working kernel to fall back on, so you don't have to find your boot media when, not if, your new kernel won't boot.
So don't rebuild the same version as in will install its binary and modules over the top of the kernel that was there.


Yes, you're right. I've learned this lesson by doing (...it wrong).

NeddySeagoon wrote:
If you know that any external kernel modules you use respect LOCALVERSION, use that to identify your kernels.
That will keep the binaries and modules separate.

Your kernel names will be like 5.19.66-gentoo-megalodon-1 ... and so on.
Read the help on the option.

Be warned that some external modules ignore LOCALVERSION, then won't work with a LOCALVERSIONed kernel.


I need to read more about this.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum