From 69553ad37547b9202350da5a8e72c8b53e9462d3 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Sat, 29 Oct 2022 10:19:23 +0800
Subject: [PATCH] Merge branch 'master' of ssh://master.iot-yun.club:2280/imx6ull
---
tools/setup_tools.sh | 48 +++++++++++++++++++++---------------------------
1 files changed, 21 insertions(+), 27 deletions(-)
diff --git a/tools/setup_tools.sh b/tools/setup_tools.sh
index 11c2908..4c75e07 100755
--- a/tools/setup_tools.sh
+++ b/tools/setup_tools.sh
@@ -2,8 +2,6 @@
# This shell script used to setup imx6ull build envrionment
#
-LYFTP_PUB=http://wekei-iot.com:2211/imx/igkboard/tools/lintools
-
# display in yellow
function pr_warn() {
echo -e "\033[40;33m --W-- $1 \033[0m\n"
@@ -47,7 +45,7 @@
systools="coreutils jq wget curl tree gawk sed unzip cpio lz4 lzop zstd rsync kmod kpartx tmux \
desktop-file-utils iputils-ping xterm diffstat chrpath asciidoc docbook-utils help2man \
build-essential gcc g++ make cmake automake groff socat flex texinfo bison texi2html \
- git cvs subversion mercurial autoconf autoconf-archive \
+ bc git cvs subversion mercurial autoconf autoconf-archive \
python2 python3 python3-pip python3-pexpect python3-git python3-jinja2 libsdl1.2-dev \
lib32z1 libssl-dev libncurses-dev lib32ncurses-dev libgl1-mesa-dev libglu1-mesa-dev \
"
@@ -56,7 +54,7 @@
apt install -y $systools
}
-function install_crosstool()
+function install_devtools()
{
if command -v arm-linux-gnueabihf-gcc > /dev/null 2>&1 ; then
pr_warn "All development tools already installed, skip it"
@@ -69,39 +67,35 @@
binfmt-support qemu qemu-user-static debootstrap debian-archive-keyring "
apt install -y $devtools
-
- #sudo update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc-9 10
}
-function install_buildroot()
+# NXP document suggest cross compiler from ARM Developer:
+# https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
+function install_crosstool()
{
- BUILDROOT_PATH=/opt/buildroot
- BUILDROOT_NAME=cortexA7
+ ARMTOOL_VER=10.3-2021.07
+ ARMTOOL_NAME=gcc-arm-$ARMTOOL_VER
+ ARMTOOL_PACK=${ARMTOOL_NAME}-`uname -p`-arm-none-linux-gnueabihf
+ ARMTOOL_URL=https://developer.arm.com/-/media/Files/downloads/gnu-a/$ARMTOOL_VER/binrel/
- BUILDROOT_VER=buildroot-2021.02.7-cortexA7
- BUILDROOT_TAR=${BUILDROOT_VER}.tar.bz2
- BUILDROOT_DLADDR=${LYFTP_PUB}/$BUILDROOT_TAR
-
- if [ -d ${BUILDROOT_PATH}/${BUILDROOT_NAME} ] ; then
- pr_warn "Buildroot already installed to $BUILDROOT_PATH/$BUILDROOT_NAME"
+ if [ -d /opt/$ARMTOOL_NAME ] ; then
+ pr_info "$ARMTOOL_NAME crosstool already installed, skip it"
return 0;
fi
- mkdir -p ${BUILDROOT_PATH}
+ pr_info "start download cross compiler from ARM Developer"
- if [ ! -f $BUILDROOT_TAR ] ; then
- pr_info "download $BUILDROOT_VER now..."
- wget -c $BUILDROOT_DLADDR
+ if [ ! -s $ARMTOOL_PACK.tar.xz ] ; then
+ wget $ARMTOOL_URL/$ARMTOOL_PACK.tar.xz
fi
- pr_info "install $BUILDROOT_VER to $BUILDROOT_PATH/$BUILDROOT_NAME now..."
- tar -xjf ${BUILDROOT_TAR} -C ${BUILDROOT_PATH}
+ tar -xJf $ARMTOOL_PACK.tar.xz -C /opt
+ rm -f $ARMTOOL_PACK.tar.xz
- $BUILDROOT_PATH/$BUILDROOT_NAME/bin/arm-linux-gcc -v
+ mv /opt/$ARMTOOL_PACK /opt/$ARMTOOL_NAME
- pr_info "Cross compiler: $BUILDROOT_PATH/$BUILDROOT_NAME/bin/arm-linux-"
-
- rm -f ${BUILDROOT_TAR}
+ /opt/$ARMTOOL_NAME/bin/arm-none-linux-gnueabihf-gcc -v
+ pr_info "cross compiler installed to \"/opt/$ARMTOOL_NAME\" successfully"
}
echo ""
@@ -110,7 +104,7 @@
install_systools
-install_crosstool
+install_devtools
-#install_buildroot
+install_crosstool
--
Gitblit v1.9.1