Getting ready

We will need to build and install the extensible SDK as we have seen in the previous recipe so that the devtool command-line application is available. To build the full extensible SDK we do the following:

$ bitbake -c populate_sdk_ext <image name>

Depending on the chosen image, it may happen that the size of the full SDK is too big to manage. In that case, we can configure our build to use the minimal extensible SDK as follows:

SDK_EXT_TYPE = "minimal" 
SDK_INCLUDE_TOOLCHAIN = "1" 
SDK_INCLUDE_PKGDATA = "1" 

Here, the following applies:

  • SDK_EXT_TYPE can be either full, the default, or minimal.
  • SDK_INCLUDE_TOOLCHAIN controls whether the toolchain is included or not in the SDK. As mentioned previously, the full SDK will by default include the toolchain, and the minimal SDK will not, unless configured to do so.
  • SDK_INCLUDE_PKGDATA includes the package data for all world target recipes in the extensible SDK. This allows devtool to find these recipes and map dependencies effectively, but increases significantly the build time. This is used in conjunction with the minimal extensible SDK, and the EXCLUDE_FROM_WORLD_pn-<recipename> variable can be used to limit the built queue. For example, to exclude the ffmpeg recipe you would add the following to conf/local.conf:
EXCLUDE_FROM_WORLD_pn-ffmpeg = "1" 

Most layers are not prepared to build for the world target, so it is likely that a lot of recipes will need to be excluded. The minimal SDK does not include a toolchain or libraries by default. In the previous configuration, we configure it to include the toolchain and we add the package data for all world target recipes so that devtool knows about them. With the configuration above, devtool will need to build the items it needs from source. To avoid that, we can configure a shared state cache it can use as we saw in Chapter 1, The Build System in the Sharing the shared state cache recipe. We then need to share this SSTATE_MIRROR variable with the SDK. This can be done in a conf/sdk-extra.conf file, either in your build directory or any of the layers. If the SSTATE_MIRRORS are common between the build system and the SDK, it can also be passed to the SDK with:

SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS" 

The extensible SDK build environment can be customized by the following variables:

  • SDK_LOCAL_CONF_WHITELIST, which contains a list of variables from the build system available in the SDK configuration
  • SDK_LOCAL_CONF_BLACKLIST, a list of build system variables not allowed into the SDK
  • SDK_INHERIT_BLACKLIST lists all the classes removed from the INHERIT  variable in the SDK configuration

Once the SDK build finishes, the toolchain can be found under tmp/deploy/sdk. To install it, we copy it to the destination machine and do the following:

$ ./poky-glibc-x86_64-core-image-minimal-cortexa9hf-neon-toolchain-ext-2.4.sh
Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.4===================================================================================
Enter target directory for SDK (default: ~/poky_sdk):
You are about to install the SDK to " ~/poky_sdk". Proceed[Y/n]?Extracting SDK............................done
Setting it up...
Extracting buildtools...
Preparing build system...
Parsing recipes: 100% |#################################################################################################| Time: 0:00:5$
Initialising tasks: 100% |##############################################################################################| Time: 0:00:0$
Checking sstate mirror object availability: 100% |######################################################################| Time: 0:00:0$
Parsing recipes: 100% |#################################################################################################| Time: 0:00:4$
Initialising tasks: 100% |##############################################################################################| Time: 0:00:02
done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
$ . / ~/poky_sdk/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset