[bootlin/training-materials updates] master: Add boot-time source downloading lab (7a89a4d4)

Michael Opdenacker michael.opdenacker at bootlin.com
Thu May 16 14:17:19 CEST 2019


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

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

commit 7a89a4d4e9c7f3451b155dfca32972d266bda47f
Author: Michael Opdenacker <michael.opdenacker at bootlin.com>
Date:   Wed May 15 17:43:04 2019 +0200

    Add boot-time source downloading lab
    
    Signed-off-by: Michael Opdenacker <michael.opdenacker at bootlin.com>


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

7a89a4d4e9c7f3451b155dfca32972d266bda47f
 .../boot-time-sources-download.tex                 | 139 +++++++++++++++++++++
 mk/boot-time.mk                                    |   1 +
 2 files changed, 140 insertions(+)

diff --git a/labs/boot-time-sources-download/boot-time-sources-download.tex b/labs/boot-time-sources-download/boot-time-sources-download.tex
new file mode 100644
index 00000000..a22c29a6
--- /dev/null
+++ b/labs/boot-time-sources-download/boot-time-sources-download.tex
@@ -0,0 +1,139 @@
+\subchapter{Downloading bootloader, kernel and Buildroot source
+code}{Save time and start fetching the source code that you will need
+during these labs}
+
+\section{Setup}
+
+Create the \code{$HOME/boot-time-labs/src} directory.
+
+\section{Installing git packages}
+
+We are going to access bootloader, kernel and Buildroot sources through
+their \code{git} repositories, which will allow us to track any changes
+that we make to the source code of these projects.
+
+Depending on how fast your network connection is (and how many users
+share it), fetching such sources is likely to take a significant amount
+of time. That's why we're starting such downloads now.
+
+So, let's install the below packages:
+
+\begin{verbatim}
+sudo apt install git gitk git-email
+\end{verbatim}
+
+\section{Git configuration}
+
+After installing \code{git} on a new machine, the first thing to do is
+to let \code{git} know about your name and e-mail address:
+
+\begin{verbatim}
+git config --global user.name ’My Name’
+git config --global user.email me at mydomain.net
+\end{verbatim}
+
+Such information will be stored in commits. It is important
+to configure it properly in case we need to generate and
+send patches.
+
+\section{Cloning the Buildroot source tree}
+
+\begin{verbatim}
+git clone git://git.buildroot.net/buildroot
+\end{verbatim}
+
+or if you are behind a proxy blocking \code{git}, here's a slower
+alternative:
+
+\begin{verbatim}
+git clone https://git.buildroot.net/buildroot
+\end{verbatim}
+
+If the connection to the Internet turns out to be not fast enough,
+your instructor can give you a USB flash drive with a
+\code{tar} archive of a recently cloned tree:
+
+\begin{verbatim}
+tar xf buildroot-git.tar.xz
+cd buildroot
+git checkout master
+git pull
+\end{verbatim}
+
+We will select a particular release tag later. Let's move on to the next
+source repository.
+
+\section{Cloning the Buildroot source tree}
+
+Get back to the top \code{src} directory.
+
+\begin{verbatim}
+git clone git://git.denx.de/u-boot.git
+\end{verbatim}
+
+or
+
+\begin{verbatim}
+git clone https://git.denx.de/u-boot.git
+\end{verbatim}
+
+Similarly, your instructor can give you a pre-downloaded archive if
+needed.
+
+\section{Cloning the mainline Linux tree}
+
+Get back to the top \code{src} directory.
+
+This represents the biggest amout of sources to download, actually more
+than 1 GB of data! Again, you can use a pre-downloaded archive if that
+turns out to be to much for your actual connection.
+
+{\small
+\begin{verbatim}
+git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
+\end{verbatim}
+}
+
+or
+
+{\small
+\begin{verbatim}
+git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
+\end{verbatim}
+}
+
+\section{Accessing stable Linux releases}
+
+Stay in the Linux source directory.
+
+Having the Linux kernel development sources is great, but when you are
+creating products, you prefer to avoid working with a target that moves
+every day.
+
+That's why we need to use the {\em stable} releases of the Linux
+kernel.
+
+Fortunately, with \code{git}, you won't have to clone an entire source
+tree again. All you need to do is add a reference to a {\em remote}
+tree, and fetch only the commits which are specific to that remote tree.
+
+{\footnotesize
+\begin{verbatim}
+git remote add stable git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
+git fetch stable
+\end{verbatim}
+}
+
+As this still represents many git objects to download (253 MiB when 4.19 was
+the latest version), if you are using an already downloaded git tree,
+your instructor will probably have fetched the {\em stable} branch ahead
+of time for you too. You can check by running:
+
+\begin{verbatim}
+git branch -a
+\end{verbatim}
+
+We will choose a particular stable version in the next labs.
+
+Now, let's continue the lectures. This will leave time for the commands
+that you typed to complete their execution (if needed).
diff --git a/mk/boot-time.mk b/mk/boot-time.mk
index a6d596c3..e235018b 100644
--- a/mk/boot-time.mk
+++ b/mk/boot-time.mk
@@ -21,6 +21,7 @@ BOOT_TIME_SLIDES = \
 		boottime-hardware-init \
 
 BOOT_TIME_LABS = setup \
+		boot-time-sources-download \
 		boot-time-board-setup \
 		boottime-init-scripts \
 		boottime-application \




More information about the training-materials-updates mailing list