Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Get linux source code, prepare config files and create symlinks
- VERSION=`uname -r | awk -F'.' '{print $1"."$2}'`
- cd /usr/src
- 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/rpi-dev/linux-rpi-${VERSION}.y/
- sudo bash -c "zcat /proc/config.gz > /usr/src/rpi-dev/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/rpi-dev/linux-`uname -r`
- sudo ln -s /usr/src/linux-rpi-${VERSION}.y /usr/src/rpi-dev/linux
- # Get driver source, compile, install and load it
- cd /usr/src/
- 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 -rf /usr/src/linux-rpi-${VERSION}.y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement