Solving “WiFi not working” issue after new kernel install on an Android device

Yesterday I managed to successfully install a self-built kernel onto my test Android phone. The major visible issue that cropped up was that of WiFi not working. After going through several blogs, have finally solved the issue :), thanks mainly to a great point mentioned on a geeksphone blog (point no. 9). I’ll summarize the issue and the solution here:

The filesystem present on the Android device contains several kernel modules at the location /system/lib/modules.These may have been compiled using an unknown toolchain (android-ndk or Linaro or Sabermod, etc.). Personally, am using Sabermod-4.7-32bit toolchain, given that I have a 32-bit linux OS installed on my laptop.

This mismatch in toolchains results in the zImage created by our kernel-build, and the several .ko files already present in devices’ /system/lib/modules being incompatible, and thus issues like WiFi not working crop up!

To solve this, copy all the .ko’s generated during our kernel build to the devices /system/lib/modules. This can be achieved through the following steps:

# cd to kernel source directory
cd kernel-src-dir/

#copy all kernel modules from kernel source directory
find . -name '*ko' -exec cp '{}' custom-dir/ \;

#mount the device after plugging it into the USB
adb shell mount -o remount,rw /system
for filename in custom-dir/*
do
  adb push `basename $filename` /system/lib/modules/
done;

#reboot the device
adb reboot

Thats it! Next time you reboot, WiFi should be working as normal with your own new, shiny custom kernel.. Enjoy!!

Advertisements