#396 Installing Koji kernel. Booting specific kernel by default.
Merged 6 months ago by ankursinha. Opened 9 months ago by jetstream.
fedora-docs/ jetstream/quick-docs master  into  master

file modified
+2
@@ -71,10 +71,12 @@ 

  ** xref:upgrading-fedora-online.adoc[Upgrading Fedora using package manager]

  

  * xref:kernel/overview.adoc[Kernel and booting]

+ ** xref:kernel/booting.adoc[Booting]

  ** xref:kernel/troubleshooting.adoc[Troubleshooting]

  ** xref:kernel/build-custom-kernel.adoc[Building a Custom Kernel]

  ** xref:kernel/howto-kernel-testday.adoc[Guide for Kernel Test Days]

  ** xref:debug-dracut-problems.adoc[How to debug Dracut problems]

+ ** xref:kernel/installing-koji-kernel.adoc[Installing a kernel from Koji]

  

  * Virtualization

  ** xref:getting-started-with-virtualization.adoc[Getting started with virtualization (libvirt)]

@@ -0,0 +1,44 @@ 

+ [[booting_specific_kernel_default]]

+ == Setting an installed kernel to boot by default

+ 

+ To set a specific installed kernel to boot by default, first check the kernels installed on the system.

+ 

+ ----

+ sudo ls /boot | grep vmlinuz

+ ----

+ 

+ Identify the kernel to be set to boot by default.

+ 

+ Use the following command to set the default kernel to boot:

+ 

+ ----

+ sudo grubby --set-default /boot/vmlinuz-<version>.<release>.<arch>

+ ----

+ 

+ Here is a sample output (on an `x84_64` architecture system):

+ 

+ ----

+ sudo ls /boot | grep vmlinuz

+ 

+ vmlinuz-0-rescue-c722f5f7d614446b99c39b846c2bb76c

+ vmlinuz-5.12.18-200.fc33.x86_64

+ vmlinuz-5.8.15-301.fc33.x86_64

+ ----

+ 

+ If `vmlinuz-<version>.<release>.<arch>` is chosen to be set as the default, we issue the following command:

+ 

+ ----

+ sudo grubby --set-default /boot/vmlinuz-<version>.<release>.<arch>

+ ----

+ 

+ For the above scenario, the command will look like so

+ 

+ ----

+ sudo grubby --set-default /boot/vmlinuz-5.12.18-200.fc33.x86_64

+ ----

+ 

+ 

+ [[sect-references]]

+ === References:

+ 

+ * https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/kernel-module-driver-configuration/Working_with_the_GRUB_2_Boot_Loader/[Fedora Rawhide Docs :: Working with the GRUB 2 Boot Loader]

@@ -112,6 +112,7 @@ 

  

  If you use a GUI update application which does not allow you to specify packages to exclude when they run, this method can be used.

  

+ [[sect-using-dnf-plugin]]

  === Using the DNF Versionlock plugin

  

  You can also use the DNF `versionlock` plugin to limit the packages that are included in a transaction.

@@ -0,0 +1,4 @@ 

+ Booting

Is this heading required? The include has its own heading (and it's about changing the default not just "booting" in general?

+ =======

+ 

+ include::{partialsdir}/proc_booting-specific-kernel-default.adoc[]

@@ -0,0 +1,79 @@ 

+ = Installing kernel from Koji

+ 

+ :description: A quick guide on installing a kernel from the Koji repository.

+ 

+ Koji is the build system Fedora developers use to build software for inclusion into Fedora. 

+ If there is a need to install a kernel that is not currently available in the Fedora repositories, 

+ these can be obtained from the Koji repository.

+ 

+ == Check Koji (Fedora build system) for archived builds

+ 

+ Check the https://koji.fedoraproject.org/koji/search?match=glob&type=build&terms=kernel-*[Koji] archive for the historical builds.

+ It is possible to use different searches or expressions to help narrow down on a specific kernel build.

+ Once the specific kernel has been identified, there are several ways to download and install it.

+ 

+ == Download using the browser and install

+ 

+ One way is to download the identified packages using the browser and installing them.

+ 

+ Download the following package rpms for a specific kernel version into a directory 

+ (best to create a new directory and just have the downloaded rpms in it.:

+ 

+ ----

+ kernel-<version>.<release>.<arch>.rpm

+ kernel-core-<version>.<release>.<arch>.rpm

+ kernel-modules-<version>.<release>.<arch>.rpm

+ ----

+ 

+ then, open a command prompt and change to this directory.

+ Execute the command to install the kernel:

+ 

+ ----

+ sudo dnf install *

+ ----

+ 

+ == Download and install a kernel using the koji client

+ 

+ === Install the koji client

+ 

+ The koji client makes the process of installing a specific kernel much easier from the command line. 

+ Use this command to install the client:

+ 

+     $ sudo dnf install koji

+ 

+ === Download and install the kernel

+ 

+ Below is a one-line command that creates a new unique temporary directory, 

+ downloads kernel RPMs to it and installs them. 

+ This assumes we are working with the `x86_64` architecture.

+ 

+     cd $(mktemp -d) \

+       && koji download-build --arch=x86_64 --arch=noarch kernel-n.nn.nn-nnn.fcnn \

+       && sudo dnf install *

+ 

+ This eliminates the need to clean up after installation and the risk of installing unwanted rpms accidentally.

+ 

+ The following part of the above command downloads the kernel 

+ and its dependencies for the given architecture and kernel version.

+ 

+     koji download-build --arch=[arch] kernel-<version>.<release>

+ 

+ where [arch] indicates the architecture i.e. `x86_64`

+ 

+ == Additional Steps:

+ 

+ The following additional steps are often useful:

+ 

+ * Set the default boot option - so this boots automatically subsequently

+ 

+ See xref:kernel/booting.adoc[quick-doc on setting a specific kernel to boot by default]

+ 

+ * Add a versionlock to ensure this version is not deleted when kernel updates are installed

+ 

+ See xref:dnf.adoc#sect-using-dnf-plugin[quick-doc on using the dnf versionlock plugin]

+ 

+ [[sect-references]]

+ == References

+ 

+ . https://fedoramagazine.org/install-kernel-koji/#comment-472889[Fedora Magazine article: How to install a kernel from koji]

+ 

Added the following changes:

  • quickdoc for installing kernel from Koji
  • booting page and HowTo for booting a specific kernel by default

Could you add an example here please? I mean show the output of ls /boot on your machine, and then what the command should be? (These docs are for users who will not be techies and so we need explicit instructions with examples to make sure they can follow steps). Also: does the command always need the x86_64 suffix, and is /boot the correct place for UEFI boots also?

I'd remove the Fedora 23 guide. Even if it's relevant, that version of Fedora is long gone and we don't want users to be looking at other information there assuming everything there still applies :/

Is this heading required? The include has its own heading (and it's about changing the default not just "booting" in general?

"If there is a need to install a kernel that is not currently available in the Fedora repositories"?

So, one needs to first check if a kernel with this NVR was actually ever built for Fedora, by going to the Koji web interface.

I think it'll be good to give two methods here: one by going to the koji web interface, finding the necessary build, and then downloading files using the browser; and then the second can be this cli based method which is for more advanced users.

I think it's best to use <version>-<release> instead of n.nn and so on everywhere. That way the command is self explanatory?

Metadata Update from @ankursinha:
- Request assigned

9 months ago

Metadata Update from @ankursinha:
- Pull-request tagged with: improvement, needs changes

9 months ago

Thanks very much for this @jetstream . I've done a first round of review here now ^

Could you add an example here please? I mean show the output of ls /boot on your machine, and then what the command should be? (These docs are for users who will not be techies and so we need explicit instructions with examples to make sure they can follow steps). Also: does the command always need the x86_64 suffix, and is /boot the correct place for UEFI boots also?

Sure. Adding an example in the next push.

I reckon it can be generalised to <arch>. Including the change in the next update.

AFAIK, kernels are located in /boot by default (for BIOS as well as UEFI systems)

Is this heading required? The include has its own heading (and it's about changing the default not just "booting" in general?

I was trying to align the addition to the existing structure. Here's my understanding.

Introduced a page for Booting (hence the heading Booting) under the section Kernel and Booting. This page has one include (for booting a kernel by default) for now. Any additional quick-docs on booting could be added as includes to this page.

Is that moving away from the current layout?

"If there is a need to install a kernel that is not currently available in the Fedora repositories"?

Not sure I understood. Did you want me to change the wording to the sentence you suggested? I thought Koji is a Fedora repository.

"If there is a need to install a kernel that is not currently available in the Fedora repositories"?

Not sure I understood. Did you want me to change the wording to the sentence you suggested? I thought Koji is a Fedora repository.

Yes please. Koji is not a repository, it's the build system which archives a certain number of old builds. The repositories only include a version of software that was released with a new Fedora release in the fedora repository, and then another version in the updates repository---they won't contain all the different update versions that may be available on koji. dnf does not speak to koji, it only knows of the repositories.

Is this heading required? The include has its own heading (and it's about changing the default not just "booting" in general?

I was trying to align the addition to the existing structure. Here's my understanding.

Introduced a page for Booting (hence the heading Booting) under the section Kernel and Booting. This page has one include (for booting a kernel by default) for now. Any additional quick-docs on booting could be added as includes to this page.

Is that moving away from the current layout?

Let's leave this as is for the time being, it can be easily tweaked later.

Please drop a comment when you've made more changes. Thanks again

1 new commit added

  • Updates to resolve review comments.
6 months ago

Apologies for the delay, @ankursinha I have made the changes and pushed another commit. Please can you have a look when you get a chance?

Sure thing, on my list to do this week :thumbsup:

Looks great now. Merging! Thanks!

Pull-Request has been merged by ankursinha

6 months ago

I've also added you to the quick-doc committers group now. Please feel free to review other tickets and so on :)