Patching the Kernel

We will continue from the Porting NetHunter page and work on the Google Nexus 6P kernel as an example. The idea stays the same though.

Patching

By default, we apply Wi-Fi injection patches and patches that add Wi-Fi drivers. Kernel versions below 4.x will require HID keyboard / mouse patches. Some devices need additional patches to avoid build errors. We no longer need CD-ROM patches as all modern operating systems support being installed from USB storage devices, thus we can mount NetHunter as USB drive.

In the Kernel-Builder, choose “Apply NetHunter kernel patches”:

Navigate to the directory that closest resembles your kernel version:

And apply each applicable patch:

We recommend that you work in another terminal window in parallel and commit the changes to the kernel source after having applied each patch.

Every device’s kernel is different. If the above patches fail, you can try to patch by hand. Even if the patches fail, the sources can be quite similar, so patching manually is possible in most cases. If you succeed, feel free to add your patch to the kernel builder’s repo.


Updated on: 2024-Oct-22
Author: re4son