SAMA5D4 Xplained Ultra Board BSP
guowenxue
2019-08-11 c901644942ddf153ef3e2dac6a38a9bd772e15dc
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
# This shell script used to setup ok335x build envrionment
#
# 1. U-boot, Linux kernel and root file system all compiled or generated by this crosstool.
# 2. This crsootool is built in i386, running on x86-64 depends on lib32
# 3. Install mkimage and mkfs.ubifs tools
 
if [ `id -u` != 0 ] ; then
    echo ""
    echo "ERROR: This shell script must be excuted as root or by sudo"
    echo ""
    exit 1;   
fi
CROSSTOOL_PATH=/opt/crosstool
CROSSTOOL_NAME=cortex-a7
 
CROSSTOOL_VER=gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi
CROSSTOOL_TAR=${CROSSTOOL_VER}.tar.xz
CROSSTOOL_DLADDR=ftp://master.iot-yun.club/pub/$CROSSTOOL_TAR
 
echo "apt-get update ..."
apt-get update > /dev/null 2>&1
apt-get install -y lib32z1 lib32ncurses5 
 
mkimage -V > /dev/null 2>&1
if [ $? != 0 ] ; then 
   apt-get install -y u-boot-tools
fi 
 
mkfs.ubifs -V > /dev/null 2>&1
if [ $? != 0 ] ; then
   apt-get install -y mtd-utils
fi
 
if [ ! -d ${CROSSTOOL_PATH}/${CROSSTOOL_NAME} ] ; then
   mkdir -p ${CROSSTOOL_PATH}
 
   if [ ! -f $CROSSTOOL_TAR ] ; then
       wget -c $CROSSTOOL_DLADDR
   fi
 
   tar -xJf ${CROSSTOOL_TAR} -C ${CROSSTOOL_PATH}
   mv ${CROSSTOOL_PATH}/${CROSSTOOL_VER}/  ${CROSSTOOL_PATH}/${CROSSTOOL_NAME}
   
fi
 
 
# QT build will install to this path
mkdir -p /apps && chmod 777 /apps