From 9367df5d081e4d1adc393727cc4ed5eb378af68c Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Sun, 09 Oct 2022 14:45:49 +0800
Subject: [PATCH] update BSP compiler from ARM Developer

---
 bsp/scripts/setup_env.sh |   43 ++++++++++++++++++++++---------------------
 1 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/bsp/scripts/setup_env.sh b/bsp/scripts/setup_env.sh
index 701935d..fd4acf5 100755
--- a/bsp/scripts/setup_env.sh
+++ b/bsp/scripts/setup_env.sh
@@ -5,28 +5,29 @@
 
 # update by top build.sh
 BOARD=igkboard
-CROSS_TOOL=/opt/buildroot/cortexA7/bin/arm-linux-
+CROSS_TOOL=/opt/gcc-arm-11.2-2022.02/bin/arm-none-linux-gnueabihf-
 
 # Source code download address
-SRC_URL=http://weike-iot.com:2211/imx6ull/
-#SRC_URL=http://127.0.0.1:2211/imx6ull/
-BSP_VER=lf-5.10.52-2.1.0
+SRV_URL=http://weike-iot.com:2211
+#SRV_URL=http://127.0.0.1:2211
+BSP_VER=lf-5.15.32-2.0.0
+BSP_URL=${SRV_URL}/imx/bsp/${BSP_VER}
 
-# SYSTEM  should be: yocto, buildroot or debian
-# DISTRO  should be: hardknott/honister, 2021.02 or bullseye
+# SYSTEM  should be: yocto or debian
+# DISTRO  should be: hardknott, buster
+# SYSNAME should be: yocto, buster
 SYSTEM=yocto
-DISTRO=hardknott
+DISTRO=kirkstone
 
 TARBALL_DIR=${PRJ_PATH}/../tarballs/
 
-if [ $SYSTEM == "buildroot" ] ; then
-    SYSNAME=${SYSTEM}
-else
+if [ $SYSTEM == "debian" ] ; then
     SYSNAME=${DISTRO}
+else
+    SYSNAME=${SYSTEM}
 fi
 
-ROOTFS_DIR=rootfs_${SYSNAME}
-
+ROOTFS_DIR=rootfs_${DISTRO}
 
 JSON_CONF=${PRJ_PATH}/${BOARD}.json
 JOBS=`cat /proc/cpuinfo | grep processor | wc -l`
@@ -60,8 +61,6 @@
 
     pr_info "decompress $tarball"
 
-    mkdir -p $dstpath
-
     case $tarball in
         *.tar.gz)
             tar -xzf $tarball -C $dstpath
@@ -78,6 +77,10 @@
         *.tar)
             tar -xf $tarball -C $dstpath
             ;;
+
+        *.zip)
+            unzip -qo $tarball -d $dstpath
+	    ;;
 
         *)
             pr_error "decompress Unsupport packet: $tarball"
@@ -97,7 +100,7 @@
 
     mkdir -p $dst
 
-    if [[ $src =~ .tar ]] ; then
+    if [[ "$src" =~ ".tar" ]] || [[ "$src" =~ ".zip" ]] ; then
         do_unpack $src ${dst}
     else
         rm -rf ${dst}/`basename ${src}`
@@ -145,16 +148,14 @@
     dirname=$2
     tarfile=`basename $url`
 
-	mkdir -p ${TARBALL_DIR}
+    mkdir -p ${TARBALL_DIR}
 
     if [ ! -f ${TARBALL_DIR}/$tarfile ] ; then
         pr_info "wget $url"
-        wget $url -P ${TARBALL_DIR} > /dev/null 2>&1
-    fi
 
-    if [ ! -d $dirname ] ; then
-        do_unpack ${TARBALL_DIR}/$tarfile
+	wget $url -P ${TARBALL_DIR} > /dev/null 2>&1
     fi
+	do_unpack ${TARBALL_DIR}/$tarfile $dirname
 }
 
 # fetch source code by copy
@@ -165,7 +166,7 @@
 
     cp -rf $url $tarfile
 
-    if [[ "$tarfile" =~ ".tar" ]] ; then
+    if [[ "$tarfile" =~ ".tar" ]] || [[ "$tarfile" =~ ".zip" ]] ; then
         do_unpack $tarfile $dirname
     fi
 }

--
Gitblit v1.9.1