Wiki Raspberry Pi 2

Installation de l'OS : Raspbian

Téléchargez l'image appropriée

Renommer user & group par défaut
$ sudo passwd root 
$ sudo vi /etc/ssh/sshd_config
PermitRootLogin yes
$ sudo service sshd restart
# usermod -l t2fr -d /home/t2fr -m pi
# groupmod --new-name t2fr pi
$ sudo passwd -l root
$ sudo vi /etc/ssh/sshd_config
PermitRootLogin no
$ sudo service sshd restart
Augmentation de la mémoire allouée au GPU

La plateforme est destinée à être un media center et/ou une console de retrograming. Ainsi pour pouvoir profiter des vidéos HD et de l'émulation de la Nintendo 64, il faut augmenter la mémoire allouée au GPU éditant le fichier config.txt :

$ sudo vi /boot/config.txt

et en y ajoutant la ligne suivante :

gpu_mem=256

Installation et configuration du media center : Kodi

Kodi est présent dans les packets Raspbian; pour l'installer il suffit d'entrer les commandes suivantes :

$ sudo apt-get update
$ sudo apt-get install kodi

Afin que Kodi se lance automatiquement au démarrage du système, créer le fichier /lib/systemd/system/kodi.service :

$ sudo vi /lib/systemd/system/kodi.service
[Unit]
Description = Kodi Media Center
After = remote-fs.target network-online.target
Wants = network-online.target

[Service]
User = t2fr
Group = t2fr
Type = simple
ExecStart = /usr/bin/kodi
Restart = on-abort
RestartSec = 5

[Install]
WantedBy = multi-user.target

Ajouter les permissions au compte t2fr :

$ sudo usermod -a -G audio,video,input,dialout,plugdev,netdev,users,cdrom,tty t2fr

Créér le service :

$ sudo systemctl enable kodi.service

Installation et configuration du retrogaming : EmulationStation, RetroArch et ses cores

Il n'y a pas de paquets prévus pour Rasbian, il faut donc compiler les sources.

Installer les dépendances /!\incomplet/!\

sudo apt-get install libasound2-dev git-core

Compiler RetroArch

$ mkdir -p ~/retro/src
$ git clone --depth 1 git://github.com/libretro/RetroArch.git
$ cd RetroArch
$ git clone https://github.com/libretro/common-overlays.git
$ mv common-overlays overlay
$ git clone https://github.com/RetroPie/common-shaders.git rpi
$ mv rpi shaders
$ export CFLAGS="-O2 -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard"
$ export MAKEFLAGS="-j2"
$ ./configure --prefix=/usr --enable-sdl2 --disable-x11 --enable-gles --disable-ffmpeg --disable-sdl --enable-sdl2 --disable-oss --disable-pulse --disable-al --disable-jack --enable-dispmanx --enable-floathard --enable-neon
$ make
$ cp retroarch ~/retro
$ mkdir ~/retro/{shader,assets,overlays}
$ cp -a shader/* ~/retro/shader/
$ cp -a overlays/* ~/retro/overlays/

Compiler ensuite les cores nécessaires pour l'émulation des différentes plateformes :

Compiler ProSystem
$ cd ~/retro/src
$ git clone https://github.com/libretro/prosystem-libretro
$ cd prosystem-libretro/
$ make clean
$ CXXFLAGS="$CXXFLAGS -fsigned-char" make
$ mv prosystem_libretro.so ~/retro
Compiler Genesis-Plus-GX
$ cd ~/retro/src
$ git clone https://github.com/libretro/Genesis-Plus-GX.git
$ cd Genesis-Plus-GX
$ make -f Makefile.libretro clean
$ make -f Makefile.libretro
$ mv genesis_plus_gx_libretro.so ~/retro
Compiler PCSX-ReARMed
$ sudo apt-get install libpng12-dev libx11-dev
$ cd ~/retro/src
$ git clone https://github.com/libretro/pcsx_rearmed.git
$ cd pcsx_rearmed
$ ./configure --platform=libretro
$ make clean
$ make
$ mv libretro.so ~/retro
Compiler Gambatte
$ cd ~/retro/src
$ git clone https://github.com/libretro/gambatte-libretro.git
$ cd gambatte-libretro
$ make -C libgambatte -f Makefile.libretro clean
$ make -C libgambatte -f Makefile.libretro
$ mv gambatte_libretro.so ~/retro
Compiler mGBA
$ cd ~/retro/src
$ git clone https://github.com/libretro/mgba.git
$ cd mgba
$ make -f Makefile.libretro clean
$ make -f Makefile.libretro HAVE_NEON=1
$ mv mgba_libretro.so ~/retro
Compiler Nestopia
$ cd ~/retro/src
$ git clone https://github.com/libretro/nestopia.git
$ cd nestopia
$ make clean
$ make
$ mv nestopia_libretro.so ~/retro
Compiler Snes9x Next
$ cd ~/retro/src
$ git clone https://github.com/libretro/snes9x-next.git
$ cd snes9x-next
$ sed -i "s/CFLAGS += -O3/CFLAGS += -O2/" Makefile.libretro
$ make -f Makefile.libretro clean
$ make -f Makefile.libretro platform=armvneon
$ mv snes9x_next_libretro.so ~/retro
Compiler Mupen64 Plus

Utilisation de la version RetroPie

$ cd ~/retro/src
$ git clone https://github.com/gizmo98/mupen64plus-libretro.git rpi2_fix
$ cd rpi2_fix
$ make clean
$ make platform="rpi2"
$ mv mupen64plus_libretro.so ~/retro

gles2n64rom.conf ?

$ vi ~/.config/retroarch/retroarch-core-options.cfg
mupen64-gfxplugin = "rice"
mupen64-gfxplugin-accuracy = "low"
mupen64-screensize = "640x480"
Compiler Final Burn Alpha libretro
$ cd ~/retro/src
$ git clone https://github.com/libretro/libretro-fba.git
$ cd libretro-fba
$ make -f makefile.libretro clean
$ make -f makefile.libretro platform=rpi2 profile=performance
$ mv fba_libretro.so ~/retro
Compiler Mednafen NGP
$ cd ~/retro/src
$ git clone https://github.com/libretro/beetle-ngp-libretro.git
$ cd 
$ make clean
$ make
$ mv mednafen_ngp_libretro.so ~/retro

Les jeux peuvent déjà être lancé avec la commande ~/retro/retroarch -L CORE_LIB.so /path/to/ROM

Sources :

Avoir une interface graphique plus aboutie grace à EmulationStation

Installer les dépendances

$ sudo apt-get install libsdl2-dev

Compiler les souces

$ cd ~/retro/src
$ git clone https://github.com/Aloshi/EmulationStation
$ cd EmulationStation
$ git checkout unstable
$ cmake -DCMAKE_CXX_COMPILER=g++-4.7 -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/ .
$ mv emulationstation  ~/retro

Lancer EmulationStation pour configurer les controles puis quitter (les fichiers de configuration doivent se générer automatiquement)

$ cd ~/retro/
$ ./emulationstation

Installer un thème pour EmulationStation

$ mkdir -p ~/.emulationstation/themes
$ cd ~/.emulationstation/themes
$ wget http://emulationstation.org/downloads/themes/simple_latest.zip
$ unzip simple_latest.zip
$ rm simple_latest.zip

Configurer es_systems.cfg :

$ vi ~/.emulationstation/es_systems.cfg
<systemList>
    <system>
        <name>arcade</name>
        <fullname>Arcade</fullname>
        <path>~/roms/arcade</path>
        <extension>.zip .ZIP</extension>
        <command>~/retro/retroarch -L ~/retro/fba_libretro.so %ROM%</command>
        <platform>arcade</platform>
        <theme>mame</theme>
    </system>
    <system>
        <name>atari7800</name>
        <fullname>Atari 7800</fullname>
        <path>~/roms/atari7800</path>
        <extension>.a78 .A78</extension>
        <command>~/retro/retroarch -L ~/retro/prosystem_libretro.so %ROM%</command>
        <platform>atari7800</platform>
        <theme>atari7800</theme>
    </system>
    <system>
        <name>dreamcast</name>
        <fullname>Sega Dreamcast</fullname>
        <path>~/roms/dreamcast</path>
        <extension>.cdi .CDI .gdi .GDI</extension>
        <command>~/retro/retroarch -L ~/retro/ %ROM%</command>
        <platform>dreamcast</platform>
        <theme>dreamcast</theme>
    </system>
    <system>
        <name>gamegear</name>
        <fullname>Sega Game Gear</fullname>
        <path>~/roms/gamegear</path>
        <extension>.gg .GG</extension>
        <command>~/retro/retroarch -L ~/retro/genesis_plus_gx_libretro.so %ROM%</command>
        <platform>gamegear</platform>
        <theme>gamegear</theme>
    </system>
    <system>
        <name>gb</name>
        <fullname>Nintendo Game Boy</fullname>
        <path>~/roms/gb</path>
        <extension>.gb .GB</extension>
        <command>~/retro/retroarch -L ~/retro/gambatte_libretro.so %ROM%</command>
        <platform>gb</platform>
        <theme>gb</theme>
    </system>
    <system>
        <name>gba</name>
        <fullname>Nintendo Game Boy Advance</fullname>
        <path>~/roms/gba</path>
        <extension>.gba .GBA</extension>
        <command>~/retro/retroarch -L ~/retro/mgba_libretro.so %ROM%</command>
        <platform>gba</platform>
        <theme>gba</theme>
    </system>
    <system>
        <name>gbc</name>
        <fullname>Nintendo Game Boy Color</fullname>
        <path>~/roms/gbc</path>
        <extension>.gbc .GBC</extension>
        <command>~/retro/retroarch -L ~/retro/gambatte_libretro.so %ROM%</command>
        <platform>gbc</platform>
        <theme>gbc</theme>
    </system>
    <system>
        <name>mastersystem</name>
        <fullname>Sega Master System</fullname>
        <path>~/roms/mastersystem</path>
        <extension>.sms .SMS</extension>
        <command>~/retro/retroarch -L ~/retro/genesis_plus_gx_libretro.so %ROM%</command>
        <platform>mastersystem</platform>
        <theme>mastersystem</theme>
    </system>
    <system>
        <name>megadrive</name>
        <fullname>Sega Mega Drive</fullname>
        <path>~/roms/megadrive</path>
        <extension>.smd .SMD .bin .BIN .gen .GEN .md .MD</extension>
        <command>~/retro/retroarch -L ~/retro/genesis_plus_gx_libretro.so %ROM%</command>
        <platform>genesis,megadrive</platform>
        <theme>megadrive</theme>
    </system>
    <system>
        <name>n64</name>
        <fullname>Nintendo 64</fullname>
        <path>~/roms/n64</path>
        <extension>.z64 .Z64 .n64 .N64 .v64 .V64</extension>
        <command>~/retro/retroarch -L ~/retro/mupen64plus_libretro.so %ROM%</command>
        <platform>n64</platform>
        <theme>n64</theme>
    </system>
    <system>
        <name>neogeo</name>
        <fullname>NeoGeo</fullname>
        <path>~/roms/neogeo</path>
        <extension>.zip .ZIP</extension>
        <command>~/retro/retroarch -L ~/retro/fba_libretro.so %ROM%</command>
        <platform>neogeo</platform>
        <theme>neogeo</theme>
    </system>
    <system>
        <name>nes</name>
        <fullname>Nintendo Entertainment System</fullname>
        <path>~/roms/nes</path>
        <extension>.nes .NES</extension>
        <command>~/retro/retroarch -L ~/retro/nestopia_libretro.so %ROM%</command>
        <platform>nes</platform>
        <theme>nes</theme>
    </system>
    <system>
        <name>ngp</name>
        <fullname>NeoGeo Pocket</fullname>
        <path>~/roms/ngp</path>
        <extension>.ngp .NGP</extension>
        <command>~/retro/retroarch -L ~/retro/mednafen_ngp_libretro.so %ROM%</command>
        <platform>ngpc</platform>
        <theme>ngp</theme>
    </system>
    <system>
        <name>ngpc</name>
        <fullname>NeoGeo Pocket Color</fullname>
        <path>~/roms/ngpc</path>
        <extension>.ngc .NGC</extension>
        <command>~/retro/retroarch -L ~/retro/mednafen_ngp_libretro.so %ROM%</command>
        <platform>ngpc</platform>
        <theme>ngpc</theme>
    </system>
    <system>
        <name>psx</name>
        <fullname>Sony PlaysStation</fullname>
        <path>~/roms/psx</path>
        <extension>.cue .CUE</extension>
        <command>~/retro/retroarch -L ~/retro/libretro.so %ROM%</command>
        <platform>psx</platform>
        <theme>psx</theme>
    </system>
    <system>
        <name>sega32x</name>
        <fullname>Sega 32X</fullname>
        <path>~/roms/sega32x</path>
        <extension>.32x .32X</extension>
        <command>~/retro/retroarch -L ~/retro/genesis_plus_gx_libretro.so %ROM%</command>
        <platform>sega32x</platform>
        <theme>sega32x</theme>
    </system>
    <system>
        <name>snes</name>
        <fullname>Super Nintendo</fullname>
        <path>~/roms/snes</path>
        <extension>.smc .SMC</extension>
        <command>~/retro/retroarch -L ~/retro/snes9x_next_libretro.so %ROM%</command>
        <platform>snes</platform>
        <theme>snes</theme>
    </system>
</systemList>

Sources :

Scraper !

/home/t2fr/retro/scraper \
    -append \
    -mame \
    -rom_dir "/home/t2fr/roms/arcade" \
    -rom_path "/home/t2fr/roms/arcade" \
    -image_dir "/home/t2fr/.emulationstation/downloaded_images/arcade" \
    -image_path "/home/t2fr/.emulationstation/downloaded_images/arcade" \
    -output_file "/home/t2fr/.emulationstation/gamelists/arcade/gamelist.xml" \
    -missing "/home/t2fr/.emulationstation/gamelists/arcade/missing.txt"

#/home/t2fr/retro/scraper \
#   -append \
#   -rom_dir "/home/t2fr/roms/atari7800" \
#   -rom_path "/home/t2fr/roms/atari7800" \
#   -image_dir "/home/t2fr/.emulationstation/downloaded_images/atari7800" \
#   -image_path "/home/t2fr/.emulationstation/downloaded_images/atari7800" \
#   -output_file "/home/t2fr/.emulationstation/gamelists/atari7800/gamelist.xml" \
#   -missing "/home/t2fr/.emulationstation/gamelists/atari7800/missing.txt"

#/home/t2fr/retro/scraper \
#   -append \
#   -rom_dir "/home/t2fr/roms/dreamcast" \
#   -rom_path "/home/t2fr/roms/dreamcast" \
#   -image_dir "/home/t2fr/.emulationstation/downloaded_images/dreamcast" \
#   -image_path "/home/t2fr/.emulationstation/downloaded_images/dreamcast" \
#   -output_file "/home/t2fr/.emulationstation/gamelists/dreamcast/gamelist.xml" \
#   -missing "/home/t2fr/.emulationstation/gamelists/dreamcast/missing.txt"

/home/t2fr/retro/scraper \
    -append \
    -rom_dir "/home/t2fr/roms/gamegear" \
    -rom_path "/home/t2fr/roms/gamegear" \
    -image_dir "/home/t2fr/.emulationstation/downloaded_images/gamegear" \
    -image_path "/home/t2fr/.emulationstation/downloaded_images/gamegear" \
    -output_file "/home/t2fr/.emulationstation/gamelists/gamegear/gamelist.xml" \
    -missing "/home/t2fr/.emulationstation/gamelists/gamegear/missing.txt"

/home/t2fr/retro/scraper \
    -append \
    -rom_dir "/home/t2fr/roms/gb" \
    -rom_path "/home/t2fr/roms/gb" \
    -image_dir "/home/t2fr/.emulationstation/downloaded_images/gb" \
    -image_path "/home/t2fr/.emulationstation/downloaded_images/gb" \
    -output_file "/home/t2fr/.emulationstation/gamelists/gb/gamelist.xml" \
    -missing "/home/t2fr/.emulationstation/gamelists/gb/missing.txt"

/home/t2fr/retro/scraper \
    -append \
    -rom_dir "/home/t2fr/roms/gba" \
    -rom_path "/home/t2fr/roms/gba" \
    -image_dir "/home/t2fr/.emulationstation/downloaded_images/gba" \
    -image_path "/home/t2fr/.emulationstation/downloaded_images/gba" \
    -output_file "/home/t2fr/.emulationstation/gamelists/gba/gamelist.xml" \
    -missing "/home/t2fr/.emulationstation/gamelists/gba/missing.txt"

/home/t2fr/retro/scraper \
    -append \
    -rom_dir "/home/t2fr/roms/gbc" \
    -rom_path "/home/t2fr/roms/gbc" \
    -image_dir "/home/t2fr/.emulationstation/downloaded_images/gbc" \
    -image_path "/home/t2fr/.emulationstation/downloaded_images/gbc" \
    -output_file "/home/t2fr/.emulationstation/gamelists/gbc/gamelist.xml" \
    -missing "/home/t2fr/.emulationstation/gamelists/gbc/missing.txt"

/home/t2fr/retro/scraper \
    -append \
    -rom_dir "/home/t2fr/roms/mastersystem" \
    -rom_path "/home/t2fr/roms/mastersystem" \
    -image_dir "/home/t2fr/.emulationstation/downloaded_images/mastersystem" \
    -image_path "/home/t2fr/.emulationstation/downloaded_images/mastersystem" \
    -output_file "/home/t2fr/.emulationstation/gamelists/mastersystem/gamelist.xml" \
    -missing "/home/t2fr/.emulationstation/gamelists/mastersystem/missing.txt"

/home/t2fr/retro/scraper \
    -append \
    -rom_dir "/home/t2fr/roms/megadrive" \
    -rom_path "/home/t2fr/roms/megadrive" \
    -image_dir "/home/t2fr/.emulationstation/downloaded_images/megadrive" \
    -image_path "/home/t2fr/.emulationstation/downloaded_images/megadrive" \
    -output_file "/home/t2fr/.emulationstation/gamelists/megadrive/gamelist.xml" \
    -missing "/home/t2fr/.emulationstation/gamelists/megadrive/missing.txt"

/home/t2fr/retro/scraper \
    -append \
    -rom_dir "/home/t2fr/roms/n64" \
    -rom_path "/home/t2fr/roms/n64" \
    -image_dir "/home/t2fr/.emulationstation/downloaded_images/n64" \
    -image_path "/home/t2fr/.emulationstation/downloaded_images/n64" \
    -output_file "/home/t2fr/.emulationstation/gamelists/n64/gamelist.xml" \
    -missing "/home/t2fr/.emulationstation/gamelists/n64/missing.txt"

/home/t2fr/retro/scraper \
    -append \
    -mame \
    -rom_dir "/home/t2fr/roms/neogeo" \
    -rom_path "/home/t2fr/roms/neogeo" \
    -image_dir "/home/t2fr/.emulationstation/downloaded_images/neogeo" \
    -image_path "/home/t2fr/.emulationstation/downloaded_images/neogeo" \
    -output_file "/home/t2fr/.emulationstation/gamelists/neogeo/gamelist.xml" \
    -missing "/home/t2fr/.emulationstation/gamelists/neogeo/missing.txt"

/home/t2fr/retro/scraper \
    -append \
    -rom_dir "/home/t2fr/roms/nes" \
    -rom_path "/home/t2fr/roms/nes" \
    -image_dir "/home/t2fr/.emulationstation/downloaded_images/nes" \
    -image_path "/home/t2fr/.emulationstation/downloaded_images/nes" \
    -output_file "/home/t2fr/.emulationstation/gamelists/nes/gamelist.xml" \
    -missing "/home/t2fr/.emulationstation/gamelists/nes/missing.txt"

#/home/t2fr/retro/scraper \
#   -append \
#   -rom_dir "/home/t2fr/roms/ngp" \
#   -rom_path "/home/t2fr/roms/ngp" \
#   -image_dir "/home/t2fr/.emulationstation/downloaded_images/ngp" \
#   -image_path "/home/t2fr/.emulationstation/downloaded_images/ngp" \
#   -output_file "/home/t2fr/.emulationstation/gamelists/ngp/gamelist.xml" \
#   -missing "/home/t2fr/.emulationstation/gamelists/ngp/missing.txt"

#/home/t2fr/retro/scraper \
#   -append \
#   -rom_dir "/home/t2fr/roms/ngpc" \
#   -rom_path "/home/t2fr/roms/ngpc" \
#   -image_dir "/home/t2fr/.emulationstation/downloaded_images/ngpc" \
#   -image_path "/home/t2fr/.emulationstation/downloaded_images/ngpc" \
#   -output_file "/home/t2fr/.emulationstation/gamelists/ngpc/gamelist.xml" \
#   -missing "/home/t2fr/.emulationstation/gamelists/ngpc/missing.txt"

/home/t2fr/retro/scraper \
    -append \
    -rom_dir "/home/t2fr/roms/psx" \
    -rom_path "/home/t2fr/roms/psx" \
    -image_dir "/home/t2fr/.emulationstation/downloaded_images/psx" \
    -image_path "/home/t2fr/.emulationstation/downloaded_images/psx" \
    -output_file "/home/t2fr/.emulationstation/gamelists/psx/gamelist.xml" \
    -missing "/home/t2fr/.emulationstation/gamelists/psx/missing.txt"

/home/t2fr/retro/scraper \
    -append \
    -rom_dir "/home/t2fr/roms/sega32x" \
    -rom_path "/home/t2fr/roms/sega32x" \
    -image_dir "/home/t2fr/.emulationstation/downloaded_images/sega32x" \
    -image_path "/home/t2fr/.emulationstation/downloaded_images/sega32x" \
    -output_file "/home/t2fr/.emulationstation/gamelists/sega32x/gamelist.xml" \
    -missing "/home/t2fr/.emulationstation/gamelists/sega32x/missing.txt"

/home/t2fr/retro/scraper \
    -append \
    -rom_dir "/home/t2fr/roms/snes" \
    -rom_path "/home/t2fr/roms/snes" \
    -image_dir "/home/t2fr/.emulationstation/downloaded_images/snes" \
    -image_path "/home/t2fr/.emulationstation/downloaded_images/snes" \
    -output_file "/home/t2fr/.emulationstation/gamelists/snes/gamelist.xml" \
    -missing "/home/t2fr/.emulationstation/gamelists/snes/missing.txt"

OBSOLETE ?

Installation de Unrar non-free

La plupart des archives présentes sur les réseaux Usenet ou Torrent ne peuvent pas être extraites avec le binaire unrar libre de Raspbian: installer la version non-free.

Naviguer dans l'arborescence et créer le répertoire nécessaire à la construction du paquet :

$ cd ~/utils/src
$ mkdir unrar-nonfree
$ cd unrar-nonfree

Construire les dépendances et compiler le paquet :

$ sudo apt-get build-dep unrar-nonfree
$ sudo apt-get source -b unrar-nonfree

Installer le paquet obtenu :

$ sudo dpkg -i unrar_4.1.4-1_armhf.deb

Installation de NZBGet

Pour télécharger sur Usenet, installer NZBGet. La version de Raspbian ne possède pas l'interface Web: compiler NZBGet depuis les sources. De plus, il nécessite une version "patchée" de libpar2 pour fonctionner correctement sur le Raspberry Pi.

Installer les outils et dépendances nécessaires à la compilation :

$ sudo apt-get install libncurses5-dev sigc++ libpar2-0-dev libssl-dev libgnutls-dev libxml2-dev g++

Naviguer dans l'arborescence, télécharger et extraire les sources :

$ cd ~/utils/src
$ wget http://sourceforge.net/projects/nzbget/files/nzbget-11.0.tar.gz
$ tar xf nzbget-11.0.tar.gz
$ wget http://sourceforge.net/projects/parchive/files/libpar2/0.2/libpar2-0.2.tar.gz
$ tar xf libpar2-0.2.tar.gz

Patcher libpar2 :

$ cd libpar2-0.2
$ cp ../nzbget-11.0/libpar2-0.2-*.patch .
$ sudo patch < libpar2-0.2-bugfixes.patch
$ sudo patch < libpar2-0.2-cancel.patch

Configurer et compiler libpar2 :

$ ./configure
$ sudo make

Installer la version "patchée" de libpar2 :

$ sudo make install

Configurer et compiler NZBGet :

$ cd ~/utils/src/nzbget-11.0
$ ./configure
$ sudo make

Installer NZBGet :

$ sudo make install

Copier le fichier de configuration example dans le répertoire /etc :

$ sudo cp /usr/local/share/nzbget/nzbget.conf /etc

Editer le fichier de configuration /etc/nzbget.conf :

$ sudo vi /etc/nzbget.conf

et vérifier (ou adapter) les lignes suivantes :

MainDir=/home/t2fr/Downloads
DestDir=${MainDir}/done
WebDir=/usr/local/share/nzbget/webui
LogFile=${MainDir}/nzbget.log
Server1.Group=0
Server1.Host=à définir
Server1.Port=119
Server1.Username=à définir
Server1.Password=à définir
Server1.JoinGroup=yes
ControlIP=raspberry.home
ControlUsername=à définir
ControlPassword=à définir
DaemonUsername=t2fr
UnpackPauseQueue=yes

L'utilisateur t2fr éxécutera NZBGet, donner les permissions sur le fichier de configuration :

$ sudo chown t2fr:t2fr /etc/nzbget.conf

Créer le script de contrôle de NZBGet :

$ sudo vi /etc/init.d/nzbget

et y ajouter les lignes suivantes :

#!/bin/sh
### BEGIN INIT INFO
# Provides:          NZBget
# Required-Start:    $network $remote_fs $syslog
# Required-Stop:     $network $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start NZBget at boot
# Description:       Start NZBget
### END INIT INFO
case "$1" in
start)   echo -n "Start services: NZBget"
/usr/local/bin/nzbget -D
;;
stop)   echo -n "Stop services: NZBget"
/usr/local/bin/nzbget -Q
;;
restart)
$0 stop
$0 start
;;
*)   echo "Usage: $0 start|stop|restart"
exit 1
;;
esac
exit 0

Changer les permissions et installer le script de contrôle pour démarrer et arrêter NZBGet en même temps que le Raspberry Pi :

sudo chmod 755 /etc/init.d/nzbget
	sudo update-rc.d nzbget defaults

Démarrer NZBGet :

$ sudo service nzbget start

et y accéder via l'adresse http://raspberry.home:6789/ en utilisant l'utilisateur et mot de passe définis précédement.

Installation de Transmission

Pour télécharger des torrent: installer Transmission. La version de Raspbian est suffisante.

Installer Transmission :

$ sudo apt-get install transmission-daemon

Editer le fichier de configuration /etc/transmission-daemon/settings.json :

$ sudo vi /etc/transmission-daemon/settings.json

et vérifier (ou adapter) les lignes suivantes :

"blocklist-enabled": true,
"blocklist-url": "http://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz",
"download-dir": "/home/t2fr/Downloads/done",
"download-queue-enabled": true,
"download-queue-size": 1,
"incomplete-dir": "/home/t2fr/Downloads/tmp",
"incomplete-dir-enabled": true,
"rpc-password": "à définir",
"rpc-username": "à définir",
"rpc-whitelist-enabled": false,
"watch-dir": "/home/t2fr/Downloads/torrent",
"watch-dir-enabled": true

Recharger la configuration :

$ sudo service transmission-daemon reload

Arrêter Transmission :

$ sudo service transmission-daemon stop

Editier le script de contrôle transmission-daemon :

$ sudo vi /etc/init.d/transmission-daemon

et vérifier (ou adapter) la ligne suivante pour éxécuter Transmission avec l'utilisateur t2fr :

USER=t2fr

Réitérer pour

$ sudo vi /etc/systemd/system/multi-user.target.wants/transmission-daemon.service
User=t2fr

Positionner donc les droits sur les répertoires :

$ sudo chown t2fr:t2fr -R /etc/transmission-daemon
$ sudo chown t2fr:t2fr -R /var/lib/transmission-daemon
$ sudo chown t2fr:t2fr -R /etc/init.d/transmission-daemon
$ mkdir -p /home/t2fr/.config/transmission-daemon/
$ ln -s /etc/transmission-daemon/settings.json /home/t2fr/.config/transmission-daemon/
$ chown -R t2fr:t2fr /home/t2fr/.config/transmission-daemon/

Démarrer Transmission :

$ sudo systemctl daemon-reload
$ sudo service transmission-daemon start

et y accéder via l'adresse http://raspberry.home:9091/ en utilisant l'utilisateur et mot de passe définis précédement.

Installation de Samba

Afin d'accéder aux fichier sur le Raspberry Pi depuis Windows: créer le partage avec Samba.

Installer Samba :

$ sudo apt-get install samba samba-common-bin

Editer le fichier de configuration :

$ sudo vi /etc/samba/smb.conf

et ajouter (ou adapter) les lignes suivantes pour partager le "home" de t2fr :

security = user
[t2fr]
comment = t2fr's home
path = /home/t2fr
valid users = t2fr
force group = t2fr
create mask = 0644
directory mask = 0755
read only = no

Ajouter l'utilisateur t2fr à Samba :

$ sudo smbpasswd -a t2fr

Relancer Samba :

$ sudo /etc/init.d/samba restart

Accéder au répertoire \\raspberry\t2fr avec l'utilisateur et le mot de passe définis précédement.

Installation de pyLoad

...

Télécharger les paquets requis :

$ sudo apt-get install python python-crypto python-pycurl python-imaging python-qt4 tesseract-ocr liblept3 rhino

Naviguer dans l'arborescence, télécharger et installer le paquet :

$ cd ~/utils/src
$ wget http://get.pyload.org/get/ubuntu
$ sudo dpkg -i pyload-v0.4.9-all.deb