How to install a kernel from koji

Kernel developers frequently request bug reporters test on a different kernel. Sometimes this is a full new version. Other times it’s a test build with a patch. This article shows you how to install a kernel someone has built elsewhere.

The kernel build process produces a long list of RPM packages. The most important ones are kernel, kernel-core, and kernel-modules:

  • The kernel package doesn’t contain any files; its only purpose is to bring in the other two packages.
  • kernel-core contains the files that end up in /boot and a set of kernel modules needed for core functionality.
  • kernel-modules contains the rest of the modules that are installed with the system. (There is a kernel-modules-extra package as well which contains drivers for rare hardware.)

A developer who requests testing — such as for a bugfix or other change — typically gives a link to a koji build. Koji is the build system Fedora developers use to build software for inclusion into Fedora.

A build only for testing is called a scratch build. These scratch builds are only retained for a short time. After that, the Koji system collects them as garbage and gets rid of them. A scratch build isn’t signed, so to install it you need to turn off secure boot if it’s turned on. A koji build produces binaries for multiple architectures, as seen below.

A screenshot of a build of the Kernel in Koji

A build of the Kernel in Koji

Get and install the kernel

Find the architecture you want to test (typically x86_64) and click the download link next to the kernel, kernel-core, and kernel-modules packages. Once the RPMs are downloaded, you can install them on the command line using dnf with sudo:

sudo dnf install ./path/to/kernel-4.10.8-100.fc24.x86_64.rpm ./path/to/kernel-core-4.10.8-100.fc24.x86_64.rpm ./path/to/kernel-modules-4.10.8-100.fc24.x86_64.rpm

You can then reboot into your new kernel. If you want to remove it after testing, make sure to remove all three packages kernel, kernel-core, and kernel-modules to fully remove the files.

For Developers For System Administrators Using Software

4 Comments

  1. An easy way to grab all the packages is to do:

    koji download-task –arch=x86_64

    This grabs all the RPMs for that arch in the task to the current directory, so it’s worth doing it in a quick empty one.

    Then you can install all the rpms you need. Don’t forget modules-extra if using something like an XBox controller with drivers in extras!

    • @James: Correct. You can also do something like:

      koji download-build --arch=x86_64 kernel-4.11.0-2.fc26

      You need the koji package installed. For scratch builds this won’t work, though. There is a scratch build downloader in the fedora-review package, or download-task works fine as you mentioned. The instructions in the article will cover every case, though, even if they’re just a bit more manual.

  2. Zach Villers

    Great Article,

    Are scratch-build kernels built for all releases or is that determined by the person submitting the build? Is it possible to mix a kernel built for F26 on an F25 system? (I know I can install any kernel on my system by building it, but are there packages on a F25 system that will update if I install a F26 kernel?

  3. Jiri Kastner

    i have kernel.repo with
    ##########
    [kernel]
    name=kernel
    baseurl=file:///root/kernel
    gpgcheck=0
    metadata_expire=1s
    #################
    when downloaded from build to /root/kernel folder i just do createrepo_c /root/kernel && dnf update -c kernel.repo

Comments are Closed

The opinions expressed on this website are those of each author, not of the author's employer or of Red Hat. Fedora Magazine aspires to publish all content under a Creative Commons license but may not be able to do so in all cases. You are responsible for ensuring that you have the necessary permission to reuse any work on this site. The Fedora logo is a trademark of Red Hat, Inc. Terms and Conditions