[FE training-materials-updates] Fix lines wraping
maxime.ripard at free-electrons.com
maxime.ripard at free-electrons.com
Tue Jun 19 14:10:57 CEST 2012
- Log -----------------------------------------------------------------
http://git.free-electrons.com/training-materials/commit/?id=e41a4adfc780289427d2a30dc62cb4d9e0021f21
commit e41a4adfc780289427d2a30dc62cb4d9e0021f21
Author: Maxime Ripard <maxime.ripard at free-electrons.com>
Date: Tue Jun 19 14:09:02 2012 +0200
Fix lines wraping
Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
diff --git a/labs/android-boot/android-boot.tex b/labs/android-boot/android-boot.tex
index 47eaa18..2ad5905 100644
--- a/labs/android-boot/android-boot.tex
+++ b/labs/android-boot/android-boot.tex
@@ -14,26 +14,30 @@ Go to the \code{/home/<user>/felabs/android/kernel} directory.
\section{Compile a kernel for the Android emulator}
-The Android emulator uses QEMU to create a virtual ARM9 SoC called Goldfish.
+The Android emulator uses QEMU to create a virtual ARM9 SoC called
+Goldfish.
-In the standard Android source code we fetched, the kernel source was not included.
-So the first thing to do is download the Android kernel sources.
+In the standard Android source code we fetched, the kernel source was
+not included. So the first thing to do is download the Android kernel
+sources.
\code{git clone https://android.googlesource.com/kernel/goldfish.git kernel}
-Go to the \code{kernel} directory. That's where the kernel source repository
-was cloned.
+Go to the \code{kernel} directory. That's where the kernel source
+repository was cloned.
-Using \code{git branch -a}, find the name of the most recent stable kernel version that
-supports the Goldfish platform. At the time of this writing, Linux 3.0 still doesn't
-seem to work with the emulator, and you will have to choose the 2.6.29 kernel.
+Using \code{git branch -a}, find the name of the most recent stable
+kernel version that supports the Goldfish platform. At the time of
+this writing, Linux 3.0 still doesn't seem to work with the emulator,
+and you will have to choose the 2.6.29 kernel.
Switch to this branch as follows:
\code{git checkout <branch>}.
-Now that we have kernel sources, we now need a toolchain to compile the kernel. Fortunately,
-Android provides one. First, add the toolchain from the previous lab to your \code{PATH}.
+Now that we have kernel sources, we now need a toolchain to compile
+the kernel. Fortunately, Android provides one. First, add the
+toolchain from the previous lab to your \code{PATH}.
\code{PATH=$HOME/felabs/android/aosp/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH}
@@ -41,8 +45,8 @@ Now, configure the kernel for the target platform
\code{ARCH=arm make goldfish_defconfig}
-Then, configure the kernel using the tool of your choice to add a custom suffix
-to the kernel version and compile the kernel!
+Then, configure the kernel using the tool of your choice to add a
+custom suffix to the kernel version and compile the kernel!
\code{ARCH=arm CROSS_COMPILE=arm-eabi- make -j 4}
@@ -51,16 +55,16 @@ A few minutes later, you have a kernel image in \code{arch/arm/boot}.
\section{Boot your new kernel}
To run the emulator again, this time with your new kernel image, you
-have to restore the environment that you had after building Android from
-sources. This is needed every time you reboot your workstation, and every time
-you work with a new terminal.
+have to restore the environment that you had after building Android
+from sources. This is needed every time you reboot your workstation,
+and every time you work with a new terminal.
Go back to \code{$HOME/felabs/android/aosp/android/}.
All you need to do is source the environment and run the \code{lunch}
command to specify which product you're working with
\footnote{Remember that Android sources allow you to work with
-multiple products}:
+ multiple products}:
\begin{verbatim}
source build/envsetup.sh
@@ -70,24 +74,24 @@ lunch generic-eng
Now, test that you can still run the emulator as you did in the
previous lab.
-To run the emulator with your own kernel, you can use the \code{-kernel}
-option:
+To run the emulator with your own kernel, you can use the
+\code{-kernel} option:
\begin{verbatim}
-emulator -kernel ~/felabs/android/kernel/kernel/arch/arm/boot/zImage
+emulator -kernel $HOME/felabs/android/kernel/kernel/arch/arm/boot/zImage
\end{verbatim}
-Once again, check the kernel version in the Android settings. Make sure
-that the kernel was built today.
+Once again, check the kernel version in the Android settings. Make
+sure that the kernel was built today.
\section{Generate a patchset from the Android Kernel}
To compare the Android kernel sources with the official kernel ones,
-we need to fetch the latter sources too, allowing us to see which
+we need to fetch the latter sources too, allowing us to see which
commits differ. Git is great for that and offers everything we need.
-First, add the \code{linux-stable} repository from Greg Kroah-Hartmann to our
-repository:
+First, add the \code{linux-stable} repository from Greg Kroah-Hartmann
+to our repository:
\code{git remote add stable git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git}
@@ -95,23 +99,25 @@ Now, we need to fetch the changes from this remote repository:
\code{git fetch stable}
-A while later, you should have all the changes in your own repository, browsable
-offline!
+A while later, you should have all the changes in your own repository,
+browsable offline!
-Now, open the main \code{Makefile} with your favorite editor and get the kernel version
-that is in it. Now that we have it, we can generate the whole set of commits that
-differ from the linux kernel by doing:
+Now, open the main \code{Makefile} with your favorite editor and get
+the kernel version that is in it. Now that we have it, we can generate
+the whole set of commits that differ from the linux kernel by doing:
\code{git log v<kernel-version>..HEAD}
-Now, extract the corresponding set of patches\footnote{Git generates one patch per commit.}:
+Now, extract the corresponding set of patches\footnote{Git generates
+ one patch per commit.}:
\code{git format-patch v<kernel-version>..HEAD}
In this set of patches, find the one that adds the wakelocks.
-Congratuations! You now have all the patches to apply to a vanilla kernel version to obtain a
-full Android kernel.
+Congratuations! You now have all the patches to apply to a vanilla
+kernel version to obtain a full Android kernel.
-In this lab, we showed useful Git commands, but didn't go into details, as this is not a Git course. Don't
-hesitate to ask your instructor for more details about Git.
+In this lab, we showed useful Git commands, but didn't go into
+details, as this is not a Git course. Don't hesitate to ask your
+instructor for more details about Git.
diff --git a/labs/android-first-compilation/android-first-compilation.tex b/labs/android-first-compilation/android-first-compilation.tex
index 97682ca..87721a8 100644
--- a/labs/android-first-compilation/android-first-compilation.tex
+++ b/labs/android-first-compilation/android-first-compilation.tex
@@ -12,14 +12,14 @@ Stay in the \code{/home/<user>/felabs/android/aosp/android} directory.
\section{Build environment}
-Now that \code{repo sync} is over, we will compile an Android system for the
-emulator. This will include building the emulator itself.
+Now that \code{repo sync} is over, we will compile an Android system
+for the emulator. This will include building the emulator itself.
First, run \code{source build/envsetup.sh}.
-This file contains many useful shell functions and aliases, such as \code{croot} to
-go to the root directory of the Android source code or \code{lunch}, to select
-the build options.
+This file contains many useful shell functions and aliases, such as
+\code{croot} to go to the root directory of the Android source code or
+\code{lunch}, to select the build options.
Check your \code{PATH} environment variable:
@@ -27,30 +27,31 @@ Check your \code{PATH} environment variable:
echo $PATH
\end{verbatim}
-You will see that \code{build/envsetup.sh} hasn't modified your \code{PATH}.
-This will be done during the build job.
+You will see that \code{build/envsetup.sh} hasn't modified your
+\code{PATH}. This will be done during the build job.
-The target product for the emulator is {\it generic}, and we want to have an
-engineering build. To do this, run \code{lunch generic-eng}
+The target product for the emulator is {\it generic}, and we want to
+have an engineering build. To do this, run \code{lunch generic-eng}
\section{Compile the root filesystem}
-The build system will use the proper setup to build this target. Before running
-\code{make}, first check the number of CPU cores in your workstation, as seen by
-the operating system (hyperthreading could make your OS see 4 cores instead of 2,
-for example).
+The build system will use the proper setup to build this
+target. Before running \code{make}, first check the number of CPU
+cores in your workstation, as seen by the operating system
+(hyperthreading could make your OS see 4 cores instead of 2, for
+example).
\begin{verbatim}
cat /proc/cpuinfo
\end{verbatim}
-You can use \code{make -j} (\code{j} stands for {\it jobs} to instruct \code{make}
-to run multiple compile jobs in parallel, taking advantage of the multiple
-CPU cores, and making sure that I/Os
-and CPU cores are always at 100\%. This will significantly reduce build time.
+You can use \code{make -j} (\code{j} stands for {\it jobs} to instruct
+\code{make} to run multiple compile jobs in parallel, taking advantage
+of the multiple CPU cores, and making sure that I/Os and CPU cores are
+always at 100\%. This will significantly reduce build time.
-For example, if Linux sees 4 cores, you will get good performance by specifying
-the double number of parallel jobs:
+For example, if Linux sees 4 cores, you will get good performance by
+specifying the double number of parallel jobs:
\begin{verbatim}
make -j 8
@@ -58,9 +59,10 @@ make -j 8
Go grab (several cups of) coffee!
-\textbf{Known issue}: in rare circumstances, some builds can fail when \code{make}
-is run with multiple jobs in parallel. If this happens, you can run \code{make}
-with no option after the failure, and this is likely to make the issue disappear.
+\textbf{Known issue}: in rare circumstances, some builds can fail when
+\code{make} is run with multiple jobs in parallel. If this happens,
+you can run \code{make} with no option after the failure, and this is
+likely to make the issue disappear.
\section{Test your Android build}
@@ -68,19 +70,22 @@ Now, look at the \code{PATH} environment variable again.
You can see that it contains:
\begin{itemize}
- \item \code{$HOME/felabs/android/aosp/android/out/host/linux-x86/bin/}.
- That's where new utilities have just been compiled.
- \item Prebuilt executables, in particular the ARM cross-compiling toolchain,
- which was already present in the repositories fetched by \code{repo}.
+\item
+ \code{$HOME/felabs/android/aosp/android/out/host/linux-x86/bin/}.
+ That's where new utilities have just been compiled.
+\item Prebuilt executables, in particular the ARM cross-compiling
+ toolchain, which was already present in the repositories fetched by
+ \code{repo}.
\end{itemize}
Look at the contents of the \code{out/target/product/generic} folder.
That's where the system images have been built.
-Run the \code{emulator} command. It will run the emulator with these generated images.
-Wait a few minutes for the emulator to load the system, and then
-check the build number in the \code{Settings} application in Android.
+Run the \code{emulator} command. It will run the emulator with these
+generated images. Wait a few minutes for the emulator to load the
+system, and then check the build number in the \code{Settings}
+application in Android.
-\textbf{Note}: the \code{PATH} settings automatically added by the build
-process will be lost if you close your terminal. We will see how to restore
-this environment in the next lab.
+\textbf{Note}: the \code{PATH} settings automatically added by the
+build process will be lost if you close your terminal. We will see how
+to restore this environment in the next lab.
diff --git a/labs/android-new-board/android-new-board.tex b/labs/android-new-board/android-new-board.tex
index 0958067..69a1b6a 100644
--- a/labs/android-new-board/android-new-board.tex
+++ b/labs/android-new-board/android-new-board.tex
@@ -17,24 +17,26 @@ Install the \code{bzr}, \code{python-argparse} and
\section{Download the source code}
-Linaro has been working for some time now on a optimized Android distribution,
-available on at least one chip of most of the major ARM vendors. At each release,
-Linaro also maintains an Android flavored Linux kernel corresponding to the latest
-upstream Linux release.
-
-One of the platforms supported by the Linaro's Android is the BeagleBoard, which
-is very similar to the DevKit8000 we use. In particular, both boards have the
-same OMAP3530 CPU. Moreover, in the last kernel versions,
-the kernel needed for both of these boards have been unified, so we can boot the
-exact same kernel on both boards. For these reasons, we will use this
-distribution as a starting point for the rest of the labs.
-
-First, we need to download the source code. We will use the 11.11 release, which
-is based on Android 2.3 Gingerbread and Linux 3.1.1
-\footnote{At the time of this writing, Linaro doesn't support Android 4.0 Ice Cream
-Sandwich on the Beagle board, and the port from \href{http://code.google.com/p/rowboat}
-{Rowboat project} doesn't seem to be fully stable either. We decided to stick
-with the most stable version for our hardware.}.
+Linaro has been working for some time now on a optimized Android
+distribution, available on at least one chip of most of the major ARM
+vendors. At each release, Linaro also maintains an Android flavored
+Linux kernel corresponding to the latest upstream Linux release.
+
+One of the platforms supported by the Linaro's Android is the
+BeagleBoard, which is very similar to the DevKit8000 we use. In
+particular, both boards have the same OMAP3530 CPU. Moreover, in the
+last kernel versions, the kernel needed for both of these boards have
+been unified, so we can boot the exact same kernel on both boards. For
+these reasons, we will use this distribution as a starting point for
+the rest of the labs.
+
+First, we need to download the source code. We will use the 11.11
+release, which is based on Android 2.3 Gingerbread and Linux 3.1.1
+\footnote{At the time of this writing, Linaro doesn't support Android
+ 4.0 Ice Cream Sandwich on the Beagle board, and the port from
+ \href{http://code.google.com/p/rowboat} {Rowboat project} doesn't
+ seem to be fully stable either. We decided to stick with the most
+ stable version for our hardware.}.
\begin{verbatim}
mkdir src
@@ -44,24 +46,25 @@ repo init -u git://android.git.linaro.org/platform/manifest.git \
\end{verbatim}
Take a look at the \code{.repo/manifest.xml} file and compare it with
-the one in \code{~/felabs/android/aosp/android/}. You can see that Linaro
-took full advantage of the capabilities of the manifest file, using multiple
-git servers instead of a unique one, and replacing some of the components
-(like Dalvik and Bionic, for example) by its own optimized versions.
+the one in \code{$HOME/felabs/android/aosp/android/}. You can see that
+Linaro took full advantage of the capabilities of the manifest file,
+using multiple git servers instead of a unique one, and replacing some
+of the components (like Dalvik and Bionic, for example) by its own
+optimized versions.
Now, let's run the big download job:
\begin{verbatim}
repo sync -j4
\end{verbatim}
-Once again, even with a fast Internet connection, the \code{repo sync} command can
-take more than one hour. Your instructor will keep you busy with other things
-during these downloads.
+Once again, even with a fast Internet connection, the \code{repo sync}
+command can take more than one hour. Your instructor will keep you
+busy with other things during these downloads.
-In the mean time, you should also download and extract the associated Linaro toolchain:
-\footnote{The original URL is
-\url{http://android-build.linaro.org/builds/~linaro-android/toolchain-4.6-2011.11/4/android-toolchain-eabi-linaro-4.6-2011.11-4-2011-11-15_12-22-49-linux-x86.tar.bz2}. We wanted to give you something much shorter
-to type.}
+In the mean time, you should also download and extract the associated
+Linaro toolchain: \footnote{The original URL is
+ \url{http://android-build.linaro.org/builds/~linaro-android/toolchain-4.6-2011.11/4/android-toolchain-eabi-linaro-4.6-2011.11-4-2011-11-15_12-22-49-linux-x86.tar.bz2}. We
+ wanted to give you something much shorter to type.}
\begin{verbatim}
cd ..
wget http://goo.gl/Wn4dM
@@ -72,28 +75,33 @@ tar jxf Wn4dM
Get back to the \code{src} directory.
-As we said earlier, the DevKit8000 is very similar to the BeagleBoard, so we
-will first compile a build for the BeagleBoard. The command to run is:
+As we said earlier, the DevKit8000 is very similar to the BeagleBoard,
+so we will first compile a build for the BeagleBoard. The command to
+run is:
\code{make TARGET_PRODUCT=beagleboard TARGET_TOOLS_PREFIX=~/felabs/android/linaro/android-toolchain-eabi/bin/arm-eabi- boottarball systemtarball userdatatarball -j8}
-Once again, you can expect this build job to take at least one hour to run,
-even on a recent and rather fast laptop.
+Once again, you can expect this build job to take at least one hour to
+run, even on a recent and rather fast laptop.
-This job will build three tarballs in \code{out/target/product/beagleboard}:
-\code{boot.tar.bz2}, \code{system.tar.bz2}, \code{userdata.tar.bz2}, plus the images of Xloader,
-U-Boot, Linux kernel and its initramfs (which are also contained in
-\code{boot.tar.bz2}).
+This job will build three tarballs in
+\code{out/target/product/beagleboard}: \code{boot.tar.bz2},
+\code{system.tar.bz2}, \code{userdata.tar.bz2}, plus the images of
+Xloader, U-Boot, Linux kernel and its initramfs (which are also
+contained in \code{boot.tar.bz2}).
-We then need to put these images on an SD card so that we can boot on this system.
+We then need to put these images on an SD card so that we can boot on
+this system.
-First, take the SD card provided by your instructor, and insert it into an SD card reader slot
-in your workstation, or into a USB card reader provided by your instructor too. Then,
-using the \code{dmesg} command, find which device your workstation uses for your SD card.
-Let's assume that this device is \code{/dev/sdc}.
+First, take the SD card provided by your instructor, and insert it
+into an SD card reader slot in your workstation, or into a USB card
+reader provided by your instructor too. Then, using the \code{dmesg}
+command, find which device your workstation uses for your SD card.
+Let's assume that this device is \code{/dev/sdc}.
-Now we can use a \code{linaro-android-media-create} script that Linaro developed,
-which takes the three tarballs and aggregates them to produce a ready-to-boot SD card.
+Now we can use a \code{linaro-android-media-create} script that Linaro
+developed, which takes the three tarballs and aggregates them to
+produce a ready-to-boot SD card.
You can install this script with the following commands:
@@ -110,25 +118,25 @@ into the corresponding slot on the DevKit8000 board.
\section{Setting up serial communication with the board}
-To see the board boot, we need to read the first boot messages
-issued on the board's serial port.
+To see the board boot, we need to read the first boot messages issued
+on the board's serial port.
Your instructor will provide you with a special serial cable
-\footnote{This should be the same cable as for the Beagle and IGEPv2 boards}
-for the DevKit8000 board, together with a USB-to-serial adaptor for the connection
-with your laptop.
+\footnote{This should be the same cable as for the Beagle and IGEPv2
+ boards} for the DevKit8000 board, together with a USB-to-serial
+adaptor for the connection with your laptop.
-When you plug in this adaptor, a serial port should appear on your workstation:
-\code{/dev/ttyUSB0}.
+When you plug in this adaptor, a serial port should appear on your
+workstation: \code{/dev/ttyUSB0}.
-You can also see this device appear by looking at the output of the \code{dmesg}
-command.
+You can also see this device appear by looking at the output of the
+\code{dmesg} command.
To communicate with the board through the serial port, install a
serial communication program, such as \code{picocom}:
-\footnote{\code{picocom} is one of the simplest utilities to access
-a serial console. \code{minicom} looks more featureful, but is also
-more complex to configure.}
+\footnote{\code{picocom} is one of the simplest utilities to access a
+ serial console. \code{minicom} looks more featureful, but is also
+ more complex to configure.}
\begin{verbatim}
sudo apt-get install picocom
@@ -141,93 +149,99 @@ you wish to exit picocom, press \code{[Ctrl][a]} followed by
\section{Booting the board}
-Once you inserted the SD card, you can boot the board by
-holding the \code{boot} key while switching the board on. On the
-serial port, you should see Android going through its boot process, until
-you finally have a shell on the serial link.
+Once you inserted the SD card, you can boot the board by holding the
+\code{boot} key while switching the board on. On the serial port, you
+should see Android going through its boot process, until you finally
+have a shell on the serial link.
-However, as you may have seen, the system boots, but you have no display at
-all. We are going to fix this.
+However, as you may have seen, the system boots, but you have no
+display at all. We are going to fix this.
\section{Fix the blank screen}
-The first problem we see is that the display remains blank the whole time. This
-is because of the generated U-Boot being targeted for the BeagleBoard and not
-for the DevKit8000. In the BeagleBoard product definition, find where the U-boot
-config file to use is set and change this configuration to use the default
-configuration for the DevKit8000 (\code{devkit8000_config}).
+The first problem we see is that the display remains blank the whole
+time. This is because of the generated U-Boot being targeted for the
+BeagleBoard and not for the DevKit8000. In the BeagleBoard product
+definition, find where the U-boot config file to use is set and change
+this configuration to use the default configuration for the DevKit8000
+(\code{devkit8000_config}).
-Compile and test your changes. You should now see the display working, while it
-has a major glitch: it prints only a portion of the screen.
+Compile and test your changes. You should now see the display working,
+while it has a major glitch: it prints only a portion of the screen.
You can avoid doing a full rebuild by removing the
\code{out/target/product/beagleboard/obj/u-boot} directory.
\section{Fix the resolution}
-The actual resolution is set to 640x480 on the screen, while its resolution is
-only 480x272. This kind of adjustment is mostly done through the kernel
-command line. On the SD card's \code{boot} partition, you will find a file named
-\code{boot.txt}, which is a U-Boot script setting all the parameters needed
-to boot the board properly, including the kernel command line. Change the
-\code{omapdss.def_disp} and \code{omapfb.mode} properties so that it uses the LCD instead of
-the DVI output and the correct resolution.
+The actual resolution is set to 640x480 on the screen, while its
+resolution is only 480x272. This kind of adjustment is mostly done
+through the kernel command line. On the SD card's \code{boot}
+partition, you will find a file named \code{boot.txt}, which is a
+U-Boot script setting all the parameters needed to boot the board
+properly, including the kernel command line. Change the
+\code{omapdss.def_disp} and \code{omapfb.mode} properties so that it
+uses the LCD instead of the DVI output and the correct resolution.
You can find some documentation for these options in the
-\code{kernel/Documentation/arm/OMAP/DSS} file, in the \code{Kernel boot arguments} section.
+\code{kernel/Documentation/arm/OMAP/DSS} file, in the
+\code{Kernel boot arguments} section.
-You will then have to generate from this \code{boot.txt} file a \code{boot.scr} file
-using the following command:
+You will then have to generate from this \code{boot.txt} file a
+\code{boot.scr} file using the following command:
\code{mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n 'Execute uImage.bin' -d boot.txt boot.scr}
\footnote{This command puts the \code{boot.txt} file contents into a special container,
allowing U-boot to know that the \code{boot.scr} file is a script, and telling it how to handle
this file. All the files handled by U-boot should be put in such a container.}
-Once this is done, test your changes by booting the board. You should see the
-display working correctly now.
+Once this is done, test your changes by booting the board. You should
+see the display working correctly now.
\section{Fix the touchscreen}
-If you test the touchscreen with the previous Android build you made, you should
-see that it is almost unusable, while the system receives some inputs. This mean
-that the kernel has the driver for the touchscreen controller, but it returns
-bogus values. If you pay attention however, you will find that the touchscreen
-doesn't have the same orientation as the display.
+If you test the touchscreen with the previous Android build you made,
+you should see that it is almost unusable, while the system receives
+some inputs. This mean that the kernel has the driver for the
+touchscreen controller, but it returns bogus values. If you pay
+attention however, you will find that the touchscreen doesn't have the
+same orientation as the display.
-Get back to the OMAP DSS documentation to find an option that might address
-this problem.
+Get back to the OMAP DSS documentation to find an option that might
+address this problem.
\section{Bring it all together}
-These tweaks are not persistent because the \code{boot.scr} file is generated at run
-time by the \code{linaro-android-media-create} script. To automate this, modify this
-script to add a ``devkit8000'' target device with the right kernel command line.
+These tweaks are not persistent because the \code{boot.scr} file is
+generated at run time by the \code{linaro-android-media-create}
+script. To automate this, modify this script to add a ``devkit8000''
+target device with the right kernel command line.
To do so, you will need to edit the files
\code{linaro_image_tools/media_create/boards.py} and
-\code{linaro_image_tools/media_create/android_boards.py} to add \code{class} entries in each
-file to specify the right boot command for your board. It should not take more than 10 lines to
-add.
+\code{linaro_image_tools/media_create/android_boards.py} to add
+\code{class} entries in each file to specify the right boot command
+for your board. It should not take more than 10 lines to add.
-Once you have a solution that works, you can ask your instructor to give
-you a URL where Free Electrons' solution is available, and compare it with yours.
+Once you have a solution that works, you can ask your instructor to
+give you a URL where Free Electrons' solution is available, and
+compare it with yours.
-You can also add \code{no_console_suspend} to the bootargs as Android by
-default suspends the shell on the serial line after a minute or so, making it pretty
-hard to use it properly.
+You can also add \code{no_console_suspend} to the bootargs as Android
+by default suspends the shell on the serial line after a minute or so,
+making it pretty hard to use it properly.
\section{Add the Buttons}
If you happen to launch an application, you will find that you cannot
-get back to the home screen, as no button is mapped to the \code{back} and \code{home}
-keys.
+get back to the home screen, as no button is mapped to the \code{back}
+and \code{home} keys.
-Button mapping is done in two steps. First, in the kernel, the
-board should define the available buttons. In this case, we will use
-the small black buttons right next to the screen on the
-DevKit8000. These buttons are handled by the \code{gpio-keys} driver,
-and defined in the devkit8000 board file in the kernel.
+Button mapping is done in two steps. First, in the kernel, the board
+should define the available buttons. In this case, we will use the
+small black buttons right next to the screen on the DevKit8000. These
+buttons are handled by the \code{gpio-keys} driver, and defined in the
+devkit8000 board file in the kernel.
If you look into that file, you will see that only one button is
defined, the one corresponding to the button labeled \code{user key}
@@ -235,20 +249,20 @@ on the board.
We will map this button to the \code{back} key in Android. In the
\code{gpio_keys_button} structure, there is a \code{code} field. The
-value of this field defines the keycode sent to the input
-subsystem when you press that button, and will be later dispatched to
-the userspace. Replace the keycode used by \code{KEY_EXIT} and look up
-its value in the \code{include/linux/input.h} file.
+value of this field defines the keycode sent to the input subsystem
+when you press that button, and will be later dispatched to the
+userspace. Replace the keycode used by \code{KEY_EXIT} and look up its
+value in the \code{include/linux/input.h} file.
-The Android input system loads keymaps and key layouts for each loaded input
-driver. To load these properly, it uses the same name as the
+The Android input system loads keymaps and key layouts for each loaded
+input driver. To load these properly, it uses the same name as the
input driver, with an extension. In our case, the input driver being
\code{gpio-keys}, we will need to modify the \code{gpio-keys.kl} file.
This file consists of a list of entries, corresponding to what actions
-every keycode should trigger in the system. Add a new entry to this file
-for the back button, which should be like:
-\code{key <keycode> BACK}
+every keycode should trigger in the system. Add a new entry to this
+file for the back button, which should be like:
+\code{key <keycode> BACK}
Once you're done, rebuild the system, boot it, and you should be able
to use the \code{back} key now!
http://git.free-electrons.com/training-materials/commit/?id=cd25107e08381e2987a4ee027135b36be543d703
commit cd25107e08381e2987a4ee027135b36be543d703
Author: Maxime Ripard <maxime.ripard at free-electrons.com>
Date: Tue Jun 19 14:08:46 2012 +0200
Fix misplaced arrow
Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
diff --git a/slides/android-introduction-history/history.dia b/slides/android-introduction-history/history.dia
index 2bc9d4f..6342e9c 100644
--- a/slides/android-introduction-history/history.dia
+++ b/slides/android-introduction-history/history.dia
@@ -862,41 +862,6 @@
</dia:object>
<dia:object type="Standard - ZigZagLine" version="1" id="O25">
<dia:attribute name="obj_pos">
- <dia:point val="25,22"/>
- </dia:attribute>
- <dia:attribute name="obj_bb">
- <dia:rectangle val="24.3882,22;25.1118,28.3618"/>
- </dia:attribute>
- <dia:attribute name="orth_points">
- <dia:point val="25,22"/>
- <dia:point val="25,22"/>
- <dia:point val="25,28"/>
- <dia:point val="25,28"/>
- </dia:attribute>
- <dia:attribute name="orth_orient">
- <dia:enum val="0"/>
- <dia:enum val="1"/>
- <dia:enum val="0"/>
- </dia:attribute>
- <dia:attribute name="autorouting">
- <dia:boolean val="true"/>
- </dia:attribute>
- <dia:attribute name="end_arrow">
- <dia:enum val="22"/>
- </dia:attribute>
- <dia:attribute name="end_arrow_length">
- <dia:real val="0.5"/>
- </dia:attribute>
- <dia:attribute name="end_arrow_width">
- <dia:real val="0.5"/>
- </dia:attribute>
- <dia:connections>
- <dia:connection handle="0" to="O12" connection="6"/>
- <dia:connection handle="1" to="O23" connection="1"/>
- </dia:connections>
- </dia:object>
- <dia:object type="Standard - ZigZagLine" version="1" id="O26">
- <dia:attribute name="obj_pos">
<dia:point val="19,26"/>
</dia:attribute>
<dia:attribute name="obj_bb">
@@ -930,7 +895,7 @@
<dia:connection handle="1" to="O23" connection="1"/>
</dia:connections>
</dia:object>
- <dia:object type="Standard - Box" version="0" id="O27">
+ <dia:object type="Standard - Box" version="0" id="O26">
<dia:attribute name="obj_pos">
<dia:point val="35,2"/>
</dia:attribute>
@@ -959,7 +924,7 @@
<dia:boolean val="true"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Text" version="1" id="O28">
+ <dia:object type="Standard - Text" version="1" id="O27">
<dia:attribute name="obj_pos">
<dia:point val="37,2.5"/>
</dia:attribute>
@@ -992,10 +957,10 @@
<dia:enum val="2"/>
</dia:attribute>
<dia:connections>
- <dia:connection handle="0" to="O27" connection="4"/>
+ <dia:connection handle="0" to="O26" connection="4"/>
</dia:connections>
</dia:object>
- <dia:object type="Standard - Box" version="0" id="O29">
+ <dia:object type="Standard - Box" version="0" id="O28">
<dia:attribute name="obj_pos">
<dia:point val="35,4"/>
</dia:attribute>
@@ -1024,7 +989,7 @@
<dia:boolean val="true"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Text" version="1" id="O30">
+ <dia:object type="Standard - Text" version="1" id="O29">
<dia:attribute name="obj_pos">
<dia:point val="37,4.5"/>
</dia:attribute>
@@ -1057,10 +1022,10 @@
<dia:enum val="2"/>
</dia:attribute>
<dia:connections>
- <dia:connection handle="0" to="O29" connection="4"/>
+ <dia:connection handle="0" to="O28" connection="4"/>
</dia:connections>
</dia:object>
- <dia:object type="Standard - Box" version="0" id="O31">
+ <dia:object type="Standard - Box" version="0" id="O30">
<dia:attribute name="obj_pos">
<dia:point val="35,6"/>
</dia:attribute>
@@ -1089,7 +1054,7 @@
<dia:boolean val="true"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Text" version="1" id="O32">
+ <dia:object type="Standard - Text" version="1" id="O31">
<dia:attribute name="obj_pos">
<dia:point val="37,6.5"/>
</dia:attribute>
@@ -1122,7 +1087,35 @@
<dia:enum val="2"/>
</dia:attribute>
<dia:connections>
- <dia:connection handle="0" to="O31" connection="4"/>
+ <dia:connection handle="0" to="O30" connection="4"/>
+ </dia:connections>
+ </dia:object>
+ <dia:object type="Standard - Line" version="0" id="O32">
+ <dia:attribute name="obj_pos">
+ <dia:point val="25,22"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="24.6382,21.95;25.3618,28.1118"/>
+ </dia:attribute>
+ <dia:attribute name="conn_endpoints">
+ <dia:point val="25,22"/>
+ <dia:point val="25,28"/>
+ </dia:attribute>
+ <dia:attribute name="numcp">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow">
+ <dia:enum val="22"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow_length">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow_width">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:connections>
+ <dia:connection handle="0" to="O12" connection="6"/>
+ <dia:connection handle="1" to="O23" connection="1"/>
</dia:connections>
</dia:object>
</dia:layer>
http://git.free-electrons.com/training-materials/commit/?id=8642b095bcbf5e580f118a3e26544b21aa910978
commit 8642b095bcbf5e580f118a3e26544b21aa910978
Author: Maxime Ripard <maxime.ripard at free-electrons.com>
Date: Tue Jun 19 14:06:49 2012 +0200
Fix missing backslash
Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
diff --git a/labs/android-new-board/android-new-board.tex b/labs/android-new-board/android-new-board.tex
index cf3dcd0..0958067 100644
--- a/labs/android-new-board/android-new-board.tex
+++ b/labs/android-new-board/android-new-board.tex
@@ -12,7 +12,8 @@ After this lab, you will be able to:
Go to the \code{/home/<user>/felabs/android/linaro} directory.
-Install the \code{bzr}, \code{python-argparse} and code{python-parted} packages.
+Install the \code{bzr}, \code{python-argparse} and
+\code{python-parted} packages.
\section{Download the source code}
http://git.free-electrons.com/training-materials/commit/?id=5576cf0bfc7ae326d88c60e855e72dcd8ef481ab
commit 5576cf0bfc7ae326d88c60e855e72dcd8ef481ab
Author: Maxime Ripard <maxime.ripard at free-electrons.com>
Date: Tue Jun 19 14:02:10 2012 +0200
Add lab slides
Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
diff --git a/Makefile b/Makefile
index 7d7280a..9601ee6 100644
--- a/Makefile
+++ b/Makefile
@@ -115,12 +115,14 @@ ANDROID_SLIDES = \
android-source-organization \
android-source-compilation \
android-source-contribute \
+ android-source-lab \
sysdev-linux-intro-title \
sysdev-linux-intro-features \
sysdev-linux-intro-versioning \
sysdev-linux-intro-configuration \
sysdev-linux-intro-compilation \
sysdev-linux-intro-cross-compilation \
+ android-kernel-lab-compilation \
android-kernel-changes-title \
android-kernel-changes-wakelocks \
android-kernel-changes-binder \
@@ -133,10 +135,12 @@ ANDROID_SLIDES = \
android-bootloaders-title \
sysdev-bootloaders-sequence \
android-bootloaders-fastboot \
+ android-new-board-lab \
android-adb-title \
android-adb-introduction \
android-adb-use \
android-adb-examples \
+ android-adb-lab \
android-fs-title \
sysdev-root-filesystem-principles \
android-fs-contents \
@@ -149,6 +153,7 @@ ANDROID_SLIDES = \
android-build-system-configuration \
android-build-system-modules \
android-build-system-product \
+ android-build-system-lab \
android-native-layer-title \
sysdev-toolchains-definition \
android-native-layer-bionic \
@@ -160,11 +165,14 @@ ANDROID_SLIDES = \
android-native-layer-dalvik \
android-native-layer-hal \
android-native-layer-jni \
+ android-native-layer-lab-library \
+ android-native-layer-lab-binary \
android-framework-title \
android-framework-native-services \
android-framework-ipc \
android-framework-java-services \
android-framework-extend \
+ android-framework-lab \
android-application-title \
android-application-basics \
android-application-activities \
@@ -175,6 +183,7 @@ ANDROID_SLIDES = \
android-application-resources \
android-application-storage \
android-application-apk \
+ android-application-lab \
android-resources \
last-slides
diff --git a/slides/android-adb-lab/android-adb-lab.tex b/slides/android-adb-lab/android-adb-lab.tex
new file mode 100644
index 0000000..699505c
--- /dev/null
+++ b/slides/android-adb-lab/android-adb-lab.tex
@@ -0,0 +1,10 @@
+\setuplabframe
+{Use ADB}
+{
+ \begin{itemize}
+ \item Debug your system and applications
+ \item Get a shell on a device
+ \item Exchange files with a device
+ \item Install new applications
+ \end{itemize}
+}
\ No newline at end of file
diff --git a/slides/android-application-lab/android-application-lab.tex b/slides/android-application-lab/android-application-lab.tex
new file mode 100644
index 0000000..5ec3768
--- /dev/null
+++ b/slides/android-application-lab/android-application-lab.tex
@@ -0,0 +1,8 @@
+\setuplabframe
+{Write an Application with the SDK}
+{
+ \begin{itemize}
+ \item Write an Android application
+ \item Integrate an application in the Android build system
+ \end{itemize}
+}
\ No newline at end of file
diff --git a/slides/android-build-system-lab/android-build-system-lab.tex b/slides/android-build-system-lab/android-build-system-lab.tex
new file mode 100644
index 0000000..a6384a3
--- /dev/null
+++ b/slides/android-build-system-lab/android-build-system-lab.tex
@@ -0,0 +1,10 @@
+\setuplabframe
+{System Customization}
+{
+ \begin{itemize}
+ \item Use the product configuration system
+ \item Change the default wallpaper
+ \item Add extra properties to the system
+ \item Use the product overlays
+ \end{itemize}
+}
\ No newline at end of file
diff --git a/slides/android-framework-lab/android-framework-lab.tex b/slides/android-framework-lab/android-framework-lab.tex
new file mode 100644
index 0000000..01e114d
--- /dev/null
+++ b/slides/android-framework-lab/android-framework-lab.tex
@@ -0,0 +1,10 @@
+\setuplabframe
+{Develop a JNI Library}
+{
+ \begin{itemize}
+ \item Develop bindings from Java to C
+ \item Integrate these bindings into the build system
+ \item Modify the Android framework
+ \item Use JNI bindings
+ \end{itemize}
+}
diff --git a/slides/android-kernel-lab-compilation/android-kernel-lab-compilation.tex b/slides/android-kernel-lab-compilation/android-kernel-lab-compilation.tex
new file mode 100644
index 0000000..f2a55be
--- /dev/null
+++ b/slides/android-kernel-lab-compilation/android-kernel-lab-compilation.tex
@@ -0,0 +1,9 @@
+\setuplabframe
+{Compile and Boot an Android Kernel}
+{
+ \begin{itemize}
+ \item Extract the kernel patchset from Android Kernel
+ \item Apply it on a vanilla kernel
+ \item Compile and boot a kernel for the emulator
+ \end{itemize}
+}
\ No newline at end of file
diff --git a/slides/android-native-layer-lab-binary/android-native-layer-lab-binary.tex b/slides/android-native-layer-lab-binary/android-native-layer-lab-binary.tex
new file mode 100644
index 0000000..82a4bfe
--- /dev/null
+++ b/slides/android-native-layer-lab-binary/android-native-layer-lab-binary.tex
@@ -0,0 +1,8 @@
+\setuplabframe
+{Add a Native Application to the Build}
+{
+ \begin{itemize}
+ \item Add an external binary to a system
+ \item Express dependencies on other components of the build system
+ \end{itemize}
+}
diff --git a/slides/android-native-layer-lab-library/android-native-layer-lab-library.tex b/slides/android-native-layer-lab-library/android-native-layer-lab-library.tex
new file mode 100644
index 0000000..e2fef3c
--- /dev/null
+++ b/slides/android-native-layer-lab-library/android-native-layer-lab-library.tex
@@ -0,0 +1,9 @@
+\setuplabframe
+{Building a Library}
+{
+ \begin{itemize}
+ \item Add an external library to the Android build system
+ \item Compile it statically and dynamically
+ \item Add a component to a build
+ \end{itemize}
+}
diff --git a/slides/android-new-board-lab/android-new-board-lab.tex b/slides/android-new-board-lab/android-new-board-lab.tex
new file mode 100644
index 0000000..fee288a
--- /dev/null
+++ b/slides/android-new-board-lab/android-new-board-lab.tex
@@ -0,0 +1,9 @@
+\setuplabframe
+{Supporting a New Board}
+{
+ \begin{itemize}
+ \item Boot Android on a real hardware
+ \item Troubleshoot simple problems on Android
+ \item Generate a working build
+ \end{itemize}
+}
\ No newline at end of file
diff --git a/slides/android-source-lab/android-source-lab.tex b/slides/android-source-lab/android-source-lab.tex
new file mode 100644
index 0000000..1d8bb3a
--- /dev/null
+++ b/slides/android-source-lab/android-source-lab.tex
@@ -0,0 +1,8 @@
+\setuplabframe
+{First Compilation}
+{
+ \begin{itemize}
+ \item Configure which system to build Android for
+ \item Compile your first Android root filesystem
+ \end{itemize}
+}
\ No newline at end of file
http://git.free-electrons.com/training-materials/commit/?id=43ac3fc7f271b534a52a2ef3570c0bb4203cf453
commit 43ac3fc7f271b534a52a2ef3570c0bb4203cf453
Author: Maxime Ripard <maxime.ripard at free-electrons.com>
Date: Mon Jun 11 10:14:06 2012 +0200
Add repo sync -j infos
Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
diff --git a/labs/android-source-code/android-source-code.tex b/labs/android-source-code/android-source-code.tex
index 2ef6726..e53ff93 100644
--- a/labs/android-source-code/android-source-code.tex
+++ b/labs/android-source-code/android-source-code.tex
@@ -50,21 +50,30 @@ repo init -u https://android.googlesource.com/platform/manifest \
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.
+\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.
+
+However, a lot of time is used to process the files downloaded by git,
+wasting a lot of bandwidth usage time. You can speed up the download
+using the \code{-jX} option for \code{repo sync}, \code{X} being the
+number of parallel downloads. We will use \code{2} because we all
+share the same internet connection, but you can definitely increase
+this number up to \code{8} at home.
+
+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:
+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 \
@@ -75,5 +84,6 @@ sudo apt-get install xsltproc gnupg flex bison gperf build-essential \
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.
+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.
http://git.free-electrons.com/training-materials/commit/?id=74f59faee1e3308c40fb51576823a172573d4ceb
commit 74f59faee1e3308c40fb51576823a172573d4ceb
Author: Maxime Ripard <maxime.ripard at free-electrons.com>
Date: Mon Jun 11 10:07:19 2012 +0200
Wrapping fixes
Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
diff --git a/labs/android-source-code/android-source-code.tex b/labs/android-source-code/android-source-code.tex
index 3f04e2e..2ef6726 100644
--- a/labs/android-source-code/android-source-code.tex
+++ b/labs/android-source-code/android-source-code.tex
@@ -22,19 +22,21 @@ sudo apt-get install git-core curl
\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.
+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.
+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
+curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > \
+ $HOME/bin/repo
chmod a+x $HOME/bin/repo
\end{verbatim}
http://git.free-electrons.com/training-materials/commit/?id=6e314db0a20cb45981a3021cf4d29362285400e5
commit 6e314db0a20cb45981a3021cf4d29362285400e5
Author: Maxime Ripard <maxime.ripard at free-electrons.com>
Date: Mon Jun 11 09:49:34 2012 +0200
Add android source code lab slides
Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
diff --git a/Makefile b/Makefile
index 58f0797..7d7280a 100644
--- a/Makefile
+++ b/Makefile
@@ -109,6 +109,7 @@ ANDROID_SLIDES = \
android-introduction-features \
android-introduction-history \
android-introduction-architecture \
+ android-introduction-lab \
android-source-title \
android-source-obtaining \
android-source-organization \
diff --git a/slides/android-introduction-lab/android-introduction-lab.tex b/slides/android-introduction-lab/android-introduction-lab.tex
new file mode 100644
index 0000000..043e21d
--- /dev/null
+++ b/slides/android-introduction-lab/android-introduction-lab.tex
@@ -0,0 +1,11 @@
+\setuplabframe
+{Android Source Code}
+{
+ \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}
+}
-----------------------------------------------------------------------
Summary of changes:
Makefile | 10 +
labs/android-boot/android-boot.tex | 74 +++---
.../android-first-compilation.tex | 69 +++---
labs/android-new-board/android-new-board.tex | 247 +++++++++++---------
labs/android-source-code/android-source-code.tex | 52 +++--
slides/android-adb-lab/android-adb-lab.tex | 10 +
.../android-application-lab.tex | 8 +
.../android-build-system-lab.tex | 10 +
.../android-framework-lab.tex | 10 +
slides/android-introduction-history/history.dia | 81 +++----
.../android-introduction-lab.tex | 11 +
.../android-kernel-lab-compilation.tex | 9 +
.../android-native-layer-lab-binary.tex | 8 +
.../android-native-layer-lab-library.tex | 9 +
.../android-new-board-lab.tex | 9 +
slides/android-source-lab/android-source-lab.tex | 8 +
16 files changed, 379 insertions(+), 246 deletions(-)
create mode 100644 slides/android-adb-lab/android-adb-lab.tex
create mode 100644 slides/android-application-lab/android-application-lab.tex
create mode 100644 slides/android-build-system-lab/android-build-system-lab.tex
create mode 100644 slides/android-framework-lab/android-framework-lab.tex
create mode 100644 slides/android-introduction-lab/android-introduction-lab.tex
create mode 100644 slides/android-kernel-lab-compilation/android-kernel-lab-compilation.tex
create mode 100644 slides/android-native-layer-lab-binary/android-native-layer-lab-binary.tex
create mode 100644 slides/android-native-layer-lab-library/android-native-layer-lab-library.tex
create mode 100644 slides/android-new-board-lab/android-new-board-lab.tex
create mode 100644 slides/android-source-lab/android-source-lab.tex
More information about the training-materials-updates
mailing list