diff options
| author | John Ogness <john.ogness@linutronix.de> | 2019-02-18 11:53:19 +0106 |
|---|---|---|
| committer | John Ogness <john.ogness@linutronix.de> | 2019-02-18 11:53:19 +0106 |
| commit | efc176eef8a3f807775c34b739831fd9581bbf34 (patch) | |
| tree | 2bffaf13d50408d8ff2328c73f9e76470201554c | |
| parent | 3f3b8d722e289409758c42729c4729408b871363 (diff) | |
boot-process-basics: translate to english
The german version file is still there but it will no longer be
built by the Makefile.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
| -rw-r--r-- | linux-basics/boot-process-basics/Makefile | 2 | ||||
| -rw-r--r-- | linux-basics/boot-process-basics/pres_boot-process-basics_en.tex | 254 |
2 files changed, 255 insertions, 1 deletions
diff --git a/linux-basics/boot-process-basics/Makefile b/linux-basics/boot-process-basics/Makefile index e313285..f1fafe6 100644 --- a/linux-basics/boot-process-basics/Makefile +++ b/linux-basics/boot-process-basics/Makefile @@ -1 +1 @@ -obj-$(CONFIG_LINUX_BOOT_PROCESS_BASIC) += pres_boot-process-basics_de.pdf +obj-$(CONFIG_LINUX_BOOT_PROCESS_BASIC) += pres_boot-process-basics_en.pdf diff --git a/linux-basics/boot-process-basics/pres_boot-process-basics_en.tex b/linux-basics/boot-process-basics/pres_boot-process-basics_en.tex new file mode 100644 index 0000000..d6a0af0 --- /dev/null +++ b/linux-basics/boot-process-basics/pres_boot-process-basics_en.tex @@ -0,0 +1,254 @@ +\input{configpres} + +\title{The Linux Boot Process} +\maketitle + +\subsection{Boot Process} + +\begin{frame} +\frametitle{Components of the Boot Process} +\begin{itemize} +\item Bootloader +\item Linux +\item ''Userspace'' +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{Boot Process Procedure} +\begin{enumerate} +\item bootloader initializes hardware +\item bootloader relocates kernel +\item bootloader provides parameters and starts kernel +\item Linux boots +\item Linux kernel mounts a RFS +\item Linux kernel starts first process (/sbin/init, /linuxrc, or specified with init= parameter) +\end{enumerate} +\end{frame} + +\begin{frame} +\frametitle{Responsibilities of the Bootloader} +Low-Level Initialization: +\pause +\begin{itemize} +\item clocks (CPU, PLLs, peripherals...) +\item memory (DRAM-controller, NAND-controller...) +\item serial interface +\item provide parameters to the kernel +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{The Linux Kernel} +\begin{itemize} +\item setup interrupts (i.e. timer interrupt) +\item load drivers, initialize hardware +\item mount ''root filesystem'' to / +\item start the first process +\end{itemize} +\end{frame} + +\subsection{init Systems} + +\begin{frame} +\frametitle{The init System} +\begin{itemize} +\item System V init +\item systemd +\item busybox-init +\item OpenRC +\item upstart +\item \dots +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{System V init} +\begin{itemize} +\item behavior defined in /etc/inittab +\item start scripts in /etc/init.d +\item split into ''runlevels'' +\item runlevels describe various system states (shutdown, single-user, multi-user with/without network, \dots) +\item System V does not understand dependencies, sequential calling of start scripts +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{systemd} +\begin{itemize} +\item starts processes in parallel (without explizitly configuring dependencies): +\begin{itemize} +\item creates sockets for communicating with the starting processes +\item data written so the sockets are buffered until the starting processes can receieve the data +\end{itemize} +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{systemd} +\begin{itemize} +\item configuration via invidividual text files (no shell code) +\item the actions to perform are based on the configuration and are performed by systemd (Linux executable) +\item this prevents starting many individual shell instances +\item administration via systemctl +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{systemd} +\begin{itemize} +\item ''targets'' replace the roll of ''runlevels'' (i.e. runlevel 0 == poweroff.target) +\item multiple targets can be activated simultaneously +\item configuration files in /etc/systemd and /lib/systemd +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{systemd} +\begin{itemize} +\item compatbile to System V init. Scripts in /etc/init.d will be started +\item uses ''control groups'' for starting/monitoring processes (systemd requires CGROUPS support in the kernel!) +\end{itemize} +\end{frame} + +\begin{frame}[fragile] +\frametitle{systemd: Integrating own Services} +/lib/systemd/system/training.service +\begin{verbatim} +[Unit] +Description=Just a simple systemd service + +[Service] +Type=oneshot +ExecStart=/home/devel/systemd_test.sh +StandardOutput=syslog +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{systemd: Integrating own Services} +/home/devel/systemd\_test.sh +\begin{verbatim} +#!/bin/sh + +echo "Here I AM :)" +sleep 5 +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{systemd: Integrating own Services} +/home/devel/systemd\_test.sh +\begin{verbatim} +$ systemctl enable training.service +ln -s '/lib/systemd/system/training.service' + '/etc/systemd/system/multi-user.target.wants/training.service' +\end{verbatim} +\end{frame} + +\subsection{Boot Time Analysis} + +\begin{frame}[fragile] +\frametitle{Boot Time Analysis: Bootloader} +Use the scope, Luke! ;) +\begin{figure}[h] +\centering +\includegraphics[height=5cm]{images/at91_ipl_quiet_lpj_lzo.png} +\end{figure} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Boot Time Analysis: Kernel} +\begin{itemize} +\item boot the target withinitcall\_debug und printk.time=1 +\item from the target: dmesg > bootlog.txt +\item copy bootlog.txt to the host +\item from the host: +\begin{verbatim} +perl linux-src/scripts/bootgraph.pl < bootlog.txt > bootlog.svg +\end{verbatim} +\end{itemize} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Boot Time Analysis: Kernel} +\begin{figure}[h] +\centering +\includegraphics[height=5cm]{images/bootlog.png} +\end{figure} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Boot Time Analysis: System V} +Analyze the boot process with bootchart: +\begin{itemize} +\item booten the target with init=/sbin/bootchartd +\item after booting, stop bootchard on the target: +\begin{verbatim} +/sbin/bootchartd stop +\end{verbatim} +\item copy /var/log/bootchart.tgz to the host +\item from the host generate an SVG graphic file: +\begin{verbatim} +java -jar bootchart.jar -f svg bootchart.tgz +\end{verbatim} +\end{itemize} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Boot Time Analysis: System V / bootchart} +\begin{figure}[h] +\centering +\includegraphics[height=5cm]{images/bootchart.png} +\end{figure} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Boot Time Analysis: systemd} +Analyze the boot process with systemd: +\begin{itemize} +\item boot the target via systemd +\item after booting, run systemd-analyze on the target +\begin{verbatim} +$ systemd-analyze blame +1897ms networking.service +1715ms vmware-tools.service +1234ms nfs-common.service + +# or + +$ system-analyze plot > boot.svg +\end{verbatim} +\item copy the output or plot to the host to analyze +\end{itemize} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Boot Time Analysis: systemd-analyze plot} +\begin{figure}[h] +\centering +\includegraphics[width=8cm]{images/debian_systemd_top.png} +\end{figure} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Boot Time Analysis: systemd-analyze plot} +\begin{figure}[h] +\centering +\includegraphics[width=8cm]{images/debian_systemd_bottom.png} +\end{figure} +\end{frame} + +\begin{frame} +\frametitle{Sources} +\begin{thebibliography}{1} +\bibitem{kof} Linux 2012, Michael Kofler, PEARSON Verlag +\bibitem{heise} http://www.heise.de/open/artikel/Das-Init-System-Systemd-Teil-1-1563259.html +\end{thebibliography} +\end{frame} + +\input{tailpres} |
