Merge "[Bugfix][T108-GSW][bug-view-1717] gsw modem state monitor doesn't work: link only support dlsym" into GSW_V1453
diff --git a/build.sh b/build.sh
index 8346703..463ffbf 100755
--- a/build.sh
+++ b/build.sh
@@ -582,8 +582,8 @@
 	if [ "$SEC_SUPPORT" == "Y" ];then
 		# build mbtk lib in the first.
 		build_mbtk
-	
-		excmd make OPT_SEC=y -j8 V=99 2>&1 | tee build.log
+	        excmd make -j8 V=99 2>&1 | tee build.log
+	#	excmd make OPT_SEC=y -j1 V=99 2>&1 | tee build.log
 	else
 		excmd make -j8 V=99 2>&1 | tee build.log
 	fi
diff --git a/config/defconfig_asr1806p301 b/config/defconfig_asr1806p301
index 29e61fb..850796b 100755
--- a/config/defconfig_asr1806p301
+++ b/config/defconfig_asr1806p301
@@ -98,7 +98,7 @@
 # Global build settings
 #
 CONFIG_MBTK_BUILD_PROJECT="T108"
-# CONFIG_MBTK_ADB_SEC_SUPPORT is not set
+CONFIG_MBTK_ADB_SEC_SUPPORT=y
 CONFIG_MBTK_DRIVERS=y
 # CONFIG_CUSTOMER_DRIVERS is not set
 # CONFIG_MPIPE_SHARE_NETWORK is not set
@@ -112,10 +112,11 @@
 CONFIG_AB_SYSTEM=y
 CONFIG_ASR_SDTIM=y
 # CONFIG_SEC is not set
-# CONFIG_TEE_OS is not set
+CONFIG_TEE_OS=y
 CONFIG_LIB_ATPS=y
 CONFIG_HARDWARE_AES_ENGINE=y
-# CONFIG_SECURE_DM is not set
+CONFIG_SECURE_DM=y
+# CONFIG_SECURE_DM_CRYPT is not set
 # CONFIG_SECURE_IMA is not set
 # CONFIG_QSPINAND_64M is not set
 # CONFIG_MODULE_BUILDIN is not set
@@ -301,10 +302,25 @@
 CONFIG_KERNEL_DXSLIC_NONE=y
 # CONFIG_KERNEL_SECURITY_NETWORK_XFRM is not set
 CONFIG_XFRM_USER=m
-# CONFIG_KERNEL_MD is not set
+CONFIG_KERNEL_MD=y
+CONFIG_KERNEL_BLK_DEV_DM=y
+CONFIG_KERNEL_DM_VERITY=y
+# CONFIG_KERNEL_DM_CRYPT is not set
+CONFIG_KERNEL_DM_INIT=y
+# CONFIG_KERNEL_BLK_DEV_MD is not set
 # CONFIG_KERNEL_DM_DEBUG_BLOCK_MANAGER_LOCKING is not set
+# CONFIG_KERNEL_DM_SNAPSHOT is not set
+# CONFIG_KERNEL_DM_VERITY_VERIFY_ROOTHASH_SIG is not set
+# CONFIG_KERNEL_DM_VERITY_FEC is not set
+# CONFIG_KERNEL_DM_BOW is not set
+CONFIG_KERNEL_DM_USER=y
+CONFIG_KERNEL_TEE=y
+CONFIG_KERNEL_OPTEE=y
+CONFIG_KERNEL_OPTEE_SHM_NUM_PRIV_PAGES=1
 # CONFIG_KERNEL_HW_RANDOM_OPTEE is not set
 # CONFIG_KERNEL_ASR_DSDS is not set
+CONFIG_KERNEL_ASR_OPTEE_VIRTUAL_UART=y
+CONFIG_KERNEL_ASR_OPTEE_LOG_LEVEL=y
 # CONFIG_KERNEL_HW_RANDOM_ASR is not set
 CONFIG_KERNEL_CRYPTO_USER_API=y
 CONFIG_KERNEL_CRYPTO=y
@@ -1962,7 +1978,7 @@
 # CONFIG_BUSYBOX_CONFIG_BB_ARCH is not set
 CONFIG_BUSYBOX_CONFIG_UNIQ=y
 # CONFIG_BUSYBOX_CONFIG_UNLINK is not set
-# CONFIG_BUSYBOX_CONFIG_USLEEP is not set
+CONFIG_BUSYBOX_CONFIG_USLEEP=y
 # CONFIG_BUSYBOX_CONFIG_UUDECODE is not set
 # CONFIG_BUSYBOX_CONFIG_BASE32 is not set
 # CONFIG_BUSYBOX_CONFIG_BASE64 is not set
@@ -7133,19 +7149,19 @@
 CONFIG_MISLIC_MODEM_DTMF_DETECTION=y
 # end of Mislic Configuration
 
-# CONFIG_PACKAGE_optee_app is not set
+CONFIG_PACKAGE_optee_app=y
 
 #
 # OPTEE application Configuration
 #
-# CONFIG_HWRANDOM is not set
-# CONFIG_CIPHER_TEST is not set
-# CONFIG_SECURE_STORAGE is not set
-# CONFIG_ACIPHER_TEST is not set
-# CONFIG_KEY_TEST is not set
+CONFIG_HWRANDOM=y
+CONFIG_CIPHER_TEST=y
+CONFIG_SECURE_STORAGE=y
+CONFIG_ACIPHER_TEST=y
+CONFIG_KEY_TEST=y
 # end of OPTEE application Configuration
 
-# CONFIG_PACKAGE_optee_client is not set
+CONFIG_PACKAGE_optee_client=y
 
 #
 # OPTEE Client Configuration
diff --git a/mbtk/libgsw_lib/gsw_sms_interface.c b/mbtk/libgsw_lib/gsw_sms_interface.c
index a0d74e7..415bc49 100755
--- a/mbtk/libgsw_lib/gsw_sms_interface.c
+++ b/mbtk/libgsw_lib/gsw_sms_interface.c
@@ -442,14 +442,15 @@
 
     if(gsw_sms_callback)
     {
-        if(total_pack > 1 && curr_pack < total_pack)
-        {
+        // if(total_pack > 1 && curr_pack < total_pack)
+        // {
             gsw_sms_callback(GSW_SMS_RECEIVED_FLG, &gsw_sms_msg);
-        }
-        else
-        {
-            gsw_sms_callback(GSW_SMS_FULL_FLG, &gsw_sms_msg);
-        }
+            LOGD("the gsw_sms_state_e is %d\n",GSW_SMS_RECEIVED_FLG);
+        // }
+        // else
+        // {
+        //     gsw_sms_callback(GSW_SMS_FULL_FLG, &gsw_sms_msg);
+        // }
         
     }
 
@@ -508,7 +509,7 @@
         return GSW_HAL_NORMAL_FAIL;
     }
 
-    mbtk_log_init("syslog", "MBTK_RIL");
+    //mbtk_log_init("syslog", "MBTK_RIL");
 
     sms_info_handle = mbtk_info_handle_get();
     if(sms_info_handle == NULL)
diff --git a/mbtk/rootfs/etc/init.d/gsw_start b/mbtk/rootfs/etc/init.d/gsw_start
index 0fe39dd..0d6c5a2 100755
--- a/mbtk/rootfs/etc/init.d/gsw_start
+++ b/mbtk/rootfs/etc/init.d/gsw_start
@@ -3,7 +3,6 @@
 START=12
 start_service() {
         echo "gsw start--" > /dev/kmsg
-        rmmod mfp #temp for gsw
 	echo 255 > /sys/class/leds/red/brightness #when start oemapp up GPIO08
 	ifconfig eth0 up
 	ifconfig eth0 mtu 1500
diff --git a/package/utils/adbd/src/adb/file_sync_service.c b/package/utils/adbd/src/adb/file_sync_service.c
index 3d83eb7..749d5a7 100755
--- a/package/utils/adbd/src/adb/file_sync_service.c
+++ b/package/utils/adbd/src/adb/file_sync_service.c
@@ -582,7 +582,9 @@
                     D("MBTK : chmod(%s, %x) fail.\n", file_name, mode);
                 } else {
                     D("MBTK : chmod(%s, %x) success.\n", file_name, mode);
-                    system("sync");
+                    int result = system("sync");
+                    if (result)
+                        fail_message(fd, "system failure");
                 }
             }
 #endif
diff --git a/package/utils/adbd/src/adb/services.c b/package/utils/adbd/src/adb/services.c
index b57e891..1181b8a 100755
--- a/package/utils/adbd/src/adb/services.c
+++ b/package/utils/adbd/src/adb/services.c
@@ -425,6 +425,7 @@
     switch (mode) {
     case SUBPROC_PTY:
         ret_fd = create_subproc_pty(SHELL_COMMAND, arg0, arg1, &pid);
+        printf("cmd is %s\n",SHELL_COMMAND);
         break;
     case SUBPROC_RAW:
         ret_fd = create_subproc_raw(SHELL_COMMAND, arg0, arg1, &pid);
diff --git a/target/linux/mmp/base-files/bin/adb_shell b/target/linux/mmp/base-files/bin/adb_shell
index befe636..d95d930 100755
--- a/target/linux/mmp/base-files/bin/adb_shell
+++ b/target/linux/mmp/base-files/bin/adb_shell
@@ -1,14 +1,15 @@
 #!/bin/sh
 export ENV='/etc/adb_profile'
 
-USER_NAME=root
+#USER_NAME=root
 
-#if [ $1 = '-' ];then
-#    /bin/login
-#elif [ $1 = '-c' ];then
-#    /bin/login -c "$2"
-#else
-#    /bin/login
-#fi
+if [ $1 = '-' ];then
+    /bin/login
+elif [ $1 = '-c' ];then
+    /bin/login -c "$2"
+else
+    /bin/login
 
-/bin/login $USER_NAME
+fi
+
+#/bin/login $USER_NAME
diff --git a/target/linux/mmp/base-files/etc/init.d/cm.init b/target/linux/mmp/base-files/etc/init.d/cm.init
index eee7c8f..0b9c7ff 100755
--- a/target/linux/mmp/base-files/etc/init.d/cm.init
+++ b/target/linux/mmp/base-files/etc/init.d/cm.init
@@ -63,7 +63,7 @@
 				start_instance 0 "cm" "${PATH_UBIN}"
 			fi
 			[ "$PRODMODE" == "0" ] && /sbin/kmodloader
-			insmod mfp.ko
+			#insmod mfp.ko
 		fi
 	fi
 }