From 7c3713ddcbe283c9a2f2e05e7b77b2d721daa627 Mon Sep 17 00:00:00 2001 From: JetStream Date: Oct 12 2021 00:32:49 +0000 Subject: [PATCH 1/2] Installing Koji kernel. Booting specific kernel by default. Added the following changes: - quickdoc for installing kernel from Koji - booting page and HowTo for booting a specific kernel by default --- diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index 16c5376..1859a25 100644 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -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)] diff --git a/modules/ROOT/pages/_partials/proc_booting-specific-kernel-default.adoc b/modules/ROOT/pages/_partials/proc_booting-specific-kernel-default.adoc new file mode 100644 index 0000000..2a573f1 --- /dev/null +++ b/modules/ROOT/pages/_partials/proc_booting-specific-kernel-default.adoc @@ -0,0 +1,16 @@ +[[booting_specific_kernel_default]] +== Setting an installed kernel to boot by default + +To set a specific installed kernel to boot by default, use the following command + +---- +sudo grubby --set-default /boot/vmlinuz-n.nn.nn-nnn.fcnn.x86_64 +---- + +where `vmlinuz-n.nn.nn-nnn.fcnn` is the version of installed kernel as can be found in the `/boot` directory. + +[[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] +* https://docs.fedoraproject.org/en-US/Fedora/23/html/System_Administrators_Guide/sec-Configuring_GRUB_2_Using_the_grubby_Tool.html[Using the grubby tool] diff --git a/modules/ROOT/pages/dnf.adoc b/modules/ROOT/pages/dnf.adoc index 4a1e363..e72978c 100644 --- a/modules/ROOT/pages/dnf.adoc +++ b/modules/ROOT/pages/dnf.adoc @@ -112,6 +112,7 @@ If you have used this configuration, you can disable it in individual DNF comman 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. diff --git a/modules/ROOT/pages/kernel/booting.adoc b/modules/ROOT/pages/kernel/booting.adoc new file mode 100644 index 0000000..8c10cc9 --- /dev/null +++ b/modules/ROOT/pages/kernel/booting.adoc @@ -0,0 +1,4 @@ +Booting +======= + +include::{partialsdir}/proc_booting-specific-kernel-default.adoc[] diff --git a/modules/ROOT/pages/kernel/installing-koji-kernel.adoc b/modules/ROOT/pages/kernel/installing-koji-kernel.adoc new file mode 100644 index 0000000..0fd93ec --- /dev/null +++ b/modules/ROOT/pages/kernel/installing-koji-kernel.adoc @@ -0,0 +1,45 @@ += 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 different from the one that gets installed by default, these can be obtained from the Koji repository. + +== Install the koji package + +The koji package makes this process much easier. Let's install the package: + + $ 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-n.nn.nn-nnn.fcnn + +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] + From 4aa7a35aa64f29fb632a99cefb3c3df685a22da9 Mon Sep 17 00:00:00 2001 From: JetStream Date: Jan 08 2022 03:49:47 +0000 Subject: [PATCH 2/2] Updates to resolve review comments. --- diff --git a/modules/ROOT/pages/_partials/proc_booting-specific-kernel-default.adoc b/modules/ROOT/pages/_partials/proc_booting-specific-kernel-default.adoc index 2a573f1..6985fa0 100644 --- a/modules/ROOT/pages/_partials/proc_booting-specific-kernel-default.adoc +++ b/modules/ROOT/pages/_partials/proc_booting-specific-kernel-default.adoc @@ -1,16 +1,44 @@ [[booting_specific_kernel_default]] == Setting an installed kernel to boot by default -To set a specific installed kernel to boot by default, use the following command +To set a specific installed kernel to boot by default, first check the kernels installed on the system. ---- -sudo grubby --set-default /boot/vmlinuz-n.nn.nn-nnn.fcnn.x86_64 +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-.. +---- + +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-..` is chosen to be set as the default, we issue the following command: + +---- +sudo grubby --set-default /boot/vmlinuz-.. +---- + +For the above scenario, the command will look like so + +---- +sudo grubby --set-default /boot/vmlinuz-5.12.18-200.fc33.x86_64 ---- -where `vmlinuz-n.nn.nn-nnn.fcnn` is the version of installed kernel as can be found in the `/boot` directory. [[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] -* https://docs.fedoraproject.org/en-US/Fedora/23/html/System_Administrators_Guide/sec-Configuring_GRUB_2_Using_the_grubby_Tool.html[Using the grubby tool] diff --git a/modules/ROOT/pages/kernel/installing-koji-kernel.adoc b/modules/ROOT/pages/kernel/installing-koji-kernel.adoc index 0fd93ec..e5108b3 100644 --- a/modules/ROOT/pages/kernel/installing-koji-kernel.adoc +++ b/modules/ROOT/pages/kernel/installing-koji-kernel.adoc @@ -2,17 +2,50 @@ :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 different from the one that gets installed by default, these can be obtained 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. -== Install the koji package +== Check Koji (Fedora build system) for archived builds -The koji package makes this process much easier. Let's install the package: +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-...rpm +kernel-core-...rpm +kernel-modules-...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 +=== 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. +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 \ @@ -20,9 +53,10 @@ Below is a one-line command that creates a new unique temporary directory, downl 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. +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-n.nn.nn-nnn.fcnn + koji download-build --arch=[arch] kernel-. where [arch] indicates the architecture i.e. `x86_64`