\subchapter{Training setup}{Download files and directories used in practical labs}

\section{Update your system}

Time might have elapsed since your system was last updated. Keep your
system up to date:

\begin{verbatim}
sudo apt-get update
sudo apt-get dist-upgrade
\end{verbatim}

\section{Install lab data}

For the different labs in the training, your instructor has prepared a
set of data (kernel images, kernel configurations, root filesystems
and more). Download the tarball at

\url{http://free-electrons.com/labs/labs.tar.bz2}

Then, from a terminal, extract the tarball using the following
commands:

\begin{verbatim}
cd	(going to your home directory)
sudo tar jxf labs.tar.bz2
sudo chown -R <user>.<user> felabs
\end{verbatim}

Note that using \code{root} permissions are required to extract the
character and block device files contained in the lab structure.

Lab data are now available in an \code{felabs} directory in your home
directory. For each lab there is a directory containing various
data. This directory will also be used as working space for each lab,
so that the files that you produce during each lab are kept separate.

You are now ready to start the real practical labs!

\section{Install extra packages}

Ubuntu comes with a very limited version of the \code{vi}
editor. Install \code{vim}, a improved version of this editor.

\begin{verbatim}
sudo apt-get install vim
\end{verbatim}

\section{More guidelines}

Can be useful throughout any of the labs

\begin{itemize}

\item Read instructions and tips carefully. Lots of people make
  mistakes or waste time because they missed an explanation or a
  guideline.

\item Always read error messages carefully, in particular the first
  one which is issued. Some people stumble on very simple errors just
  because they specified a wrong file path and didn't pay enough
  attention to the corresponding error message.

\item Never stay stuck with a strange problem more than 5
  minutes. Show your problem to your colleagues or to the instructor.

\item You should only use the root user for operations that require
  super-user privileges, such as: mounting a file system, loading a
  kernel module, changing file ownership, configuring the
  network. Most regular tasks (such as downloading, extracting
  sources, compiling...) can be done as a regular user.

\item If you ran commands from a root shell by mistake, your regular
  user may no longer be able to handle the corresponding generated
  files. In this case, use the \code{chown -R} command to give the new
  files back to your regular user.\\
  Example: \code{chown -R myuser.myuser linux-3.4}

\item In Debian, Ubuntu and other derivatives, don't be surprised if
  you cannot run graphical applications as \code{root}. You could set the
  \code{DISPLAY} variable to the same setting as for your regular user, but
  again, it's unnecessary and unsafe to run graphical applications as
  \code{root}.

\end{itemize}

