SDK Generation
This section describes the steps required to install the SDK. This is an advanced topic and should only be attempted if the pre-prepared Virtual machine is not sufficient, further note that the VM has some of these steps already done.
By the end of this section you should be able to set-up
your fresh build environment and build the required images and toolchain.
Installing the required packages
Download the following essential packages using the following command:
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo build-essential chrpath libsdl1.2-dev xterm ssh kpartx
Setting up the SDK environment
The instructions below guide you through the installation of the required tools and repositories.
- Download/Transfer the Eurotech BSP components to the $HOME/Downloads directory, ie.
$ pushd $HOME/Downloads
$ wget http://eurotechcloud.transfer.eurotech-inc.com/~publicaccess/projects/CPU-3xx/cpu-3xx_bsp_rev_p2.tar.gz
$ wget http://eurotechcloud.transfer.eurotech-inc.com/~publicaccess/projects/CPU-3xx/make-media_rev_p.tar.gz
$ popd
- Create folder called yocto.
$ mkdir -p $HOME/yocto
$ tar -C $HOME/yocto -zxvf $HOME/Downloads/cpu-3xx_bsp_rev_p2.tar.gz
- Decompress the make-media scripts.
$ tar -zxvf $HOME/Downloads/make-media_rev_p.tar.gz
- Create a $HOME/bin directory.
$ mkdir -p $HOME/bin
- Add the $HOME/bin directory to the $PATH variable.
If you are using ubuntu-12.04.5, the $HOME/bin directory will be added to the $PATH variable by default. If not please modify the $HOME/.profile to add it.
NOTE: You might need to logout for the $HOME/bin directory to be included if
its created for the first time.
- Create a symlink for yocto_platform in $HOME/bin folder.
$ ln -s ~/yocto/meta-eurotech/common/scripts/yocto_platform $HOME/bin/yocto_platform
- A bash_completion.d script for yocto_platform is provided to simplify use. You will need to copy this
(as root) to /etc/bash_completion.d/ using the following
$ sudo cp $HOME/yocto/meta-eurotech/common/scripts/bash_completion.d/yocto_platform /etc/bash_completion.d/
You will need to source this script using the following command for it to load in this session. Alternatively it
will get picked up on reboot.
$ source /etc/bash_completion.d/yocto_platform
Adding Oracle Embedded JRE
The default Eurotech images includes a recipe for Oracle Embedded JRE (ejre). If this is not required the users can remove this feature by removing "esf" from machine configuration file in $HOME/yocto/meta-eurotech/meta-cpu-3xx/conf/machine/cpu-3xx.conf
EUROTECH_FEATURES = " esf debug"
NOTE: In the example above we are using machine configuration file cpu-3xx.conf which is for a Quad Device.
In order to comply with Oracle license agreements, users must MANUALLY
download the JRE from:
http://www.oracle.com/technetwork/java/embedded/downloads/javase/index.html
The version used by this BSP is called (or similar):
ejre-7u40-fcs-b43-linux-arm-vfp-sflt-server_headless-27_aug_2013.tar.gz
Refer to the recipe for exact version. You must accept the licence before you download the image.
You only need to do this once, then store in a location where the BSP
can find it for future builds.
To simplify the process and to keep it inside the Yocto build system,
we have implemented the following:
- Create a folder called 'java' below your meta-eurotech BSP folder. If you normally have the BSP in
$HOME/yocto/meta-eurotech create the folder here $HOME/yocto/java as follows:
$ mkdir -p $HOME/yocto/java
- Download the JRE listed above and save it in the new 'java' folder.
The Directory Layout
Following the above steps will result in the following directory layout. The java directory is only required if Oracle Embedded JRE is enabled.
$HOME/yocto
|--- java # This contains the Oracle Embedded JRE (ejre)
|--- meta-eurotech # Eurotech BSP layer
|--- meta-fsl-arm # Yocto BSP layer for Freescale's ARM based platforms
|--- meta-fsl-arm-extra # Yocto BSP layer for Freescale's ARM based platforms
|--- meta-fsl-demos # Yocto BSP layer for Freescale's ARM based platforms
|--- meta-oe # Contains collection of layers for the OE-core
|--- poky # The build system and development environment
Building Images
Once you get the repos as described above, you can speed up your setup by calling 'yocto_platform' as follows:
- eurotech-console-sato:
$ cd $HOME/yocto
$ yocto_platform cpu-3xx gateway image eurotech-console-sato quad
- eurotech-console-basic:
$ cd $HOME/yocto
$ yocto_platform cpu-3xx gateway image eurotech-console-basic solo
This will create a project folder called 'gateway', uses some default .conf files for your project and builds the required images. The 'gateway' folder will be used as a reference in all the installation examples throughout this document. If you have named it to something else, please make the appropriate substitutions.
IMPORTANT: The last parameter determines the CPU type.
For Reliagate-10-20, this is normally a single core 'solo' CPU.
If you omit the CPU & image type, the image will default to 'eurotech-console-basic' for a quad core CPU.
For more information, please run 'yocto_platform' without parameters to see help information.
Building Utiliboot Images
Once the above images have been built then the utiliboot images, which can be used to program the eMMC and also allow the ability to install of additional archives and/or executables, can be built. Choose one of the following cases:
- Utiliboot image without additional packages:
$ cd $HOME/yocto/gateway/tmp/deploy/images/
$ sudo $HOME/make-media/make-utiliboot eurotech-console-sato cpu-3xx $HOME/make-media/make-media
- Utiliboot image with additional packages:
This will allow loading archives and/or executables which are placed in $HOME/yocto/gateway/tmp/deploy/images/extra. They are simply copied as-is onto the utiliboot filesystem.
$ cd $HOME/yocto/gateway/tmp/deploy/images/
$ sudo $HOME/make-media/make-utiliboot eurotech-console-sato cpu-3xx $HOME/make-media/make-media extra/*
Once complete, this will create the utiliboot image. The name of the utiliboot image will include the last portion of the image name. For example, if the image argument is "eurotech-console-sato" and the base image extension is ".sdcard", then the final image will be named utiliboot-sato.sdcard.
Freescale EULA
Each time you create a *new* project, you will be asked to accept the Freescale EULA. An entry then gets
added to the project's local.conf. You can avoid this question, by updating your copy of default_local.conf
that is in meta-eurotech/meta-cpu-3xx.
Generating Toolchain and Sysroot
Once the image has been created, the toolchain and sysroot can be created using the following
$ cd $HOME/yocto
$ source poky/oe-init-build-env gateway
$ bitbake -c populate_sdk eurotech-console-sato
or
$ bitbake -c populate_sdk eurotech-console-basic
When the bitbake command completes, the toolchain installer will be in tmp/deploy/sdk in the build
directory (e.g. gateway in this case).
NOTE: By default the toolchain is generated to run on the local
host machine i.e. based on the machine type i.e. i686 or x86_64 of the local machine. It is possible to
change this so that you can build toolchain items that run on an architecture other than that of your
build host. For example, you can use an x86_64-based build host to create packages that will run on an
i686-based system. This can be set in the local.conf file in the build directory by adding the
SDKMACHINE type as follows:
SDKMACHINE ?= "i686"
Installing the Toolchain
Refer to Application Development toolkit (ADT) for details on installing the toolchain.
Installing Eclipse
The instructions below describes the Eclipse installation.
- Use the following commands to install the version of eclipse that came with SDK.
$ sudo apt-get install openjdk-7-jre
$ mkdir -p $HOME/Utils
$ tar -zxvf $HOME/Downloads/Eurotech-SDK-tools/eclipse-Juno-4.2-32bit/eclipse-cpp-juno-SR2-linux-gtk.tar.gz -C $HOME/Utils
- Create the Eclipse desktop icon.
$ sudo gedit /usr/share/applications/eclipse.desktop
- Copy the following to the eclipse.desktop file.
[Desktop Entry]
Name=Eclipse
Type=Application
Exec=/home/eurotech/Utils/eclipse/eclipse
Terminal=false
Icon=/home/eurotech/Utils/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE
Name[en]=eclipse.desktop