ASR_BASE
Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/target/linux/mmp/base-files/etc/init.d/services.init b/target/linux/mmp/base-files/etc/init.d/services.init
new file mode 100755
index 0000000..a843afc
--- /dev/null
+++ b/target/linux/mmp/base-files/etc/init.d/services.init
@@ -0,0 +1,64 @@
+#!/bin/sh /etc/rc.common
+
+START=42
+
+USE_PROCD=1
+
+PATH_BIN=/bin/
+PATH_UBIN=/usr/bin/
+PATH_CURR=
+
+start_instance() {
+ local respawn="$1"
+ local name="$2"
+ local path="$3$2"
+ local param="$4"
+
+ procd_open_instance "$name"
+
+ if [ -n "$param" ]; then
+ procd_set_param command "$path" "$param"
+ else
+ procd_set_param command "$path"
+ fi
+
+ if [ $respawn == 1 ]; then
+ procd_set_param respawn
+ fi
+ procd_close_instance
+}
+
+start_service() {
+ echo "Start Marvell Service Applications"
+
+ HAWK=`uci get cmdline.HAWK 2> /dev/null`
+ PIPE=`uci get cmdline.PIPE 2> /dev/null`
+ if [ "$PIPE" == "1" ]; then
+ local lan_auto=`uci get network.lan.auto 2> /dev/null`
+ if [ "$lan_auto" == "0" ]; then
+ uci set network.lan.auto=1
+ uci commit network
+ /etc/init.d/network reload
+ fi
+ fi
+
+# start_instance 0 "chl" "${PATH_UBIN}"
+ start_instance 0 "stk" "${PATH_UBIN}"
+ start_instance 0 "traf_m" "${PATH_UBIN}"
+ start_instance 0 "traf_s" "${PATH_UBIN}"
+ start_instance 0 "router" "${PATH_UBIN}"
+
+ start_instance 0 "aoc" "${PATH_UBIN}"
+ start_instance 0 "ota" "${PATH_UBIN}" "ota"
+ start_instance 0 "tr069" "${PATH_UBIN}"
+ start_instance 0 "ctcc_dm_http" "${PATH_UBIN}"
+ start_instance 0 "ctcc_dm_sms" "${PATH_UBIN}"
+
+ if [ "$HAWK" == "1" ]; then
+ start_instance 0 "hawk" "${PATH_BIN}" -p
+ fi
+
+ [ -e /sys/devices/platform/asr-gps* ] && {
+ start_instance 0 "gnss_demo" "${PATH_BIN}"
+ }
+}