Modifying the Kernel

We will continue from the Porting NetHunter page and work on the Galaxy Note 3 kernel as an example. The idea stays the same though: replace the defconfig with one that is used by your kernel.

Let’s start fresh:

make clean
make msm8974_sec_defconfig
make menuconfig


By default, we use the mac80211 injection patch. You can apply this patch as follows:

patch -p1 < mac80211.compat08082009.wl_frag+ack_v1.patch

Other patches are HID patches for keyboard support and CDROM patch.

Configure Builds

We are now presented with options to modify the kernel. Since I ran into the Touch Wake problem, I will show how easy it was to remove it. This is what the error looked like:

$ /note3/drivers/misc/touch_wake.c:539: undefined reference to `register_power_suspend'

We can see that it’s located in the drivers/misc folder so it works the same in menuconfig. Go to Device Drivers in the menu then de-select Touch Wake with the spacebar:

Removing touch wake


The first options to check are in General Setup. Check that System V IPC is enabled and feel free to change the hostname to “kali”. Use the spacebar to enable the * next to what you want to enable:

General Setup


Next, we want to enable modules in Enable Loadable Module Support just in case there are any devices we want to load through the command line using modprobe. The correct options look like this:



Networking Support is where we go to enable support for most of the network devices we are adding. Go to Wireless (you may need to de-select some of the modules in the Wireless menu as you don’t want M unless you want to load a module each time your device starts). It should look like this:


While still in Networking Support, navigate to Bluetooth subsystem Support, then Bluetooth Device Drivers. Set the options as shown below:


Navigate to Device Drivers -> Network Device Support -> USB Network Adapters and configure the following options:

USB Ethernet

Wireless LAN

Navigate to Device Drivers -> Network Device Support -> Wireless LAN and make the following selections:

Top Bottom

Atheros RALink


Choose Device Drivers then Multimedia and select the following:

Navigate to Device Drivers -> Multimedia -> DVB/ATSC adapters -> Customize DVB Frontends and ensure the following is selected:


USB Modem - CDC ACM support is required for Proxmark and similar devices

Navigate to Device Drivers -> USB support and select the option “USB Modem (CDC ACM) support”:


USB Gadget support - Generic serial, CDC ACM, CDC ECM, and HID are required for various USB ethernet gadget functions:

Navigate to Device Drivers -> USB support -> USB Gadget Support and select “Ethernet Control Model (CDC ECM)”:


Save and Rebuild

Save your new kernel configuration as .config then start your kernel build using the new config:


If it builds successfully, then we can save the new config file:

cp .config arch/arm/configs/kali_defconfig

In the future, if we need to build/modify a new kernel, we can just do the following:

make clean
make kali_defconfig
make # or if you want to modify make menuconfig

You should now be the proud owner of a new kernel in arch/arm/boot/zImage or arch/arm/boot/zImage-dtb. We prefer to use the -dtb extension if given the choice.