[bugfix][T108] [Task-1677] Optimize CP log config (case:Question #136388)

Only Configure: No
Affected branch: GSW_V1453
Affected module: log
Self-test: yes
Doc Update: no

Change-Id: Ib8436ef3a4fd0b19274500b79a737a07eb3b2881
diff --git a/marvell/lte-telephony/configuration/mrvl_tel_diag.cfg b/marvell/lte-telephony/configuration/mrvl_tel_diag.cfg
index 6ea751f..db4dbb9 100644
--- a/marvell/lte-telephony/configuration/mrvl_tel_diag.cfg
+++ b/marvell/lte-telephony/configuration/mrvl_tel_diag.cfg
@@ -9,7 +9,7 @@
 #output logcat message
 logcat_enable=1
 #Default Media: 0-off, 1-usb (default), 2-sd, 3-tcp
-default_media=1
+default_media=2
 #Diag Silent Type: 0-off, 1-on (default)
 silent_type=1
 #Write Cache Size in KBytes
@@ -29,7 +29,7 @@
 #SD mode mount point
 mount_path=/mnt/mmcblk0
 #SD mode directory
-log_path=/sdcard
+log_path=/media/var/log
 #Log folder name prefix
 folder_prefix=Log
 
diff --git a/mbtk/rootfs/etc/init.d/mbtk_boot_normal b/mbtk/rootfs/etc/init.d/mbtk_boot_normal
index d3e0f61..a587798 100755
--- a/mbtk/rootfs/etc/init.d/mbtk_boot_normal
+++ b/mbtk/rootfs/etc/init.d/mbtk_boot_normal
@@ -35,8 +35,6 @@
 	DEBUG_ENABLE=`getprop persist.mbtk.appdump 2> /dev/null`
 	if [ "$DEBUG_ENABLE" == "1" ];then
                 grep -qxF 'ulimit -c unlimited' /etc/profile || echo 'ulimit -c unlimited' >> /etc/profile
-                sed -i 's/^default_media=.*/default_media=2/' /etc/mrvl_tel_diag.cfg
-                sed -i 's|^log_path=.*|log_path=/media/var/log|' /etc/mrvl_tel_diag.cfg
             
                 [ ! -d /media/var/log/modem_dump ] && mkdir -p /media/var/log/modem_dump
 		[ -f /proc/sys/kernel/core_pattern ] && echo "/media/var/log/modem_dump/coredump-%e-%s-%t" > /proc/sys/kernel/core_pattern
diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot
index b98e302..36724d1 100755
--- a/package/base-files/files/etc/init.d/boot
+++ b/package/base-files/files/etc/init.d/boot
@@ -4,6 +4,9 @@
 START=10
 STOP=90
 
+PRODMODE=`uci get cmdline.PROD 2> /dev/null`
+RDUPMODE=`uci get cmdline.RDUP 2> /dev/null`
+
 uci_apply_defaults() {
 	. /lib/functions/system.sh
 
@@ -55,7 +58,11 @@
 	/sbin/wifi config
 	uci_apply_defaults
 	sync
-	
+
+        if [ "$PRODMODE" == "0" ] && [ "$RDUPMODE" == "1" ];then
+	        nice -n -5 /bin/diag &
+        fi
+
 	# temporary hack until configd exists
 	/sbin/reload_config
 
diff --git a/package/network/services/lte-telephony/Makefile b/package/network/services/lte-telephony/Makefile
index 7af8941..43104b9 100755
--- a/package/network/services/lte-telephony/Makefile
+++ b/package/network/services/lte-telephony/Makefile
@@ -112,6 +112,20 @@
 		compile
 endef
 
+define Build/Install
+	$(MAKE) $(PKG_JOBS) -C $(SVC_SOURCE_DIR) \
+		SUBTARGET="$(SUBTARGET)" \
+		CROSS_COMPILE="$(TARGET_CROSS)" \
+		EXTRA_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include \
+			-I$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/include \
+			-I$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-$(LIBC_VERSION)/include" \
+		LD_FLAGS="$(TARGET_LDFLAGS) -L$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-$(LIBC_VERSION)/lib/ -L$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-$(LIBC_VERSION)/libc/"\
+		INSTALL_DIR="$(PKG_INSTALL_DIR)" \
+		OBJ_DIR="$(PKG_BUILD_DIR)/obj" \
+		PKG_BUILD_DIR="$(PKG_BUILD_DIR)" \
+		install
+endef
+
 define Build/Clean
     @if [ -e $(SVC_SOURCE_DIR)/apps/atcmd_server ]; then \
         echo "Removing previous atcmd_server symlink..."; \
diff --git a/package/network/services/lte-telephony/files/telinit b/package/network/services/lte-telephony/files/telinit
index 62c6cc6..a6e5d5a 100755
--- a/package/network/services/lte-telephony/files/telinit
+++ b/package/network/services/lte-telephony/files/telinit
@@ -84,10 +84,6 @@
 	/bin/atcmdsrv -A &
 fi
 
-if [ "$PRODMODE" == "0" ] && [ "$RDUPMODE" == "1" ];then
-	nice -n -5 /bin/diag &
-fi
-
 #need to start rndis for ramdump mode
 if [ "$PRODMODE" == "0" ]; then
 	######### user mode ########