User Tools

Site Tools


install_qnap

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
install_qnap [2011/12/24 00:17]
cerberus created
install_qnap [2012/02/25 17:57] (current)
cerberus
Line 1: Line 1:
-EDIT: There is now a optware package available that should be alot easier to install serviio from +====== 1 The Easy Way ======
-Head over to http://forum.qnap.com/viewtopic.php?f=252&t=45994 and follow the instructions, it should make installing a lot easier.+
  
-Will keep the procedure I used below here incase anyone can't get the qpkg to work.+1. Locate the correct version of JRE [[http://java.sun.com/javase/downloads/embedded.jsp|Here]] and download to the Public share
  
 +2. Download and install the JRE 6 QPKG for ARM or x86 from the link provided below.
  
 +ARM x19: [[http://ftp.qnap.com/QPKG/ARM/JRE_6_arm-x19.zip|Download Here]]
 +x86: [[http://eu1.qnap.com/Storage/QPKG/X86/JRE_6_X86.zip|Download Here]]
  
-Thought I should write down my success (i think now atleast) story too and maybe i will help someone out.+3. Once installed, enable it from the admin backend and that's it. You can now run any types of Java apps on your NAS now but expect the performance degrades as it is NAS and not a server/pc.
  
-Note: If you get some problems I am fairly sure I wont be able to help you out since everything feels sorta unstable once you reboot, the smallest error and nothing will work after bootup and you have to go through all config again and reboot (which takes like 5-10 minutes).+4. Download and install the Serviio QPKG.
  
-The biggest issues I had setting it up is that basically you can't change any base config in for example/etc/init.dfolders and whatnot, cause the QNAP NAS will overwrite most of it with its built-in settings (probably wise to avoid support issues where people have bricked their NAS or something by scewing up the OS  )+[[http://forum.qnap.com/viewtopic.php?f=252&t=45994|Download Here]]
  
-Anyways, what I did to get everything to run smoothly is (I might have missed a bit here and there, but bear with me):+====== 2 The Hard Way ======
  
-0I used most of the synology guide at http://pcloadletter.co.uk/2011/02/07/se ... h-arm-cpuas reference since the systems are really similar.+<note>If you make smallest error and nothing will work after bootup and you have to go through all config again and reboot (which takes like 5-10 minutes). 
 +</note> 
 + 
 +The biggest issues is that basically you can't change any base config in for example/etc/init.dfolders and whatnot, cause the QNAP NAS will overwrite most of it with its built-in settings (probably wise to avoid support issues where people have bricked their NAS or something by scewing up the OS  )
  
 1. Start by installing IPKG Optware from the appliaction services/qpkg plugins page (also make sure to enable it) from the QNAP web administration frontend. 1. Start by installing IPKG Optware from the appliaction services/qpkg plugins page (also make sure to enable it) from the QNAP web administration frontend.
Line 24: Line 29:
 4. make a tmp dir in /opt/tmp 4. make a tmp dir in /opt/tmp
  
-  Code: mkdir /opt/tmp+  mkdir /opt/tmp
      
-5. From [[http://www.oracle.com/technetwork/java/embedded/overview/sys-reqs-embedded-159989.html|Here]] get the ARM v5 embedded runtime. The file I got (after all email stuff etc) was called 'ejre-1_6_0_21-fcs-b09-linux-arm-sflt-eabi-headless-27_sep_2010.tar.gz'+5. From [[http://www.oracle.com/technetwork/java/embedded/overview/sys-reqs-embedded-159989.html|Here]] get the Java embedded runtime. 
  
 6. Put the file somewhere on your NAS and copy it to the temp folder 6. Put the file somewhere on your NAS and copy it to the temp folder
  
-  Code: cp /share/MyStuff/ejre-1_6_0_21-fcs-b09-linux-arm-sflt-eabi-headless-27_sep_2010.tar.gz /opt/tmp+  cp /share/MyStuff/Filenameyoujustdownloaded /opt/tmp
      
 7. Download some required files in this new folder 7. Download some required files in this new folder
  
-<code>cd /opt/tmp +  cd /opt/tmp 
-wget http://download.serviio.org/releases/serviio-0.5.2-linux.tar.gz +  wget http://download.serviio.org/releases/serviio-0.5.2-linux.tar.gz 
-wget http://download.serviio.org/opensource/ffmpeg-26303.tar.gz</code> +  wget http://download.serviio.org/opensource/ffmpeg-26303.tar.gz 
 +  
 8. Extract all the .tar.gz files in this folder with the command 8. Extract all the .tar.gz files in this folder with the command
  
-  Code:tar xvzf filename.tar.gz+  tar xvzf filename.tar.gz
      
 9. Install some required components through the Optware package manager, also install nano since its a better text editor than vi 9. Install some required components through the Optware package manager, also install nano since its a better text editor than vi
  
-  Code: ipkg install optware-devel +  ipkg install optware-devel 
-ipkg install lame +  ipkg install lame 
-ipkg install nano+  ipkg install nano
  
 10. Put some stuff in better places 10. Put some stuff in better places
  
-  Code: mv serviio-0.5.2 /opt/serviio +  mv serviio-0.5.2 /opt/serviio 
-mkdir /opt/java +  mkdir /opt/java 
-mv ejre1.6.0_21 /opt/java/+  mv ejre1.6.0_21 /opt/java/
  
 11. Now its time to compile ffmpeg, i had to edit the config file to be able to run it on my QNAP NAS, there was some command that constantly failed (mktemp), I used the suggestion in this thread to resolve it http://stackoverflow.com/questions/4581 ... ure-script  11. Now its time to compile ffmpeg, i had to edit the config file to be able to run it on my QNAP NAS, there was some command that constantly failed (mktemp), I used the suggestion in this thread to resolve it http://stackoverflow.com/questions/4581 ... ure-script 
 so so
  
-  Code: nano /opt/tmp/ffmpeg/configure+  nano /opt/tmp/ffmpeg/configure
  
 and make the neccesary changes according to the thread above, and incase it dies, change the line and make the neccesary changes according to the thread above, and incase it dies, change the line
  
-  Code: if ! check_cmd type mktemp; then+  if ! check_cmd type mktemp; then
      
 to to
  
-  Code: if true; then+  if true; then
      
 after you done that, its time to compile ffmpeg after you done that, its time to compile ffmpeg
  
-  Code: cd /opt/tmp/ffmpeg +  cd /opt/tmp/ffmpeg 
-./configure --arch=arm --enable-armv5te --prefix=/opt --extra-cflags='-I/opt/include' --extra-ldflags='-L/opt/lib' --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-libmp3lame +  ./configure --arch=arm --enable-armv5te --prefix=/opt --extra-cflags='-I/opt/include' --extra-ldflags='-L/opt/lib' --enable- 
-make +  static --disable-shared --disable-ffplay --disable-ffserver --enable-libmp3lame 
-make install+  make 
 +  make install 
 +  
 Note that both configure and make take a long time to complete (like several minutes for configure and up to 20-30 minutes for make), make also shows some warnings, but its nothing to worry about, just sloppy coders  Note that both configure and make take a long time to complete (like several minutes for configure and up to 20-30 minutes for make), make also shows some warnings, but its nothing to worry about, just sloppy coders 
  
 12. When that is done, you should be able to test if ffmpeg is correctly installed: 12. When that is done, you should be able to test if ffmpeg is correctly installed:
  
-  Code: cd /opt/bin +  cd /opt/bin 
-ffmpeg+  ffmpeg 
 +  
 this should hopefully generate an error that libmp3lame.so.0 could not be found (atleast it did for me), we will resolve this shortly. this should hopefully generate an error that libmp3lame.so.0 could not be found (atleast it did for me), we will resolve this shortly.
 You could also try to move out of the folder /opt/bin and run ffmpeg, this should hopefully launch the old ffmpeg included on the NAS for twonkymedia. You can see that the old ones build date/time is not just today (since you just compiled the new one). The text --enable-libmp3lame should also not be present in what ffmpeg prints out when you run it if it is the old one already on the NAS. You could also try to move out of the folder /opt/bin and run ffmpeg, this should hopefully launch the old ffmpeg included on the NAS for twonkymedia. You can see that the old ones build date/time is not just today (since you just compiled the new one). The text --enable-libmp3lame should also not be present in what ffmpeg prints out when you run it if it is the old one already on the NAS.
Line 84: Line 92:
 13. Now its time for some configuration 13. Now its time for some configuration
  
-  Code: nano /opt/Optware.sh+  nano /opt/Optware.sh
  
 find the line below find the line below
  
-  Code: # adding Ipkg apps into system path ...+  # adding Ipkg apps into system path ...
  
 and replace the two lines just below it with the following and replace the two lines just below it with the following
  
-  Code: /bin/cat /etc/profile | /bin/grep "PATH" | /bin/grep "/opt/bin" 1>>/dev/null 2>>/dev/null +  /bin/cat /etc/profile | /bin/grep "PATH" | /bin/grep "/opt/bin" 1>>/dev/null 2>>/dev/null 
-        [ $? -ne 0 ] && /bin/echo "export PATH=/opt/bin:/opt/sbin:/opt/java/ejre1.6.0_21/bin:\$PATH" >> /etc/profile+  [ $? -ne 0 ] && /bin/echo "export PATH=/opt/bin:/opt/sbin:/opt/java/ejre1.6.0_21/bin:\$PATH" >> /etc/profile
  
 This is to resolve a bug where the paths are added in the wrong order, refer to http://wiki.qnap.com/wiki/Install_Optwa ... .2Fprofile for an explanation of why. as you can see above, we also add the path to java above, so it is not exactly the same as in the link. This is to resolve a bug where the paths are added in the wrong order, refer to http://wiki.qnap.com/wiki/Install_Optwa ... .2Fprofile for an explanation of why. as you can see above, we also add the path to java above, so it is not exactly the same as in the link.
Line 99: Line 107:
 Also add the init script execution fix from the wiki link just below the two changed lines: Also add the init script execution fix from the wiki link just below the two changed lines:
  
-  Code: 
 # Patch per http://wiki.qnap.com/wiki/Install_Optware_IPKG # Patch per http://wiki.qnap.com/wiki/Install_Optware_IPKG
   /bin/echo "Run Optware/ipkg /opt/etc/init.d/*"   /bin/echo "Run Optware/ipkg /opt/etc/init.d/*"
Line 109: Line 116:
        # Ignore dangling symlinks (if any).        # Ignore dangling symlinks (if any).
            #[ ! -f "$i" ] && continue            #[ ! -f "$i" ] && continue
- 
             case "$i" in             case "$i" in
                 *.sh)                 *.sh)
Line 125: Line 131:
             esac                         esac            
         done                         done                
-# End patch+  # End patch 
 14. Make a few config files in /opt/etc/init.d for serviio and ffmpeg (stupid names, i have no idea if the Sxx makes any difference whatsoever, but mine are named that and they are working so..) 14. Make a few config files in /opt/etc/init.d for serviio and ffmpeg (stupid names, i have no idea if the Sxx makes any difference whatsoever, but mine are named that and they are working so..)
  
-  Code: +  nano /opt/etc/init.d/S95misc.sh 
-nano /opt/etc/init.d/S95misc.sh+
 add the following to the file add the following to the file
  
-  Code: +  #!/bin/sh 
-#!/bin/sh +  ldconfig /opt/lib 
-ldconfig /opt/lib +  export JAVA_HOME=/opt/java/ejre1.6.0_21 
-export JAVA_HOME=/opt/java/ejre1.6.0_21+
 The ldconfig is so ffmpeg can find libmp3lame.so.0 later on, i also try in vain to create a environment variable for JAVA_HOME, but that will not work, dont worry though, its not needed. The ldconfig is so ffmpeg can find libmp3lame.so.0 later on, i also try in vain to create a environment variable for JAVA_HOME, but that will not work, dont worry though, its not needed.
  
 Create the serviio daemon script Create the serviio daemon script
  
-  Code: +  nano /opt/etc/init.d/S99serviio.sh 
-nano /opt/etc/init.d/S99serviio.sh+
 add the following to the file add the following to the file
  
-  Code: +  #!/bin/sh 
-#!/bin/sh +   
- +  case "$1" in 
-case "$1" in +   
- +  stop)
-stop)+
         echo "Stop Serviio..."         echo "Stop Serviio..."
         "/opt/serviio/bin/serviio.sh -stop" > /dev/null 2>&1 &         "/opt/serviio/bin/serviio.sh -stop" > /dev/null 2>&1 &
         ;;         ;;
- +   
-start)+  start)
         # start Serviio in background mode         # start Serviio in background mode
         "/opt/serviio/bin/serviio.sh" > /dev/null 2>&1 &         "/opt/serviio/bin/serviio.sh" > /dev/null 2>&1 &
         echo "Start Serviio..."         echo "Start Serviio..."
         ;;         ;;
- +   
-restart)+  restart)
         $0 stop         $0 stop
         sleep 1         sleep 1
         $0 start         $0 start
         ;;         ;;
- +   
-*)+  *)
         echo "usage: $0 { start | stop | restart}" >&2         echo "usage: $0 { start | stop | restart}" >&2
         exit 1         exit 1
         ;;         ;;
 +  
 +  esac
  
-esac 
 Also make both files executable Also make both files executable
  
-  Code: +  chmod +x /opt/etc/init.d/S95misc.sh 
-chmod +x /opt/etc/init.d/S95misc.sh +  chmod +x /opt/etc/init.d/S99serviio.sh 
-chmod +x /opt/etc/init.d/S99serviio.sh+
 15. Almost there now. Edit the serviio start file 15. Almost there now. Edit the serviio start file
  
-  Code: +  nano /opt/serviio/bin/serviio.sh 
-nano /opt/serviio/bin/serviio.sh+ 
 Just before the last line of that file (that start the server), add the following Just before the last line of that file (that start the server), add the following
  
-  Code: +  LANG=en_US.UTF-8 
-LANG=en_US.UTF-8 +  export LANG 
-export LANG+
 I had to place that there, even tho the system has utf8 already set, serviio would ignore that and use US-ASCII anyways, if you put it there, serviio will run on UTF8 and hopefully be able to handle special characters (mine did atleast) I had to place that there, even tho the system has utf8 already set, serviio would ignore that and use US-ASCII anyways, if you put it there, serviio will run on UTF8 and hopefully be able to handle special characters (mine did atleast)
  
 Also, on the very last line of this file, there is the actual command to start the server, at the end of this line, add a space and the character & so it reads something like below Also, on the very last line of this file, there is the actual command to start the server, at the end of this line, add a space and the character & so it reads something like below
  
-  Code: "$JAVA" -Xmx384M $JAVA_OPTS -classpath "$SERVIIO_CLASS_PATH" org.serviio.MediaServer "$@" &+  "$JAVA" -Xmx384M $JAVA_OPTS -classpath "$SERVIIO_CLASS_PATH" org.serviio.MediaServer "$@" & 
 That will make serviio actually run in the background on startup should you ever want to start it manually instead of on system start (the start script in /opt/init.d *should* already take care of this during system startup) That will make serviio actually run in the background on startup should you ever want to start it manually instead of on system start (the start script in /opt/init.d *should* already take care of this during system startup)
  
 16. Reboot the system 16. Reboot the system
  
-  Code: reboot+  reboot
      
 17. Now hopefully everything should work, once the NAS is up, try logging in to with with putty and run ps, it should generate a list of processes with a line similar to the one below in there somewhere (the actual numbers will vary ofcourse) 17. Now hopefully everything should work, once the NAS is up, try logging in to with with putty and run ps, it should generate a list of processes with a line similar to the one below in there somewhere (the actual numbers will vary ofcourse)
  
   Code: 4168 admin     56036 S   java -Xmx384M -Djava.net.preferIPv4Stack=true    Code: 4168 admin     56036 S   java -Xmx384M -Djava.net.preferIPv4Stack=true 
 +
 This means serviio is running, you should be able to check the configuration fromtend by surfing to wherever you put that in step 2 This means serviio is running, you should be able to check the configuration fromtend by surfing to wherever you put that in step 2
  
 also, try to run ffmpeg, the output should be something similar to below: also, try to run ffmpeg, the output should be something similar to below:
-[/opt/etc/init.d] # ffmpeg 
  
-  Code: FFmpeg version UNKNOWN, Copyright (c) 2000-2011 the FFmpeg developers+  [/opt/etc/init.d] # ffmpeg 
 +   
 +  FFmpeg version UNKNOWN, Copyright (c) 2000-2011 the FFmpeg developers
   built on Apr 13 2011 20:14:18 with gcc 4.2.3   built on Apr 13 2011 20:14:18 with gcc 4.2.3
-  configuration: --arch=arm --enable-armv5te --prefix=/opt --extra-cflags=-I/opt/include --extra-ldflags=-L/opt/lib --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-libmp3lame+  configuration: --arch=arm --enable-armv5te --prefix=/opt --extra-cflags=-I/opt/include --extra-ldflags=-L/opt/lib --enable- 
 +  static --disable-shared --disable-ffplay --disable-ffserver --enable-libmp3lame
   libavutil     50.36. 0 / 50.36. 0   libavutil     50.36. 0 / 50.36. 0
   libavcore      0.16. 0 /  0.16. 0   libavcore      0.16. 0 /  0.16. 0
Line 215: Line 226:
   libavfilter    1.72. 0 /  1.72. 0   libavfilter    1.72. 0 /  1.72. 0
   libswscale     0.12. 0 /  0.12. 0   libswscale     0.12. 0 /  0.12. 0
-Hyper fast Audio and Video encoder +  Hyper fast Audio and Video encoder 
-usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...+  usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... 
 +  Use -h to get full help or, even better, run 'man ffmpeg'
  
-Use -h to get full help or, even better, run 'man ffmpeg' 
  
-Conclusion: +<note tip>When ffmpeg is running (like when serviio adds files to the library and extracts metadata), it is almost impossible to change any settings through the configuration frontend cause it eats almost all cpu power. So if you get errors when you change something just after you have added a new folder to the library, dont worry, when serviio is done adding, you cna change config again  You can also ofcourse keep trying and hope to be lucky. Also as of v 0.5.2.1 of the php frontend, you cant change anything on the presentation tab, it just reverts back to the default values. I am not sure where the error lies since there is no error reported to the frontend from serviio.
-There is probably some security issues while running all this as admin, but I couldn't for the life of me get anything working if i tried to run anything as another user, so I just gave up on it (same way as everyone turns off UAC on win vista/7) and ran as admin. +
-Also, im gonna try to be bold and install the latest ffmpeg some day in the future (from http://www.ffmpeg.org/releases/ffmpeg-0.6.90-rc0.tar.gz). But I havent dared that yet incase something breaks. +
-All in all, I can safely say that I now know 100 why linux will never be a OS for the "average joe"  +
-I had serviio up and running in 10 minutes from scratch on my windows pc. On my NAS i have spent like 3-4 days just to get it working at all, and a few more tweaking it to run correctly on startup. So i am eagerly awaiting a "windows embedded os" :p +
- +
-Note that when ffmpeg is running (like when serviio adds files to the library and extracts metadata), it is almost impossible to change any settings through the configuration frontend cause it eats almost all cpu power. So if you get errors when you change something just after you have added a new folder to the library, dont worry, when serviio is done adding, you cna change config again  You can also ofcourse keep trying and hope to be lucky. Also as of v 0.5.2.1 of the php frontend, you cant change anything on the presentation tab, it just reverts back to the default values. I am not sure where the error lies since there is no error reported to the frontend from serviio.+
 I also have not tried transcoding (i have it disabled) since I always just reencode any movie that my samsung PS50C7705 cant play (which is very few to be honest). I also have not tried transcoding (i have it disabled) since I always just reencode any movie that my samsung PS50C7705 cant play (which is very few to be honest).
- +</note>
-Ah well, regardless, it was a fun ride, and now im gonna watch some movies on my 50" samsung plasma tv.+
  
install_qnap.1324685849.txt.gz · Last modified: 2011/12/24 00:17 by cerberus