[bootlin/training-materials updates] master: Boot time labs: updates for the init-scripts optimizations (dde59919)

Michael Opdenacker michael.opdenacker at bootlin.com
Fri Apr 2 18:46:22 CEST 2021


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

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

commit dde59919ac9d5d251ee6a57fd726c9b024c32658
Author: Michael Opdenacker <michael.opdenacker at bootlin.com>
Date:   Fri Apr 2 18:46:22 2021 +0200

    Boot time labs: updates for the init-scripts optimizations
    
    Signed-off-by: Michael Opdenacker <michael.opdenacker at bootlin.com>


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

dde59919ac9d5d251ee6a57fd726c9b024c32658
 .../boot-time-build-kernel-and-start-system.tex    |   5 +++
 .../boot-time-init-scripts.tex                     |  34 +++++++++++++++------
 labs/boot-time-init-scripts/bootlog.png            | Bin 67526 -> 59212 bytes
 3 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/labs/boot-time-build-kernel-and-start-system/boot-time-build-kernel-and-start-system.tex b/labs/boot-time-build-kernel-and-start-system/boot-time-build-kernel-and-start-system.tex
index 72338f5e..14c072f4 100644
--- a/labs/boot-time-build-kernel-and-start-system/boot-time-build-kernel-and-start-system.tex
+++ b/labs/boot-time-build-kernel-and-start-system/boot-time-build-kernel-and-start-system.tex
@@ -203,6 +203,11 @@ setenv bootargs console=ttyO0,115200n8 root=/dev/mmcblk0p2 rootwait ro
 \item \code{rootwait} waits for the root device to be ready before
 attempting to mount it. You may have a kernel panic otherwise.
 \item \code{ro} mounts the root filesystem in read-only mode.
+If this is possible, this is quite important to avoid random
+filesystem checks at boot time, depending on how the system was shut
+down, switched off or rebooted. Such filesystem checks can add a lot
+of jitter from one boot to another, making boot time measurements
+unpredicable and difficult to reproduce.
 \end{itemize}
 
 Last but not least, save your changes:
diff --git a/labs/boot-time-init-scripts/boot-time-init-scripts.tex b/labs/boot-time-init-scripts/boot-time-init-scripts.tex
index 98527196..26d6e635 100644
--- a/labs/boot-time-init-scripts/boot-time-init-scripts.tex
+++ b/labs/boot-time-init-scripts/boot-time-init-scripts.tex
@@ -11,18 +11,20 @@ Check and write down the initial size of the root filesystem archive.
 
 \subsection{Use bootchartd on the board}
 
-Add \code{bootchartd} to your \code{BusyBox} configuration:
+Add \code{bootchartd} support (\projconfig{busybox}{CONFIG_BOOTCHARTD})
+to your \code{BusyBox} configuration:
 
 \begin{verbatim}
 cd ~/boot-time-labs/rootfs/buildroot
 make busybox-menuconfig
-make
 \end{verbatim}
 
-Also add support for {\em gzip compression} in utilities like \code{tar}
-(\code{BR2_FEATURE_SEAMLESS_GZ}), which is needed by \code{bootchartd}.
+In \code{Archival Utilities}, also enable \code{Make tar, rpm, modprobe
+etc understand .gz data} (\code{FEATURE_SEAMLESS_GZ}), which is needed by
+\code{bootchartd}.
 
-The \code{make} command should only take a few seconds to run.
+After saving the configuration, the \code{make} command should only take
+a few seconds to run.
 
 \subsection{Re-flash the root filesystem}
 
@@ -44,15 +46,28 @@ U-Boot> saveenv
 
 This will make the system boot and the resulting bootlog will be located
 in \code{/var/log/bootlog.tgz}. As \code{/var/log} is actually stored in
-RAM (through the {\em tmpfs} filesystem, copy it to the root filesystem
-storage and halt your board:
+RAM (through the {\em tmpfs} filesystem, you will copy it to the root
+filesystem.
+
+First, as the filesystem is read-only, remount it in read-write mode:
+\begin{verbatim}
+mount -o remount,rw /
+\end{verbatim}
+
+Now, copy the file to the root filesystem storage and halt your board:
 
 \begin{verbatim}
 cp /var/log/bootlog.tgz /root/
 halt
 \end{verbatim}
 
-Remove the SD card and copy that file to \code{~/boot-time-labs/rootfs/} on your host.
+Remove the SD card, insert it in your PC, and copy that file on your host:
+
+\begin{verbatim}
+cd $HOME/boot-time-labs/rootfs
+sudo cp /media/$USER/rootfs/root/bootlog.tgz .
+sudo chown $USER.$USER bootlog.tgz
+\end{verbatim}
 
 \subsection{Analyze bootchart data on your workstation}
 
@@ -69,8 +84,7 @@ Now, get the \code{bootchart} source code for version 0.9 from
 \url{http://www.bootchart.org/}\footnote{Don't try to get the \code{bootchart} package supplied by
 Ubuntu instead. While it has similar functionality, it looks like a completely
 unrelated piece of software. To confirm this, it has no dependency
-whatsoever on Java packages.}
-, compile it and use \code{bootchart} to generate the boot
+whatsoever on Java packages.}, compile it and use \code{bootchart} to generate the boot
 chart:
 
 \begin{verbatim}
diff --git a/labs/boot-time-init-scripts/bootlog.png b/labs/boot-time-init-scripts/bootlog.png
index 7b86b74a..f37a160b 100644
Binary files a/labs/boot-time-init-scripts/bootlog.png and b/labs/boot-time-init-scripts/bootlog.png differ




More information about the training-materials-updates mailing list