adt-manual: Updates to de-emphasize opt/poky and include sysroot

Fixes YOCTO #2645

Several changes to make sure that the default toolchain directory
(opt/poky) is understood as the default.  I changed some wordings
to call it out as the default.  Some examples I left alone as they
used /opt/poky but I clearly indicated that the example was using
the default installation directory.

I also updated the note in the manual that talks about alternatively
building the toolchain installer.  Previously, it mentioned two
methods.  I have added the third and most significant method that
uses bitbake image -c populate_sdk.  This method creates a toolchain
installer that contains the matching sysroot.

(From yocto-docs rev: 2e5eeb7e0c9aa448149cc369572b31dbc1603e28)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Scott Rifenbark 2013-03-01 14:22:44 -06:00 committed by Richard Purdie
parent b7397f3559
commit d8e26e2b9f
2 changed files with 80 additions and 50 deletions

View File

@ -7,8 +7,8 @@
<para> <para>
Recall that earlier the manual discussed how to use an existing toolchain Recall that earlier the manual discussed how to use an existing toolchain
tarball that had been installed into <filename>/opt/poky</filename>, tarball that had been installed into the default installation
which is outside of the directory, <filename>/opt/poky</filename>, which is outside of the
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
(see the section "<link linkend='using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball)</link>". (see the section "<link linkend='using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball)</link>".
And, that sourcing your architecture-specific environment setup script And, that sourcing your architecture-specific environment setup script
@ -81,13 +81,15 @@
<listitem><para><emphasis>Source the cross-toolchain <listitem><para><emphasis>Source the cross-toolchain
environment setup file:</emphasis> environment setup file:</emphasis>
Installation of the cross-toolchain creates a cross-toolchain Installation of the cross-toolchain creates a cross-toolchain
environment setup script in <filename>/opt/poky/&lt;release&gt;</filename>. environment setup script in the directory that the ADT
was installed.
Before you can use the tools to develop your project, you must Before you can use the tools to develop your project, you must
source this setup script. source this setup script.
The script begins with the string "environment-setup" and contains The script begins with the string "environment-setup" and contains
the machine architecture, which is followed by the string the machine architecture, which is followed by the string
"poky-linux". "poky-linux".
Here is an example for an environment setup using the Here is an example that sources a script from the
default ADT installation directory that uses the
32-bit Intel x86 Architecture and using the 32-bit Intel x86 Architecture and using the
&DISTRO_NAME; Yocto Project release: &DISTRO_NAME; Yocto Project release:
<literallayout class='monospaced'> <literallayout class='monospaced'>
@ -158,8 +160,7 @@
For an Autotools-based project, you can use the cross-toolchain by just For an Autotools-based project, you can use the cross-toolchain by just
passing the appropriate host option to <filename>configure.sh</filename>. passing the appropriate host option to <filename>configure.sh</filename>.
The host option you use is derived from the name of the environment setup The host option you use is derived from the name of the environment setup
script in <filename>/opt/poky</filename> resulting from installation of the script found in the directory in which you installed the cross-toolchain.
cross-toolchain tarball.
For example, the host option for an ARM-based target that uses the GNU EABI For example, the host option for an ARM-based target that uses the GNU EABI
is <filename>armv5te-poky-linux-gnueabi</filename>. is <filename>armv5te-poky-linux-gnueabi</filename>.
You will notice that the name of the script is You will notice that the name of the script is

View File

@ -198,24 +198,29 @@
$ cd ~/adt-installer $ cd ~/adt-installer
$ ./adt_installer $ ./adt_installer
</literallayout> </literallayout>
Once the installer begins to run, you are asked to enter the location for Once the installer begins to run, you are asked to enter the
cross-toolchain installation. location for cross-toolchain installation.
The default location is <filename>/opt/poky/&lt;release&gt;</filename>. The default location is
After selecting the location, you are prompted to run in <filename>/opt/poky/&lt;release&gt;</filename>.
interactive or silent mode. After either accepting the default location or selecting your
If you want to closely monitor the installation, choose “I” for interactive own location, you are prompted to run the installation script
mode rather than “S” for silent mode. interactively or in silent mode.
If you want to closely monitor the installation,
choose “I” for interactive mode rather than “S” for silent mode.
Follow the prompts from the script to complete the installation. Follow the prompts from the script to complete the installation.
</para> </para>
<para> <para>
Once the installation completes, the ADT, which includes the cross-toolchain, is installed. Once the installation completes, the ADT, which includes the
You will notice environment setup files for the cross-toolchain in cross-toolchain, is installed in the selected installation
<filename>&YOCTO_ADTPATH_DIR;</filename>, directory.
and image tarballs in the <filename>adt-installer</filename> You will notice environment setup files for the cross-toolchain
directory according to your installer configurations, and the target sysroot located in the installation directory, and image tarballs in the
according to the <filename>YOCTOADT_TARGET_SYSROOT_LOC_&lt;arch&gt;</filename> variable <filename>adt-installer</filename> directory according to your
also in your configuration file. installer configurations, and the target sysroot located
according to the
<filename>YOCTOADT_TARGET_SYSROOT_LOC_&lt;arch&gt;</filename>
variable also in your configuration file.
</para> </para>
</section> </section>
</section> </section>
@ -224,11 +229,12 @@
<title>Using a Cross-Toolchain Tarball</title> <title>Using a Cross-Toolchain Tarball</title>
<para> <para>
If you want to simply install the cross-toolchain by hand, you can do so by running the If you want to simply install the cross-toolchain by hand, you can
toolchain installer. do so by running the toolchain installer.
If you use this method to install the cross-toolchain and you still need to install the target If you use this method to install the cross-toolchain and you
sysroot, you will have to extract and install sysroot separately. might still need to install the target sysroot by installing and
For information on how to do this, see the extracting it separately.
For information on how to install the sysroot, see the
"<link linkend='extracting-the-root-filesystem'>Extracting the Root Filesystem</link>" section. "<link linkend='extracting-the-root-filesystem'>Extracting the Root Filesystem</link>" section.
</para> </para>
@ -248,29 +254,50 @@
<literallayout class='monospaced'> <literallayout class='monospaced'>
poky-eglibc-x86_64-i586-toolchain-gmae-&DISTRO;.sh poky-eglibc-x86_64-i586-toolchain-gmae-&DISTRO;.sh
</literallayout> </literallayout>
<note><para>As an alternative to steps one and two, you can build the toolchain installer <note><para>As an alternative to steps one and two, you can
if you have a <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. build the toolchain installer if you have a
If you need GMAE, you should use the <filename>bitbake meta-toolchain-gmae</filename> <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
If you need GMAE, you should use the
<filename>bitbake meta-toolchain-gmae</filename>
command. command.
The resulting installation script when run will support such development. Running the resulting installation script will support
However, if you are not concerned with GMAE, such development.
you can generate the toolchain installer using If you are not concerned with GMAE, you can generate
<filename>bitbake meta-toolchain</filename>.</para> the toolchain installer using
<para>Use the appropriate <filename>bitbake</filename> command only after you have <filename>bitbake meta-toolchain</filename>.
sourced the <filename>&OE_INIT_PATH;</filename> script located in the Source Either of these methods requires you to still
Directory and you have made sure your <filename>conf/local.conf</filename> install the target sysroot by installing and
variables are correct. extracting it separately.
For information on how to install the sysroot, see the
"<link linkend='extracting-the-root-filesystem'>Extracting the Root Filesystem</link>" section.
</para>
<para>A final method of building the toolchain installer
exists that has significant advantages over the previous
two methods.
This method results in a toolchain installer that
contains the sysroot that matches your target root
filesystem.
To build this installer, use the
<filename>bitbake image -c populate_sdk</filename>
command.</para>
<para>Remember, before using any
<filename>bitbake</filename> command, you must source
the <filename>&OE_INIT_PATH;</filename> script
located in the Source Directory and you must make sure
your <filename>conf/local.conf</filename> variables are
correct.
In particular, you need to be sure the In particular, you need to be sure the
<ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
variable matches the architecture for which you are building and that the variable matches the architecture for which you are
<filename>SDKMACHINE</filename> variable is correctly set if you are building building and that the <filename>SDKMACHINE</filename>
a toolchain for an architecture that differs from your current variable is correctly set if you are building
development host machine.</para> a toolchain for an architecture that differs from your
<para>When the <filename>bitbake</filename> command completes, the current development host machine.</para>
toolchain installer will be in <filename>tmp/deploy/sdk</filename> in the <para>When the <filename>bitbake</filename> command
Build Directory. completes, the toolchain installer will be in
</para></note> <filename>tmp/deploy/sdk</filename> in the Build
</para></listitem> Directory.</para>
</note></para></listitem>
<listitem><para>Once you have the installer, run it to install the toolchain. <listitem><para>Once you have the installer, run it to install the toolchain.
You must change the permissions on the toolchain installer You must change the permissions on the toolchain installer
script so that it is executable.</para> script so that it is executable.</para>
@ -354,7 +381,8 @@
Before you can develop using the cross-toolchain, you need to set up the Before you can develop using the cross-toolchain, you need to set up the
cross-development environment by sourcing the toolchain's environment setup script. cross-development environment by sourcing the toolchain's environment setup script.
If you used the ADT Installer or hand-installed cross-toolchain, If you used the ADT Installer or hand-installed cross-toolchain,
then you can find this script in the <filename>&YOCTO_ADTPATH_DIR;</filename> then you can find this script in the directory you chose for installation.
The default installation directory is the <filename>&YOCTO_ADTPATH_DIR;</filename>
directory. directory.
If you installed the toolchain in the If you installed the toolchain in the
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>, <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>,
@ -367,8 +395,9 @@
which you are developing. which you are developing.
Environment setup scripts begin with the string “<filename>environment-setup</filename> Environment setup scripts begin with the string “<filename>environment-setup</filename>
and include as part of their name the architecture. and include as part of their name the architecture.
For example, the toolchain environment setup script for a 64-bit IA-based architecture would For example, the toolchain environment setup script for a 64-bit
be the following: IA-based architecture installed in the default installation directory
would be the following:
<literallayout class='monospaced'> <literallayout class='monospaced'>
&YOCTO_ADTPATH_DIR;/environment-setup-x86_64-poky-linux &YOCTO_ADTPATH_DIR;/environment-setup-x86_64-poky-linux
</literallayout> </literallayout>
@ -497,9 +526,9 @@
The example extracts the root filesystem into the <filename>$HOME/qemux86-sato</filename> The example extracts the root filesystem into the <filename>$HOME/qemux86-sato</filename>
directory: directory:
<literallayout class='monospaced'> <literallayout class='monospaced'>
$ source $HOME/poky/build/tmp/environment-setup-i586-poky-linux $ source $HOME/toolchain_dir/environment-setup-i586-poky-linux
$ runqemu-extract-sdk \ $ runqemu-extract-sdk \
tmp/deploy/images/core-image-sato-sdk-qemux86-2011091411831.rootfs.tar.bz2 \ ~Downloads/core-image-sato-sdk-qemux86-2011091411831.rootfs.tar.bz2 \
$HOME/qemux86-sato $HOME/qemux86-sato
</literallayout> </literallayout>
In this case, you could now point to the target sysroot at In this case, you could now point to the target sysroot at