Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Combining kernel configs?
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
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 687

PostPosted: Thu Jan 09, 2025 2:36 pm    Post subject: Combining kernel configs? Reply with quote

So, it's that time of the decade when hardware gets "handed down" like a Mexican Wave, previous iterations of this decennial ritual have taught me how to "normalise" CFLAGS/CPUFLAGS and do an emerge -e world.
I can just install two kernels, one for the old hardware and one for the new (all *my* kernels are monolithic), or just make a -dist kernel work for the swap over, but I'm interested in the concept of combining two .config files.
My intuition says to cat one into the other, remove all the "is not set" lines, sanity check the non-tristate (non-boolean in my case) entries, and pass the whole mess through sort -u before running make oldconfig - there must be a more elegant way to do this that doesn't involve the "fun" of an extensive make menuconfig session, someone must have done this before?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Thu Jan 09, 2025 2:43 pm    Post subject: Reply with quote

Ralphred,

Free with the kernel source tree is
Code:
/usr/src/linux/scripts/diffconfig

which may help.
_________________
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
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1368
Location: Richmond Hill, Canada

PostPosted: Thu Jan 09, 2025 3:28 pm    Post subject: Reply with quote

You can try
Code:
make oldconfig <your new machine .config file>


with Neddy suggestion using diffconfig to generate kernel config fragments.

This is know as Linux kernel config fragments search internet will give you many way of doing this.
Back to top
View user's profile Send private message
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 687

PostPosted: Thu Jan 09, 2025 9:19 pm    Post subject: Reply with quote

Thanks both, make oldconfig <some other config> does nothing I'm afraid.

./scripts/diffconfig is cool, and I managed to get some sensible output from it; I also underestimated the vast difference between the two .config files, some 1400 differences, and ~170 options that needed "turning on" on the new kernel for it to stand in for the old one.
Needless to say I'm not that into fondling a kernel config that will only be useful for literally two boot cycles, and I'm off to copy a kernel that I know won't boot the old hardware. I plan to use the grub menu to avoid it until it's needed. I've got about 10 years to author a script for "next time" though :wink:
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