Add sysdump and appdump support(Default is close)

Change-Id: I26264bb2763a76e997fb878e34550c0ee482b844
diff --git a/marvell/linux/kernel/signal.c b/marvell/linux/kernel/signal.c
old mode 100644
new mode 100755
index 25fd3ec..224ed52
--- a/marvell/linux/kernel/signal.c
+++ b/marvell/linux/kernel/signal.c
@@ -1280,9 +1280,13 @@
 static void panic_on_fatal_signals(int signr)
 {
 	int i;
-
+	// Change by liubin for not reboot when App dump.
+#if 1
+	return;
+#else
 	if (print_fatal_signals < 15)
 		return;
+#endif
 	for (i = 0; i < K_SIG_GUIDS_MAX; i++) {
 		if (k_sig_uid[i] < 0)
 			break;
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 &
diff --git a/package/network/services/lte-telephony/files/telinit b/package/network/services/lte-telephony/files/telinit
index 9483d76..53289ad 100755
--- a/package/network/services/lte-telephony/files/telinit
+++ b/package/network/services/lte-telephony/files/telinit
@@ -35,7 +35,7 @@
 cmdline2uci
 
 # Add by liubin for open/close dump.
-RDUP_MODE=`getprop persist.mbtk.dump 2> /dev/null`
+RDUP_MODE=`getprop persist.mbtk.sysdump 2> /dev/null`
 if [ "$RDUP_MODE" == "1" ];then
     echo 0xF > /proc/sys/kernel/print-fatal-signals
 else