#!/bin/sh . /etc/init.d/functions PATH=/bin:/sbin:/usr/bin:/usr/sbin # # for USB Gadget "UVC Composite with ACM and RNDIS" # - activate UVC # USB_GADGET_IS_UVC_COMPOSITE=n if [ "${USB_GADGET_IS_UVC_COMPOSITE}" = "y" ]; then /etc/init.d/uvc-gadget fi # # for AV Codec Midleware # - load firmware # ACM_CODEC=encoder if [ "${ACM_CODEC}" = "encoder" -o "${ACM_CODEC}" = "decoder" ]; then echo -n "load ${ACM_CODEC} firmware: " echo "${ACM_CODEC}" > /sys/devices/platform/acm.0/codec for i in 1 2 3 4 5; do sleep 1 grep "\[${ACM_CODEC}\]" /sys/devices/platform/acm.0/codec > /dev/null if [ $? -eq 0 ]; then break else false fi done check_status fi ## Wired network enable WIRED_NETWORK=y if [ "${WIRED_NETWORK}" = "y" ]; then ifup eth0 fi ## Firewall Settings RTSP_PORT=554 iptables -A INPUT -p tcp --dport ${RTSP_PORT} -j ACCEPT # if you delete firewall-rules, execute following command. #iptables -D INPUT -p tcp --dport OLD_RTSP_PORT -j ACCEPT ## Copy factory default files if [ ! -e /etc/config/onvif ]; then cp -ar /etc/default/onvif /etc/config fi if [ ! -e /etc/config/onvif_default ]; then cp -ar /etc/default/onvif_default /etc/config fi ## Setup Gstreamer Plugin export GST_PLUGIN_SYSTEM_PATH_1_0=/usr/lib/gstreamer-1.0 export GST_PLUGIN_SCANNER_1_0=/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner ## Execute nvtapl if [ "${USB_GADGET_IS_UVC_COMPOSITE}" = "n" ]; then date 2015.04.02-00:00:00 nvtapl& fi