[FE training-materials-updates] yocto: slides: rework the mirror slides

Antoine Ténart antoine.tenart at free-electrons.com
Wed Jun 8 15:50:42 CEST 2016


Repository : git://git.free-electrons.com/training-materials.git
On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=05c91834ba27952f1d221fe87d6b69240e8f0f7b

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

commit 05c91834ba27952f1d221fe87d6b69240e8f0f7b
Author: Antoine Tenart <antoine.tenart at free-electrons.com>
Date:   Wed Jun 8 14:54:38 2016 +0200

    yocto: slides: rework the mirror slides
    
    Signed-off-by: Antoine Tenart <antoine.tenart at free-electrons.com>


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

05c91834ba27952f1d221fe87d6b69240e8f0f7b
 slides/yocto-advanced/yocto-advanced.tex           | 82 +++++++++++++++-------
 slides/yocto-recipe-basics/yocto-recipe-basics.tex |  2 -
 2 files changed, 58 insertions(+), 26 deletions(-)

diff --git a/slides/yocto-advanced/yocto-advanced.tex b/slides/yocto-advanced/yocto-advanced.tex
index 4ab1201..ba26e65 100644
--- a/slides/yocto-advanced/yocto-advanced.tex
+++ b/slides/yocto-advanced/yocto-advanced.tex
@@ -313,35 +313,67 @@ $ ./scripts/sstate-cache-management.sh --remove-duplicated -d \
 
 \subsection{Network usage}
 
+\begin{frame}
+  \frametitle{Source fetching}
+  \begin{itemize}
+    \item BitBake will look for files to retrieve at the following
+      locations, in order:
+      \begin{enumerate}
+        \item \code{DL_DIR} (the local download directory).
+        \item The \code{PREMIRRORS} locations.
+        \item The upstream source, as defined in \code{SRC_URI}.
+        \item The \code{MIRRORS} locations.
+      \end{enumerate}
+    \item If all the mirrors fail, the build will fail.
+  \end{itemize}
+\end{frame}
+
 \begin{frame}[fragile]
-  \frametitle{Keeping package sources on a local network}
+  \frametitle{Mirror configuration in Poky}
+  \begin{block}{}
+    \begin{minted}[fontsize=\scriptsize]{sh}
+PREMIRRORS ??= "\
+bzr://.*/.*   http://downloads.yoctoproject.org/mirror/sources/ \n \
+cvs://.*/.*   http://downloads.yoctoproject.org/mirror/sources/ \n \
+git://.*/.*   http://downloads.yoctoproject.org/mirror/sources/ \n \
+hg://.*/.*    http://downloads.yoctoproject.org/mirror/sources/ \n \
+osc://.*/.*   http://downloads.yoctoproject.org/mirror/sources/ \n \
+p4://.*/.*    http://downloads.yoctoproject.org/mirror/sources/ \n \
+svk://.*/.*   http://downloads.yoctoproject.org/mirror/sources/ \n \
+svn://.*/.*   http://downloads.yoctoproject.org/mirror/sources/ \n"
+
+MIRRORS =+ "\
+ftp://.*/.*   http://downloads.yoctoproject.org/mirror/sources/ \n \
+http://.*/.*  http://downloads.yoctoproject.org/mirror/sources/ \n \
+https://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n"
+    \end{minted}
+  \end{block}
+\end{frame}
+
+\begin{frame}[fragile]
+  \frametitle{Configuring the mirrors}
   \begin{itemize}
-    \item When fetching source code, BitBake will first search in the
-      local download directory (\code{DL_DIR}).
-    \item It will then try to access mirrors:
-      \begin{itemize}
-        \item First it tries locations from the \code{PREMIRRORS} variable,
-          usually set by the distribution layer. Poky uses:
-          \begin{block}{}
-            \begin{minted}[fontsize=\small]{sh}
+    \item It's possible to prepend custom mirrors, using the
+      \code{PREMIRRORS} variable:
+  \end{itemize}
+  \begin{block}{}
+    \begin{minted}{sh}
 PREMIRRORS_prepend = "\
-     git://.*/.* http://www.yoctoproject.org/sources/ \n \
-     ftp://.*/.* http://www.yoctoproject.org/sources/ \n \
-     http://.*/.* http://www.yoctoproject.org/sources/ \n \
-     https://.*/.* http://www.yoctoproject.org/sources/ \n"
-            \end{minted}
-          \end{block}
-        \item Then it tries locations from the \code{MIRRORS} variable
-      \end{itemize}
-    \item Use the \code{own-mirrors} class to set your mirrors:
-          \begin{block}{}
-            \begin{minted}[fontsize=\small]{sh}
+ git://.*/.* http://www.yoctoproject.org/sources/   \n \
+ ftp://.*/.* http://www.yoctoproject.org/sources/   \n \
+ http://.*/.* http://www.yoctoproject.org/sources/  \n \
+ https://.*/.* http://www.yoctoproject.org/sources/ \n"
+    \end{minted}
+  \end{block}
+  \begin{itemize}
+    \item Another solution is to use the \code{own-mirror} class:
+  \end{itemize}
+  \begin{block}{}
+    \begin{minted}{sh}
 INHERIT += "own-mirrors"
 SOURCE_MIRROR_URL = "http://example.com/my-source-mirror"
-            \end{minted}
-          \end{block}
-    \item If all the mirrors fail, the build will fail.
-  \end{itemize}
+    \end{minted}
+  \end{block}
 \end{frame}
 
 \begin{frame}[fragile]
@@ -351,5 +383,7 @@ SOURCE_MIRROR_URL = "http://example.com/my-source-mirror"
       generate tarballs of the git repositories in \code{DL_DIR}
     \item You can also completely disable network access using
       \code{BB_NO_NETWORK = "1"}
+    \item Or restrict BitBake to only download files from the
+      \code{PREMIRRORS}, using \code{BB_FETCH_PREMIRRORONLY = "1"}
   \end{itemize}
 \end{frame}
diff --git a/slides/yocto-recipe-basics/yocto-recipe-basics.tex b/slides/yocto-recipe-basics/yocto-recipe-basics.tex
index f321ad2..896a2cd 100644
--- a/slides/yocto-recipe-basics/yocto-recipe-basics.tex
+++ b/slides/yocto-recipe-basics/yocto-recipe-basics.tex
@@ -117,8 +117,6 @@
     \item By default, sources are fetched in
       \code{$BUILDDIR/downloads}. Change it with the \code{DL_DIR}
       variable in \code{conf/local.conf}
-    \item Use the \code{PREMIRRORS} and \code{MIRRORS} variables if
-      you want to use local mirrors or fallback mirrors.
   \end{itemize}
 \end{frame}
 




More information about the training-materials-updates mailing list