New script to compile TP-Link TL-WN725N version 2 lwfinger driver in Raspbian

Eneko
enekochan
Published in
2 min readMar 8, 2014

This script overrides the old “Compile and install driver for TP-Link TL-WN725N version 2 in Raspbian”.

I’ve tried it with 3.10.33+ and worked perfectly but it failed for 3.10.24+ (I got the usual “ERROR: could not insert '8188eu': Exec format error"). It would be nice if people could give me their results for different kernel versions.

#!/bin/bash

# Get linux source code, prepare config files and create symlinks
VERSION=`uname -r | awk -F'.' '{print $1"."$2}'`
cd ~
wget https://codeload.github.com/raspberrypi/linux/tar.gz/rpi-${VERSION}.y -O rpi-${VERSION}.y.tar.gz
sudo tar zxf rpi-${VERSION}.y.tar.gz -C /usr/src/
cd /usr/src/linux-rpi-${VERSION}.y/
sudo bash -c "zcat /proc/config.gz > /usr/src/linux-rpi-${VERSION}.y/.config"
# In the next step you may be prompted questions about the configuration
# if your /proc/config.gz does not answer them (new features for example)
sudo make oldconfig
sudo make modules_prepare
sudo wget https://github.com/raspberrypi/firmware/raw/master/extra/Module.symvers
sudo ln -s /usr/src/linux-rpi-${VERSION}.y /lib/modules/`uname -r`/source
sudo ln -s /usr/src/linux-rpi-${VERSION}.y /lib/modules/`uname -r`/build
# Optional
#sudo ln -s /usr/src/linux-rpi-${VERSION}.y /usr/src/linux-`uname -r`
#sudo ln -s /usr/src/linux-rpi-${VERSION}.y /usr/src/linux

# Get driver source, compile, install and load it
cd ~
git clone https://github.com/lwfinger/rtl8188eu.git
cd rtl8188eu
# This wil take around 20 minutes
make all
sudo make install
# After this step you should have those new files installed:
# /lib/modules/`uname -r`/kernel/drivers/net/wireless/8188eu.ko
# /lib/firmware/rtlwifi/rtl8188eufw.bin
sudo modprobe 8188eu

# Remove driver and linux source code to recover some space (around 700MB)
# Leave those lines commented if you want to keep the code for future compilations
#sudo rm /lib/modules/`uname -r`/source
#sudo rm /lib/modules/`uname -r`/build
#sudo rm /usr/src/linux-`uname -r`
#sudo rm /usr/src/linux
#sudo rm -R /usr/src/linux-rpi-${VERSION}.y
#cd ~
#rm rpi-${VERSION}.y.tar.gz
#rm -R rtl8188eu

Ref: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=71&t=17666&p=179845

--

--