Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1

allow multiple kernel versions to be compiled and tailored for different
functions: You just change the symbolic link to the kernel directory you want
to work on.


CAUTION
The correct symbolic link is critical to the operation of make. Always have
the symbolic link point to the version of the kernel sources you are working
with.

Patching the Kernel


It is possible to patch a kernel to the newest Linux kernel version as opposed
to downloading the entire source code. This choice can be beneficial for those
who are not using a high-speed broadband connection. Whether you are
patching existing sources or downloading the full source, the end results are
identical.


Patching the kernel is not a mindless task. It requires the user to retrieve all
patches from the current version to the version the user wants to upgrade to.
For example, if you are currently running 4.15.1 (and have those sources)
and want to upgrade to 4.15.3, you must retrieve the 4.15.2 and
4.15.3 patch sets, and so on. After you download these patches, you must
apply them in succession to upgrade to 4.15.3. This is more tedious than
downloading the entire source, but it’s useful for those who keep up with
kernel hacking and want to perform incremental upgrades to keep their Linux
kernel as up-to-date as possible.


To patch up to several versions in a single operation, you can use the patch-
kernel script located in the kernel source directory for the kernel version
you currently use. This script applies all necessary version patches to bring
your kernel up to the latest version.


The format for using the patch-kernel script looks like this:


Click here to view code image
patch-kernel source_dir patch_dir stopversion


The source directory defaults to /usr/src/linux if none is given, and
patch_dir defaults to the current working directory if one is not supplied.


For example, assume that you have a 4.15.1 kernel code tree that needs to
be patched to the 4.15.3 version. The 4.15.2 and 4.15.3 patch files
have been downloaded and placed in the /patch directory in the source tree.

Free download pdf