dey-image: create an sdk/toolchain dey version file with params to identify it

This commit creates a new file called 'dey-version-${REAL_MULTIMACH_TARGET_SYS}'
(for example, 'dey-version-cortexa7hf-neon-dey-linux-gnueabi') at the same level
as 'version-${REAL_MULTIMACH_TARGET_SYS}',
'site-config-${REAL_MULTIMACH_TARGET_SYS}', and
'environment-setup-${REAL_MULTIMACH_TARGET_SYS}' files.

The file contains the following parameters:
   * Machine. The name of the platform the toolchain was built for (ccimx6sbc,
     ccimx6ulsbc, ccimx6ulstarter).
   * Version: A versioning system for the generated toolchains. Currently is the
     distro version followed by the timestamp on which the current build started.
   * Image: The name of the image that triggered the population of the SDK
     (core-image-base, dey-image-aws, dey-image-qt-${GRAPHICAL_BACKEND})

The purpose of the 'dey-version-*' file is to be parsed by Eclipse so toolchains
can be autodetected.

This file is packaged with the rest of SDK/toolchain resources ('version-*',
'site-config-*', and 'environment-setup-*' files, and 'sysroots' directory)
when creating the SDK tarball and later the installation script.

The 'dey-version-*' file could also be created in a 'meta-environment.bbappend'
appending to the 'create_sdk_files()'. But from this recipe there is no access
to the name of the image that triggers the creation of the SDK (core-image-base,
dey-image-aws, dey-image-qt, etc.).

Currently, we are redefining 'SDK_POSTPROCESS_COMMAND' (from
'poky/meta/classes/populate_sdk_base.bbclass') to insert the generation of the
'dey-version-*' file just before creating the SDK tarball.

https://jira.digi.com/browse/DEL-5074

Signed-off-by: Tatiana Leon <tatiana.leon@digi.com>
This commit is contained in:
Tatiana Leon 2017-10-02 20:29:23 +02:00
parent 74b734f095
commit 7d2a07cf2f
1 changed files with 24 additions and 0 deletions

View File

@ -32,3 +32,27 @@ inherit ${@bb.utils.contains("IMAGE_FEATURES", "dey-qt", "populate_sdk_qt5", "",
#
DEY_IMAGE_INSTALLER ?= "0"
inherit ${@base_conditional("DEY_IMAGE_INSTALLER", "1", "dey-image-installer", "", d)}
#
# Create a dey-version file when populating the toolchain/SDK
#
# 'SDK_POSTPROCESS_COMMAND' variable is originally defined in populate_sdk_base
# class: poky/meta/classes/populate_sdk_base.bbclass
# It is redefined here to be able to tweak the resulting SDK before packaging,
# using the proper 'IMAGE_BASENAME' value.
#
SDK_PREPACKAGING_COMMAND ?= "toolchain_create_sdk_dey_version"
SDK_POSTPROCESS_COMMAND = " create_sdk_files; check_sdk_sysroots; ${SDK_PREPACKAGING_COMMAND}; tar_sdk; ${SDK_PACKAGING_COMMAND} "
# This function creates a DEY version information file
fakeroot toolchain_create_sdk_dey_version() {
local deyversionfile="${SDK_OUTPUT}/${SDKPATH}/dey-version-${REAL_MULTIMACH_TARGET_SYS}"
rm -f $deyversionfile
touch $deyversionfile
echo 'Machine: ${MACHINE}' >> $deyversionfile
echo 'Version: ${DISTRO_VERSION}-${DATETIME}' >> $deyversionfile
echo 'Image: ${IMAGE_BASENAME}' >> $deyversionfile
}
toolchain_create_sdk_dey_version[vardepsexclude] = "DATETIME"