[Feature][T8TSK-294][UCI]fix rndis config to lynq_uci_ro config_2

Only Configure: Yes
Affected branch: MR3.0-Merge-v3.0-GSW
Affected module: UCI
Is it affected on both ZXIC and MTK: only MTK
Self-test: Yes
Doc Update: No

Change-Id: I91d8e0b872524b413795dc34742ca8dc52cb5c79
diff --git a/meta/meta-mediatek-mt2735/recipes-core/images/mtk-image-2735.bb b/meta/meta-mediatek-mt2735/recipes-core/images/mtk-image-2735.bb
index abd37dc..b3bbdec 100755
--- a/meta/meta-mediatek-mt2735/recipes-core/images/mtk-image-2735.bb
+++ b/meta/meta-mediatek-mt2735/recipes-core/images/mtk-image-2735.bb
@@ -239,9 +239,9 @@
 	SOURCE=${TOPDIR}/tmp/deploy/images/auto2735evb-ivt-main/state
 	TARGET=${TOPDIR}/tmp/work/auto2735evb_ivt_main-poky-linux/mtk-image-2735/1.0-r0/rootfs
 	mkdir ${TARGET}/data_backup
-	cp ${TARGET}/etc/config/radio_property ${TARGET}/data_backup/
-        cp ${TARGET}/data/atsvc/lynq_atsvc_plugin.xml ${TARGET}/data_backup/
-        cp ${TARGET}/data/atsvc/terminal_controller.conf ${TARGET}/data_backup/
+	cp -r ${TARGET}/etc/config/ ${TARGET}/data_backup/
+	cp ${TARGET}/data/atsvc/lynq_atsvc_plugin.xml ${TARGET}/data_backup/
+	cp ${TARGET}/data/atsvc/terminal_controller.conf ${TARGET}/data_backup/
 	if [ -e ${TARGET}/etc/firmware/catcher_filter_5_SuperSlim.bin ]; then
 		cp ${TARGET}/etc/firmware/catcher_filter_5_SuperSlim.bin ${TARGET}/data_backup	
 	fi
diff --git a/meta/meta-mediatek-mt2735/recipes-core/initial/files/lynq_data_recover b/meta/meta-mediatek-mt2735/recipes-core/initial/files/lynq_data_recover
index 0bd5de1..32a45b3 100755
--- a/meta/meta-mediatek-mt2735/recipes-core/initial/files/lynq_data_recover
+++ b/meta/meta-mediatek-mt2735/recipes-core/initial/files/lynq_data_recover
@@ -84,6 +84,21 @@
     format_ubi
 
 }
+
+#you.chen@2023.07.11 add for rndis check start
+check_copy_file() {
+	if [ $# -ne 2 ];then
+		return
+	fi
+
+	diff $1 $2 > /dev/null
+	if [ $? -ne 0 ]; then
+		echo "cp $1 $2" > /dev/kmsg
+		cp $1 $2
+	fi
+}
+#you.chen@2023.07.11 add for rndis check start
+
 recover_tmp_conf()
 {
     FIND_FILE="/usr/lib/tmpfiles.d/tmp.conf"
@@ -119,6 +134,36 @@
         echo "$FIND_STR5" >> "$FIND_FILE"
     fi
 }
+#jb.qi@2024.3.15 add for uci check start
+check_uci()
+{
+    uci get lynq_uci.lynq_ril > /dev/null
+    if [ $? -ne 0 ]; then
+        echo "$TAG: lynq_uci config cant get" > /dev/kmsg
+        cp /data_backup/config/lynq_uci /etc/config/lynq_uci
+    fi
+    uci get mdlog.property > /dev/null
+    if [ $? -ne 0 ]; then
+        echo "$TAG: mdlog config cant get" > /dev/kmsg
+        cp  /data_backup/config/mdlog /etc/config/mdlog
+    fi
+    uci get radio_property.property > /dev/null
+    if [ $? -ne 0 ]; then
+        echo "$TAG: radio_property config cant get" > /dev/kmsg
+        cp  /data_backup/config/radio_property /etc/config/radio_property
+    fi
+    uci get service.tcp > /dev/null
+    if [ $? -ne 0 ]; then
+        echo "$TAG: service config cant get" > /dev/kmsg
+        cp  /data_backup/config/service /etc/config/service
+    fi
+    uci get usb.config > /dev/null
+    if [ $? -ne 0 ]; then
+        echo "$TAG: usb config cant get" > /dev/kmsg
+        cp /data_backup/config/usb /etc/config/usb
+    fi
+}
+#jb.qi@2024.3.15 add for uci check end
 
 cd /
 #recover some files start
@@ -128,10 +173,11 @@
 echo "$TAG: Before recover radio_property" > /dev/kmsg
 rm -rf /etc/config/.*.uci*
 rm -rf /home/root/.config/pulse/*
-
+check_uci
+check_copy_file /data_backup/config/lynq_uci_ro /etc/config/lynq_uci_ro
 mkdir -p /data/atsvc
-cp /data_backup/lynq_atsvc_plugin.xml /data/atsvc/lynq_atsvc_plugin.xml
-cp /data_backup/terminal_controller.conf /data/atsvc/terminal_controller.conf
+check_copy_file /data_backup/lynq_atsvc_plugin.xml /data/atsvc/lynq_atsvc_plugin.xml
+check_copy_file /data_backup/terminal_controller.conf /data/atsvc/terminal_controller.conf
 echo "$TAG: After recover radio_property" > /dev/kmsg
 
 recover_tmp_conf
diff --git a/update_version.sh b/update_version.sh
index 092d58b..873e199 100644
--- a/update_version.sh
+++ b/update_version.sh
@@ -1,10 +1,17 @@
 #!/bin/bash
 
-LYNQ_SW_INSIDE_VERSION="LYNQ_CONFIG_VERSION = \"T800_GSW_v02.MP1_MR3.02b20.06.00\""
-LYNQ_SW_VERSION="LYNQ_CONFIG_SW_VERSION = \"T800_GSW_v02.MP1_MR3.02b20.06.00\""
+SW_INSIDE_VERSION="T800_GSW_v02.MP1_MR3.02b20.06.00"
+SW_VERSION="T800_GSW_v02.MP1_MR3.02b20.06.00"
+
+LYNQ_SW_INSIDE_VERSION="LYNQ_CONFIG_VERSION = \"${SW_INSIDE_VERSION}\""
+LYNQ_SW_VERSION="LYNQ_CONFIG_SW_VERSION = \"${SW_VERSION}\""
+
 COMMIT_ID="$(git rev-parse --short HEAD)"
 LYNQ_COMMITID="LYNQ_CONFIG_COMMITID = \"${COMMIT_ID}\""
 
+LYNQ_VERSION_UCI="        option LYNQ_SW_VERSION '${SW_VERSION}'"
+LYNQ_INSIDE_VERSION_UCI="        option LYNQ_SW_INSIDE_VERSION '${SW_INSIDE_VERSION}'"
+
 eval sed -i 's/^.*LYNQ_CONFIG_VERSION.*$/"${LYNQ_SW_INSIDE_VERSION}"/' $(pwd)/meta/meta-mediatek-mt2735/conf/machine/auto2735evb-ivt-base.conf
 eval sed -i 's/^.*LYNQ_CONFIG_SW_VERSION.*$/"${LYNQ_SW_VERSION}"/' $(pwd)/meta/meta-mediatek-mt2735/conf/machine/auto2735evb-ivt-base.conf
 eval sed -i 's/^.*LYNQ_CONFIG_COMMITID.*$/"${LYNQ_COMMITID}"/' $(pwd)/meta/meta-mediatek-mt2735/conf/machine/auto2735evb-ivt-base.conf
@@ -13,3 +20,6 @@
 eval sed -i 's/^.*LYNQ_CONFIG_SW_VERSION.*$/"${LYNQ_SW_VERSION}"/' $(pwd)/meta-sdk/meta/meta-lynqSDK-T800/conf/machine/auto2735evb-ivt-base.conf
 eval sed -i 's/^.*LYNQ_CONFIG_COMMITID.*$/"${LYNQ_COMMITID}"/' $(pwd)/meta-sdk/meta/meta-lynqSDK-T800/conf/machine/auto2735evb-ivt-base.conf
 
+eval sed -i 's/^.*LYNQ_SW_VERSION.*$/"${LYNQ_VERSION_UCI}"/' $(pwd)/LYNQ_PUBLIC/common_src/lib/liblynq-uci/lynq_uci_ro.config
+eval sed -i 's/^.*LYNQ_SW_INSIDE_VERSION.*$/"${LYNQ_INSIDE_VERSION_UCI}"/' $(pwd)/LYNQ_PUBLIC/common_src/lib/liblynq-uci/lynq_uci_ro.config
+