From 6af5ebcb9035ac368840c8786c5fe89ad95c33ea Mon Sep 17 00:00:00 2001 From: Zachery Wu Date: Mon, 27 Sep 2021 11:51:57 +0800 Subject: [PATCH] fix shell script. Signed-off-by: Zachery Wu Change-Id: I55dfb07369b100ba5a7e56f15bb5b18262b52432 --- kernel_module_build.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel_module_build.sh b/kernel_module_build.sh index aeeca2f..d9e5db0 100755 --- a/kernel_module_build.sh +++ b/kernel_module_build.sh @@ -17,21 +17,21 @@ set -e export OUT_DIR=$1 export KERNEL_VERSION=$6 -if [ $2 == "small" ];then +if [ "$2" == "small" ];then if [ ""x == $(which arm-linux-gnueabi-ld)x ] || [ ""x == $(which arm-linux-gnueabi-gcc)x ];then echo "Please install gcc-arm-linux-gnueabi, run \"sudo apt-get install gcc-arm-linux-gnueabi\"." exit 1 fi export BUILD_TYPE=small LINUX_KERNEL_OUT=${OUT_DIR}/kernel/${KERNEL_VERSION} - if [ $3 != "" ];then + if [ "$3" != "" ];then LLVM_PATH=$3 export CLANG_CC=${LLVM_PATH}/bin/clang fi - if [ $5 == "hispark_taurus" ];then + if [ "$5" == "hispark_taurus" ];then export DEVICE_NAME=hi3516dv300 fi -elif [ $2 == "standard" ];then +elif [ "$2" == "standard" ];then export BUILD_TYPE=standard export DEVICE_NAME=$5 LINUX_KERNEL_OUT=${OUT_DIR}/kernel/src_tmp/${KERNEL_VERSION} @@ -46,14 +46,14 @@ LINUX_KERNEL_UIMAGE_FILE=${LINUX_KERNEL_OBJ_OUT}/arch/arm/boot/uImage make -f kernel.mk -if [ -f ${LINUX_KERNEL_UIMAGE_FILE} ];then +if [ -f "${LINUX_KERNEL_UIMAGE_FILE}" ];then echo "uImage: ${LINUX_KERNEL_UIMAGE_FILE} build success" else echo "uImage: ${LINUX_KERNEL_UIMAGE_FILE} build failed!!!" exit 1 fi -if [ $2 == "small" ];then +if [ "$2" == "small" ];then cp -rf ${LINUX_KERNEL_UIMAGE_FILE} ${OUT_DIR}/uImage_${DEVICE_NAME}_smp fi -- Gitee