[Feature][T106]add script to make T106

Change-Id: Id7d51de6b9082b421d74253ccdf15d4a00fa7d6a
diff --git a/esdk_patch/linux_bb.diff b/esdk_patch/linux_bb.diff
new file mode 100644
index 0000000..b4bc4f9
--- /dev/null
+++ b/esdk_patch/linux_bb.diff
@@ -0,0 +1,25 @@
+diff --git a/linux-zxic_5.10.bb b/linux-zxic_5.10.bb
+old mode 100644
+new mode 100755
+index 29942f4..4b10e1c
+--- a/linux-zxic_5.10.bb
++++ b/linux-zxic_5.10.bb
+@@ -4,15 +4,15 @@ PV      = "${LINUX_VERSION}"
+ LICENSE = "GPLv2"
+ LIC_FILES_CHKSUM ?= "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
+ LINUX_VERSION    ?= "5.10.156"
+-
++BSPDIR = "${TOPDIR}/../upstream/"
+ #pub include
+-include ${BSPDIR}/sources/meta-zxic/conf/pub.inc
++include ${TOPDIR}/layers/meta-zxic/conf/pub_esdk.inc
+ 
+ DEPENDS += "kern-tools-native"
+ inherit kernel  siteinfo  
+ 
+ EXTRA_OEMAKE_append = " LOADADDR=${KERNEL_LOADADDR} EXTRA_CFLAGS='${ZXIC_EXTRA_CFLAGS}' "
+-FILESEXTRAPATHS_prepend :="${SRC-PATH}:"
++FILESEXTRAPATHS_prepend :="${TOPDIR}/../upstream:"
+ # PR_CONFIG_cpe = "linux-5_10-cpe-${BOOT_CTL}-defconfig"
+ # PR_CONFIG_v2x = "linux-5_10-v2x-${BOOT_CTL}-defconfig"
+ PR_CONFIG_vehicle_dc = "linux-5_10-vehicle_dc-${BOOT_CTL}-defconfig"
diff --git a/esdk_patch/mk_esdk.sh b/esdk_patch/mk_esdk.sh
new file mode 100755
index 0000000..5037d76
--- /dev/null
+++ b/esdk_patch/mk_esdk.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+dest_dir_relative=$1
+intall_dir=$(pwd)
+
+chmod a+x ./vehicle_dc-glibc-x86_64-zxic-image-armv7a-zx297520v3-toolchain-ext-1.0.sh
+mkdir ${dest_dir_relative}
+cd $1
+dest_dir=$(pwd)
+cd $intall_dir
+if [ ! -d ${dest_dir} ]; then
+	echo "Input invaild path for folders to install\n"
+	exit 1
+fi
+./vehicle_dc-glibc-x86_64-zxic-image-armv7a-zx297520v3-toolchain-ext-1.0.sh -d ${dest_dir}/esdk
+tar -zxvf upstream.tar.gz -C $dest_dir
+ln -s ${dest_dir}/upstream/tools ${dest_dir}/esdk
+cp linux_bb.diff ${dest_dir}/esdk/layers/meta-zxic/recipes-kernel/linux/
+cd ${dest_dir}/esdk/layers/meta-zxic/recipes-kernel/linux
+git apply linux_bb.diff
+cd ${dest_dir}/esdk
diff --git a/mk_T106.sh b/mk_T106.sh
new file mode 100644
index 0000000..145e993
--- /dev/null
+++ b/mk_T106.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+TOP=$(pwd)
+source update_version.sh
+
+cd ap/project/zx297520v3/prj_vehicle_dc/build/
+make allclean all
+cd ../../../../..
+cd boot/prj/zx297520v3/vehicle_dc/build/
+make allclean all
+cd ../../../../..
+cd cap/zx297520v3/
+#ln -s ~/T106_downloads/downloads/ ./
+DISTRO=vehicle_dc MACHINE=zx297520v3 source zxic-setup-release.sh -b build-vehicle_dc
+bitbake zxic-image && bitbake mkimgsig
+cd ${TOP}/allbins/zx297520v3/prj_vehicle/scripts_linux
+bash copybin_vehicle_dc.sh
+cd ${TOP}/cap/zx297520v3
+bitbake zxic-image -c populate_sdk_ext
+cd ${TOP}
+cp esdk_patch/mk_esdk.sh cap/zx297520v3/build-vehicle_dc/tmp/deploy/sdk/
+cp esdk_patch/linux_bb.diff cap/zx297520v3/build-vehicle_dc/tmp/deploy/sdk/
+mkdir cap/zx297520v3/build-vehicle_dc/tmp/deploy/sdk/upstream
+cp -R pub cap/zx297520v3/build-vehicle_dc/tmp/deploy/sdk/upstream/
+cp -R tools cap/zx297520v3/build-vehicle_dc/tmp/deploy/sdk/upstream/
+cp -R cap/zx297520v3/zxic_code/zxic_source/linux-5.10 cap/zx297520v3/build-vehicle_dc/tmp/deploy/sdk/upstream/
+cd cap/zx297520v3/build-vehicle_dc/tmp/deploy/sdk/
+tar -czvf upstream.tar.gz upstream
+mkdir do_package_tool
+cd ${TOP}
+cp -R allbins cap/zx297520v3/build-vehicle_dc/tmp/deploy/sdk/do_package_tool/
+cd cap/zx297520v3/build-vehicle_dc/tmp/deploy/sdk/
+tar -czvf do_package_tool.tar.gz do_package_tool
+rm -rf do_package_tool upstream
+tar -czvf T106_esdk.tar.gz ./*
diff --git a/update_version.sh b/update_version.sh
index a64b49f..2f49050 100644
--- a/update_version.sh
+++ b/update_version.sh
@@ -10,6 +10,8 @@
 LYNQ_AP_SW_VERSION="export LYNQ_VERSION=\"${LYNQ_AP_VERSION}\""
 LYNQ_COMMITID="LYNQ_CONFIG_COMMITID = \"${COMMIT_ID}\""
 LYNQ_BOOT_COMMIT_ID="LYNQ_COMMIT_ID = \"${COMMIT_ID}\""
+eval sed -i 's/^.*LYNQ_CONFIG_VERSION.*$/"${LYNQ_SW_INSIDE_VERSION}"/' $(pwd)/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc.conf
+eval sed -i 's/^.*LYNQ_CONFIG_SW_VERSION.*$/"${LYNQ_SW_VERSION}"/' $(pwd)/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc.conf
 eval sed -i 's/^.*LYNQ_CONFIG_VERSION.*$/"${LYNQ_SW_INSIDE_VERSION}"/' $(pwd)/cap/zx297520v3/sources/meta-zxic-custom/conf/lynq_base.conf
 eval sed -i 's/^.*LYNQ_CONFIG_SW_VERSION.*$/"${LYNQ_SW_VERSION}"/' $(pwd)/cap/zx297520v3/sources/meta-zxic-custom/conf/lynq_base.conf
 eval sed -i 's/^.*LYNQ_CONFIG_COMMITID.*$/"${LYNQ_COMMITID}"/' $(pwd)/cap/zx297520v3/sources/meta-zxic-custom/conf/lynq_base.conf