| | |
| | | # This shell script used to setup imx6ull build envrionment |
| | | # |
| | | |
| | | LYFTP_PUB=http://master.iot-yun.club:2211/imx/crosstool |
| | | |
| | | # display in yellow |
| | | function pr_warn() { |
| | | echo -e "\033[40;33m --W-- $1 \033[0m\n" |
| | |
| | | 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() |
| | | { |
| | | BUILDROOT_PATH=/opt/buildroot |
| | | BUILDROOT_NAME=gcc-10.4-cortexA7-2023.02 |
| | | BUILDROOT_TAR=$BUILDROOT_NAME.tar.xz |
| | | |
| | | if [ -d ${BUILDROOT_PATH}/${BUILDROOT_NAME} ] ; then |
| | | pr_warn "Buildroot already installed to $BUILDROOT_PATH/$BUILDROOT_NAME" |
| | | return 0; |
| | | fi |
| | | |
| | | mkdir -p ${BUILDROOT_PATH} |
| | | |
| | | if [ ! -f $BUILDROOT_TAR ] ; then |
| | | pr_info "download $BUILDROOT_NAME now..." |
| | | wget -c $LYFTP_PUB/$BUILDROOT_TAR |
| | | fi |
| | | |
| | | pr_info "install $BUILDROOT_NAME to $BUILDROOT_PATH now..." |
| | | tar -xJf ${BUILDROOT_TAR} -C ${BUILDROOT_PATH} |
| | | |
| | | $BUILDROOT_PATH/$BUILDROOT_NAME/bin/arm-linux-gcc -v |
| | | |
| | | pr_info "Cross compiler: $BUILDROOT_PATH/$BUILDROOT_NAME/bin/arm-linux-" |
| | | |
| | | rm -f ${BUILDROOT_TAR} |
| | | } |
| | | |
| | | # NXP document suggest cross compiler from ARM Developer: |
| | |
| | | tar -xJf $ARMTOOL_PACK.tar.xz -C /opt |
| | | rm -f $ARMTOOL_PACK.tar.xz |
| | | |
| | | mv /opt/$ARMTOOL_PACK /opt/$ARMTOOL_NAME |
| | | mv /opt/$ARMTOOL_PACK /opt/$ARMTOOL_NAME |
| | | |
| | | /opt/$ARMTOOL_NAME/bin/arm-none-linux-gnueabihf-gcc -v |
| | | pr_info "cross compiler installed to \"/opt/$ARMTOOL_NAME\" successfully" |
| | |
| | | |
| | | install_crosstool |
| | | |
| | | #install_buildroot |
| | | |