Modifying the Kernel
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:
wget http://patches.aircrack-ng.org/mac80211.compat08082009.wl_frag+ack_v1.patch patch -p1 < mac80211.compat08082009.wl_frag+ack_v1.patch
Other patches are HID patches for keyboard support and CDROM patch.
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:
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:
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:
Navigate to Device Drivers -> Network Device Support -> Wireless LAN and make the following selections:
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:
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.