# How can I build a Rocky Linux 9.5 kernel using only a Gentoo .config file?”

**URL:** <https://forums.rockylinux.org/t/how-can-i-build-a-rocky-linux-9-5-kernel-using-only-a-gentoo-config-file/19066>\
**Category:** Rocky Linux Help & Support\
**Tags:** rocky-linux-9\
**Created:** [July 8, 2025, 4:16pm UTC](https://forums.rockylinux.org/t/how-can-i-build-a-rocky-linux-9-5-kernel-using-only-a-gentoo-config-file/19066 "2025-07-08T16:16:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gajit246](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gajit246](https://forums.rockylinux.org/u/gajit246)\
**Post date:** [July 8, 2025, 4:16pm UTC](https://forums.rockylinux.org/t/how-can-i-build-a-rocky-linux-9-5-kernel-using-only-a-gentoo-config-file/19066/1 "2025-07-08T16:16:48Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![FrankCox](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/frankcox/32/1572_2.png) [@FrankCox](https://forums.rockylinux.org/u/FrankCox)\
**Post date:** [July 8, 2025, 5:12pm UTC](https://forums.rockylinux.org/t/how-can-i-build-a-rocky-linux-9-5-kernel-using-only-a-gentoo-config-file/19066/2 "2025-07-08T17:12:34Z")

</div>

I would use something like meld ([https://meldmerge.org/](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.

---

<div class="post-metadata">

**Author:** ![anthyve](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@anthyve](https://forums.rockylinux.org/u/anthyve)\
**Post date:** [July 9, 2025, 7:35am UTC](https://forums.rockylinux.org/t/how-can-i-build-a-rocky-linux-9-5-kernel-using-only-a-gentoo-config-file/19066/3 "2025-07-09T07:35:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [September 7, 2025, 7:35am UTC](https://forums.rockylinux.org/t/how-can-i-build-a-rocky-linux-9-5-kernel-using-only-a-gentoo-config-file/19066/4 "2025-09-07T07:35:52Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
