It's the same as any Linux kernel compile, assuming you've ever done that. Everything is command line in Linux (Kali is recommended, I did mine on Ubuntu 5.10)
General starting point for nethunter is here:
https://github.com/offensive-securit...ing-the-Kernel
Use Git to pull a kernel source - I used BinkyBear's ElementalX 5 (
https://github.com/binkybear/flo/tree/ElementalX-5.00). Git on linux is easy -
git clone
https://github.com/binkbear/flo.git -b ElementalX-5.00
Then follow the directions on the first link to set up your development environment. Mostly a compiler, some libraries, and environment variables.
Run "make kali_defconfig" to setup the initial config. Then you can modify it two different ways
1) Run "make menuconfig" for a GUI. Navigate (arrow keys up and down, enter to follow a menu, space to select an option) to the options and select them, then save the new .config.
2) Open ".config" with your text editor of choice and change "is not configured" to "=y" for the two options.
Then run "make", and let the kernel compile. You will get a file called "zImage" in arch/arm/boot.
There might be a better way to install the kernel, but what
I did is clone the new installer from Offensive Security (
https://github.com/offensive-securit...ewinstaller-fj)
git clone
https://github.com/offensive-security/kali-nethunter -b newinstaller-fj
Go into that directory, then Anykernel2/kernels/[android version]/flo and copy the new zImage from your kernel compile into it.
In the Anykernel2 directory, run
python build.py -d flo --[android version] -k
You will get a Zip file called something like "kernel-nethunter-flo-...-.zip". Copy it to your device and install with TWRP.
Keep in mind that this install method is based off of a Git repo that isn't officially released yet, so while it worked for me YMMV.