[FE training-materials-updates] step

Boris Brezillon boris.brezillon at free-electrons.com
Wed May 13 18:19:57 CEST 2015


Repository : git://git.free-electrons.com/training-materials.git

On branch  : mtd-rework-WIP
Link       : http://git.free-electrons.com/training-materials/commit/?id=5e78305ae565a2d31d681c7c273fa6af9dc4b587

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

commit 5e78305ae565a2d31d681c7c273fa6af9dc4b587
Author: Boris Brezillon <boris.brezillon at free-electrons.com>
Date:   Wed May 13 18:19:08 2015 +0200

    step
    
    Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>


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

5e78305ae565a2d31d681c7c273fa6af9dc4b587
 .../sysdev-flash-filesystems.tex                   | 481 +++++++++++++++------
 slides/sysdev-flash-filesystems/ubi-leb.dia        | Bin 0 -> 1471 bytes
 2 files changed, 338 insertions(+), 143 deletions(-)

diff --git a/slides/sysdev-flash-filesystems/sysdev-flash-filesystems.tex b/slides/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
index 7587c46..fcad422 100644
--- a/slides/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
+++ b/slides/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
@@ -78,6 +78,26 @@
 \end{frame}
 
 \begin{frame}
+  \frametitle{NAND flashes: ECC}
+  \begin{itemize}
+  \item ECC partly address the reliability problem on NAND flashes
+  \item Operates on blocks (usually 512 or 1024 bytes)
+  \item ECC data are stored in the OOB area
+  \item Three algorithms:
+    \begin{itemize}
+    \item Hamming: can fixup a single bit per block
+    \item Reed-Solomon: can fixup several bits per block
+    \item BCH: can fixup several bits per block
+    \end{itemize}
+  \item BCH and Reed-Solomon strengths depends on the size allocated
+    for ECC data, which in turn depends on the OOB size
+  \item NAND manufacturers specify the required ECC strength in their
+    datasheets: ignoring these requirements might compromise data
+    integrity
+  \end{itemize}
+\end{frame}
+
+\begin{frame}
   \frametitle{The MTD subsystem (1)}
   \begin{itemize}
   \item MTD stands for {\em Memory Technology Devices}
@@ -110,31 +130,6 @@
 \end{frame}
 
 \begin{frame}
-  \frametitle{MTD devices: interface with userspace}
-  \begin{itemize}
-  \item MTD devices are visible in \code{/proc/mtd}
-  \item The {\bf mtdchar} driver creates a character device for each
-    MTD device of the system
-    \begin{itemize}
-    \item Usually named \code{/dev/mtdX} or \code{/dev/mtdXro}, major 90.
-      Even minors for read-write access (\code{/dev/mtdX}),
-      odd minors for read-only access (\code{/dev/mtdXro})
-    \item Provide \code{ioctl()} to erase and manage the flash
-    \item Used by the {\em mtd-utils} utilities
-    \end{itemize}
-  \item The {\bf mtdblock} driver creates a block device for each MTD
-    device of the system
-    \begin{itemize}
-    \item Usually named \code{/dev/mtdblockX}, major 31. Minor is the
-      number of the MTD device
-    \item Allows read/write block-level access. But bad blocks are not
-      handled, and no wear leveling is done for writes.
-    \item Primary use: mounting filesystems
-    \end{itemize}
-  \end{itemize}
-\end{frame}
-
-\begin{frame}
   \frametitle{MTD partitioning}
   \begin{itemize}
   \item MTD devices are usually partitioned
@@ -162,8 +157,166 @@
   \end{itemize}
 \end{frame}
 
+\begin{frame}
+  \frametitle{U-Boot: manipulating NAND devices}
+  \begin{itemize}
+  \item U-Boot provides a set of commands to manipulate NAND devices
+  \item Grouped under the \code{nand} command
+    \begin{itemize}
+    \item \code{nand info}: show available NAND devices and their
+      characteristics
+    \item \code{nand device [dev]}: select or display the active NAND
+      device
+    \item \code{nand read[.option] <addr> <offset|part> <size>} read
+      data from the NAND
+    \item \code{nand write[.option] <addr> <offset|part> <size>} write
+      data on the NAND
+    \item Use \code{nand write.trimffs} to avoid writing empty pages
+      (those filled with \code{0xff})
+    \item \code{nand erase <offset> <size>} erase a NAND region
+    \item \code{nand erase.part <part>} erase a NAND partition
+    \item more commands for debugging purpose
+    \end{itemize}
+  \end{itemize}
+\end{frame}
+
+\begin{frame}
+  \frametitle{U-Boot: manipulating NOR devices (1)}
+  \begin{itemize}
+  \item U-Boot provides a set of commands to manipulate NOR devices
+  \item Memory mapped NOR devices
+    \begin{itemize}
+    \item \code{flinfo [devid]} display information of all NOR devices
+      or a specific one if \code{devid} is provided
+    \item \code{cp.[bwl] <src> <target> <count>} read/write data frm/to
+      the NOR device
+    \item \code{erase <start> <end>} or \code{erase <start> +<len>}
+      erase a memory region
+    \item \code{erase bank <bankid>} erase a memory bank
+    \item \code{erase all} erase all banks
+    \item \code{protect on|off <range-description>} protect a memory
+      range
+    \end{itemize}
+  \end{itemize}
+\end{frame}
+
+\begin{frame}
+  \frametitle{U-Boot: manipulating NOR devices (2)}
+  \begin{itemize}
+  \item SPI NOR devices
+    \begin{itemize}
+    \item Grouped under the \code{sf} command
+    \item \code{sf probre [[bus:]cs] [hz] [mode]} probe a NOR device on
+    \item \code{sf read|write <addr> <offset> <len>} read/write data
+       from/to a SPI NOR
+    \item \code{sf erase <offset> +<len>} erase a memory region
+    \item \code{sf update <addr> <offset> <len>} erase + write operation
+    \end{itemize}
+  \end{itemize}
+\end{frame}
+
+\begin{frame}
+  \frametitle{U-Boot: using MTD partitions}
+  \begin{itemize}
+  \item U-Boot provides a way to define mtd partitions on top flash
+    devices
+  \item Using partitions ease manipulation of flash devices, which might
+    be particularly error prone
+  \item Requires two environment variables:
+    \begin{itemize}
+    \item \code{mtdids} attach an mtdid to a flash device.
+      Example: \code{mtdids=<devid>=<mtdid>[,<devid>=<mtdid>]}
+      \begin{itemize}
+      \item \code{devid}: device identifier retrieved with
+        \code{nand info} or \code{flinfo}
+      \item \code{mtdid}: mtd identifier (should match linux MTD device
+        name)
+      \item \code{mtdid} is displayed when booting the linux kernel
+      \end{itemize}
+    \item \code{mtdparts} attach an mtdid to a flash device
+    \end{itemize}
+  \item Use the \code{mtdparts} command to setup the configuration
+    specified by the \code{mtdids} and \code{mtdparts} variables
+  \item Use flash specific commands (depends on your flash device type),
+    and pass partition names instead of numerical offsets
+  \item Example: \code{nand erase <partname>}
+  \end{itemize}
+\end{frame}
+
 \begin{frame}[fragile]
-  \frametitle{Definition of MTD partitions (1)}
+  \frametitle{U-Boot: defining MTD partitions (1)}
+  \begin{itemize}
+  \item \code{mtdparts} format: \code{<mtdid>:<partition>[,partition]}
+  \item \code{partition} format: \code{<size>[@offset](<name>)[ro]}
+  \item \code{mtdid} is the MTD device name assigned by linux
+  \item \code{mtdid} is displayed at boot (and can be retrieved using
+    \code{dmesg})
+  \end{itemize}
+\tiny
+\begin{verbatim}
+NAND device: Manufacturer ID: 0x2c, Chip ID: 0xbc (Micron NAND 512MiB 1,8V 16-bit)
+Creating 5 MTD partitions on "omap2-nand.0":
+0x000000000000-0x000000080000 : "X-Loader"
+0x000000080000-0x000000200000 : "U-Boot"
+0x000000200000-0x000000280000 : "Environment"
+0x000000280000-0x000000580000 : "Kernel"
+0x000000580000-0x000020000000 : "File System"
+\end{verbatim}
+\end{frame}
+
+\begin{frame}
+  \frametitle{U-Boot: defining MTD partitions (2)}
+  \begin{itemize}
+  \item Example:\\
+    \code{mtdparts=omap2-nand.0:512k(X-Loader)ro,1536k(U-Boot)ro,512k(Environment),4m(Kernel),16m(RootFS),-(Data)}
+  \item We've just defined 6 partitions in the \code{omap2-nand.0} device:
+    \begin{itemize}
+    \item \code{1st stage bootloader} (512 KiB, read-only)
+    \item \code{U-Boot} (1536 KiB, read-only)
+    \item \code{U-Boot environment} (512 KiB)
+    \item \code{Kernel} (4 MiB)
+    \item \code{Root filesystem} (16 MiB)
+    \item \code{Data filesystem} (Remaining space)
+    \end{itemize}
+  \item Partition sizes must be multiple of the erase block size.\\
+    You can use sizes in hexadecimal too. Remember the below sizes:\\
+    \code{0x20000} = 128k, \code{0x100000} = 1m, \code{0x1000000} = 16m
+  \item \code{ro} lists the partition as read only
+  \item \code{-} is used to use all the remaining space.
+  \end{itemize}
+\end{frame}
+
+\begin{frame}
+  \frametitle{Linux: MTD devices interface with userspace}
+  \begin{itemize}
+  \item MTD devices are visible in \code{/proc/mtd}
+  \item The userspace only see MTD partitions, not the flash device
+    under those partitions
+  \item The {\bf mtdchar} driver creates a character device for each
+    MTD device/partition of the system
+    \begin{itemize}
+    \item Usually named \code{/dev/mtdX} or \code{/dev/mtdXro}, major 90.
+      Even minors for read-write access (\code{/dev/mtdX}),
+      odd minors for read-only access (\code{/dev/mtdXro})
+    \item Provide \code{ioctl()} to erase and manage the flash
+    \item Used by the {\em mtd-utils} utilities
+    \end{itemize}
+  \item The {\bf mtdblock} driver creates a block device for each MTD
+    device of the system
+    \begin{itemize}
+    \item Usually named \code{/dev/mtdblockX}, major 31. Minor is the
+      number of the MTD device
+    \item Allows read/write block-level access. But bad blocks are not
+      handled, and no wear leveling is done for writes.
+    \item Primary use: mounting read only block filesystems or JFFS2
+    \item Do not write on mtdblock devices
+    \end{itemize}
+  \end{itemize}
+\end{frame}
+
+
+\begin{frame}[fragile]
+  \frametitle{Linux: definition of MTD partitions (1)}
   The Device Tree is the standard place to device MTD partitions
   for boards with Device Tree support.\\
   Example from \code{arch/arm/boot/dts/omap3-igep0020.dts}:
@@ -188,7 +341,7 @@
 \end{frame}
 
 \begin{frame}[fragile]
-  \frametitle{Definition of MTD partitions (2)}
+  \frametitle{Linux: definition of MTD partitions (2)}
   For boards or platforms that do not use the Device Tree,
   MTD partitions can be defined in the kernel.
   Legacy example from \code{arch/arm/mach-omap2/board-igep0020.c}
@@ -216,50 +369,26 @@ static struct mtd_partition igep2_flash_partitions[] = {
 \end{frame}
 
 \begin{frame}[fragile]
-  \frametitle{Modifying MTD partitions (1)}
+  \frametitle{Linux: modifying MTD partitions (1)}
   \begin{itemize}
   \item MTD partitions can fortunately be defined through the kernel
     command line.
   \item First need to find the name of the MTD device. Look at the
     kernel log at boot time. In the below example, the MTD device name is
     \code{omap2-nand.0}:
+  \item U-Boot and linux are using the same syntax to describe the MTD
+    partitions
+  \item Directly pass the \code{mtdparts} environment variable defined in
+    u-boot to the kernel cmdline
+  \item Be careful: when modifying the partition layout you might impact
+    MTD users which have already stored data on existing partitions: e.g.
+    a file system might complain about data corruption if you change
+    your partition layout after the file system initialization
 \end{itemize}
-\tiny
-\begin{verbatim}
-NAND device: Manufacturer ID: 0x2c, Chip ID: 0xbc (Micron NAND 512MiB 1,8V 16-bit)
-Creating 5 MTD partitions on "omap2-nand.0":
-0x000000000000-0x000000080000 : "X-Loader"
-0x000000080000-0x000000200000 : "U-Boot"
-0x000000200000-0x000000280000 : "Environment"
-0x000000280000-0x000000580000 : "Kernel"
-0x000000580000-0x000020000000 : "File System"
-\end{verbatim}
 \end{frame}
 
 \begin{frame}
-  \frametitle{Modifying MTD partitions (2)}
-  \begin{itemize}
-  \item You can now use the \code{mtdparts} kernel boot parameter
-  \item Example:\\
-    \code{mtdparts=omap2-nand.0:512k(X-Loader)ro,1536k(U-Boot)ro,512k(Environment),4m(Kernel),16m(RootFS),-(Data)}
-  \item We've just defined 6 partitions in the \code{omap2-nand.0} device:
-    \begin{itemize}
-    \item \code{1st stage bootloader} (512 KiB, read-only)
-    \item \code{U-Boot} (1536 KiB, read-only)
-    \item \code{U-Boot environment} (512 KiB)
-    \item \code{Kernel} (4 MiB)
-    \item \code{Root filesystem} (16 MiB)
-    \item \code{Data filesystem} (Remaining space)
-    \end{itemize}
-  \item Be careful: when doing that you might impact MTD users which
-    have already stored data on existing partitions: e.g. a file system
-    might complain about data corruption if you change your partition
-    layout after its initialization
-  \end{itemize}
-\end{frame}
-
-\begin{frame}
-  \frametitle{Modifying MTD partitions (3)}
+  \frametitle{Linux: modifying MTD partitions (3)}
   \begin{itemize}
   \item Partition sizes must be multiple of the erase block size.\\
     You can use sizes in hexadecimal too. Remember the below sizes:\\
@@ -270,6 +399,25 @@ Creating 5 MTD partitions on "omap2-nand.0":
 \end{frame}
 
 \begin{frame}
+  \frametitle{Linux: userspace flash management tools}
+  \begin{itemize}
+  \item \code{mtd-utils} is a set of utilities to manipulate MTD devices
+    \begin{itemize}
+    \item \code{mtdinfo} to get detailed information about an MTD device
+    \item \code{flash_erase} to partially or completely erase a given
+      MTD device
+    \item \code{flashcp} to write to NOR flash
+    \item \code{nandwrite} to write to NAND flash
+    \item Flash filesystem image creation tools: \code{mkfs.jffs2}
+    \end{itemize}
+  \item Usually available as the \code{mtd-utils} package in your distribution
+  \item Most commands now also available in BusyBox
+  \item See \url{http://www.linux-mtd.infradead.org/}
+  \end{itemize}
+\end{frame}
+
+
+\begin{frame}
   \frametitle{Flash wear leveling (1)}
   \begin{itemize}
   \item Wear leveling is about distributing write over the whole flash
@@ -399,6 +547,27 @@ Creating 5 MTD partitions on "omap2-nand.0":
 \end{frame}
 
 \begin{frame}
+  \frametitle{UBI: internals}
+  \begin{columns}
+    \column{0.5\textwidth}
+    \begin{itemize}
+    \item UBI is storing its metadata in-band
+    \item In each MTD erase block
+    \begin{itemize}
+      \item One page is reserved to count the number of erase cycles
+      \item Another page is reserved to attach the erase block to a
+        UBI volume
+      \item The remaining pages are used to store payload data
+      \end{itemize}
+    \item If the device supports subpage write, the EC and VID headers
+      can be stored on the same page
+    \end{itemize}
+    \column{0.5\textwidth}
+    \includegraphics[scale=0.3]{slides/sysdev-flash-filesystems/ubi-leb.pdf}
+  \end{columns}
+\end{frame}
+
+\begin{frame}
   \frametitle{UBI: good practice}
   \begin{itemize}
   \item UBI is responsible for distributing writes all over the flash
@@ -441,67 +610,116 @@ Creating 5 MTD partitions on "omap2-nand.0":
 \end{frame}
 
 \begin{frame}
-  \frametitle{mtd-utils}
+  \frametitle{Linux: UBI host tools (1)}
   \begin{itemize}
-  \item A set of utilities to manipulate MTD devices
+  \item \code{ubinize} is the only host tool for the UBI layer
+  \item Creates a UBI image to be flashed on an MTD partition
+  \item Takes the following arguments:
     \begin{itemize}
-    \item \code{mtdinfo} to get detailed information about an MTD device
-    \item \code{flash_erase} to partially or completely erase a given
-      MTD device
-    \item \code{flashcp} to write to NOR flash
-    \item \code{nandwrite} to write to NAND flash
-    \item UBI utilities
-    \item Flash filesystem image creation tools: \code{mkfs.jffs2},
-      \code{mkfs.ubifs}
+    \item \code{-o <output-file-path>} path to the output image file
+    \item \code{-p <peb-size>} the PEB size (MTD erase block size)
+    \item \code{-m <min-io-size>} the minimum write unit size (e.g.
+      MTD write size)
+    \item \code{-s <subpage-size>} subpage size, only needed if both
+      your flash and your flash controller are supporting subpage
+      writes
+    \item The last argument is a path to a UBI image description file
     \end{itemize}
-  \item Usually available as the \code{mtd-utils} package in your distribution
-  \item Most commands now also available in BusyBox
-  \item See \url{http://www.linux-mtd.infradead.org/}
+  \item Example: \code{ubinize -o ubi.img -p 16KiB -m 512 -s 256 cfg.ini}
   \end{itemize}
 \end{frame}
 
-\begin{frame}
-  \frametitle{UBI - Preparation}
+\begin{frame}[fragile]
+  \frametitle{Linux: UBI host tools (2)}
+  \begin{itemize}
+  \item \code{ubinize} config file can contain several sections
+  \item Each section is describing a UBI volume
+  \item Example:
+  \end{itemize}
+  \begin{columns}
+    \column{0.33\textwidth}
+\small
+\begin{verbatim}
+[kernel-volume]
+mode=ubi
+image=zImage
+vol_id=1
+vol_type=static
+vol_name=kernel
+vol_alignment=1
+\end{verbatim}
+    \column{0.33\textwidth}
+\small
+\begin{verbatim}
+[rootfs-volume]
+mode=ubi
+image=rootfs.squashfs
+vol_id=1
+vol_type=static
+vol_name=rootfs
+vol_alignment=1
+\end{verbatim}
+    \column{0.33\textwidth}
+\small
+\begin{verbatim}
+[data-volume]
+mode=ubi
+image=data.ubifs
+vol_id=1
+vol_size=30MiB
+vol_type=dynamic
+vol_name=data
+vol_flags=autoresize
+vol_alignment=1
+\end{verbatim}
+  \end{columns}
   \begin{itemize}
-  \item Have \code{/dev/} mounted as a \code{devtmpfs} filesystem
-  \item Erase your flash partition while preserving your erase counters\\
-    \code{ubiformat /dev/mtd1}\\
-    See \url{http://www.linux-mtd.infradead.org/faq/ubi.html} if you
-    face problems
-  \item Attach UBI to one (of several) of the MTD partitions:\\
-    \code{ubiattach /dev/ubi_ctrl -m 1}
-  \item This command creates the \code{ubi0} device, which represent
-    the full UBI space stored on MTD device 1 (new \code{/dev/ubi0}
-    character device)
+  \item Build systems like Buildroot can run \code{ubinize} automatically!
   \end{itemize}
 \end{frame}
 
 \begin{frame}
-  \frametitle{UBI - Volume management}
+  \frametitle{Linux: UBI target tools (1)}
   \begin{itemize}
-  \item Volume creation with \code{ubimkvol}
-    \begin{itemize}
-    \item \code{ubimkvol /dev/ubi0 -N test -s 116MiB}
-    \item \code{ubimkvol /dev/ubi0 -N test -m} (max available size)
-    \item The volume is then identified as \code{ubi0:test} for the
-      \code{mount}/\code{umount} commands
-    \end{itemize}
-  \item Volume removal with \code{ubirmvol}
+  \item Tools used on the target to dynamically create and modify
+      UBI elements
+  \item UBI device management:
     \begin{itemize}
-    \item \code{ubirmvol /dev/ubi0 -N test}
+    \item \code{ubiformat <MTD-device-id>} format an MTD partition and
+      preserve Erase Counter information if any
+    \item \code{ubiattach -m <MTD-device-id> /dev/ubi_ctrl} attach an
+      MTD partition/device to the UBI layer, and create a UBI device
+    \item \code{ubidetach -m <MTD-device-id> /dev/ubi_ctrl} detach an
+      MTD partition/device from the UBI layer, and remove this associated
+      UBI device
     \end{itemize}
   \end{itemize}
 \end{frame}
 
 \begin{frame}
-  \frametitle{UBIFS - How to use}
+  \frametitle{Linux: UBI target tools (2)}
   \begin{itemize}
-  \item When a UBI volume is created, creating an empty UBIFS
-    filesystem is just a matter of mounting it
+  \item UBI volume management:
     \begin{itemize}
-    \item \code{mount -t ubifs ubi0:test /mnt/flash}
+    \item \code{ubimkvol /dev/ubi<UBI-device-id> -N <name> -s <size>} create
+      a new volume. Use \code{-m} in place of \code{-s <size>} if you want
+      to assign all the remaining to this volume
+    \item \code{ubirmvol /dev/ubi<UBI-device-id> -N <name>} delete an UBI
+      volume
+    \item \code{ubiupdatevol /dev/ubi<UBI-device-id>_<UBI-vol-id> [-s <size>] <vol-image-file>}
+      update volume content
+    \item \code{ubirsvol /dev/ubi<UBI-device-id> -N <name> -s <size>}
+      resize an UBI volume
+    \item \code{ubirename /dev/ubi<UBI-device-id>_<UBI-vol-id> <old-name> <new-size>}
+      rename a UBI volume
     \end{itemize}
-  \item Images of UBIFS filesystems can be created using the
+  \end{itemize}
+\end{frame}
+
+\begin{frame}
+  \frametitle{Linux: UBIFS host tools}
+  \begin{itemize}
+  \item UBIFS filesystems images can be created using the
     \code{mkfs.ubifs} utility
     \begin{itemize}
     \item \code{mkfs.ubifs -m 4096 -e 252KiB -c 1000 -r rootfs/ ubifs.img}
@@ -514,64 +732,41 @@ Creating 5 MTD partitions on "omap2-nand.0":
         blocks. Details:
         {\tiny\url{http://linux-mtd.infradead.org/faq/ubifs.html\#L_max_leb_cnt}}
       \end{itemize}
-    \item Can be written to a UBI volume using \code{ubiupdatevol}: \\
-      \code{ubiupdatevol /dev/ubi0_0 /path/to/ubifs.img}
+    \item Once created
+      \begin{itemize}
+      \item Can be written to a UBI volume from the target using
+        \code{ubiupdatevol}
+      \item Or, can be included in a UBI image (using \code{ubinize}
+        on the host)
+      \end{itemize}
     \end{itemize}
   \end{itemize}
 \end{frame}
 
-\begin{frame}[fragile]
-  \frametitle{Ubinize (1)}
-  After creating images of UBIFS filesystems, images of a full UBI space,
-  containing several volumes, can be created using \code{ubinize}:
-  \begin{itemize}
-  \item Can be written to a raw MTD partition in U-boot.
-  \item Must be written using \code{nand write.trimffs}.
-  \item Caution: \code{nand erase} will also erase the Erase Counters
-  \end{itemize}
-  First, create a configuration file describing the UBI volumes (\code{ubi.ini}):
-\small
-\begin{verbatim}
-[RFS-volume]
-mode=ubi
-image=rootfs.ubifs
-vol_id=1
-vol_size=30MiB
-vol_type=dynamic
-vol_name=rootfs
-vol_flags=autoresize
-vol_alignment=1
-\end{verbatim}
-\end{frame}
-
 \begin{frame}
-  \frametitle{Ubinize (2)}
+  \frametitle{Linux: flashing UBI/UBIFS howtos}
   \begin{itemize}
-  \item \code{ubinize -o ubi.img -p 256KiB -m 4096 ubi.ini}
-  \begin{itemize}
-    \item Creates \code{ubi.img}, with 256KiB physical erase blocks,
-      4096 minimum I/O size (\code{-m}).
-  \end{itemize}
   \item See
     \url{http://free-electrons.com/blog/creating-flashing-ubi-ubifs-images/}
     for details about creating UBI and UBIFS images.
   \item See
     \url{http://www.linux-mtd.infradead.org/doc/ubi.html\#L_flasher_algo}
-    for what is required when flashing UBI images containing UBIFS volumes.
-  \item Build systems like Buildroot can run \code{ubinize} automatically!
+    for what is required when flashing UBI images.
   \end{itemize}
 \end{frame}
 
 \begin{frame}
-  \frametitle{UBIFS - How to prepare a root fs}
+  \frametitle{Linux: Booting a UBIFS filesystem as a rootfs}
   \begin{itemize}
-  \item Create the UBIFS image for the root filesystem
-  \item Create the UBI device image (with \code{ubinize})
-  \item Flash it from the bootloader
-  \item Pass UBI layout information to the kernel:
+  \item You just have to pass the following information on the kernel
+    cmdline:
     \begin{itemize}
-    \item \code{rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs}
+    \item \code{ubi.mtd=1}: attach /dev/mtd1 to the UBI layer and
+      create ubi0
+    \item \code{rootfstype=ubifs root=ubi0:rootfs}: mount the
+      \code{rootfs} volume on ubi0 as a UBIFS filesystem
     \end{itemize}
+  \item Example\code{rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs}
   \end{itemize}
 \end{frame}
 
@@ -634,7 +829,7 @@ vol_alignment=1
 {
   \begin{itemize}
   \item Creating partitions in your internal flash storage
-  \item Create a UBI image with several volumes and flash it from u-boot
-  \item Manipulate UBI volumes from linux
+  \item Creating a UBI image with several volumes and flash it from u-boot
+  \item Manipulating UBI volumes from linux
   \end{itemize}
 }
diff --git a/slides/sysdev-flash-filesystems/ubi-leb.dia b/slides/sysdev-flash-filesystems/ubi-leb.dia
new file mode 100644
index 0000000..f6e5a44
Binary files /dev/null and b/slides/sysdev-flash-filesystems/ubi-leb.dia differ



More information about the training-materials-updates mailing list