I am trying to recreate an environment for debugging purposes. I require Fedora 20 specific kernel version (in this case its 3.17.7-200.fc20.x86_64).

I have manually compiled vanilla kernel (3.17.7) from tar package.

cd /usr/src/kernels/linux-3.17.7
make oldconfig
make
make install
make module_install

And would like to do same with Fedora sources, however it seems I am missing some common knowledge, as I am not able to obtain proper sources.

I have installed Fedora with yum install kernel, but that compiles a default version (I need to edit .config) and removes the all sources afterwards, leaving only initrm, systemmap and vmlinuz behind.

I have tried to:

yum install kernel-devel kernel-headers

for given F20 version.

But when I go to the

/usr/src/kernel/<my_desired_kernel_version>/

and try to make but I always get errors about missing files. Closer inspection of directories and files shows that, when compared to Vanilla kernel directory, dir with fedora kernel sources is missing a lot of files. Does it mean that fedora kernel-devels files are just patches?

My end goal in here is to compile a specific Fedora kernel with some edits to .config file. I would also appreciate some basic background where I am doing something wrong. Regards

The kernel-devel package only has what is required to build additional modules for the kernel, not the entire kernel sources. You need to get the source rpm to build the entire kernel. You can stick with using a vanilla kernel as you said you've done, or if you'd like to build your own kernel rpm see these instructions

You can get the specific source RPM from Koji, Fedora's build system. In this case, it's at https://kojipkgs.fedoraproject.org/packages/kernel/3.17.7/200.fc20/. (There are multiple ways to find this, but in this case, I simply did a Google search for "kernel-3.17.7-200.fc20.x86_64 koji".)

Install the source rpm (as non-root) — install and run rpmdev-setuptree to create the necessary environment in your home directory, if need be. Then, you can either mess with the sources and patches directly, or you can modify the kernel.spec file with an additional patch which makes your desired config change.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.