Guide to compile and install Minidlna 1.0.24 on FFP 0.7 arm

Marvell Kirkwood based
Locked
barmalej2
Posts: 2382
Joined: Sun Apr 29, 2012 5:24 pm

Guide to compile and install Minidlna 1.0.24 on FFP 0.7 arm

Post by barmalej2 » Thu May 10, 2012 8:53 am

These instructions are outdated and needs serious corrections. Do not follow them!
You can install MiniDLNA following the steps on this post: viewtopic.php?f=249&t=11831


Did this on my NSA 310-firmware 4.40 with FFP 0.7/arm
All steps below I did logged as root in ssh session.

Before start, I suggest to update /ffp/funpkg/cache/sites file to have access via slacker tool to five repositories of packages for FFP 0.7/arm-Kylek, Memiks, Fonz, Mijzelf and Uli:

Code: Select all

wget http://wolf-u.li/u/441 -O /ffp/bin/uwsiteloader.sh

Code: Select all

chmod a+x /ffp/bin/uwsiteloader.sh

Code: Select all

uwsiteloader.sh
In menu select all five repositories and update them.

Note 1:you can use "slacker -Ua", then installing from repositories.This will update the list of packages available on these five repositories.

Code: Select all

slacker -Ua
Note 2:sometimes then one of repositories is down, it can cause "slacker -Ua" to fail, so use again "uwsiteloader.sh" and unselect not working repository from the list of available.

Secondly, for editing files I use Midnight Commander editor. You might want to use other editors.
Midnight Commander is available on Mijzelf repository-(mz):

Code: Select all

slacker -a

select glib2-2.30.2-arm-0.txz and mc-4.8.1-arm-0.txz in the list then press ok to install them.

Shortly to edit file:
type mc in command line
move cursor on file you want to edit
press F4
edit
press F10 -exit from editor and press YES to save changes.
press F10 again-exit from Midnight Commander and return to command line.
Other useful Midnight Commander editor commands:
Shift+Ins -paste from Windows (XP or 7) clipboard to the file, which you are editing
Shift+select with mouse -copy to Windows clipboard

Third step that you need is to install all compile dependencies from fonz-(s): repository:
• autoconf
• automake
• bash (default installed with ffp)
• binutils
• bison
• coreutils (default installed with ffp)
• curl
• flex
• gcc
• gcc-solibs (default installed with ffp)
• gettext (default installed with ffp)
• grep (default installed with ffp)
• linux-headers
• make
• mpfr
• patch
• uClibc
• uClibc-solibs (default installed with ffp)

The easiest way to do it is via slacker tool:

Code: Select all

slacker -U -a -A s:automake s:autoconf s:binutils  s:bison s:curl s:flex  s:gcc s:linux-headers s:make  s:mpfr s:patch s:uClibc
and press OK to install them.

Also you need to install minidlna dependencies:
- libjpeg (fonz-s:)
- ffmpeg 0.10.2 (mz:)
- flac (uli:)
- libexif (uli:)
- libid3tag (uli:)
- libogg (uli:)
- libvorbis (uli:)
- sqlite (uli:)

Code: Select all

slacker -a -A s:libjpeg mz:ffmpeg uli:flac uli:libexif uli:libid3tag uli:libogg uli:libvorbis uli:sqlite
and press ok to install them.

OK. Lets start with minidlna.
1. We need to get startup-shutdown script of minidlna. We can get it by installing older minidlna 1.0.22 from Kylek repository:

Code: Select all

slacker -a
select from list minidlna-1.0.22-arm-1.txz and press OK.

And uninstall it:

Code: Select all

slacker -r
select from list minidlna-1.0.22-arm-1.txz and press OK.
Uninstalling do not removes file /ffp/start/minidlna.sh, which will be needed later.

Remove unnecessary left other file:

Code: Select all

rm /ffp/etc/minidlna.conf-example
2. Lets create temporary directories for compiling:

Code: Select all

mkdir -p /i-data/md0/build/ffp/start /i-data/md0/build/ffp/etc /i-data/md0/build/ffp/bin
3. Move startup-shutdown script to /i-data/md0/build/ffp/start:

Code: Select all

mv /ffp/start/minidlna.sh /i-data/md0/build/ffp/start
4. Edit minidlna.sh:

Code: Select all

cd /i-data/md0/build/ffp/start
(In line 9 of minidlna.sh change to) command="/ffp/bin/minidlna"
(In line 14 of minidlna.sh change to) pid_file="/ffp/var/run/minidlna.pid"

5. Go to:

Code: Select all

cd /i-data/md0/build
6. Get the source file:

Code: Select all

wget http://downloads.sourceforge.net/project/minidlna/minidlna/1.0.24/minidlna_1.0.24_src.tar.gz
7. Unpack it:

Code: Select all

tar zxvf minidlna_1.0.24_src.tar.gz
8. Remove unnecessary archive:

Code: Select all

rm minidlna_1.0.24_src.tar.gz
9. Go to:

Code: Select all

cd /i-data/md0/build/minidlna-1.0.24
10. Change strings "usr" to "ffp" in the file genconfig.sh:

Code: Select all

sed -i 's/usr/ffp/g' genconfig.sh
11. Edit genconfig.sh to specify paths, where Minidlna should store it's database and log files:
(in line 27 of genconfig.sh change to) DB_PATH="/ffp/tmp/minidlna" -this points to FFP USB
Note1: you can point to the path what ever you want (of course not to RAM :D ). For example to hard disk: DB_PATH="/i-data/md0/minidlna".
Note2: You can miss this step and later setup paths in minidlna.conf

12. Change strings "usr" to "ffp" in the Makefile:

Code: Select all

sed -i 's/usr/ffp/g' Makefile
13. Edit Makefile:
(in line 26 of Makefile change to) SBININSTALLDIR = $(INSTALLPREFIX)/bin
(in line 40 of Makefile add two additionall strings to the row LIBS) LIBS= -lintl -liconv

14. Lets compile:

Code: Select all

make
You will get 2 new files-minidlna ant testupnpdescgen.

15. Copy them and minidlna.conf to temporary directories:

Code: Select all

cp minidlna /i-data/md0/build/ffp/bin

Code: Select all

cp testupnpdescgen /i-data/md0/build/ffp/bin

Code: Select all

cp minidlna.conf /i-data/md0/build/ffp/etc
16. Edit minidlna.conf - specify paths to audio, video, and photo directories and set inotify interval in seconds to search for new files:

Code: Select all

cd /i-data/md0/build/ffp/etc
Edit lines:
media_dir=A,/i-data/md0/music
media_dir=V,/i-data/md0/video
media_dir=P,/i-data/md0/photo

Also edit line:
notify_interval=60

Note1: you can set database and log file paths if you missed in step 11:
db_dir=/ffp/tmp/minidlna
log_dir=/ffp/tmp/minidlna
Note2: Name of server-Zyxel looks like nicer to me.
friendly_name=Zyxel

17. Go to:

Code: Select all

cd /i-data/md0/build
18. Remove unnecessary files and directory:
rm -rf minidlna-1.0.24/
19. Make the package:

Code: Select all

makepkg minidlna 1.0.24 0

This will create package minidlna-1.0.24-arm-0.txz in /tmp directory.

20. Remove unnecessary files and directory:
rm -rf /i-data/md0/build/
cd /i-data/md0/
21. Create new directory in /ffp/funpkg/ :

Code: Select all

mkdir -p /ffp/funpkg/additional
22. Move new package minidlna-1.0.24-arm-0.txz to /ffp/funpkg/additional

Code: Select all

mv /tmp/minidlna-1.0.24-arm-0.txz /ffp/funpkg/additional
23. Go to:

Code: Select all

cd /ffp/funpkg/additional
24. Install minidlna:

Code: Select all

funpkg -i minidlna-1.0.24-arm-0.txz
25. Run it:

Code: Select all

/ffp/start/minidlna.sh start
26. Hmmm... This is it. The end. At last :mrgreen:

Other useful info:
View status of Minidlna daemon:

Code: Select all

/ffp/start/minidlna.sh status
Stop Minidlna daemon:

Code: Select all

/ffp/start/minidlna.sh stop
or

Code: Select all

killall minidlna
View status of Minidlna server in network:
http://nsa310:8200
or
http://YourNasIP:8200

This worked for me :) Might not will work for you :(
P.S. Inotify updates new files list automatically and almost immediately after copying files to shared video, audio and photo directories.
Thanks to Mijzelf, for helping me to solve compile problems (Step 13).
-------------------------------------------------------------------------------------------------------------------------------------------------------------------

For those, who not succeeded or not so patient
You can install already compiled package from Mijzelf third party repository and try it:

Code: Select all

slacker -U -a -A mz:minidlna
but to run it you need to have all minidlna dependacies intstalled. Next follow from the step 25.
------------------------------------------------------------------------------------------------------------------------------------------------------------------

How to uninstall Minidlna 1.0.24
1. Stop daemon:

Code: Select all

/ffp/start/minidlna.sh stop
2. Uninstall the package:

Code: Select all

funpkg -r minidlna-1.0.24-arm-0.txz
or you can remove via slacker -r

3. Remove unnecessary files and database directory:

Code: Select all

rm /ffp/etc/minidlna.conf

Code: Select all

rm /ffp/start/minidlna.sh

Code: Select all

rm -rf /ffp/tmp/minidlna/
Last edited by barmalej2 on Sat Aug 31, 2013 4:12 pm, edited 44 times in total.

m3cab
Posts: 84
Joined: Mon Apr 23, 2012 5:03 am

Re: Guide to compile and install Minidlna 1.0.24 on FFP 0.7

Post by m3cab » Fri May 11, 2012 1:51 am

Hi thanks for the tuorial, just what i been looking for....

Got to step 14 ( make ( compile))

I got error /bin/sh: gcc: not found
The following command failed:
bla..bla....bla...error 127

barmalej2
Posts: 2382
Joined: Sun Apr 29, 2012 5:24 pm

Re: Guide to compile and install Minidlna 1.0.24 on FFP 0.7

Post by barmalej2 » Fri May 11, 2012 4:38 am

m3cab wrote:Hi thanks for the tuorial, just what i been looking for....

Got to step 14 ( make ( compile))

I got error /bin/sh: gcc: not found
The following command failed:
bla..bla....bla...error 127
Do you installed all compile and minidlna dependancies?
Seems to me that gcc library is missing. Check the list of compile dependancies. You must have installed gcc-4.5_20111110-arm-1.txz (fonz repository).
Also you can select error line (lines), then press ctrl+c and paste here.
I've edited step 13 and step 16. Please check them again. . After that I tried to recheck the guide and followed all steps on reseted NSA 310 with fresh FFP 0.7/arm. Everything went smoothly and succesfully.
Last edited by barmalej2 on Fri May 11, 2012 11:51 am, edited 3 times in total.

Mijzelf
Posts: 6198
Joined: Mon Jun 16, 2008 10:45 am

Re: Guide to compile and install Minidlna 1.0.24 on FFP 0.7

Post by Mijzelf » Fri May 11, 2012 7:49 am

Nice tutorial! Finally something to refer to on all the questions 'how to build my own FFP packages'.

One little thing (after a quick scan):
barmalej2 wrote:You don't need uwsiteloader.sh anymore, because sites file is already updated:

Code: Select all

rm /ffp/bin/uwsiteloader.sh
uwsiteloader.sh actually downloads a database of slacker sites from Uli's site. This database can be updated, so the script isn't useless after running once. Further it appears Kyleks repository is regularly down, causing 'slacker -U' to fail. In that case Uli's script is an easy way to disable that site temporary.

barmalej2
Posts: 2382
Joined: Sun Apr 29, 2012 5:24 pm

Re: Guide to compile and install Minidlna 1.0.24 on FFP 0.7

Post by barmalej2 » Fri May 11, 2012 11:27 am

Yes you are right. When repository is down,it can cause 'slacker -U' to fail. So, I will edit tutorial accordingly to your note. Thanks again.
I'm not so sure about the way i'm creating packages, but tested again on reseted-fresh system (there was no need, just for check i did that) and all steps worked for me.

m3cab
Posts: 84
Joined: Mon Apr 23, 2012 5:03 am

Re: Guide to compile and install Minidlna 1.0.24 on FFP 0.7

Post by m3cab » Sat May 12, 2012 12:46 am

hi ive installed memiks:gcc-4.6.2-arm-1.txz as i cannot find it in fonz's repo

now i'm getting this error??

Compiling minidlna.c
minidlna.c:49:20: fatal error: stdlib.h: No such file or directory
compilation terminated.
The following command failed:
gcc -Wall -g -O3 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -I/ffp/include/ffmpeg -I/ffp/include/libavutil -I/ffp/include/libavcodec -I/ffp/include/libavformat -I/ffp/include/ffmpeg/libavutil -I/ffp/include/ffmpeg/libavcodec -I/ffp/include/ffmpeg/libavformat -o minidlna.o -c minidlna.c
make: *** [minidlna.o] Error 1
any ideas?

barmalej2
Posts: 2382
Joined: Sun Apr 29, 2012 5:24 pm

Re: Guide to compile and install Minidlna 1.0.24 on FFP 0.7

Post by barmalej2 » Sat May 12, 2012 10:59 am

m3cab wrote:hi ive installed memiks:gcc-4.6.2-arm-1.txz as i cannot find it in fonz's repo

now i'm getting this error??

Compiling minidlna.c
minidlna.c:49:20: fatal error: stdlib.h: No such file or directory
compilation terminated.
The following command failed:
gcc -Wall -g -O3 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -I/ffp/include/ffmpeg -I/ffp/include/libavutil -I/ffp/include/libavcodec -I/ffp/include/libavformat -I/ffp/include/ffmpeg/libavutil -I/ffp/include/ffmpeg/libavcodec -I/ffp/include/ffmpeg/libavformat -o minidlna.o -c minidlna.c
make: *** [minidlna.o] Error 1
any ideas?
Did you installed all compile and minidlna dependencies :shock: ?
Did you rechecked my step 13?
As I can see gcc-4.5_20111110-arm-1.txz is always on Fonz repo. It is shorten to (s:) in the list-s:gcc-4.5_20111110-arm-1.txz :shock:All compile dependent libraries are on FONZ - s: repo.
Is ffmpeg library installed?
Follow all steps carefully, thats why I did this guide.

m3cab
Posts: 84
Joined: Mon Apr 23, 2012 5:03 am

Re: Guide to compile and install Minidlna 1.0.24 on FFP 0.7

Post by m3cab » Sat May 12, 2012 4:02 pm

I think the best thing to do is to format. My USB stick and start from fresh.... Just to clarify its gcc-4.5_20111110-arm-1.txz I need not gcc.4.0.6.txz?

m3cab
Posts: 84
Joined: Mon Apr 23, 2012 5:03 am

Re: Guide to compile and install Minidlna 1.0.24 on FFP 0.7

Post by m3cab » Sat May 12, 2012 4:17 pm

m3cab wrote:I think the best thing to do is to format. My USB stick and start from fresh.... Just to clarify its gcc-4.5_20111110-arm-1.txz I need not gcc.4.0.6.txz?
Sorry I meant memiks:gcc-4.6.2-arm-1.txz...

Before I format my stick, is it possible to run transmission 2.51 arm 2 on ffp 0.7 with fw 4.4 I'm currently on 2.42

barmalej2
Posts: 2382
Joined: Sun Apr 29, 2012 5:24 pm

Re: Guide to compile and install Minidlna 1.0.24 on FFP 0.7

Post by barmalej2 » Sat May 12, 2012 7:10 pm

m3cab wrote:
m3cab wrote:I think the best thing to do is to format. My USB stick and start from fresh.... Just to clarify its gcc-4.5_20111110-arm-1.txz I need not gcc.4.0.6.txz?
Sorry I meant memiks:gcc-4.6.2-arm-1.txz...

Before I format my stick, is it possible to run transmission 2.51 arm 2 on ffp 0.7 with fw 4.4 I'm currently on 2.42
I don’t think so, that there is a great difference between using gcc-4.5_20111110-arm-1.txz and gcc-4.6.2-arm-1.txz, I used first one and I'm suggesting using it to you too. I asked about it, just for clarity, because I'm not sure that you installed all compile and minidlna dependencies.

And yes. You can install transmission 2.51, but be very careful. Don't run at once, first of all you must configure it after install; otherwise transmission data can fulfill your precious NAS internal memory. Somewhere I saw a good tutorial about installing transmission.
http://forum.dsmg600.info/t2719-%5BREL% ... ssion.html
https://trac.transmissionbt.com/wiki/EditConfigFiles
P.S. I didn't tested 2.51-arm-2 version

m3cab
Posts: 84
Joined: Mon Apr 23, 2012 5:03 am

Re: Guide to compile and install Minidlna 1.0.24 on FFP 0.7

Post by m3cab » Mon May 14, 2012 1:05 am

you are a genius.....3 weeks of having the nsa310 an you know all this shit.....i had mine about the same time, i know how to use the standard Zyxel os, but Linux, still havnt a clue.... Thanks to you guys on here especially you and Mijzelf i have my NSA310 configured..

barmalej2
Posts: 2382
Joined: Sun Apr 29, 2012 5:24 pm

Re: Guide to compile and install Minidlna 1.0.24 on FFP 0.7

Post by barmalej2 » Mon May 14, 2012 5:09 am

Glad to see that you succeeded. One last notice:
in my tutorial I pointed database directory and log file (step 11) to store in ffp stick. You might want to change to hard disk if your USB amount is very small and you are using a lot files for DLNA sharing. This can be done by editing minidlna.conf file in /ffp/etc directory (stop minidlna before editing):
db_dir=/i-data/md0/minidlna
log_dir=/i-data/md0/minidlna

dslama
Posts: 9
Joined: Mon Aug 22, 2011 11:56 pm

Re: Guide to compile and install Minidlna 1.0.24 on FFP 0.7

Post by dslama » Sun Jun 03, 2012 10:45 pm

How does MiniDLNA compare to the built-in DLNA server from Zyxel?
Specifically, does it perform better?
I'm guessing you'd want to turn off the built in service before starting this one right?

barmalej2
Posts: 2382
Joined: Sun Apr 29, 2012 5:24 pm

Re: Guide to compile and install Minidlna 1.0.24 on FFP 0.7

Post by barmalej2 » Tue Jun 05, 2012 6:20 am

dslama wrote:How does MiniDLNA compare to the built-in DLNA server from Zyxel?
Specifically, does it perform better?
I'm guessing you'd want to turn off the built in service before starting this one right?
I didn't try built-in at all. Turned it off. Waiting until new firmware will released in the middle of this month with Twonky 7 to compare with Minidlna.

elPablo
Posts: 3
Joined: Tue Jun 19, 2012 7:29 pm

Re: Guide to compile and install Minidlna 1.0.24 on FFP 0.7

Post by elPablo » Tue Jun 19, 2012 7:32 pm

Hello
How I can enable autostart minidlna.sh after reboot? I use FFP 0.7
regards

Locked