[Feature][T108][task-view-1591] call start_oemapp.sh script when booting up 1

Only Configure: No
Affected branch: GSW_V1453
Affected module: ALL
Is it affected on IC: only ASR
Self-test: yes
Doc Update: no

Change-Id: I596b5590fe227159eaffef6c2a5efebd7f293be8
diff --git a/build.sh b/build.sh
index efe3d45..712b03b 100755
--- a/build.sh
+++ b/build.sh
@@ -184,6 +184,10 @@
 			ln -s ../init.d/mbtk_logd S13mbtk_logd
 		fi
 
+		if [ ! -f S20gsw_start -a -f ../init.d/gsw_start ];then
+			ln -s ../init.d/gsw_start S20gsw_start
+		fi
+
 		cd $CUR_PWD
 
 		if [ -d $MBTK_DIR/lib_tmp ];then
diff --git a/mbtk/rootfs/etc/gsw_oemapp_start.sh b/mbtk/rootfs/etc/gsw_oemapp_start.sh
new file mode 100755
index 0000000..dd9dde2
--- /dev/null
+++ b/mbtk/rootfs/etc/gsw_oemapp_start.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+gsw_start(){
+
+        MAX_WAIT=20  # 20s
+        STATE=$(uci get persist.mbtk.sdk__state 2>/dev/null)
+
+        count=0
+        while [ "$STATE" != "0" ] && [ $count -lt $MAX_WAIT ]; do
+                sleep 1
+                STATE=$(uci get persist.mbtk.sdk__state 2>/dev/null)
+                count=$((count + 1))
+                echo "wait sdk ready count:$count" > /dev/kmsg
+        done
+        echo "GSW oemapp start" > /dev/kmsg
+        /oemapp/start_oemapp.sh &
+}
+
+if [ -f /oemapp/start_oemapp.sh ];then
+        gsw_start
+fi
+
diff --git a/mbtk/rootfs/etc/init.d/gsw_start b/mbtk/rootfs/etc/init.d/gsw_start
new file mode 100755
index 0000000..6ecf684
--- /dev/null
+++ b/mbtk/rootfs/etc/init.d/gsw_start
@@ -0,0 +1,12 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2011 OpenWrt.org
+START=20
+start_service() {
+	echo "gsw start--" > /dev/kmsg
+	if [ -f /etc/gsw_oemapp_start.sh ]
+        then
+		/etc/gsw_oemapp_start.sh &
+	fi
+	echo "--gsw start end--" > /dev/kmsg
+}
+start_service
diff --git a/mbtk/rootfs/media/hello b/mbtk/rootfs/media/hello
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/mbtk/rootfs/media/hello