scripts: skip autopatch when not git [1/1]

PD#TV-142755

Problem:
skip autopatch when not git

Solution:
skip autopatch when not git

Verify:
local

Change-Id: I242f8d1fa8ea0741496b4879e45dc4a989ad73ef
Signed-off-by: qinglin.li <qinglin.li@amlogic.com>
diff --git a/amlogic_utils.sh b/amlogic_utils.sh
index 034706f..41dcef7 100644
--- a/amlogic_utils.sh
+++ b/amlogic_utils.sh
@@ -1591,7 +1591,12 @@
 		[[ "${FULL_KERNEL_VERSION}" != "common13-5.15" && "${ARCH}" == "arm64" ]] && BAZEL=1
 	fi
 
-	auto_patch_to_common_dir
+	if [[ -d ${KERNEL_DIR}/.git ]]; then
+		auto_patch_to_common_dir
+	else
+		echo "WARNING: no git, auto patch skip!!!"
+		export SYS_SKIP_GIT=1
+	fi
 
 	if [[ ! -f ${BUILD_DIR}/build_abi.sh && ${BAZEL} == 0 ]]; then
 		echo "The directory of build does not exist";
diff --git a/mk.sh b/mk.sh
index 12eed49..e6adfe5 100755
--- a/mk.sh
+++ b/mk.sh
@@ -110,7 +110,8 @@
 build_part_of_kernel
 
 if [[ "${FULL_KERNEL_VERSION}" != "common13-5.15" && "${ARCH}" = "arm64" && ${BAZEL} == 1 ]]; then
-	args="$@ --config=stamp --config=fast"
+	args="$@ --config=fast"
+	[[ -z ${SYS_SKIP_GIT} ]] && args="${args} --config=stamp"
 	[[ -z ${PREBUILT_GKI} ]] && args="${args} --lto=${LTO}"
 	[[ -n ${FAST_BUILD} ]] && args="${args} --lto=none"
 	[[ -z ${GKI_CONFIG} ||  -n ${FAST_BUILD} ]] && args="${args} --notrim --nokmi_symbol_list_strict_mode"