From 7d2a07cf2ffc5e9a8882946367250efb861dd3a6 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Mon, 2 Oct 2017 20:29:23 +0200 Subject: [PATCH] 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 --- meta-digi-dey/classes/dey-image.bbclass | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/meta-digi-dey/classes/dey-image.bbclass b/meta-digi-dey/classes/dey-image.bbclass index 8d19292dd..cea4ffe8d 100644 --- a/meta-digi-dey/classes/dey-image.bbclass +++ b/meta-digi-dey/classes/dey-image.bbclass @@ -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" +