Building a Fedora Based Linux Kernel

We have a few different ways we build a Kernel for internal consumption. One is very minimal, to be used when space is at a premium. Another is very closely based on the Fedora configuration to be used as a replacement Kernel for a Fedora install. While we do provide our team with RPMs to install, development often requires building from source. I’ve done this (and forgotten steps) enough times to want to have a quick reference. The following should work on a recent Fedora install.

yum groupinstall "Development Tools"
yum install dwarves openssl grubby
git clone git@$(GITSERVER):$(LINUX_REPO).git
cd linux
cp $( KERNEL_CONFIG_SOURCE) ./.config
make olddefconfig
make -j `nproc`  && make -j `nproc` modules && make -j `nproc` modules_install && make install
grubby --set-default-index=0

1 thought on “Building a Fedora Based Linux Kernel

  1. FWIW, the upstream kernel these days contains a “quick building” doc with a “quick reference” that is not that different:

    It’s obviously not Fedora-specific and uses localmodconfig instead (but mentions olddefconfig).

    FWIW, I wonder why you wrote “grubby –set-default-index=0”, as I never needed it locally. And you afaics can reduce the number ob make calls to two (see above document)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.