How to setup environment for ADT with 1.1 on Fedora 16

From Yocto Project
Jump to navigationJump to search

Installing the ADT

There are three method to install the ADT, which includes the cross-toolchain. Regardless of the installation you choose, you must source the cross-toolchain environment setup script before you use the toolchain.

  • Use the ADT Installer Script: This method is the recommended way to install the ADT because it automates much of the process for you. For example, you can configure the installation to install the QEMU emulator and the user-space NFS, specify which root filesystem profiles to download, and define the target sysroot location.
  • Use an Existing Toolchain Tarball: Using this method, you select and download an architecture-specific toolchain tarball and then hand-install the toolchain. If you use this method, you just get the cross-toolchain and QEMU - you do not get any of the other mentioned benefits had you run the ADT Installer script.
  • Use the Toolchain from within a Yocto Project Build Tree: If you already have a Yocto Project build tree, you can build the cross-toolchain within tree. However, like the previous method mentioned, you only get the cross-toolchain and QEMU - you do not get any of the other benefits without taking separate steps.

We use the ADT Installer Script as an example to install ADT below.

Getting the ADT Installer Tartall

The ADT Installer is contained in the ADT Installer tarball. You can download the tarball of version 1.1 into any directory from http://downloads.yoctoproject.org/releases/yocto/yocto-1.1/adt_installer.

Configuring and Running the ADT Installer Script

Before running the ADT Installer script, you need to unpack the tarball. You can unpack the tarball in any directory you wish. Unpacking it creates the directory adt-installer, which contains the ADT Installer script (adt-installer) and its configuration file is adt_installer.conf. Before you run the script, however, you should examine the ADT Installer configuration file and be sure you are going to get what you want. Your configurations determine which kernel and filesystem image are downloaded. The following list describes the configurations you can define for the ADT Installer. For configuration values and restrictions, see the comments in the adt-installer.conf file:

  • YOCTOADT_REPO: This area includes the IPKG-based packages and the root filesystem upon which the installation is based. If you want to set up your own IPKG repository pointed to by YOCTOADT_REPO, you need to be sure that the directory structure follows the same layout as the reference directory set up at http://adtrepo.yoctoproject.org. Also, your repository needs to be accessible through HTTP.
  • YOCTOADT_TARGETS: The machine target architectures for which you want to set up cross-development environments.
  • YOCTOADT_QEMU: Indicates whether or not to install the emulator QEMU.
  • YOCTOADT_NFS_UTIL: Indicates whether or not to install user mode NFS. If you plan to use the Yocto Eclipse IDE plug-in against QEMU, you should in-stall NFS.
  • YOCTOADT_ROOTFS_<arch>: The root filesystem images you want to download from the YOCTOADT_IPKG_REPO repository.
  • YOCTOADT_TARGET_SYSROOT_IMAGE_<arch>: The particular root filesystem used to extract and create the target sysroot. The value of this variable must have been specified with YOCTOADT_ROOTFS_<arch>. For example, if you downloaded both minimal and sato-sdk images by setting YOCTOADT_ROOTFS_<arch> to "minimal sato-sdk", then YOCTOADT_ROOTFS_<arch> must be set to either minimal or sato-sdk.
  • YOCTOADT_TARGET_SYSROOT_LOC_<arch>: The location on the development host where the target sysroot is created.

For working with Eclipse, we set the parameters in adt-installer.conf as below, we just install arm arch as an example:

  YOCTOADT_VERSION=1.1
  YOCTOADT_REPO=http://adtrepo.yoctoproject.org/$YOCTOADT_VERSION
  YOCTOADT_TARGETS="arm"
  YOCTOADT_QEMU="Y"
  YOCTOADT_NFS_UTIL="Y"
  YOCTOADT_ROOTFS_arm=" sato-sdk"
  YOCTOADT_TARGET_SYSROOT_IMAGE_arm=" sato-sdk "
  YOCTOADT_TARGET_SYSROOT_LOC_arm="$HOME/xuhongna/test-yocto/arm"

After you have configured the adt_installer.conf file, run the installer using the following command: adt_installer, before you run the script, you should make sure add the sudo authority to your user account. The installation is dependent on the “Packages” section of The Tocto Project Quick Start and other two packages of python-psyco and eglibc-devel. Once the installer begins to run, you are asked whether you want to run in in-teractive or 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. Once the installation completes, the ADT, which includes the cross-toolchain, is installed. You will notice environment setup files for the cross-toolchain in /opt/poky/1.1, and image tarballs in the adt-installer directory according to your installer configurations, and the target sysroot located according to the YOCTOADT_TARGET_SYSROOT_LOC_<arch> variable also in your configura-tion file.

Working with Eclipse

Setting up the Eclipse IDE

To develop within the Eclipse IDE, you need to do the following:

Install the optimal version of the Eclipse IDE

For FC 16,To install the Eclipse IDE we just run command: sudo yum install eclipse, currently it will install the version 3.7.1. Avoid Memory Error we start eclipse use this command: eclipse --vmargs --XX:PermSize=256M

Configure the Eclipse IDE

1.Start the Eclipse IDE.

2.Make sure you are in your Workbench and select "Install New Software" from the "Help" pull-down menu.

3.Select indigo - http://download.eclipse.org/releases/indigo from the "Work with:" pull-down menu, if there is no indigo you should select Add… to add the URL.

4.Expand the box next to Programming Languages and select the Autotools Support for CDT (incubation) and C/C++ Development Tools boxes.

5.Complete the installation and restart the Eclipse IDE.

6.After the Eclipse IDE restarts and from the Workbench, select "Install New Software" from the "Help" pull-down menu.

7.Click the "Available Software Sites" link.

8.Check the box next to http://download.eclipse.org/tm/updates/3.3 and click "OK".

9.Select http://download.eclipse.org/tm/updates/3.3 from the "Work with:" pull-down menu.

10.Check the box next to TM and RSE Main Features.

11.Expand the box next to TM and RSE Optional Add-ons and select every item except RSE Unit Tests and RSE WinCE Services (incuba-tion).

12.Complete the installation and restart the Eclipse IDE.

13.If necessary, select "Install New Software" from the "Help" pull-down menu so you can click the "Available Software Sites" link again.

14.After clicking "Available Software Sites", check the box next to http://download.eclipse.org/tools/cdt/releases/indigo and click "OK".

15.Select http://download.eclipse.org/tools/cdt/releases/indigo from the "Work with:" pull-down menu.

16.Check the box next to CDT Main Features.

17.Expand the box next to CDT Optional Features and select C/C++ Remote Launch and Target Communication Framework (incubation).

18.Complete the installation and restart the Eclipse IDE.

Install the Eclipse Yocto Plug-in

1.Start up the Eclipse IDE.

2.In Eclipse, select "Install New Software" from the "Help" menu.

3.Click "Add..." in the "Work with:" area.

4.Enter http://www.yoctoproject.org/downloads/eclipse-plugin/1.1 in the URL field and provide a meaningful name in the "Name" field.

5.If you want to update the version of eclipse-plugin, you may get the tarball named like org.yocto.sdk-${Release}-${Date}-archive.zip, in step 4 you just click Archive… to point the location of the tarball.

6.Click "OK" to have the entry added to the "Work with:" drop-down list.

7.Select the entry for the plug-in from the "Work with:" drop-down list.

8.Complete the remaining software installation steps and then restart the Eclipse IDE to finish the installation of the plug-in.

Configure the Eclipse Yocto Plug-in

Configuring the Eclipse Yocto Plug-in involves setting the Cross Compiler options and the Target options. The configurations you choose become the default settings for all projects. You do have opportunities to change them later when you configure the project (see the following section). To start, you need to do the following from within the Eclipse IDE: Choose Windows -> Preferences to display the Preferences Dialog and Click Yocto ADT To configure the Cross Compiler Options, you must select the type of toolchain, point to the toolchain, specify the sysroot location, and select the target architecture.

Selecting the Toolchain Type: Choose between Standalone pre-built toolchain and Build system derived toolchain for Cross Compiler Options.

  • Standalone Pre-built Toolchain: Select this mode when you are using a standalone cross-toolchain. For example, suppose you are an application developer and do not need to build a target image. Instead, you just want to use an architecture-specific toolchain on an existing kernel and target root filesystem.
  • Build System Derived Toolchain: Select this mode if the cross-toolchain has been installed and built as part of the Yocto Project build tree. When you select Build system derived toolchain, you are using the toolchain bundled inside the Yocto Project build tree.

Point to the Toolchain: If you are using a standalone pre-built toolchain, you should be pointing to the /opt/poky/1.1 (in our version 1.1) directory. This is the location for toolchains installed by the ADT Installer or by hand. If you are using a system-derived toolchain, the path you provide for the Toolchain Root Location field is the Yocto Project's build directory.

Specify the Sysroot Location: This location is where the root filesystem for the target hardware is created on the development system by the ADT Installer. The QEMU user-space tools, the NFS boot process, and the cross-toolchain all use the sysroot location.

Select the Target Architecture: The target architecture is the type of hardware you are going to use or emulate. Use the pull-down Target Architecturemenu to make your selection. The pull-down menu should have the supported architectures. If the architecture you need is not listed in the menu, you will need to build the image.

Configuring the Target Options, You can choose to emulate hardware using the QEMU emulator, or you can choose to run your image on actual hardware.

QEMU: Select this option if you will be using the QEMU emulator. If you are using the emulator, you also need to locate the kernel and specify any custom options.If you selected Build system derived toolchain, the target kernel you built will be located in the Yocto Project build tree in tmp/deploy/images directory. If you selected Standalone pre-built toolchain, the pre-built image you downloaded is located in the directory you specified when you downloaded the image.

Most custom options are for advanced QEMU users to further customize their QEMU instance. These options are specified between paired angled brackets. Some options must be specified outside the brackets. In particular, the options serial, nographic, and kvm must all be outside the brackets. Use the man qemu command to get help on all the options and their use.

External HW: Select this option if you will be using actual hardware.

Click the OK button to save your plug-in configurations. In our demo, As the adt-installer.conf settings in section 1.2, we set “Yocot ADT” as the picture show https://wiki.yoctoproject.org/wiki/images/3/33/Yocto.png