Category Archives: Raspbian

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

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

TP-Link TL-WN725N

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

Upgrade/Downgrade to a specific firmware-kernel version with rpi-update in Raspbian

You can upgrade/downgrade to any revision of Raspbians firmware using rpi-update. For example if you want to install revision 3.10.25+ you should execute this:

sudo rpi-update 2ef601a50b68eebeeb4dc3c6c525855961891be6

The long string represents the Git hash for the specific firmware revision. You can look for those hash in the rpi-update git repos commits list: https://github.com/Hexxeh/rpi-firmware/commits/master.

Look for the commits having “kernel: bump to 3.X.X” and click the boton on the right:

bump-to

Now you can see the whole hash string in the url:

git-hash

Ref: https://github.com/Hexxeh/rpi-update

Delete backups after rpi-update

After installing rpi-update:

sudo apt-get update
sudo apt-get install rpi-update

And doing an update of the firmware and the kernel with it:

sudo rpi-update

You can delete the backups done by rpi-update (but be sure to test everything is ok rebooting the Raspberry Pi first). In my case I updated from 3.10-3-rpi to 3.10.33+ and those are the commands I used:

sudo rm -R /boot.bak
sudo rm -R /lib/modules.bak
sudo rm -R /lib/modules/3.10-3-rpi

Ref: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=27&t=28434
https://github.com/Hexxeh/rpi-update

Larger fonts for XBMC in Raspbian

Edit the file /usr/share/xbmc/addons/skin.confluence/720p/Font.xml and add the following code inside the <fonts> block:

    <fontset id="Massive" idloc="31393" unicode="true"> 
    <!-- Normal Fonts -->
        <font>
            <name>font10</name>
            <filename>Roboto-Regular.ttf</filename>
            <size>14</size>
        </font>
        <font>
            <name>font12</name>
            <filename>Roboto-Regular.ttf</filename>
            <size>23</size>
        </font>
        <font>
            <name>font13</name>
            <filename>Roboto-Regular.ttf</filename>
            <size>25</size>
        </font>
        <font>
            <name>font14</name>
            <filename>Roboto-Regular.ttf</filename>
            <size>25</size>
        </font>
        <font>
            <name>font16</name>
            <filename>Roboto-Regular.ttf</filename>
            <size>25</size>
        </font>
        <font>
            <name>font30</name>
            <filename>Roboto-Regular.ttf</filename>
            <size>30</size>
        </font>
        <font>
            <name>fontContextMenu</name>
            <filename>Roboto-Regular.ttf</filename>
            <size>25</size>
        </font>


    <!-- Title Fonts -->
        <font>
            <name>font10_title</name>
            <filename>Roboto-Bold.ttf</filename>
            <size>12</size>
        </font>
        <font>
            <name>font12_title</name>
            <filename>Roboto-Bold.ttf</filename>
            <size>17</size>
        </font>
        <font>
            <name>font13_title</name>
            <filename>Roboto-Bold.ttf</filename>
            <size>20</size>
        </font>
        <font>
            <name>font24_title</name>
            <filename>Roboto-Bold.ttf</filename>
            <size>24</size>
        </font>
        <font>
            <name>font28_title</name>
            <filename>Roboto-Bold.ttf</filename>
            <size>28</size>
        </font>
        <font>
            <name>font30_title</name>
            <filename>Roboto-Bold.ttf</filename>
            <size>30</size>
        </font>
        <font>
            <name>font35_title</name>
            <filename>Roboto-Bold.ttf</filename>
            <size>35</size>
        </font>
        <font>
            <name>font45caps_title</name>
            <filename>Roboto-Bold.ttf</filename>
            <size>45</size>
        </font>
        <font>
            <name>font_MainMenu</name>
            <filename>Roboto-Bold.ttf</filename>
            <style>uppercase</style>
            <size>40</size>
        </font>
        <font>
            <name>WeatherTemp</name>
            <filename>Roboto-Bold.ttf</filename>
            <size>80</size>
        </font>
    </fontset>

To select the newly created fontset go to “System > Settings > Appearance > Skin > Fonts” and change it to the blank value.

Settings.appearance.skin

If you edit the file /usr/share/xbmc/addons/skin.confluence/720p/language/English/strings.po (or the corresponding file to your current language) and add the following code at the end it should appear “Massive” and not a blank text in the fonts option but that didn’t work for me though:

msgctxt "#31911"
msgid "Massive"
msgstr ""

Ref: http://forum.xbmc.org/showthread.php?tid=127671

Add Shutdown option to XBMC in Raspbian

When I installed XBMC in Raspbian I noticed that the shutdown menu only had the “Exit” button, which returned me to the ussual terminal login screen. I want my parents to use this media center so I have to make it as simple as possible.

exit

After some time searching on the net I found the solution. You have to become root (using su, note that if you haven’t yet changed roots password you can do it by running sudo passwd) and create a file named /var/lib/polkit-1/localauthority/50-local.d/xbmc.pkla with those options (in my case I had to change the xbmc user to pi because thats the one that runs XBMC):

[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes

shutdown

If you want to change or remove some of the menu options in the shutdown window just edit the /usr/share/xbmc/addons/skin.confluence/720p/DialogButtonMenu.xml file. There you can change the <visible> option to “no” if you want to hide a button for example.

Ref: http://www.raspberrypi.org/phpBB3/viewtopic.php?p=127003
http://wiki.xbmc.org/index.php?title=HOW-TO:Suspend_and_wake_in_Ubuntu