Building a custom kernel in Manjaro Linux
By default kernels in Manjaro are built without support for AppArmor, Audit etc. After some research and reading Manjaro forums I came up with the following instruction on how to build and install your own kernel and overcome possible problems with network :)
During the instruction I use a native for Majnaro way to build a kernel i.e. with the use of its package manager. So let’s clone a skeleton of a package. For example, Linux 4.17
$ git clone https://gitlab.manjaro.org/packages/core/linux417.git
Then to overcome possible problems with network we need to clone a package for Realtek 8168 adapter — I’ve got the one and I had these issues.
$ git clone https://gitlab.manjaro.org/packages/extra/linux417-extramodules/r8168.git
We’ll use it a bit later. Now get back to the linux417 folder, modify the following configuration file:
config.x86_64
Update the checksums:
$ updpkgsums
Build the kernel package:
$ makepkg -s
Install the kernel packages
$ sudo pacman -U ./linux417-4.17.19-1-x86_64.pkg.tar.xz ./linux417-headers-4.17.19-1-x86_64.pkg.tar.xz
After that don’t restart your PC, you need to build and install those r8168 module. So go to the corresponding folder and run
$ makepkg -s
And then install the module
$ sudo pacman -U ./r8168-8.045.08.tar.gz
Now you can reboot your PC and enjoy the fresh kernel :)