These are the steps taken to have Sonarr, Radarr & Lidarr on piCore 9.0.3 running Mono 4.4.2
Newer version might work as well (or maybe even better), but have not been tested.
-
Unpack the
.zip
file and write the.img
file to the SD-Card (using USB Image Tool for example) -
Move the SD-Card to the Pi, plug the Pi into the network and plug in the power source
-
SSH into the Pi (using Putty for example)
Login usingtc
/piCore
-
Execute
filetool.sh -b
shell command after the first boot to save generated unique SSH keys which will be used during next boots. -
Expand the partition:
- Start the partition tool:
sudo fdisk -u /dev/mmcblk0
- List partitions with
p
command and write down the StartLBA and EndLBA of the second partition - Delete second partition with
d
than recreate it withn
command
Selectp
forPrimary Partition
and2
forPartition Number
Use the same starting sector as deleted had and use the default value forLast Cylinder
Exit fdisk withw
command - Reboot the Pi:
sudo reboot
- After reboot expand the partition:
sudo resize2fs /dev/mmcblk0p2
(may take a while)
- Start the partition tool:
-
Optionally install the nano text editor (or keep using vi):
tce-load -wi nano
-
Install Curl, Mono and SQLite:
tce-load -wi curl mono sqlite3
- Download Sonarr:
wget http://update.sonarr.tv/v2/master/mono/NzbDrone.master.tar.gz
- Create a temporary directory:
mkdir -p /tmp/SonarrExt/usr/local/bin
- Unpack the tarball:
tar -xvzf NzbDrone.master.tar.gz -C /tmp/SonarrExt/usr/local/bin
- Create extension:
mksquashfs /tmp/SonarrExt /mnt/mmcblk0p2/tce/optional/sonarr.tcz
- Add
sonarr.tcz
to/mnt/mmcblk0p2/tce/onboot.lst
- Have Sonarr auto start on boot:
sudo nano /opt/bootlocal.sh
, addmono /usr/local/bin/NzbDrone/NzbDrone.exe /data=/home/tc/.config/NzbDrone &
to the end - Save the changes:
filetool.sh -b
- Reboot:
sudo reboot
Note: Don't forget to do filetool.sh -b
after making a change to the configuration of Sonarr
- Download a linux tarball from https://github.com/Radarr/Radarr/releases
- Create a temporary directory:
mkdir -p /tmp/RadarrExt/usr/local/bin
- Unpack the tarball:
tar -xvzf Radarr.develop.*.linux.tar.gz -C /tmp/RadarrExt/usr/local/bin
- Create extension:
mksquashfs /tmp/RadarrExt /mnt/mmcblk0p2/tce/optional/radarr.tcz
- Add
radarr.tcz
to/mnt/mmcblk0p2/tce/onboot.lst
- Have Radarr auto start on boot:
sudo nano /opt/bootlocal.sh
, addmono /usr/local/bin/Radarr/Radarr.exe /data=/home/tc/.config/Radarr &
to the end - Save the changes:
filetool.sh -b
- Reboot:
sudo reboot
Radarr won't load any movie data because Radarr gets its information from TMDB, but TMDB is on a newer SSL key than mono 4.x can handle.
- Check the version Mono is on:
mono -V
, if this is <5, proceed - Install Apache (will be used as a proxy):
tce-load -wi apache2.4
- Create SSL certificate files in
~/certs
:sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /home/tc/certs/themoviedb-selfsigned.key -out /home/tc/certs/themoviedb-selfsigned.crt
.
Some questions will be asked, they can mostle be skipped through, onlyCommon Name
need to beapi.themoviedb.org
- Copy over the configuration file:
cp /usr/local/httpd/httpd.conf /home/tc/.config/httpd.conf
- Edit the copied
httpd.conf
:- Add
Listen 443
belowListen 80
- Enable (by removing
#
) modulesmod_ssl.so
,mod_proxy.so
&mod_proxy_http.so
- Below
<Directory "/usr/local/apach2/htdocs"></Directory>
add:
<VirtualHost *:443> ServerName api.themoviedb.org SSLEngine On SSLCertificateFile "/home/tc/certs/themoviedb-selfsigned.crt" SSLCertificateKeyFile "/home/tc/certs/themoviedb-selfsigned.key" SSLProxyEngine on ProxyPreserveHost On ProxyPass / https://x.x.x.x/ ProxyPassReverse / https://x.x.x.x/ # Whenever Radarr still doesn't work, one can enable the logging: #LogLevel debug #ErrorLog "/home/tc/apache.log" </VirtualHost>
- Add
- Get the IP of
api.themoviedb.org
(for example by issueing a ping) and edit theProxyPass
&ProxyPassReverse
to reflect the IP - Edit
/opt/bootlocal.sh
to make Apache auto start on boot, and also relay TMDB API traffic through Apache:
httpd -f /home/tc/.config/httpd.conf
echo "127.0.0.1 api.themoviedb.org" | tee -a /etc/hosts
- Save the changes:
filetool.sh -b
- Reboot:
sudo reboot
- Download a linux tarball from https://github.com/lidarr/Lidarr/releases
- Create a temporary directory:
mkdir -p /tmp/LidarrExt/usr/local/bin
- Unpack the tarball:
tar -xvzf Lidarr.develop.*.linux.tar.gz -C /tmp/LidarrExt/usr/local/bin
- Create extension:
mksquashfs /tmp/LidarrExt /mnt/mmcblk0p2/tce/optional/lidarr.tcz
- Add
lidarr.tcz
to/mnt/mmcblk0p2/tce/onboot.lst
- Have Lidarr auto start on boot:
sudo nano /opt/bootlocal.sh
, addmono /usr/local/bin/Lidarr/Lidarr.exe /data=/home/tc/.config/Lidarr &
to the end - Save the changes:
filetool.sh -b
- Reboot:
sudo reboot
- Install compiler:
tce-load -wi compiletc
- Go to the MediaInfo download page and download (
wget
) theSO
.gz
file - Unpack the tarball:
tar zxvf MediaInfo_DLL_??.??_GNU_FromSource.tar.gz
and change directory:cd MediaInfo_DLL_GNU_FromSource
- Run
SO_Compile.sh
(might take a while) - Change directory into
MediaInfoLib/Project/GNU/Library
and perform amake install
- Add the following lines to
/opt/.filetool.lst
:
libmediainfo.la
libmediainfo.so
libmediainfo.so.0
libmediainfo.so.0.0.0 - Add
ldconfig
to/opt/bootlocal.sh
(otherwise the lib won't be found) - Remove files from user directory:
rm -rf ~/MediaInfo*
- Save changes:
filetool.sh -b
- Install Python 2.7:
tce-load -wi python python-dev
- Install necessary dependencies:
tce-load -wi libxslt-dev libxml2-dev
- Download
get-pip.py
:wget https://bootstrap.pypa.io/get-pip.py
and make executable:chmod +x get-pip.py
- Install pip:
sudo ./get-pip.py
- Add pip to the back-up list:
sudo nano /opt/.filetool.lst
, addusr/local/bin/pip
,usr/local/bin/pip2
&usr/local/bin/pip2.7
to the end - Download a linux tarball from https://github.com/morpheus65535/bazarr/releases, for example:
wget https://github.com/morpheus65535/bazarr/archive/v0.7.5.tar.gz -O Bazarr.develop.0.7.5.linux.tar.gz
- Create a temporary directory:
mkdir -p /tmp/BazarrExt/usr/local/bin
- Unpack the tarball:
sudo tar -xvzf Bazarr.develop.*.linux.tar.gz -C /tmp/BazarrExt/usr/local/bin
- Rename the Bazarr directory:
sudo mv /tmp/BazarrExt/usr/local/bin/bazarr* /tmp/BazarrExt/usr/local/bin/bazarr
- Create extension:
mksquashfs /tmp/BazarrExt /mnt/mmcblk0p2/tce/optional/bazarr.tcz
- Add
bazarr.tcz
to/mnt/mmcblk0p2/tce/onboot.lst
- Manually install all dependencies mentioned in the requirements.txt (
sudo pip install gevent lxml
) - Turn python site-packages into an extension:
- Create a temporary directory:
mkdir -p /tmp/sitepackagesExt/usr/local/lib/python2.7/site-packages
- Copy over the files:
cp -r /usr/local/lib/python2.7/site-packages/* /tmp/sitepackagesExt/usr/local/lib/python2.7/site-packages/
- Create extension:
mksquashfs /tmp/sitepackagesExt /mnt/mmcblk0p2/tce/optional/sitepackages.tcz
- Add
sitepackages.tcz
to/mnt/mmcblk0p2/tce/onboot.lst
- Create a temporary directory:
- Add UTF-8 support:
- Install getlocale:
tce-load -wi getlocale
- Install
en_US.UTF-8
:sudo getlocale.sh
(use spacebar to enable/disable a locale) - Follow steps below to not only set the timezone, but also the locale
- Install getlocale:
- Set the timezone:
- Mount the
/dev/mmcblk0p1
partition:mount /dev/mmcblk0p1
- Figure out what file to edit:
cat /mnt/mmcblk0p1/config.txt | more
- Edit the file (according to previous command):
sudo nano /mnt/mmcblk0p1/cmdline.txt
- Add
TZ=America/Chicago
(obviously change to your timezone) - Add
LANG=en_US.UTF8
- Mount the
- Have Bazarr auto start on boot:
sudo nano /opt/bootlocal.sh
, addpython /usr/local/bin/bazarr/bazarr.py -c /home/tc/.config/Bazarr &
to the end - Save the changes:
filetool.sh -b
-
Install cifs:
tce-load -wi cifs-utils samba4 filesystems-KERNEL
-
Create a file containing the login credentials of the share
/home/tc/.smb
:user=username password=xxxxxx
-
Add a line to
/etc/fstab
://192.168.x.xxx/sharedfolder /mnt/shared cifs credentials=/home/tc/.smb,_netdev 0 0
-
Make fstab saved by adding
/etc/fstab
to/opt/.filetool.lst
-
Create a script for mounting
/opt/mount.sh
:#!/bin/sh mkdir /mnt/shared until cat /etc/fstab | grep shared do sleep 1 done sleep 5 mount /mnt/shared
-
Add the script to
/opt/bootlocal.sh
:/opt/mount.sh &
-
Save the changes:
filetool.sh -b
-
Reboot:
sudo reboot
- Kill Sonarr/Radarr/Lidarr
- Remove (or even better; back-up) the
/home/tc/.config/*/*.db
file - Create symlinks:
- Sonarr:
ln -s /mnt/share/.sonarr/nzbdrone.db /home/tc/.config/NzbDrone/nzbdrone.db
- Radarr:
ln -s /mnt/share/.radarr/radarr.db /home/tc/.config/Radarr/radarr.db
- Lidarr:
ln -s /mnt/share/.lidarr/lidarr.db /home/tc/.config/Lidarr/lidarr.db
- Bazarr:
ln -s /mnt/share/.bazarr/config /home/tc/.config/bazarr/config
ln -s /mnt/share/.bazarr/db /home/tc/.config/bazarr/db
- Save the changes:
filetool.sh -b
If you use Telegram to get notifications from Sonarr & Radarr you might notice these don't work. This is thanks to the same issue as the TMDB connection from Radarr and can be fixed by also adding a certificate for Telegram to Apache:
- Create SSL certificate files in
~/certs
:sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /home/tc/certs/telegram-selfsigned.key -out /home/tc/certs/telegram-selfsigned.crt
.
Some questions will be asked, they can mostle be skipped through, onlyCommon Name
need to beapi.telegram.org
- Edit
/home/tc/.config/httpd.conf
:- Below
<VirtualHost *:443></VirtualHost>
ofapi.themoviedb.org
add:
<VirtualHost *:443> ServerName api.telegram.org SSLEngine On SSLCertificateFile "/home/tc/certs/telegram-selfsigned.crt" SSLCertificateKeyFile "/home/tc/certs/telegram-selfsigned.key" SSLProxyEngine on ProxyPreserveHost On ProxyPass / https://x.x.x.x/ ProxyPassReverse / https://x.x.x.x/ # Whenever Telegram still doesn't work, one can enable the logging: #LogLevel debug #ErrorLog "/home/tc/apache.log" </VirtualHost>
- Below
- Get the IP of
api.telegram.org
(for example by issueing a ping) and edit theProxyPass
&ProxyPassReverse
to reflect the IP - Edit
/opt/bootlocal.sh
to also relay Telegram API traffic through Apache:
echo "127.0.0.1 api.telegram.org" | tee -a /etc/hosts
- Save the changes:
filetool.sh -b
- Reboot:
sudo reboot
- Create a file
/opt/.xfiletool.lst
and add:
home/tc/.config/*/log*
home/tc/.config/*/nzbdrone.pid
home/tc/.config/*/MediaCover
home/tc/.config/*/Backups
https://github.com/puppetlabs/Razor-Microkernel/wiki/Building-your-own-TCL-Extension