guowenxue
2020-08-21 0dbf3171f89fc5f92a2f81dac0d5464bd143b692
update rootfs build shell script, fix fl2440 ubifs boot bugs
1 files modified
33 ■■■■ changed files
linux-bsp/build.sh 33 ●●●● patch | view | raw | blame | history
linux-bsp/build.sh
@@ -23,7 +23,6 @@
TARBALL_FTP=ftp://master.iot-yun.club/src/
ROOTFS_SRC=rootfs
ROOTFS_IMG=rootfs-${BOARD}.ubi
@@ -105,25 +104,7 @@
        tar -xjf ${PACK_PATH}/${SRC_DIR}.tar.bz2 
        cd ${SRC_DIR}
        # Copy u-boot logo file
        echo ${SRC_DIR} | grep "u-boot" > /dev/null
        if [ $? == 0 ] ; then
            LOGO_FILE=logo-uboot.bmp
            if [ -f ${PATCH_PATH}/${LOGO_FILE} ] ; then
                cp -f ${PATCH_PATH}/${LOGO_FILE} tools/logos/logo.bmp
            fi
        fi
        # Copy linux kernel logo file
        echo ${SRC_DIR} | grep "linux" > /dev/null
        if [ $? == 0 ] ; then
            LOGO_FILE=logo-kernel.ppm
            if [ -f ${PATCH_PATH}/${LOGO_FILE} ] ; then
                cp -f ${PATCH_PATH}/${LOGO_FILE} drivers/video/logo/logo_linux_clut224.ppm
            fi
        fi
        # patch for Jelliesv2
        # do patch
        if [ -f ${PATCH_PATH}/${SRC_DIR}-${PATCH_SUFIX} ] ; then 
            show_banner "|            patch for ${SRC_DIR}             |"
@@ -152,19 +133,23 @@
    ubinize_cfg=ubinize.cfg 
    ubimg_tmp=ubi.img
    # Rootfs partition size
    partition_size=40  # MiB
    partition_size=80  # MiB
    # K9F2G08: Nandflash 1 block=64 pages,  1 page = 2048
    BLOCK_PAGES=64
    PAGE_SIZE=2048
    SUBPAGE_SIZE=512
    # Logic Erase Block Size: UBI requires 2 minimum I/O units out of each Physical Erase Block (PEB) for overhead:
    #   1 for maintaining erase count information, and 1 for maintaining the Volume ID information. 
    #
    # In FL2440 Linux-3.0 kernel only need 1 PEB, or kernel will throw error:
    # UBIFS error (pid 1): validate_sb: LEB size mismatch: 126976 in superblock, 129024 real
    PEB_SIZE=`expr $PAGE_SIZE \* $BLOCK_PAGES`
    LEB_SIZE=`expr $PEB_SIZE - 2 \* $PAGE_SIZE `
    LEB_SIZE=`expr $PEB_SIZE - 1 \* $PAGE_SIZE `
    #UBI reserves 4 blocks space for management and bad PEB handling operations
    # 2 PEBs are used to store the UBI volume table
@@ -190,7 +175,7 @@
    #cat $ubinize_cfg
    set -x 
    ubinize -o ${ROOTFS_IMG} -m ${PAGE_SIZE} -p ${PEB_SIZE} $ubinize_cfg
    ubinize -o ${ROOTFS_IMG} -m ${PAGE_SIZE} -p ${PEB_SIZE} -s ${SUBPAGE_SIZE} $ubinize_cfg
    set +x
    rm -f $ubimg_tmp $ubinize_cfg