Building a custom kernel with extra modules using fedpkg tools?

I am trying to make changes to the kernel source that comes from the upstream fedora git tree. The biggest issue(s) I am having is trying to get a straight answer on how to do anything! I have searched through the Fedora wiki and various other places through Google and have only come up with a fragment of what I need to make anything work.

What I am trying to accomplish is building a custom kernel, normally this would be simple by just changing the platform specific configuration file and build with fedpkg. What makes this slight more challenging is I need to add additional source code into the kernel before compilation. How do I get to the actual source code before its compiled? I know when I run fedpkg local the system retrieves the source code linux-5.1.tar.xz from Then it applies the patches as specified in the kernel.spec file.

Do I need to generate a patch and install the files that way? The code I am trying to add is fairly complex and requires that I run a automake ./configure script prior to copying it over so that may pose an issue.

When I run the same job with the upstream kernel source I just copy the files over to the kernel tree and run make menuconfig & make rpm-pkg and that’s it! I am trying to do the same here or as close as I can get.

Any instructions of how to do this? Do I need to do everything inside the kernel.spec file?


This is a little specialized for this forum — it’s possible (and hopeful) you’ll get a good answer here but if not I suggest engaging the Fedora Kernel team at

1 Like

I’m not a kernel expert but the nearest guide I can point you is this:


1 Like