# [FE training-materials-updates] Flash labs: move the rootfs update work to the end

Michael Opdenacker michael.opdenacker at free-electrons.com
Thu Oct 29 09:09:47 CET 2015

Repository : git://git.free-electrons.com/training-materials.git
On branch  : master

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

commit e68afa7a5afd76b8b36fe6d5a4aebf2e46015415
Author: Michael Opdenacker <michael.opdenacker at free-electrons.com>
Date:   Thu Oct 29 09:09:47 2015 +0100

Flash labs: move the rootfs update work to the end

Signed-off-by: Michael Opdenacker <michael.opdenacker at free-electrons.com>

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

e68afa7a5afd76b8b36fe6d5a4aebf2e46015415
.../sysdev-flash-filesystems.tex                   | 46 +++++++++++-----------
1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/labs/sysdev-flash-filesystems/sysdev-flash-filesystems.tex b/labs/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
index 7d88d1b..cff9deb 100644
--- a/labs/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
+++ b/labs/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
@@ -207,29 +207,6 @@ Reboot your system and check that the \code{log} is correcly mounted.
%mount -t ubifs ubi0:log /var/log
%

-\subsection{Atomic update}
-
-UBI also provides an atomic update feature, which is particularly useful
-if you need to safely upgrade sensitive parts of your system (kernel,
-DTB or rootfs).
-
-Duplicate the kernel volume and create a U-Boot script to fallback on
-the second kernel volume if the first one is corrupted:
-\begin{itemize}
-  \item First create a new static volume to store your kernel backup
-  \item Flash a valid kernel on the backup volume
-  \item Modify your \code{bootcmd} to fallback to the backup volume if the first one
-    is corrupted
-  \item Now try to update the kernel volume and interrupt the process before
-    it has finished and see what happens (unplug the platform)
-  \item Create a shell script to automate kernel updates (executed in Linux).
-    Be careful, this script should also handle the case where the backup
-    volume has been corrupted (copy the contents of the kernel volume into
-    the backup one)
-\end{itemize}
-
-%TODO: provide a correction
-
\subsection{Using {\em squashfs} for the root filesystem}

Root filesystems are often a sensitive part of your system, and you don't
@@ -253,3 +230,26 @@ root filesystem:
\end{itemize}

%TODO: provide a correction
+
+\subsection{Atomic update}
+
+UBI also provides an atomic update feature, which is particularly useful
+if you need to safely upgrade sensitive parts of your system (kernel,
+DTB or rootfs).
+
+Duplicate the kernel volume and create a U-Boot script to fallback on
+the second kernel volume if the first one is corrupted:
+\begin{itemize}
+  \item First create a new static volume to store your kernel backup
+  \item Flash a valid kernel on the backup volume
+  \item Modify your \code{bootcmd} to fallback to the backup volume if the first one
+    is corrupted
+  \item Now try to update the kernel volume and interrupt the process before
+    it has finished and see what happens (unplug the platform)
+  \item Create a shell script to automate kernel updates (executed in Linux).
+    Be careful, this script should also handle the case where the backup
+    volume has been corrupted (copy the contents of the kernel volume into
+    the backup one)
+\end{itemize}
+
+%TODO: provide a correction