I have a Gentoo server running kernel version 5.10.198, and I want to use its .config file to build a custom kernel on a Rocky Linux 9.5 system.
I copied the .config file from the Gentoo system into the kernel source directory on Rocky and ran make olddefconfig, but it throws errors.
I also noticed that the kernel config file from Rocky has around 5,789 options, while the Gentoo config has only about 1,789 options.
My goal is to reuse the Gentoo configuration — which has performance optimizations — to build the same kernel version (5.10.198) on Rocky Linux. How can I properly do this without getting errors?
I would use something like meld (https://meldmerge.org/) or vim using the -d option to compare the files and translate/transfer the options that you need from your old configuration file to the new one.
Kernel config options are not just a flat list - certain options are related to others, and redhat/rocky kernels have a bunch of backports that make the configuration diverge from upstream of same baseline version.
Copy the gentoo file, then configure your kernel build using make oldefconfig. This will try to use the gentoo configuration where it overlaps, and use default values otherwise.