[Android Q&A, Help & Troubleshooting] joelstitch:
I have experience flashing ROMS and so for a long time but have never death with building a kernel. I have read a lot and watched a few videos but I am getting a few questions that I don't understand and I would appreciate help so I can build and share this kernel with OnePlus 7 Pro users who want to use NetHunter.

These are the guides Iv'e been following:

https://www.youtube.com/watch?v=6-oKLou69WM

https://github.com/offensive-security/kali-nethunter/wiki/Porting-Nethunter

https://github.com/offensive-security/kali-nethunter/wiki/Modifying-the-Kernel

Here is what I've done:

1) I downloaded the stock kernel android_kernel_oneplus_sm8150-oneplus-SM8150_P_9.0

2) Download the toolchain:

rw@rw:~/Desktop/android/nethunter/kernel$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 -b pie-release toolchain64
Cloning into 'toolchain64'...
remote: Sending approximately 314.71 MiB ...
remote: Counting objects: 662, done
remote: Total 3579 (delta 2027), reused 3579 (delta 2027)
Receiving objects: 100% (3579/3579), 314.71 MiB | 1.21 MiB/s, done.
Resolving deltas: 100% (2027/2027), done.
Checking out files: 100% (268/268), done.
rw@rw:~/Desktop/android/nethunter/kernel$ export ARCH=arm64
rw@rw:~/Desktop/android/nethunter/kernel$ export SUBARCH=arm64
rw@rw:~/Desktop/android/nethunter/kernel$ export CROSS_COMPILE=`pwd`/toolchain64/bin/aarch64-linux-android-

3) Patch mac80211

rw@rw:~/Desktop/android/nethunter/kernel$ wget http://patches.aircrack-ng.org/mac80211.compat08082009.wl_frag+ack_v1.patch
--2019-07-17 23:21:34-- http://patches.aircrack-ng.org/mac80211.compat08082009.wl_frag+ack_v1.patch
Resolving patches.aircrack-ng.org (patches.aircrack-ng.org)... 213.186.33.69
Connecting to patches.aircrack-ng.org (patches.aircrack-ng.org)|213.186.33.69|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1049 (1.0K)
Saving to: ‘mac80211.compat08082009.wl_frag+ack_v1.patch’

mac80211.compat0808 100%[===================>] 1.02K --.-KB/s in 0.001s

2019-07-17 23:21:34 (1.07 MB/s) - ‘mac80211.compat08082009.wl_frag+ack_v1.patch’ saved [1049/1049]

rw@rw:~/Desktop/android/nethunter/kernel$ patch -p1 < mac80211.compat08082009.wl_frag+ack_v1.patch
patching file net/mac80211/tx.c
Hunk #1 succeeded at 803 (offset 126 lines).

4) This is one of the parts where I get errors. Making the defconfig file. For starters, I have 3 different defconfig files in the arch/arch64/configs folder. defconfig, misc_debug_defconfig and ranchu64_defconfig. I'm gonna go with the one named defconfig but I get errors with all of them. This is what I get:

rw@rw:~/Desktop/android/nethunter/kernel$ make defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
*** Default configuration is based on 'defconfig'
drivers/input/touchscreen/oneplus_touchscreen/Kconfig:52:warning: ignoring unsup'orted character '
drivers/input/touchscreen/oneplus_touchscreen/Kconfig:52:warning: ignoring unsup'orted character '
drivers/input/touchscreen/oneplus_touchscreen/Kconfig:52:warning: ignoring unsup'orted character '
drivers/input/touchscreen/oneplus_touchscreen/Kconfig:52:warning: ignoring unsup'orted character '
drivers/input/touchscreen/oneplus_touchscreen/Kconfig:55:warning: ignoring unsup'orted character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:2:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:2:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:2:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S3508/Kconfig:4:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S3508/Kconfig:6:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S3508/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S3508/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:3:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:3:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:3:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S3320/Kconfig:4:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S3320/Kconfig:6:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S3320/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S3320/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:4:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:4:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:4:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S3706/Kconfig:4:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S3706/Kconfig:6:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S3706/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S3706/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:5:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:5:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:5:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S4322/Kconfig:4:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S4322/Kconfig:6:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S4322/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S4322/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S4322/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:6:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/TD4310/Kconfig:1:warning' ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/TD4310/Kconfig:2:warning' ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/TD4310/Kconfig:3:warning' ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/TD4310/Kconfig:4:warning' ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/TD4310/Kconfig:4:warning' ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:7:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:8:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:8:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/Kconfig:8:warning: ignor'ng unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S1302_virtal_key/Kconfig'4:warning: ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S1302_virtal_key/Kconfig'6:warning: ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Synaptics/S1302_virtal_key/Kconfig'7:warning: ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Kconfig:59:warning: ignoring unsup'orted character '
drivers/input/touchscreen/oneplus_touchscreen/Goodix/Kconfig:2:warning: ignoring'unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Goodix/Kconfig:3:warning: ignoring'unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Kconfig:63:warning: ignoring unsup'orted character '
drivers/input/touchscreen/oneplus_touchscreen/Focal/Kconfig:2:warning: ignoring 'nsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Focal/Kconfig:2:warning: ignoring 'nsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Focal/Kconfig:2:warning: ignoring 'nsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Focal/FT8006/Kconfig:4:warning: ig'oring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Focal/FT8006/Kconfig:6:warning: ig'oring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Focal/FT8006/Kconfig:7:warning: ig'oring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Focal/FT8006/Kconfig:7:warning: ig'oring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Focal/FT8006/Kconfig:7:warning: ig'oring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Focal/FT8006/Kconfig:7:warning: ig'oring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Kconfig:67:warning: ignoring unsup'orted character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/Kconfig:2:warning: ignorin' unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/Kconfig:2:warning: ignorin' unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/Kconfig:2:warning: ignorin' unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36672/Kconfig:4:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36672/Kconfig:6:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36672/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36672/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36672/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/Kconfig:3:warning: ignorin' unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/Kconfig:3:warning: ignorin' unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/Kconfig:3:warning: ignorin' unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36525/Kconfig:4:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36525/Kconfig:6:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36525/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36525/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36525/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/Kconfig:4:warning: ignorin' unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/Kconfig:4:warning: ignorin' unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/Kconfig:4:warning: ignorin' unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36672_noflash/Kconfig:4:'arning: ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36672_noflash/Kconfig:6:'arning: ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36672_noflash/Kconfig:7:'arning: ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36672_noflash/Kconfig:7:'arning: ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36672_noflash/Kconfig:7:'arning: ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36672_noflash/Kconfig:11'warning: ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36672_noflash/Kconfig:13'warning: ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36672_noflash/Kconfig:14'warning: ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36672_noflash/Kconfig:14'warning: ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Novatek/NT36672_noflash/Kconfig:14'warning: ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Himax/Kconfig:2:warning: ignoring 'nsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Himax/Kconfig:2:warning: ignoring 'nsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Himax/hx83112b/Kconfig:4:warning: 'gnoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Himax/hx83112b/Kconfig:6:warning: 'gnoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Himax/hx83112b/Kconfig:7:warning: 'gnoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Himax/hx83112b/Kconfig:7:warning: 'gnoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Himax/hx83112b/Kconfig:7:warning: 'gnoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Kconfig:75:warning: ignoring unsup'orted character '
drivers/input/touchscreen/oneplus_touchscreen/Samsung/Kconfig:2:warning: ignorin' unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Samsung/Kconfig:2:warning: ignorin' unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Samsung/Kconfig:2:warning: ignorin' unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Samsung/S6SY761/Kconfig:4:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Samsung/S6SY761/Kconfig:6:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Samsung/S6SY761/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Samsung/S6SY761/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Samsung/S6SY761/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Samsung/S6SY761/Kconfig:7:warning:'ignoring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/Kconfig:79:warning: ignoring unsup'orted character '
drivers/input/touchscreen/oneplus_touchscreen/St/Kconfig:2:warning: ignoring uns'pported character '
drivers/input/touchscreen/oneplus_touchscreen/St/Kconfig:2:warning: ignoring uns'pported character '
drivers/input/touchscreen/oneplus_touchscreen/St/Kconfig:2:warning: ignoring uns'pported character '
drivers/input/touchscreen/oneplus_touchscreen/St/fst1ba90a/Kconfig:4:warning: ig'oring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/St/fst1ba90a/Kconfig:6:warning: ig'oring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/St/fst1ba90a/Kconfig:7:warning: ig'oring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/St/fst1ba90a/Kconfig:7:warning: ig'oring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/St/fst1ba90a/Kconfig:7:warning: ig'oring unsupported character '
drivers/input/touchscreen/oneplus_touchscreen/St/fst1ba90a/Kconfig:7:warning: ig'oring unsupported character '
#
# configuration written to .config

CONTINUE ON POST 2