Add sysdump and appdump support(Default is close)

Change-Id: I26264bb2763a76e997fb878e34550c0ee482b844
diff --git a/mbtk/rootfs/etc/init.d/mbtk_boot_eary b/mbtk/rootfs/etc/init.d/mbtk_boot_eary
index e3d293d..f0971ed 100755
--- a/mbtk/rootfs/etc/init.d/mbtk_boot_eary
+++ b/mbtk/rootfs/etc/init.d/mbtk_boot_eary
@@ -6,6 +6,11 @@
 mbtk_start() {
 	echo "start : $1" > /dev/kmsg
 	
+	DEBUG_ENABLE=`getprop persist.mbtk.appdump 2> /dev/null`
+	if [ "$DEBUG_ENABLE" == "1" ];then
+		ulimit -c unlimited
+	fi
+	
 	if [ -e $1 ];then
 		# stdout and stderr > /dev/null
 		#$@ &> /dev/null &
diff --git a/mbtk/rootfs/etc/init.d/mbtk_boot_last b/mbtk/rootfs/etc/init.d/mbtk_boot_last
index 4b13013..ba26a21 100755
--- a/mbtk/rootfs/etc/init.d/mbtk_boot_last
+++ b/mbtk/rootfs/etc/init.d/mbtk_boot_last
@@ -20,6 +20,11 @@
 	echo "--mbtk last boot start--" > /dev/kmsg
 #	mbtk_start /bin/mbtk_test
 #	mbtk_start /bin/mbtk_test "last" 123
+
+	DEBUG_ENABLE=`getprop persist.mbtk.appdump 2> /dev/null`
+	if [ "$DEBUG_ENABLE" == "1" ];then
+		ulimit -c unlimited
+	fi
 	
 	# [ -e /bin/mbtk_otad ] && mbtk_start /bin/mbtk_otad -a fota
 	
diff --git a/mbtk/rootfs/etc/init.d/mbtk_boot_net_ready b/mbtk/rootfs/etc/init.d/mbtk_boot_net_ready
index f00b0c2..37c2f83 100755
--- a/mbtk/rootfs/etc/init.d/mbtk_boot_net_ready
+++ b/mbtk/rootfs/etc/init.d/mbtk_boot_net_ready
@@ -3,6 +3,11 @@
 mbtk_start() {
 	echo "start : $1" > /dev/kmsg
 	
+	DEBUG_ENABLE=`getprop persist.mbtk.appdump 2> /dev/null`
+	if [ "$DEBUG_ENABLE" == "1" ];then
+		ulimit -c unlimited
+	fi
+	
 	if [ -e $1 ];then
 		# stdout and stderr > /dev/null
 		#$@ &> /dev/null &
diff --git a/mbtk/rootfs/etc/init.d/mbtk_boot_normal b/mbtk/rootfs/etc/init.d/mbtk_boot_normal
index 2ab83c8..8e0f8f4 100755
--- a/mbtk/rootfs/etc/init.d/mbtk_boot_normal
+++ b/mbtk/rootfs/etc/init.d/mbtk_boot_normal
@@ -27,6 +27,14 @@
 	echo "--mbtk normal boot start--" > /dev/kmsg
 #	mbtk_start /bin/mbtk_test
 #	mbtk_start /bin/mbtk_test "normal" 123
+
+	# ÆôÓÃapp dump
+	DEBUG_ENABLE=`getprop persist.mbtk.appdump 2> /dev/null`
+	if [ "$DEBUG_ENABLE" == "1" ];then
+		ulimit -c unlimited
+		[ ! -d /oemdata/dump ] && mkdir -p /oemdata/dump
+		[ -f /proc/sys/kernel/core_pattern ] && echo "/oemdata/dump/coredump-%e-%s-%t" > /proc/sys/kernel/core_pattern
+	fi
 	
 	[ -e /bin/mbtk_adbd ] && mbtk_start /bin/mbtk_adbd
 	[ -e /bin/mbtk_servicesd ] && mbtk_start_with_try /bin/mbtk_servicesd
diff --git a/mbtk/rootfs/etc/init.d/mbtk_boot_server_ready b/mbtk/rootfs/etc/init.d/mbtk_boot_server_ready
index 983f5fa..f0fdaf1 100755
--- a/mbtk/rootfs/etc/init.d/mbtk_boot_server_ready
+++ b/mbtk/rootfs/etc/init.d/mbtk_boot_server_ready
@@ -3,6 +3,11 @@
 mbtk_start() {
 	echo "start : $1" > /dev/kmsg
 	
+	DEBUG_ENABLE=`getprop persist.mbtk.appdump 2> /dev/null`
+	if [ "$DEBUG_ENABLE" == "1" ];then
+		ulimit -c unlimited
+	fi
+	
 	if [ -e $1 ];then
 		# stdout and stderr > /dev/null
 		#$@ &> /dev/null &