[FE training-materials-updates] Separate chapter for Android sources
michael.opdenacker at free-electrons.com
michael.opdenacker at free-electrons.com
Mon Jun 4 16:56:53 CEST 2012
- Log -----------------------------------------------------------------
http://git.free-electrons.com/training-materials/commit/?id=4ac9608c9a6d63908463044e752aa54845fd22fe
commit 4ac9608c9a6d63908463044e752aa54845fd22fe
Author: Michael Opdenacker <michael.opdenacker at free-electrons.com>
Date: Mon Jun 4 16:57:17 2012 +0200
Separate chapter for Android sources
diff --git a/Makefile b/Makefile
index be8642c..14a9886 100644
--- a/Makefile
+++ b/Makefile
@@ -209,6 +209,7 @@ KERNEL_LABS = setup \
backup
ANDROID_LABS = setup \
+ android-source-code \
android-first-compilation \
android-boot \
android-new-board \
diff --git a/labs/android-first-compilation/android-first-compilation.tex b/labs/android-first-compilation/android-first-compilation.tex
index 1e8857f..c7e93ab 100644
--- a/labs/android-first-compilation/android-first-compilation.tex
+++ b/labs/android-first-compilation/android-first-compilation.tex
@@ -1,75 +1,20 @@
\subchapter{First compilation}{Get used to the build mechanism}
-After this lab, you will be able to:
+During this lab, you will:
\begin{itemize}
- \item Find your way in the Android source code
- \item Use the tools used by Android
- \item Compile a root filesystem
+ \item Configure which system to build Android for
+ \item Compile your first Android root filesystem
\end{itemize}
\section{Setup}
-Go to the \code{/home/<user>/felabs/android/aosp} directory.
-
-\section{Install needed packages}
-
-Install the needed packages to fetch and build Android:
-
-\begin{verbatim}
-sudo apt-get install git-core gnupg flex bison gperf build-essential \
- zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
- x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
- libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
- libxml2-utils xsltproc openjdk-6-jdk
-sudo apt-get clean
-\end{verbatim}
-
-If you have a slow connection to the Internet, installing these packages
-could take several tens of minutes. Your instructor will then take advantage
-of this waiting time to continue with the lectures.
-
-\section{Fetch the source code}
-
-Android consists of many separate Git repositories, each containing a piece
-of software needed for the whole stack. This organization adds a lot of
-flexibility, allowing to easily add or remove a particular piece from the source
-tree, but also introduces a lot of overhead to manage all these repos.\\
-
-To address this issue, Google created a tool called Repo. As Repo is just a
-python script, it has not made its way in the Ubuntu packages, and we need to
-download it from Google.\\
-
-\begin{verbatim}
-mkdir $HOME/bin
-export PATH=$HOME/bin:$PATH
-curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > $HOME/bin/repo
-chmod a+x $HOME/bin/repo
-\end{verbatim}
-
-We can now fetch the Android source code.\\
-
-\begin{verbatim}
-mkdir android
-cd android
-repo init -u https://android.googlesource.com/platform/manifest \
- -b android-2.3.7_r1
-repo sync
-\end{verbatim}
-
-\code{repo sync} will synchronize the files for all the source repositories listed
-in the manifest. If you have a slow connection to the Internet, this could even
-take hours to complete.
-
-If this takes too much time, your instructor may distribute a ready-made archive
-containing what \code{repo sync} would have downloaded.
-
-Once this is done, we are ready to begin!
+Stay in the \code{/home/<user>/felabs/android/aosp/android} directory.
\section{Compile a filesystem}
-We will compile an Android system for the emulator. First, be sure that the
-emulator is in your path. You can check by running the command \code{emulator}
-in a terminal.\\
+Now that \code{repo sync} is over, we will compile an Android system for the
+emulator. First, be sure that the emulator is in your path. You can check
+by running the \code{emulator} command in a terminal.\\
Now, run \code{source build/envsetup.sh}.
diff --git a/labs/android-source-code/android-source-code.tex b/labs/android-source-code/android-source-code.tex
new file mode 100644
index 0000000..45fa964
--- /dev/null
+++ b/labs/android-source-code/android-source-code.tex
@@ -0,0 +1,77 @@
+\subchapter{Android source code}{Download the source code for Android and all its components}
+
+During this labs, you will:
+\begin{itemize}
+ \item Install all the development packages needed to fetch and compile Android
+ \item Download the \code{repo} utility
+ \item Use \code{repo} to download the source code for Android
+ and for all its components
+\end{itemize}
+
+\section{Setup}
+
+Go to the \code{/home/<user>/felabs/android/aosp} directory.
+
+\section{Install needed packages}
+
+Install the packages needed to fetch Android's source code:
+
+\begin{verbatim}
+sudo apt-get install git-core curl
+\end{verbatim}
+
+\section{Fetch the source code}
+
+Android sources are made of many separate Git repositories, each containing a piece
+of software needed for the whole stack. This organization adds a lot of
+flexibility, allowing to easily add or remove a particular piece from the source
+tree, but also introduces a lot of overhead to manage all these repos.\\
+
+To address this issue, Google created a tool called Repo. As Repo is just a
+python script, it has not made its way in the Ubuntu packages, and we need to
+download it from Google.\\
+
+\begin{verbatim}
+mkdir $HOME/bin
+export PATH=$HOME/bin:$PATH
+curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > $HOME/bin/repo
+chmod a+x $HOME/bin/repo
+\end{verbatim}
+
+We can now fetch the Android source code:\\
+
+\begin{verbatim}
+mkdir android
+cd android
+repo init -u https://android.googlesource.com/platform/manifest \
+ -b android-2.3.7_r1
+repo sync
+\end{verbatim}
+
+\code{repo sync} will synchronize the files for all the source repositories listed
+in the manifest. If you have a slow connection to the Internet, this could even
+take a few hours to complete. Fortunately, your instructor will take advantage
+of this waiting time to continue with the lectures.
+
+If this really takes too much time, your instructor may distribute a ready-made archive
+containing what \code{repo sync} would have downloaded.
+
+To save time, do not wait for the \code{repo sync} command to complete. You can
+already jump to the next section.
+
+\section{Install packages needed at compile time}
+
+While \code{repo sync} runs, download the packages that you will need to
+compile Android and its components from source:
+
+\begin{verbatim}
+sudo apt-get install xsltproc gnupg flex bison gperf build-essential \
+ zip zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
+ x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
+ libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
+ libxml2-utils xsltproc openjdk-6-jdk
+sudo apt-get clean
+\end{verbatim}
+
+Again, if you have a slow connection to the Internet, installing these packages
+could take several tens of minutes. Anyway, we are getting back to the lectures.
-----------------------------------------------------------------------
Summary of changes:
Makefile | 1 +
.../android-first-compilation.tex | 69 ++----------------
labs/android-source-code/android-source-code.tex | 77 ++++++++++++++++++++
3 files changed, 85 insertions(+), 62 deletions(-)
create mode 100644 labs/android-source-code/android-source-code.tex
More information about the training-materials-updates
mailing list