SAMA5D4 Xplained Ultra Board BSP
guowenxue
2019-09-23 c35ac6f2aad2ebe9d7cb5ca461822f0635af3798
linux-bsp/build.sh
@@ -10,10 +10,13 @@
PROJ_PATH=`pwd`
CROSSTOOL=/opt/buildroot/cortex-a5/bin/arm-linux-
BOARD=sama5d4
PACK_PATH=${PROJ_PATH}/tarballs
PATCH_PATH=${PROJ_PATH}/patches
PATCH_SUFIX=${BOARD}.patch
ROOTFS_SRC=rootfs
@@ -23,8 +26,6 @@
IMGS_PATH=images
target=
set -e
function show_help()
{
@@ -79,12 +80,19 @@
    SRC_DIR=$1
    if [ ! -d ${SRC_DIR} ] ; then
       show_banner "|       start decmpress $SRC_DIR packet       |"
       show_banner "|       start decompress $SRC_DIR packet     |"
        tar -xJf ${PACK_PATH}/${SRC_DIR}.tar.xz 
        cd ${SRC_DIR}
        if [ -f ${PATCH_PATH}/${SRC_DIR}-${PATCH_SUFIX} ] ; then 
            show_banner "|            patch for ${SRC_DIR}             |"
            # Only u-boot not update cross compiler
            echo ${SRC_DIR} | grep "u-boot" > /dev/null
            if [ $? != 0 ] ; then
                sed -i -e "s|^+CROSSTOOL=.*|+CROSSTOOL=${CROSSTOOL}|g" ${PATCH_PATH}/${SRC_DIR}-${PATCH_SUFIX}
            fi
            patch -p1 < ${PATCH_PATH}/${SRC_DIR}-${PATCH_SUFIX}
        fi
    else
@@ -128,8 +136,9 @@
    LEB_CNT=`expr $PEB_CNT - 4 - $PEB_CNT \/ 100 `
    #echo "Parition size ${partition_size}MiB and LEB=$LEB_CNT"
    set -x
    mkfs.ubifs -F -d ${ROOTFS_SRC} -m ${PAGE_SIZE} -e ${LEB_SIZE} -c $LEB_CNT -o ${ubimg_tmp}
    set -x
    printf "\nWARNNING: generete rootfs image need root privilege, please input sudo passwd!\n\n"
    sudo mkfs.ubifs -F -d ${ROOTFS_SRC} -m ${PAGE_SIZE} -e ${LEB_SIZE} -c $LEB_CNT -o ${ubimg_tmp}
    set +x
@@ -152,12 +161,8 @@
function build_rootfs()
{
    if [ ! -d ${ROOTFS_SRC} ] ; then 
        if [ `id -u` != 0 ] ; then
            printf "\nERROR: decompress rootfs need root privilege, please use sudo!\n\n"
            exit ;
        fi
        tar -xJf ${PACK_PATH}/${ROOTFS_SRC}.tar.xz
        printf "\nWARNNING: decompress rootfs need root privilege, please input sudo passwd!\n\n"
        sudo tar -xJf ${PACK_PATH}/${ROOTFS_SRC}.tar.xz
    fi
   show_banner "|           start build rootfs image...        |"