[bootlin/training-materials updates] master: Flash filesystems: corrections and improvements (dc1aa2a9)

Michael Opdenacker michael.opdenacker at bootlin.com
Sun May 31 16:12:21 CEST 2020


Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/dc1aa2a9ccafe67ce3084d7b39ef62b95136d4d0

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

commit dc1aa2a9ccafe67ce3084d7b39ef62b95136d4d0
Author: Michael Opdenacker <michael.opdenacker at bootlin.com>
Date:   Sun May 31 16:12:21 2020 +0200

    Flash filesystems: corrections and improvements
    
    Signed-off-by: Michael Opdenacker <michael.opdenacker at bootlin.com>


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

dc1aa2a9ccafe67ce3084d7b39ef62b95136d4d0
 labs/sysdev-flash-filesystems/flash-map.dia        | 376 ++++++++++-----------
 .../sysdev-flash-filesystems.tex                   |  10 +-
 .../sysdev-flash-filesystems.tex                   |  73 ++--
 3 files changed, 231 insertions(+), 228 deletions(-)

diff --git a/labs/sysdev-flash-filesystems/flash-map.dia b/labs/sysdev-flash-filesystems/flash-map.dia
index 957fa38f..56f488f9 100644
--- a/labs/sysdev-flash-filesystems/flash-map.dia
+++ b/labs/sysdev-flash-filesystems/flash-map.dia
@@ -931,105 +931,99 @@ env#</dia:string>
         <dia:enum val="3"/>
       </dia:attribute>
     </dia:object>
-    <dia:group>
-      <dia:attribute name="meta">
-        <dia:composite type="dict"/>
+    <dia:object type="Standard - Box" version="0" id="O28">
+      <dia:attribute name="obj_pos">
+        <dia:point val="33.45,2.79848"/>
       </dia:attribute>
-      <dia:attribute name="matrix"/>
-      <dia:object type="Standard - Box" version="0" id="O28">
-        <dia:attribute name="obj_pos">
-          <dia:point val="33.45,2.79848"/>
-        </dia:attribute>
-        <dia:attribute name="obj_bb">
-          <dia:rectangle val="33.4,2.74848;37.2,5.34848"/>
-        </dia:attribute>
-        <dia:attribute name="elem_corner">
-          <dia:point val="33.45,2.79848"/>
-        </dia:attribute>
-        <dia:attribute name="elem_width">
-          <dia:real val="3.7000000000000002"/>
-        </dia:attribute>
-        <dia:attribute name="elem_height">
-          <dia:real val="2.5"/>
-        </dia:attribute>
-        <dia:attribute name="border_color">
-          <dia:color val="#6cf39eff"/>
-        </dia:attribute>
-        <dia:attribute name="inner_color">
-          <dia:color val="#9deac1ff"/>
-        </dia:attribute>
-        <dia:attribute name="show_background">
-          <dia:boolean val="true"/>
-        </dia:attribute>
-      </dia:object>
-      <dia:object type="Standard - Text" version="1" id="O29">
-        <dia:attribute name="obj_pos">
-          <dia:point val="35.4,3.56888"/>
-        </dia:attribute>
-        <dia:attribute name="obj_bb">
-          <dia:rectangle val="34.0187,2.83031;36.7812,4.56666"/>
-        </dia:attribute>
-        <dia:attribute name="text">
-          <dia:composite type="text">
-            <dia:attribute name="string">
-              <dia:string>#Root
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="33.4,2.74848;37.2,5.34848"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="33.45,2.79848"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="3.7000000000000002"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="2.5"/>
+      </dia:attribute>
+      <dia:attribute name="border_color">
+        <dia:color val="#6cf39eff"/>
+      </dia:attribute>
+      <dia:attribute name="inner_color">
+        <dia:color val="#9deac1ff"/>
+      </dia:attribute>
+      <dia:attribute name="show_background">
+        <dia:boolean val="true"/>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Text" version="1" id="O29">
+      <dia:attribute name="obj_pos">
+        <dia:point val="35.4,3.56888"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="34.0187,2.83031;36.7812,4.56666"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#Root
 Filesystem#</dia:string>
-            </dia:attribute>
-            <dia:attribute name="font">
-              <dia:font family="Latin Modern Sans" style="0" name="Courier"/>
-            </dia:attribute>
-            <dia:attribute name="height">
-              <dia:real val="0.80001220721751742"/>
-            </dia:attribute>
-            <dia:attribute name="pos">
-              <dia:point val="35.4,3.56888"/>
-            </dia:attribute>
-            <dia:attribute name="color">
-              <dia:color val="#000000ff"/>
-            </dia:attribute>
-            <dia:attribute name="alignment">
-              <dia:enum val="1"/>
-            </dia:attribute>
-          </dia:composite>
-        </dia:attribute>
-        <dia:attribute name="valign">
-          <dia:enum val="3"/>
-        </dia:attribute>
-      </dia:object>
-      <dia:object type="Standard - Text" version="1" id="O30">
-        <dia:attribute name="obj_pos">
-          <dia:point val="35.4,5.07733"/>
-        </dia:attribute>
-        <dia:attribute name="obj_bb">
-          <dia:rectangle val="34.67,4.58879;36.13,5.20814"/>
-        </dia:attribute>
-        <dia:attribute name="text">
-          <dia:composite type="text">
-            <dia:attribute name="string">
-              <dia:string>#dynamic#</dia:string>
-            </dia:attribute>
-            <dia:attribute name="font">
-              <dia:font family="Latin Modern Sans" style="0" name="Courier"/>
-            </dia:attribute>
-            <dia:attribute name="height">
-              <dia:real val="0.52917494956893263"/>
-            </dia:attribute>
-            <dia:attribute name="pos">
-              <dia:point val="35.4,5.07733"/>
-            </dia:attribute>
-            <dia:attribute name="color">
-              <dia:color val="#000000ff"/>
-            </dia:attribute>
-            <dia:attribute name="alignment">
-              <dia:enum val="1"/>
-            </dia:attribute>
-          </dia:composite>
-        </dia:attribute>
-        <dia:attribute name="valign">
-          <dia:enum val="3"/>
-        </dia:attribute>
-      </dia:object>
-    </dia:group>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="Latin Modern Sans" style="0" name="Courier"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.80001220721751742"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="35.4,3.56888"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000ff"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:attribute name="valign">
+        <dia:enum val="3"/>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Text" version="1" id="O30">
+      <dia:attribute name="obj_pos">
+        <dia:point val="35.4,5.07733"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="34.0625,4.57331;36.753,5.23911"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#dynamic - 16M#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="Latin Modern Sans" style="0" name="Courier"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.52917494956893263"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="35.4,5.07733"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000ff"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:attribute name="valign">
+        <dia:enum val="3"/>
+      </dia:attribute>
+    </dia:object>
     <dia:group>
       <dia:attribute name="meta">
         <dia:composite type="dict"/>
@@ -1226,104 +1220,98 @@ Filesystem#</dia:string>
         </dia:attribute>
       </dia:object>
     </dia:group>
-    <dia:group>
-      <dia:attribute name="meta">
-        <dia:composite type="dict"/>
+    <dia:object type="Standard - Box" version="0" id="O37">
+      <dia:attribute name="obj_pos">
+        <dia:point val="37.375,2.79697"/>
       </dia:attribute>
-      <dia:attribute name="matrix"/>
-      <dia:object type="Standard - Box" version="0" id="O37">
-        <dia:attribute name="obj_pos">
-          <dia:point val="37.375,2.79697"/>
-        </dia:attribute>
-        <dia:attribute name="obj_bb">
-          <dia:rectangle val="37.325,2.74697;41.175,5.34697"/>
-        </dia:attribute>
-        <dia:attribute name="elem_corner">
-          <dia:point val="37.375,2.79697"/>
-        </dia:attribute>
-        <dia:attribute name="elem_width">
-          <dia:real val="3.75"/>
-        </dia:attribute>
-        <dia:attribute name="elem_height">
-          <dia:real val="2.5"/>
-        </dia:attribute>
-        <dia:attribute name="border_color">
-          <dia:color val="#6cf39eff"/>
-        </dia:attribute>
-        <dia:attribute name="inner_color">
-          <dia:color val="#9deac1ff"/>
-        </dia:attribute>
-        <dia:attribute name="show_background">
-          <dia:boolean val="true"/>
-        </dia:attribute>
-      </dia:object>
-      <dia:object type="Standard - Text" version="1" id="O38">
-        <dia:attribute name="obj_pos">
-          <dia:point val="39.175,3.56737"/>
-        </dia:attribute>
-        <dia:attribute name="obj_bb">
-          <dia:rectangle val="37.7937,2.8288;40.5562,4.56515"/>
-        </dia:attribute>
-        <dia:attribute name="text">
-          <dia:composite type="text">
-            <dia:attribute name="string">
-              <dia:string>#DATA
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="37.325,2.74697;41.175,5.34697"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="37.375,2.79697"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="3.75"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="2.5"/>
+      </dia:attribute>
+      <dia:attribute name="border_color">
+        <dia:color val="#6cf39eff"/>
+      </dia:attribute>
+      <dia:attribute name="inner_color">
+        <dia:color val="#9deac1ff"/>
+      </dia:attribute>
+      <dia:attribute name="show_background">
+        <dia:boolean val="true"/>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Text" version="1" id="O38">
+      <dia:attribute name="obj_pos">
+        <dia:point val="39.175,3.56737"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="37.7937,2.8288;40.5562,4.56515"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#DATA
 Filesystem#</dia:string>
-            </dia:attribute>
-            <dia:attribute name="font">
-              <dia:font family="Latin Modern Sans" style="0" name="Courier"/>
-            </dia:attribute>
-            <dia:attribute name="height">
-              <dia:real val="0.80001220721751742"/>
-            </dia:attribute>
-            <dia:attribute name="pos">
-              <dia:point val="39.175,3.56737"/>
-            </dia:attribute>
-            <dia:attribute name="color">
-              <dia:color val="#000000ff"/>
-            </dia:attribute>
-            <dia:attribute name="alignment">
-              <dia:enum val="1"/>
-            </dia:attribute>
-          </dia:composite>
-        </dia:attribute>
-        <dia:attribute name="valign">
-          <dia:enum val="3"/>
-        </dia:attribute>
-      </dia:object>
-      <dia:object type="Standard - Text" version="1" id="O39">
-        <dia:attribute name="obj_pos">
-          <dia:point val="39.25,5.07582"/>
-        </dia:attribute>
-        <dia:attribute name="obj_bb">
-          <dia:rectangle val="38.52,4.58728;39.98,5.20663"/>
-        </dia:attribute>
-        <dia:attribute name="text">
-          <dia:composite type="text">
-            <dia:attribute name="string">
-              <dia:string>#dynamic#</dia:string>
-            </dia:attribute>
-            <dia:attribute name="font">
-              <dia:font family="Latin Modern Sans" style="0" name="Courier"/>
-            </dia:attribute>
-            <dia:attribute name="height">
-              <dia:real val="0.52917494956893263"/>
-            </dia:attribute>
-            <dia:attribute name="pos">
-              <dia:point val="39.25,5.07582"/>
-            </dia:attribute>
-            <dia:attribute name="color">
-              <dia:color val="#000000ff"/>
-            </dia:attribute>
-            <dia:attribute name="alignment">
-              <dia:enum val="1"/>
-            </dia:attribute>
-          </dia:composite>
-        </dia:attribute>
-        <dia:attribute name="valign">
-          <dia:enum val="3"/>
-        </dia:attribute>
-      </dia:object>
-    </dia:group>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="Latin Modern Sans" style="0" name="Courier"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.80001220721751742"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="39.175,3.56737"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000ff"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:attribute name="valign">
+        <dia:enum val="3"/>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Text" version="1" id="O39">
+      <dia:attribute name="obj_pos">
+        <dia:point val="39.25,5.07582"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="37.9125,4.5718;40.603,5.2376"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#dynamic - 16M#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="Latin Modern Sans" style="0" name="Courier"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.52917494956893263"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="39.25,5.07582"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000ff"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:attribute name="valign">
+        <dia:enum val="3"/>
+      </dia:attribute>
+    </dia:object>
   </dia:layer>
 </dia:diagram>
diff --git a/labs/sysdev-flash-filesystems/sysdev-flash-filesystems.tex b/labs/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
index 56343b37..62be7e21 100644
--- a/labs/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
+++ b/labs/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
@@ -97,8 +97,8 @@ not.
 
 %Creating UBIFS images:
 %
-%mkfs.ubifs -d <rootfs-directory-path> -o <rootfs-image-path> -e 124KiB -m 2048 -c 1024
-%mkfs.ubifs -d <data-directory-path> -o <data-image-path> -e 124KiB -m 2048 -c 1024
+%mkfs.ubifs -d <rootfs-directory-path> -o <rootfs-image-path> -e 124KiB -m 2048 -c 133
+%mkfs.ubifs -d <data-directory-path> -o <data-image-path> -e 124KiB -m %2048 -c 133
 %
 
 %
@@ -138,7 +138,7 @@ not.
 %
 % Creating UBI images:
 %
-% # ubinize -o test.ubi -p 128KiB -m 2048 ubi.ini
+% # ubinize -o ubi.img -p 128KiB -m 2048 ubinize.cfg
 %
 
 \section{MTD partitioning and flashing}
@@ -193,11 +193,11 @@ data using the web server.
 
 %Useful u-boot environment variables
 %setenv mtdids nand0=atmel_nand
-%setenv mtdparts mtdparts=atmel_nand:256k(bootstrap),768k(u-boot),256k(u-boot-env2),256k(u-boot-env1),-(UBI)
+%setenv mtdparts %mtdparts=atmel_nand:256k(bootstrap)ro,768k(u-boot)ro,256k(u-boot-env2)ro,256k(u-boot-env1)ro,-(UBI)
 %setenv bootargs_base console=ttyS0,115200 rootfstype=ubifs root=ubi0:root ip=192.168.0.100:::::eth0 ubi.mtd=4 ro
 %setenv bootcmd 'mtdparts; ubi part UBI; ubi readvol 0x21000000 kernel;
 %ubi readvol 0x22000000 dtb; setenv bootargs ${bootargs_base} ${mtdparts}; bootz 0x21000000 - 0x22000000'
-%setenv flash 'mtdparts; nand erase.part UBI; tftp 0x21000000 test.ubi; nand write.trimffs 0x21000000 UBI ${filesize}'
+%setenv flash 'mtdparts; nand erase.part UBI; tftp 0x21000000 ubi.img; nand write.trimffs 0x21000000 UBI ${filesize}'
 
 \section{Going further}
 
diff --git a/slides/sysdev-flash-filesystems/sysdev-flash-filesystems.tex b/slides/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
index d8bd041d..3f49c41b 100644
--- a/slides/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
+++ b/slides/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
@@ -189,10 +189,11 @@
 \begin{frame}
   \frametitle{U-Boot: defining MTD partitions (1)}
   \begin{itemize}
-  \item U-Boot also provides a way to define MTD partitions on flash devices
-  \item Named partitions are easier to use, and much less error prone than using offsets.
-  \item U-Boot partition definitions can also be used by Linux too,
-    eliminating the risk of mismatches between Linux and U-Boot. 
+  \item U-Boot allows to define MTD partitions on flash devices, using
+        the same syntax as Linux for declaring them.
+  \item Sharing definitions allows to eliminate the risk
+        of mismatches between Linux and U-Boot.
+  \item Named partitions are also easier to use, and much less error prone than using offsets.
   \item Use flash specific commands (detailed soon),
     and pass partition names instead of numerical offsets
   \item Example: \code{nand erase.part <partname>}
@@ -228,29 +229,33 @@ setenv mtdparts mtdparts=omap2-nand.0:512k(XLoader)ro,1536k(UBoot)ro,512k(Env),4
 
 \begin{frame}[fragile]
   \frametitle{U-Boot: defining MTD partitions (3)}
-  Details about the two environment variables needed by U-Boot:
+  \code{mtdids} associates a U-Boot flash device name
+  to a Linux flash device name:\\
+  \code{setenv mtdids <devid>=<mtdid>[,<devid>=<mtdid>]}\\
+  That's required because the Linux name is used in partition definitions.
   \begin{itemize}
-  \item \code{mtdids} attaches an {\em mtdid} to a flash device.\\
-    \code{setenv mtdids <devid>=<mtdid>[,<devid>=<mtdid>]}
-    \begin{itemize}
-    \item \code{devid}: {\bf U-Boot} device identifier (from
-      \code{nand info} or \code{flinfo})
-    \item \code{mtdid}: {\bf Linux} mtd identifier. Displayed
-      when booting the Linux kernel:
+  \item \code{devid}: {\bf U-Boot} device identifier (from
+    \code{nand info} or \code{flinfo})
+  \item \code{mtdid}: {\bf Linux} mtd identifier. Displayed
+    when booting the Linux kernel:
     \includegraphics[width=0.85\textwidth]{slides/sysdev-flash-filesystems/kernel-mtd-log.pdf}\\
-    \end{itemize}
-  \item \code{mtdparts} defines partitions for the different devices\\
-  \code{setenv mtdparts mtdparts=<mtdid>:<partition>[,partition]}\\
-  \code{partition} format: \code{<size>[@offset](<name>)[ro]}
   \end{itemize}
-  Use the \code{mtdparts} command to setup the configuration
-  specified by the \code{mtdids} and \code{mtdparts} variables
+\end{frame}
+
+\begin{frame}[fragile]
+  \frametitle{U-Boot: defining MTD partitions (4)}
+  \code{mtdparts} defines partitions for the different devices\\
+  \begin{itemize}
+    \item \code{setenv mtdparts mtdparts=<mtdid>:<partition>[,partition]}
+    \item \code{partition} format: \code{<size>[@offset](<name>)[ro]}
+  \end{itemize}
+  Use the \code{mtdparts} command to process the \code{mtdids} and
+  \code{mtdparts} settings and activate partitions in U-Boot.
 \end{frame}
 
 \begin{frame}
   \frametitle{U-Boot: sharing partition definitions with Linux}
-  Linux understands U-Boot's \code{mtdparts} partition definitions.\\
-  Here is a recommended way to pass them from U-Boot to Linux:
+  Here is a recommended way to pass partition definitions from U-Boot to Linux:
   \begin{itemize}
   \item Define a \code{bootargs_base} environment variable:\\
     \code{setenv bootargs_base console=ttyS0 root=....}
@@ -381,7 +386,9 @@ setenv mtdparts mtdparts=omap2-nand.0:512k(XLoader)ro,1536k(UBoot)ro,512k(Env),4
     \item Wear leveling, power failure resistant
     \item Available in the official Linux kernel
     \item Boot time depends on the filesystem size: doesn't scale well
-      for large partitions.
+      for large partitions because needs to scan the whole storage at
+      boot time. Need to enable \kconfig{CONFIG_JFFS2_SUMMARY} to
+      address this issue.
     \item \url{http://www.linux-mtd.infradead.org/doc/jffs2.html}
     \end{itemize}
     \column{0.3\textwidth}
@@ -399,8 +406,8 @@ setenv mtdparts mtdparts=omap2-nand.0:512k(XLoader)ro,1536k(UBoot)ro,512k(Env),4
     \item Wear leveling, power failure resistant
     \item Fast boot time
     \item Not part of the official Linux kernel: code only available
-      separately\\
-      (Dual GPL / Proprietary license for non Linux operating systems)
+      separately (Dual GPL / Proprietary license for non Linux
+      operating systems)
     \item \url{https://yaffs.net/}
     \end{itemize}
     \column{0.3\textwidth}
@@ -452,6 +459,9 @@ setenv mtdparts mtdparts=omap2-nand.0:512k(XLoader)ro,1536k(UBoot)ro,512k(Env),4
   \begin{center}
     \includegraphics[width=\textwidth]{slides/sysdev-flash-filesystems/ubi.pdf}
   \end{center}
+  When there is too much activity on an LEB, UBI can decide to move it
+  to another PEB with a lower erase count. Even read-only volumes
+  participate to wear leveling!
 \end{frame}
 
 \begin{frame}
@@ -621,13 +631,17 @@ vol_flags=autoresize
       UBI elements
   \item UBI device management:
     \begin{itemize}
-    \item \code{ubiformat <MTD-device-id>}\\
-	Format an MTD partition and preserve Erase Counter information if any
+    \item \code{ubiformat /dev/mtdx}\\
+	Format an MTD partition and preserve Erase Counter information if any.\\
+	Example: \code{ubiformat /dev/mtd1}
     \item \code{ubiattach -m <MTD-device-id> /dev/ubi_ctrl}\\
-	Attach an MTD partition/device to the UBI layer, and create a UBI device
+	Attach an MTD partition/device to the UBI layer, and create a
+        UBI device\\
+        Example: \code{ubiattach -m 1 /dev/ubi_ctrl} 
     \item \code{ubidetach -m <MTD-device-id> /dev/ubi_ctrl}\\
 	Detach an MTD partition/device from the UBI layer, and remove
-        the associated UBI device
+        the associated UBI device\\
+        Example: \code{ubidetach -m 1 /dev/ubi_ctrl}
     \end{itemize}
   \end{itemize}
 \end{frame}
@@ -644,8 +658,8 @@ vol_flags=autoresize
     \item {\small \code{ubiupdatevol /dev/ubi<UBI-device-id>_<UBI-vol-id> [-s <size>] <vol-image-file>}}\\
 	Update volume contents
     \item {\small \code{ubirsvol /dev/ubi<UBI-device-id> -N <name> -s <size>}}\\
-      	Resize a UBI volume
-    \item {\small \code{ubirename /dev/ubi<UBI-device-id>_<UBI-vol-id> <old-name> <new-size>}}\\
+	Resize a UBI volume
+    \item {\small \code{ubirename /dev/ubi<UBI-device-id>_<UBI-vol-id> <old-name> <new-name>}}\\
 	Rename a UBI volume
     \end{itemize}
 \end{frame}
@@ -696,6 +710,7 @@ vol_flags=autoresize
   \begin{itemize}
   \item No specific tools are required to create a UBIFS filesystem.
 	An empty filesystem is created the first time it is mounted.
+        The same applies to JFFS2.
   \item Mounting a UBIFS filesystem is done with \code{mount}:\\
     \code{mount -t ubifs <ubi-device-id>:<volume-name> <mount-point>}
   \item Example:\\




More information about the training-materials-updates mailing list