[bootlin/training-materials updates] master: use global variables to define kernel versions being used in kernel patch lab (73bee0be)

Michael Opdenacker michael.opdenacker at bootlin.com
Fri Dec 18 16:46:55 CET 2020


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

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

commit 73bee0be60faffa9efbcabc50a0aac8dacd1b7be
Author: Manuel Reis <mluis.reis at gmail.com>
Date:   Thu Dec 17 21:18:57 2020 +0000

    use global variables to define kernel versions being used in kernel patch lab
    
    add extra variables to the embedded labs to allow a more abstract Latex
    compilation and focusing changes for future work in vars file
    
    Signed-off-by: Manuel Reis <mluis.reis at gmail.com>


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

73bee0be60faffa9efbcabc50a0aac8dacd1b7be
 common/embedded-linux-4d-labs-vars.tex             |  3 ++
 common/embedded-linux-labs-vars.tex                |  4 +++
 common/embedded-linux-qemu-labs-vars.tex           |  3 ++
 .../sysdev-kernel-fetch-and-patch.tex              | 36 ++++++----------------
 4 files changed, 20 insertions(+), 26 deletions(-)

diff --git a/common/embedded-linux-4d-labs-vars.tex b/common/embedded-linux-4d-labs-vars.tex
index 7f985ef3..ed7b57a8 100644
--- a/common/embedded-linux-4d-labs-vars.tex
+++ b/common/embedded-linux-4d-labs-vars.tex
@@ -1,3 +1,6 @@
 \def\labbooktitle{Embedded Linux System Development}
 \def\labbooksubtitle{STM32MP1 variant}
 \def\labboard{discovery}
+\newcommand*{\basekernel}{5.9}
+\newcommand*{\workingkernel}{5.10}
+\newcommand*{\labboarddescription}{STM32MP157A-DK1 Discovery kit}
diff --git a/common/embedded-linux-labs-vars.tex b/common/embedded-linux-labs-vars.tex
index 65aa4f3a..184bea3f 100644
--- a/common/embedded-linux-labs-vars.tex
+++ b/common/embedded-linux-labs-vars.tex
@@ -1,3 +1,7 @@
 \def\labbooktitle{Embedded Linux System Development}
 \def\labbooksubtitle{Microchip SAMA5D3 variant}
 \def\labboard{xplained}
+\newcommand{\basekernel}{5.8}
+\newcommand{\workingkernel}{5.9}
+\newcommand{\labboarddescription}{Microchip Technology SAMA5D3 Xplained Evaluation Kit
+}
diff --git a/common/embedded-linux-qemu-labs-vars.tex b/common/embedded-linux-qemu-labs-vars.tex
index 15715485..8c175809 100644
--- a/common/embedded-linux-qemu-labs-vars.tex
+++ b/common/embedded-linux-qemu-labs-vars.tex
@@ -1,3 +1,6 @@
 \def\labbooktitle{Embedded Linux System Development}
 \def\labbooksubtitle{QEMU ARM variant}
 \def\labboard{qemu}
+\newcommand{\basekernel}{5.8}
+\newcommand{\workingkernel}{5.9}
+\newcommand{\labboarddescription}{QEMU ARM Versatile Express for Cortex-A9}
diff --git a/labs/sysdev-kernel-fetch-and-patch/sysdev-kernel-fetch-and-patch.tex b/labs/sysdev-kernel-fetch-and-patch/sysdev-kernel-fetch-and-patch.tex
index f902c6df..4b71bbf9 100644
--- a/labs/sysdev-kernel-fetch-and-patch/sysdev-kernel-fetch-and-patch.tex
+++ b/labs/sysdev-kernel-fetch-and-patch/sysdev-kernel-fetch-and-patch.tex
@@ -20,35 +20,19 @@ Just to make sure you know how to do it, check the version of the
 Linux kernel running on your machine.
 %uname -r
 
-\ifdefstring{\labboard}{discovery}{
-We will use \code{linux-5.10.x}, which this lab was tested with.
+We will use \texttt{linux-\workingkernel.x}, which this lab was tested with.
 
-To practice with the \code{patch} command later, download the full 5.9
-sources. Unpack the archive, which creates a \code{linux-5.9}
+To practice with the \code{patch} command later, download the full \texttt\basekernel\
+sources. Unpack the archive, which creates a \texttt{linux-\basekernel}
 directory.
-}{
-We will use \code{linux-5.9.x}, which this lab was tested with.
-
-To practice with the \code{patch} command later, download the full 5.8
-sources. Unpack the archive, which creates a \code{linux-5.8}
-directory.
-}
 
 Remember that you can use \code{wget <URL>} on the command
 line to download files.
 
 \section{Apply patches}
 
-\ifdefstring{\labboard}{discovery}{
-Download the patch files corresponding to the latest 5.10 stable
-release: a first patch to move from 5.9 to 5.10 and if one exists,
-a second patch to move from 5.9 to 5.10.x.
-
-}{
-Download the patch files corresponding to the latest 5.9 stable
-release: a first patch to move from 5.8 to 5.9 and if one exists,
-a second patch to move from 5.9 to 5.9.x.
-}
+Download the patch files corresponding to the latest \texttt\workingkernel\ stable
+release: a first patch to move from \texttt\basekernel\ to \texttt\workingkernel\ and if one exists, a second patch to move from \texttt\basekernel\ to \texttt{\workingkernel.x}.
 
 Without uncompressing them to a separate file, apply the patches to the Linux
 source directory.
@@ -56,8 +40,8 @@ source directory.
 %xzcat ../patchfile.xz | patch -p1 (--dry-run)
 %patch -p1 (--dry-run) < ../diff_file
 
-\ifdefstring{\labboard}{discovery}{
-Rename the \code{linux-5.9} directory to \code{linux-5.10.<x>}.
-}{
-Rename the \code{linux-5.8} directory to \code{linux-5.9.<x>}.
-}
+View one of the patch files with \code{vi} or \code{gvim}
+(if you prefer a graphical editor), to understand the information carried
+by such a file. How are described added or removed files?
+
+Rename the \texttt{linux-\basekernel} directory to \texttt{linux-\workingkernel.<x>}.




More information about the training-materials-updates mailing list