From efe27ff0ad416853f838a0fd3f11528ce80a1d5e Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Fri, 21 Aug 2020 16:51:09 +0800
Subject: [PATCH] Update some build.sh shell script for create install path

---
 linux-bsp/build.sh |   33 +++++++++------------------------
 1 files changed, 9 insertions(+), 24 deletions(-)

diff --git a/linux-bsp/build.sh b/linux-bsp/build.sh
index 1e9efae..32e93e3 100755
--- a/linux-bsp/build.sh
+++ b/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

--
Gitblit v1.9.1