[bootlin/training-materials updates] master: Embedded Linux: misc improvements (0bdf1459)

Michael Opdenacker michael.opdenacker at bootlin.com
Thu Sep 24 15:53:35 CEST 2020


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

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

commit 0bdf14594f4b9ba3bee6778d437e77cebb355933
Author: Michael Opdenacker <michael.opdenacker at bootlin.com>
Date:   Thu Sep 24 15:53:35 2020 +0200

    Embedded Linux: misc improvements
    
    Signed-off-by: Michael Opdenacker <michael.opdenacker at bootlin.com>


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

0bdf14594f4b9ba3bee6778d437e77cebb355933
 .../boot-time-filesystem-optimizations.tex         |  2 +-
 .../mixing-filesystems.dia                         | 63 +++++++++++-----------
 .../sysdev-block-filesystems.tex                   | 21 +++++---
 .../sysdev-bootloaders-u-boot.tex                  |  2 +-
 .../sysdev-flash-filesystems.tex                   | 36 ++++++++++---
 .../sysdev-linux-intro-sources.tex                 |  3 +-
 6 files changed, 79 insertions(+), 48 deletions(-)

diff --git a/labs/boot-time-filesystem-optimizations/boot-time-filesystem-optimizations.tex b/labs/boot-time-filesystem-optimizations/boot-time-filesystem-optimizations.tex
index 7af12f2d..1d5cecd2 100644
--- a/labs/boot-time-filesystem-optimizations/boot-time-filesystem-optimizations.tex
+++ b/labs/boot-time-filesystem-optimizations/boot-time-filesystem-optimizations.tex
@@ -9,7 +9,7 @@ During this lab, we will compare 3 ways of accessing the root filesystem
 \item Booting from an {\em initramfs}
 \end{itemize}
 
-\section{Tests with ext4 and Squashfs}
+\section{Tests with ext4 and SquashFS}
 
 First, recompile your kernel with {\em SquashFS} support, and update it
 on the SD card.
diff --git a/slides/sysdev-block-filesystems/mixing-filesystems.dia b/slides/sysdev-block-filesystems/mixing-filesystems.dia
index d696d345..bbaa96d4 100644
--- a/slides/sysdev-block-filesystems/mixing-filesystems.dia
+++ b/slides/sysdev-block-filesystems/mixing-filesystems.dia
@@ -90,7 +90,7 @@
         <dia:point val="22,4"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="21.95,3.95;28.05,12.05"/>
+        <dia:rectangle val="21.95,3.95;28.05,10.15"/>
       </dia:attribute>
       <dia:attribute name="elem_corner">
         <dia:point val="22,4"/>
@@ -99,7 +99,7 @@
         <dia:real val="6"/>
       </dia:attribute>
       <dia:attribute name="elem_height">
-        <dia:real val="8"/>
+        <dia:real val="6.1000000000000014"/>
       </dia:attribute>
       <dia:attribute name="border_width">
         <dia:real val="0.10000000149011612"/>
@@ -116,19 +116,19 @@
     </dia:object>
     <dia:object type="Standard - Box" version="0" id="O1">
       <dia:attribute name="obj_pos">
-        <dia:point val="22,12"/>
+        <dia:point val="22,10.2"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="21.95,11.95;28.05,18.05"/>
+        <dia:rectangle val="21.95,10.15;28.05,18.05"/>
       </dia:attribute>
       <dia:attribute name="elem_corner">
-        <dia:point val="22,12"/>
+        <dia:point val="22,10.2"/>
       </dia:attribute>
       <dia:attribute name="elem_width">
         <dia:real val="6"/>
       </dia:attribute>
       <dia:attribute name="elem_height">
-        <dia:real val="6"/>
+        <dia:real val="7.7999999999999989"/>
       </dia:attribute>
       <dia:attribute name="border_width">
         <dia:real val="0.10000000149011612"/>
@@ -145,19 +145,19 @@
     </dia:object>
     <dia:object type="Standard - Box" version="0" id="O2">
       <dia:attribute name="obj_pos">
-        <dia:point val="22.05,19.75"/>
+        <dia:point val="22.05,18.9875"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="22,19.7;28.1,23.8"/>
+        <dia:rectangle val="22,18.9375;28.1,23.8"/>
       </dia:attribute>
       <dia:attribute name="elem_corner">
-        <dia:point val="22.05,19.75"/>
+        <dia:point val="22.05,18.9875"/>
       </dia:attribute>
       <dia:attribute name="elem_width">
         <dia:real val="6"/>
       </dia:attribute>
       <dia:attribute name="elem_height">
-        <dia:real val="4"/>
+        <dia:real val="4.7625000000000028"/>
       </dia:attribute>
       <dia:attribute name="border_width">
         <dia:real val="0.10000000149011612"/>
@@ -177,7 +177,7 @@
         <dia:point val="29.25,11.35"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="29.25,10.3725;34.06,11.6125"/>
+        <dia:rectangle val="29.25,10.3729;34.0625,11.6116"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
@@ -210,7 +210,7 @@
         <dia:point val="29.4,21.8"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="29.4,20.8225;31.2525,22.0625"/>
+        <dia:rectangle val="29.4,20.8229;31.2525,22.0616"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
@@ -243,12 +243,13 @@
         <dia:point val="25,5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="23.3863,4.0375;26.6137,5.2525"/>
+        <dia:rectangle val="23.3863,4.00959;26.644,6.37037"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
           <dia:attribute name="string">
-            <dia:string>#squashfs#</dia:string>
+            <dia:string>#squashfs
+/#</dia:string>
           </dia:attribute>
           <dia:attribute name="font">
             <dia:font family="Latin Modern Sans" style="80" name="Courier"/>
@@ -306,13 +307,13 @@
     </dia:object>
     <dia:object type="Standard - Line" version="0" id="O7">
       <dia:attribute name="obj_pos">
-        <dia:point val="28.6168,19.79"/>
+        <dia:point val="28.5375,19.0375"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="28.2003,19.7392;28.9665,23.8508"/>
+        <dia:rectangle val="28.1776,18.9874;28.9099,23.8501"/>
       </dia:attribute>
       <dia:attribute name="conn_endpoints">
-        <dia:point val="28.6168,19.79"/>
+        <dia:point val="28.5375,19.0375"/>
         <dia:point val="28.55,23.8"/>
       </dia:attribute>
       <dia:attribute name="numcp">
@@ -339,15 +340,16 @@
     </dia:object>
     <dia:object type="Standard - Text" version="1" id="O8">
       <dia:attribute name="obj_pos">
-        <dia:point val="25,13"/>
+        <dia:point val="25,11.3"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="24.1687,12.0071;25.8616,13.3133"/>
+        <dia:rectangle val="23.9138,10.3399;26.0862,12.6098"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
           <dia:attribute name="string">
-            <dia:string>#ext4#</dia:string>
+            <dia:string>#ext4
+/data#</dia:string>
           </dia:attribute>
           <dia:attribute name="font">
             <dia:font family="Latin Modern Sans" style="80" name="Courier"/>
@@ -356,7 +358,7 @@
             <dia:real val="1.0583332926034927"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="25,13"/>
+            <dia:point val="25,11.3"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000ff"/>
@@ -372,15 +374,16 @@
     </dia:object>
     <dia:object type="Standard - Text" version="1" id="O9">
       <dia:attribute name="obj_pos">
-        <dia:point val="25,21"/>
+        <dia:point val="25,19.95"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="23.9025,20.0375;26.0975,21.2525"/>
+        <dia:rectangle val="23.9025,18.9596;26.1278,21.3204"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
           <dia:attribute name="string">
-            <dia:string>#tmpfs#</dia:string>
+            <dia:string>#tmpfs
+/var#</dia:string>
           </dia:attribute>
           <dia:attribute name="font">
             <dia:font family="Latin Modern Sans" style="80" name="Courier"/>
@@ -389,7 +392,7 @@
             <dia:real val="1.0583332926034927"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="25,21"/>
+            <dia:point val="25,19.95"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000ff"/>
@@ -408,7 +411,7 @@
         <dia:point val="25.05,7.5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="22.8963,6.685;27.2038,9.48389"/>
+        <dia:rectangle val="22.8963,6.68579;27.2038,9.4819"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
@@ -440,10 +443,10 @@ root filesystem#</dia:string>
     </dia:object>
     <dia:object type="Standard - Text" version="1" id="O11">
       <dia:attribute name="obj_pos">
-        <dia:point val="25.14,14.595"/>
+        <dia:point val="25.14,14.995"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="23.2163,13.78;27.0638,17.4608"/>
+        <dia:rectangle val="23.2163,14.1808;27.0638,17.8588"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
@@ -460,7 +463,7 @@ data#</dia:string>
             <dia:real val="0.88194441050291061"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="25.14,14.595"/>
+            <dia:point val="25.14,14.995"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000ff"/>
@@ -479,7 +482,7 @@ data#</dia:string>
         <dia:point val="25.045,22.135"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="23.2338,21.32;26.8562,23.2369"/>
+        <dia:rectangle val="23.2338,21.3208;26.8562,23.235"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
diff --git a/slides/sysdev-block-filesystems/sysdev-block-filesystems.tex b/slides/sysdev-block-filesystems/sysdev-block-filesystems.tex
index 20d9f4dc..4ecf3a97 100644
--- a/slides/sysdev-block-filesystems/sysdev-block-filesystems.tex
+++ b/slides/sysdev-block-filesystems/sysdev-block-filesystems.tex
@@ -111,9 +111,10 @@ major minor #blocks name
     \code{ext{2,3,4}} filesystems
     \begin{itemize}
     \item \code{ext2}
-    \item \code{ext3}, brought {\em journaling} compared to \code{ext2}
+    \item \code{ext3}, brought {\em journaling} compared to \code{ext2},
+	  now obsoleted by \code{ext4}.
     \item \code{ext4}, mainly brought performance improvements and
-      support for even larger filesystems
+          support for very big partitions.
     \end{itemize}
   \item It supports all features Linux needs in a root filesystem:
     permissions, ownership, device files, symbolic links, etc.
@@ -188,13 +189,13 @@ major minor #blocks name
   \item Benchmarks: best performer on flash devices most of the time: \\
         See \url{https://lwn.net/Articles/520003/}
   \item Technical details: \url{https://lwn.net/Articles/518988/}
-  \item Not as widely used as \code{ext3,4}, even on flash-based
+  \item Not as widely used as \code{ext4} and \code{btrfs}, even on flash-based
     storage.
   \end{itemize}
 \end{frame}
 
 \begin{frame}
-  \frametitle{Squashfs: read-only filesystem}
+  \frametitle{SquashFS: read-only filesystem}
   \begin{itemize}
   \item Read-only, compressed filesystem for block devices. Fine for
     parts of a filesystem which can be read-only (kernel, binaries...)
@@ -204,6 +205,8 @@ major minor #blocks name
   \item Supports several compression algorithms (LZO, XZ, etc.)
   \item Benchmarks: roughly 3 times smaller than ext3, and 2-4 times
     faster (\url{https://elinux.org/Squash_Fs_Comparisons})
+  \item New alternative to SquashFS: EROFS\\
+    \url{https://en.wikipedia.org/wiki/EROFS}
   \end{itemize}
 \end{frame}
 
@@ -271,13 +274,12 @@ major minor #blocks name
 \subsection{Using block filesystems}
 
 \begin{frame}
-  \frametitle{Creating ext2/ext3/ext4 filesystems}
+  \frametitle{Creating ext2/ext4 filesystems}
   \begin{itemize}
-  \item To create an empty ext2/ext3/ext4 filesystem on a block device or
+  \item To create an empty ext2/ext4 filesystem on a block device or
     inside an already-existing image file
     \begin{itemize}
     \item \code{mkfs.ext2 /dev/hda3}
-    \item \code{mkfs.ext3 /dev/sda2}
     \item \code{mkfs.ext4 /dev/sda3}
     \item \code{mkfs.ext2 disk.img}
     \end{itemize}
@@ -309,6 +311,9 @@ major minor #blocks name
     the contents of the \code{rootfs.img} file.
   \item This is possible thanks to \code{loop}, which is a kernel
     driver that emulates a block device with the contents of a file.
+  \item Note: \code{-o loop} no longer necessary with recent versions
+        of \code{mount} from {\em GNU Coreutils}. Not true with BusyBox
+       \code{mount}.
   \item Do not forget to run \code{umount} before using the filesystem
     image!
   \end{itemize}
@@ -339,7 +344,7 @@ major minor #blocks name
     \column{0.7\textwidth}
     Good idea to split your block storage into:
     \begin{itemize}
-    \item A compressed read-only partition (\code{Squashfs})\\
+    \item A compressed read-only partition (\code{SquashFS})\\
       Typically used for the root filesystem (binaries, kernel...).\\
       Compression saves space. Read-only access protects your system
       from mistakes and data corruption.
diff --git a/slides/sysdev-bootloaders-u-boot/sysdev-bootloaders-u-boot.tex b/slides/sysdev-bootloaders-u-boot/sysdev-bootloaders-u-boot.tex
index 47ac5040..35b879da 100644
--- a/slides/sysdev-bootloaders-u-boot/sysdev-bootloaders-u-boot.tex
+++ b/slides/sysdev-bootloaders-u-boot/sysdev-bootloaders-u-boot.tex
@@ -298,7 +298,7 @@ GNU ld (crosstool-NG 1.24.0.105_5659366) 2.34
 \end{frame}
 
 \begin{frame}
-  \frametitle{Environment variables commands (2)}
+  \frametitle{Environment variables commands}
   Commands to manipulate environment variables:
   \begin{itemize}
     \item \code{printenv}\\
diff --git a/slides/sysdev-flash-filesystems/sysdev-flash-filesystems.tex b/slides/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
index 6e551b02..08f7a186 100644
--- a/slides/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
+++ b/slides/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
@@ -229,13 +229,35 @@ 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)}
-  \begin{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} = 128 KiB, \code{0x100000} = 1 MiB, \code{0x1000000} = 16 MiB
-  \item \code{ro} lists the partition as read only
-  \item \code{-} is used to use all the remaining space.
-  \end{itemize}
+  \begin{columns}
+  \column{0.5\textwidth}
+    \begin{itemize}
+    \item Partition sizes must be multiple of the erase block size.
+      You can use sizes in hexadecimal too.
+    \item \code{ro} lists the partition as read only
+    \item \code{-} is used to use all the remaining space.
+    \item Remember the below sizes:
+    \begin{itemize}
+      \item \code{0x100} = 256
+      \item \code{0x1000} = 4 KiB
+      \item \code{0x10000} = 64 KiB
+      \item \code{0x100000} = 1 MiB
+      \item \code{0x1000000} = 16 MiB
+    \end{itemize}
+    \end{itemize}
+  \column{0.5\textwidth}
+    Tip: use the \code{python} shell for hexadecimal/decimal/binary conversion:
+    \begin{block}{}
+    \begin{verbatim}
+>>> hex(4096)
+'0x1000'
+>>> 0x10000
+65536
+>>> bin(0xbeef)
+'0b1011111011101111'
+    \end{verbatim}
+    \end{block}
+  \end{columns}
 \end{frame}
 
 
diff --git a/slides/sysdev-linux-intro-sources/sysdev-linux-intro-sources.tex b/slides/sysdev-linux-intro-sources/sysdev-linux-intro-sources.tex
index 50cd7697..e30ddda9 100644
--- a/slides/sysdev-linux-intro-sources/sysdev-linux-intro-sources.tex
+++ b/slides/sysdev-linux-intro-sources/sysdev-linux-intro-sources.tex
@@ -15,7 +15,8 @@
     \begin{itemize}
     \item Focusing on hardware support first
     \item Can have a very important delta with mainline Linux
-    \item Useful only when mainline hasn't caught up yet.
+    \item Useful only when mainline hasn't caught up yet. Many vendors
+          invest in the mainline kernel at the same time.
     \end{itemize}
   \item Many kernel sub-communities maintain their own kernel, with
     usually newer but less stable features




More information about the training-materials-updates mailing list