凌云实验室推出的ARM Linux物联网网关开发板IGKBoard(IoT Gateway Kit Board)项目源码
guowenxue
2023-06-28 fe3873a5423e587161941ba833bfbd266cc37f6a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
 
# exit shell script when command get error
set -e
 
# crosstool name
BUILDROOT_NAME=gcc-10.4-cortexA7-2023.02
 
# crosstool download server URL
LYFTP_PUB=http://master.iot-yun.club:2211/imx/crosstool
 
# install path defined in build shell script
INST_PATH=/opt/buildroot
 
# buildroot version
BR_VER=buildroot-2023.02
 
# set workspace to build buildroot
WORK_SPACE=${HOME}
 
if [ -d $INST_PATH/$BUILDROOT_NAME ] ; then
    echo "crosstool $BUILDROOT_NAME already installed to \"$INST_PATH\""
    exit
fi
 
# check install path is writable or not
if [ ! -w $INST_PATH ] ; then
    CUR_USER=`whoami`
 
    echo "ERROR: Crosstool install path \"$INST_PATH\" not writable, please solve it by follow command: "
    echo "          sudo sh -c 'mkdir -p $INST_PATH && chown $CUR_USER.$CUR_USER $INST_PATH' "
    exit
fi
 
 
cd $WORK_SPACE
 
# Download source code pacakge, it's about 1.8GB
if [ ! -s ${BR_VER}-packets.tar.xz ] ; then
    wget $LYFTP_PUB/${BR_VER}-packets.tar.xz
fi
 
if [ ! -d ${BR_VER} ] ; then
    tar -xJf ${BR_VER}-packets.tar.xz
fi
 
cd ${BR_VER}
 
chmod +x build.sh
 
./build.sh
 
echo ""
$INST_PATH/$BUILDROOT_NAME/bin/arm-linux-gcc -v
 
echo ""
echo " -- crosstool already installed to \"$INST_PATH/$BUILDROOT_NAME\".";
echo " -- build workspace path is \"$WORK_SPACE/$BR_VER\", you can remove it now.";
echo ""