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 Info | - Fedora mailing-lists

1 Like

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



I am trying to following the quick-docs.

My host is Fedora-34
Got error during fedpkg clone -a kernel

# fedpkg clone -a kernel
Cloning into 'kernel'...
remote: Enumerating objects: 2656, done.
remote: Counting objects: 100% (2656/2656), done.
remote: Compressing objects: 100% (926/926), done.
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
Could not execute clone: Failed to execute command.

Try this:

No problem from my side

fedpkg clone -a kernel

Clonando en 'kernel'...
remote: Enumerating objects: 2656, done.
remote: Counting objects: 100% (2656/2656), done.
remote: Compressing objects: 100% (926/926), done.
remote: Total 85543 (delta 2439), reused 1845 (delta 1730), pack-reused 82887
Recibiendo objetos: 100% (85543/85543), 134.92 MiB | 18.57 MiB/s, listo.
Resolviendo deltas: 100% (53008/53008), listo.

Could you please share with us → your /home/$USER/.gitconfig

Regards., HTH

Thanks for looking into my issue.

I don’t have ~/.gitconfig
But git config --global http.postBuffer 524288000 works.

I also posted at: