#!/bin/bash
|
|
TAR_PATH=`pwd`
|
|
# update by top build.sh
|
BSP_BRANCH=lf-5.10.52-2.1.0
|
SYSTEM=buildroot
|
DISTRO=2021.02
|
SYSNAME=buildroot
|
|
ROOTFS_DIR=rootfs_${SYSNAME}
|
|
TARBALL_URL=http://weike-iot.com:2211/imx6ull/bsp
|
GIT_URL_NXP="https://source.codeaurora.org/external/imx"
|
|
function do_fetch_git()
|
{
|
SRC=$1
|
|
if [ -s ${SRC}-${BSP_BRANCH}.tar.xz ] ; then
|
echo " -- ${SRC} fetch alread, skip it --"
|
return;
|
fi
|
|
if [ ! -d $SRC ] ; then
|
git clone --branch ${BSP_BRANCH} ${GIT_URL_NXP}/${SRC}.git
|
fi
|
|
echo " -- start git clone ${SRC} now --"
|
|
cd $SRC
|
git config tar.tar.xz.command "xz -c"
|
git archive --format=tar.xz --prefix=${SRC}/ ${BSP_BRANCH} > ${TAR_PATH}/${SRC}-${BSP_BRANCH}.tar.xz
|
|
cd -
|
rm -rf $SRC
|
}
|
|
function do_fetch_url()
|
{
|
TARBALL=$1
|
|
if [ -s ${TARBALL} ] ; then
|
echo " -- ${TARBALL} fetch alread, skip it --"
|
return;
|
fi
|
|
echo " -- start wget fetch ${TARBALL} now --"
|
|
wget ${TARBALL_URL}/${TARBALL}
|
}
|
|
|
function do_fetch()
|
{
|
if [ ! -z $TARBALL_URL ] ; then
|
do_fetch_url uboot-imx-${BSP_BRANCH}.tar.xz
|
do_fetch_url linux-imx-${BSP_BRANCH}.tar.xz
|
do_fetch_url ${ROOTFS_DIR}.tar.bz2
|
do_fetch_url rtl8188fu.tar.bz2
|
do_fetch_url firmware.tar.bz2
|
else
|
do_fetch_git uboot-imx
|
do_fetch_git linux-imx
|
fi
|
}
|
|
do_fetch
|