guowenxue
2019-11-30 d39472ac2c0858cb0b5096c49af48b275ec8e328
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
# 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
 
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}/cortex-a7 ] ; then
   mkdir -p ${CROSSTOOL_PATH}
   tar -xJf gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi.tar.xz -C ${CROSSTOOL_PATH}
   mv ${CROSSTOOL_PATH}/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi/  ${CROSSTOOL_PATH}/cortex-a7
fi
 
 
# QT build will install to this path
mkdir -p /apps && chmod 777 /apps