Welcome! Log In Create A New Profile

Advanced

Build Gerbera V1.6.4 for Pogo 2/4 Armel Architecture

Posted by BobM 
Build Gerbera V1.6.4 for Pogo 2/4 Armel Architecture
February 18, 2021 09:25AM
I started working on PogoPlugs last year to sharpen my Unix skills and to get some very power/space/simple NAS and media servers onto my home network. I have managed to hack into every pogo version now thanks to the help of people here and now I have managed to get a decent Media server running and I thought I would share my tips with you all because I found the information I needed to do it not very obvious or easy. While I may not have done some of these stages optimally, it has worked.

So here is my guide to building Gerbera 1.6.4. on Pogo Kirkwood Armel architecture boxes running Debian buster. The process is very similar to the UBUNTU guide but you need a few tweaks.

1) You WILL need a swapfile when using 128Mb devices (and probably 256MB too). Add a HD or SSD but not a USB stick because of the risk of hardware failure. Bodhi recommends creating a swapfile of at least 4 times system memory - mine was 1GB

2) I opted for libnpupnp and libupnpp6 from https://www.lesbonscomptes.com/upmpdcli/ - Follow the build instructions to create Debian packages which you can then install with dpkg.

3) Build the latest Taglib [cmake, make -j4] and use 'Make Install' to install

4) Use Apt-get to install the rest of the dev packages as per dependencies list. It is best to load fmtlib-dev and libspdlog.dev from the Buster Backports

5) Clone the Gerbera git and edit the CMakeLists.txt file and comment the original version and add the new.

# set(GERBERA_VERSION "git")
set(GERBERA_VERSION "1.6.4-185-gae283931+d")


and add these lines to make the debian package

SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "KK")
# include (cmake)
include(packaging)


6) This is my Cmake command:

Cmake Command - cmake -g DEB ../gerbera -DWITH_NPUPNP=YES -DWITH_JS=1 -DWITH_MYSQL=1 -DWITH_CURL=1 -DWITH_TAGLIB=1 -DWITH_MAGIC=1 -DWITH_MATROSKA=0 -DWITH_AVCODEC=1 -DWITH_EXIF=1 -DWITH_EXIV2=0 -DWITH_LASTFM=0 -DWITH_FFMPEGTHUMBNAILER=1 -DWITH_INOTIFY=1


Resolve any dependency issues now!

7) the 'make -j4' will take at least 6 hours - go for a walk, read a book, grab some sleep .....

cpack -G DEB will create a debian package file - All being well - no errors. Use dpkg to install.


8) follow the gerbera manual for installation. Create the gerbera user (give the user a home directory e.g. /home/gerbera). Make the /etc/gerbera folder and get the config.xml. Symbolic link the config file:

ln -s /etc/gerbera/config.xml /home/gerbera/.config/gerbera

Symbolic link the web directory:

ln -s /usr/share/gerbera /usr/local/share

All the gerbera scripts expect the files to go into /usr/local/share and /usr/local/bin but dpkg puts them into /usr/share and /usr/bin. I have not find a way to tell Gerbera about the js script locations so opted to link the two directories.

9) edit config.xml and change the path to

<home>/home/gerbera/.config/gerbera</home>


10) Start gerbera with the standard launch command. The server should start - watch the messages for errors. Check the web interface functions too. when happy that all is good - control-c to get back to shell

gerbera -c /etc/gerbera/config.xml


11) for SystemD users, copy the gerbera.service script into /usr/systemd/system and edit it to correct the path to the gerbera server the use the systemctl command as per the manual to start and stop the server and debug any problems.

ExecStart=/usr/bin/gerbera -c /etc/gerbera/config.xml


12) for init.d users, you need a gerbera script which I took from the earlier version which is in the Debian APT library

13 You need to put your new gerbera package on hold to prevent apt-get upgrade downgrading back to 1.1

apt-mark hold gerbera


That should be everything you need. I have this Gerbera version running on a PogoPlug V2E02 and a V4 quite happily using vlc and bubbleupnp as clients and casting on to a fire stick and chromecast devices. I only access the devices locally on my home network and not remotely. Please be aware that the Gerbera UI has very little security and gives access to the full operating system. Bodhi has also pointed out that there are potential security issues with outdated router versions and the upnp protocol when allowing remote access.

Hope that helps someone - Bob



Edited 1 time(s). Last edit at 02/18/2021 06:57PM by BobM.
Re: Build Gerbera V1.6.4 for Pogo 2/4 Armel Architecture
February 18, 2021 04:25PM
Bob,

Well done!

Some minor comments.

> 1) You WILL need a swapfile when using 128Mb
> devices (and probably 256MB too). Add a HD or SSD
> but not a USB stick because of the risk of
> hardware failure.

Best to use 4x RAM or more, so make that 512MB or 1GB.

> That should be everything you need. I have this
> Gerbera version running on a PogoPlug V2E02 and a
> V4 Pro quite happily using vlc and bubbleupnp as
> clients and casting on to a fire stick and
> chromecast devices.

It's just "Pogoplug V4". The Pro moniker is for Pogoplug V3 Pro (OXNAS).

> Hope that helps someone - Bob

Definitely!

One thing to be careful is with UpnP, the home network is exposed to the internet. Does this process automatically set the router UpnP to active? or is the intention just to use this in your local network? It is good to clarify.

Once Upnp is open in the router, we need to watch the router FW upgrade (if it is still updated to be secure from attack).

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Build Gerbera V1.6.4 for Pogo 2/4 Armel Architecture
February 18, 2021 06:46PM
Cheers Bodhi, :)

I have just made a few updates and included the corrections you pointed out. As it happens, I did make a 1GB swapfile on my SSD which resolved all my random compile errors. I was just reading some of your tips on swapfile sizing today as my pogo all generally run with zram and no swap file. As samba and media servers the V2 E0s and V4 have been fine for me but it is right on the edge I guess.

I currently use the boxes only on my home network and I have not opened any ports on the broad band router to give me remote access to the files. I have not consciously made any changes to the routing tables on the pogo boxes This was something I was going to play with over the coming months however. By the way, the reason for choosing npupnp and upnpp6 was because it appears to be more efficient and a fresh implementation of the core functions needed. I struggled to make a build of the standard npupnp libs which the developers did eventually fix for me with a modified cmake config but i haven't tried incorporating it into gerbera yet.

Bob
Re: Build Gerbera V1.6.4 for Pogo 2/4 Armel Architecture
February 18, 2021 11:26PM
Bob,

I've also add a bit more to the post (regarding using swapiness 10, and vm.min_free_kbytes for box with 512MB RAM).

https://forum.doozan.com/read.php?2,116309,116324#msg-116324

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Build Gerbera V1.6.4 for Pogo 2/4 Armel Architecture
February 19, 2021 04:24PM
Bob,

I'm adding this to the Wiki. Thanks!

About this,

Quote

Please be aware that the Gerbera UI has very little security and gives access to the full operating system.

It sounds like it should only be used in the local network for now. More to be done if we want to use it remotely.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Build Gerbera V1.6.4 for Pogo 2/4 Armel Architecture
February 19, 2021 06:00PM
In the Gerbera manual, there is a warning about remote access with the WebUI enabled and they recommend disabling it.. There is a simple login system for the WebUI but it could be relatively easily broken. The WebUI is useful for setting up and checking operations but not as a general media system e.g. I can play a single track but not a whole album. I would probably try and use samba or ftp to the media files which are on a separate mount point/media and some sort of mapped sudo user which only has access to that area. It would certainly need some thought and research! I suppose the good thing is with LockDown, remote access is not really the highest priority!!
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: