[FE training-materials-updates] Flash labs: add information to find the LEB size

Michael Opdenacker michael.opdenacker at free-electrons.com
Wed Nov 4 17:52:27 CET 2015


Repository : git://git.free-electrons.com/training-materials.git
On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=e1984182cb4a055bbc5c472b74f9236ce8b6bd29

>---------------------------------------------------------------

commit e1984182cb4a055bbc5c472b74f9236ce8b6bd29
Author: Michael Opdenacker <michael.opdenacker at free-electrons.com>
Date:   Wed Nov 4 17:52:27 2015 +0100

    Flash labs: add information to find the LEB size
    
    Signed-off-by: Michael Opdenacker <michael.opdenacker at free-electrons.com>


>---------------------------------------------------------------

e1984182cb4a055bbc5c472b74f9236ce8b6bd29
 .../sysdev-flash-filesystems.tex                   | 29 +++++++++++++++-------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/labs/sysdev-flash-filesystems/sysdev-flash-filesystems.tex b/labs/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
index 26687e3..5203b02 100644
--- a/labs/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
+++ b/labs/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
@@ -38,11 +38,11 @@ Which gives the following layout:
 
 \section{Enabling NAND flash and filesystems}
 
-First, recompile your kernel with support for UBI and UBIFS, and enable
+First, make sure your kernel has support for UBI and UBIFS, and also
 the option allowing us to pass the partition table through the cmdline:
 (\code{CONFIG_MTD_CMDLINE_PARTS}).
 
-Recompile your kernel, and we will update your kernel image on flash
+Recompile your kernel if needed. We will update your kernel image on flash
 in the next section.
 
 \section{Filesystem image preparation}
@@ -51,15 +51,26 @@ To prepare filesystem images, we won't use what you stored on the MMC/SD
 card during the previous lab. We will get back to the filesystem sources
 that you have in \code{$HOME/embedded-linux-labs/tinysystem/nfsroot}.
 
-First, find the erase block size of the NAND flash device soldered
-on your board.
+To run \code{mkfs.ubifs}, you will need to find the Logical Erase
+Block (LEB) size that UBI will use.
 
-Prepare a UBIFS filesystem image containing the files stored in the
-\code{/www/upload/files} directory.
+A solution to get such information is to list default MTD partitions
+on the target (\code{cat /proc/mtd}), and attach the last partition
+to UBI. In case, the last partition is \code{mtd5}, you will run:
 
-Modify the \code{/etc/init.d/rcS} file to mount a UBI volume called
-\code{data} \footnote{We will create it when running \code{ubinize}
-in the next section} on \code{/var/www/files}.
+\begin{verbatim}
+ubiattach -m 5 /dev/ubi_ctrl
+\end{verbatim}
+
+Doing this, you will get details in the kernel log about the MTD page
+size and the LEB size that UBI will use.
+
+Using such information, prepare prepare a UBIFS filesystem
+image containing the files stored in the \code{/www/upload/files} directory.
+
+Modify the \code{/etc/init.d/rcS} file under \code{nfsroot} to mount a
+UBI volume called \code{data} \footnote{We will create it when
+running \code{ubinize} in the next section} on \code{/var/www/files}.
 
 Once done, create a UBIFS image of your root filesystem.
 




More information about the training-materials-updates mailing list