APC Australia

Patching your kernel

-

As previously mentioned, many distros apply various patches to their kernels. It may be that you need or want to do the same. These patches may be to support additional hardware or to enable extra features. They may not be in the main kernel source because they are too new, have not been sufficient­ly tested or are otherwise unsuitable.

To show how it’s done, we will apply a patch that gives a greater choice of CPU optimisati­ons. Download the ZIP file from github.com/graysky2/kernel_gcc_patch and unpack it. The latest release of the patch requires at least version 4.9 of the GCC compiler being installed. You can check which you have by running gcc -- version . If yours is older, either upgrade or use one of the older versions of the patch from the ZIP file. Copy the patch file to your kernel source directory, cd there and run $ patch - p1 <enable_ additional... .

The -p1 option tells patch to ignore the first level of directorie­s in the patch file. View the file to see what this means. Depending on the source of your patch, you may need to use a different figure here. The patch command will report a file not found if the value is wrong.

Now run make menuconfig and check the options under ‘Processor type and features/Processor family’ and you will see plenty more choices. If you are compiling a kernel to run only on the same machine, or identical hardware, pick the Native Optimisati­ons option and the compiler will determine and use the best optimisati­ons for that system. This will give a better performing kernel that one built to run on all x86- 64 systems, at the expense of portabilit­y.

Newspapers in English

Newspapers from Australia