View previous topic :: View next topic |
Author |
Message |
Ralphred l33t
Joined: 31 Dec 2013 Posts: 687
|
Posted: Thu Jan 09, 2025 2:36 pm Post subject: Combining kernel configs? |
|
|
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 |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54680 Location: 56N 3W
|
Posted: Thu Jan 09, 2025 2:43 pm Post subject: |
|
|
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 |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1368 Location: Richmond Hill, Canada
|
Posted: Thu Jan 09, 2025 3:28 pm Post subject: |
|
|
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 |
|
|
Ralphred l33t
Joined: 31 Dec 2013 Posts: 687
|
Posted: Thu Jan 09, 2025 9:19 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
|