The binaries creating during this build are now installed to /root/mediatomb/arm which can be packaged and transferred to the Drobo. Only the output bin, lib/*.so*, share/file, and share/mediatomb directories are required at runtime; so the other files can be excluded during transfer and packaging.

We need to create a startup script for the DroboApp. For the Drobo FS, the script is named service.sh and could look similar to the following sample:

#!/bin/sh## mediatomb
. /etc/service.subr
prog_dir=`dirname \`realpath $0\``# define DroboApp name and version name="mediatomb"version="0.12.1"# also define the admin port since mediatomb would randomly assign it otherwiseport=49152
pidfile=${prog_dir}/mediatomb.pid
logfile=${prog_dir}/mediatomb.log
# define the location of the shared libraries built for mediatomb# runtime library path was set during compile, so this should not be neededlibdir=${prog_dir}/lib
if[-n${libdir}]; thenexportLD_LIBRARY_PATH=${libdir}fiexportMEDIATOMB_DATADIR="${prog_dir}/share/mediatomb"exportMEDIATOMB_MAGIC_FILE="${prog_dir}/share/file/magic"# define the start command
start(){# launch the mediatomb daemon using the specified port and some other options${prog_dir}/bin/mediatomb -d-m${prog_dir}-f config -e eth0 -p${port} \
-P${pidfile}--logfile${logfile}>>${logfile}2>&1}# this standard stuff for service scriptscase"$1"in
start)
start_service
;;
stop)
stop_service
;;
restart)
stop_service
sleep 3
start_service
;;
status)
status
;;*)echo"Usage: $0 [start|stop|restart|status]"exit 1
;;esac