# 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