Hi,

First of all a thanks to anyone who lends a hand on this one!!

I am trying to compile drivers for a chrooted (Kali Linux) environment on a Galaxy Tab2 (P5100) as well as other devices. I seem to have hit a stumbling block as the information on building kernel source with imported drivers seems to be sparse and I have cobbled together bits and pieces from multiple forums however no success! If I manage to successfully complete this insane task I play to fully document the process as a guide here and on a blog.

I will lay out the stages below from where I am at.

Tablet = Samsung Galaxy Tab 2 - P5100 Model
ROM: CyanogenMod 10.1.3-p5100
Device: USB Alfa AWUS036H (RTL8187L driver)
Development Environment: Ubuntu 12.04 64 bit

I have successfully configured a Kali Linux Chrooted Environment

Commands issued on ubuntu to compile the drivers, please tell me where I am going wrong:

##Install agcc compilers and tools
cd /tmp
wget https://neurodroid.googlecode.com/git/nrn/agcc
wget https://neurodroid.googlecode.com/git/nrn/agcc-vfp
sudo mv agcc* /usr/local/bin
sudo chmod +x /usr/local/bin/agcc*
sudo apt-get install vim vim-common make cmake lzop gcc git python

##SDK & NDK Tools installed at ~/android-adt/ndk & ~/android-adt/sdk
##Update the build path with the SDK and NDK tools
PATH=~/android-adt/sdk/platform-tools:~/android-adt/sdk/tools:~/android-adt/ndk:$PATH
cd ~/android-adt/ndk/build/tools

#remove any previously built toolchain
rm -rf ${HOME}/android-toolchain
#create new toolchain for android 4.2
./make-standalone-toolchain.sh --arch=arm --ndk-dir=${HOME}/android-adt/ndk --install-dir=${HOME}/android-toolchain --platform=android-17 --system=linux-x86_64
PATH=~/android-toolchain/bin:$PATH

##Get the kernel for the ROM (Galaxy Tab 2 p5100, cyanmodgen 10.2)
cd ~
git clone https://github.com/CyanogenMod/andro...espresso10.git

##Modify the make file in the kernel
cd android_kernel_samsung_espresso10
nano Makefile
##Change the CFLAGS_MODULE line and add -fno-pic

##Compile the kernel source
make ARCH=arm clean
make ARCH=arm cyanogenmod_p5100_defconfig
make -j4 ARCH=arm CROSS_COMPILE=arm-linux-androideabi-

Now this is as far as I seem to be able to get without any errors, some warning however! The last step does produce the zImage but I want the *.ko drivers for RTL8187

So what is the next step? Download the source drivers from Realtek copy them too ~/android_kernel_samsung_espresso10/drivers/net/wireless? then what?

Any help would be greatly appreciated!!

Thanks

Gazos