sdk: add platform and image names to the default SDK installation path

Since the final image name is not available in a global scope, append it to the
default installation path in the SDK extraction script once it has been
packaged.

The new default installation path format is:

    /opt/dey/<version>/<platform>/<image>

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
Gabriel Valcazar 2019-11-28 13:54:42 +01:00
parent 8210d73d34
commit be0fe088e3
2 changed files with 14 additions and 5 deletions

View File

@ -34,15 +34,18 @@ DEY_IMAGE_INSTALLER ?= "0"
inherit ${@oe.utils.conditional("DEY_IMAGE_INSTALLER", "1", "dey-image-installer", "", d)}
#
# Create a dey-version file when populating the toolchain/SDK
# Create a dey-version file when populating the toolchain/SDK and modify the
# default SDK installation path so it includes the proper 'IMAGE_BASENAME'
# value.
#
# '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.
# It is redefined here to be able to tweak the resulting SDK before and after
# 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} "
SDK_POSTPACKAGING_COMMAND ?= "toolchain_modify_default_path"
SDK_POSTPROCESS_COMMAND = " create_sdk_files; check_sdk_sysroots; ${SDK_PREPACKAGING_COMMAND}; tar_sdk; ${SDK_PACKAGING_COMMAND} ${SDK_POSTPACKAGING_COMMAND}; "
# This function creates a DEY version information file
fakeroot toolchain_create_sdk_dey_version() {
@ -56,3 +59,9 @@ fakeroot toolchain_create_sdk_dey_version() {
}
toolchain_create_sdk_dey_version[vardepsexclude] = "DATETIME"
# This function appends IMAGE_BASENAME to the default installation path
fakeroot toolchain_modify_default_path() {
sed -i -e 's#^DEFAULT_INSTALL_DIR="${SDKPATH}"#DEFAULT_INSTALL_DIR="${SDKPATH}/${IMAGE_BASENAME}"#g' \
${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.sh
}

View File

@ -70,7 +70,7 @@ PREFERRED_VERSION_libsoc = "git"
PREFERRED_PROVIDER_opencl-headers ?= "imx-gpu-viv"
SDK_NAME = "${DISTRO}-${TCLIBC}-${SDK_ARCH}-${IMAGE_BASENAME}-${TUNE_PKGARCH}"
SDKPATH = "/opt/${DISTRO}/${SDK_VERSION}"
SDKPATH = "/opt/${DISTRO}/${SDK_VERSION}/${MACHINE}"
DISTRO_EXTRA_RDEPENDS += " ${POKY_DEFAULT_EXTRA_RDEPENDS}"
DISTRO_EXTRA_RRECOMMENDS += " ${POKY_DEFAULT_EXTRA_RRECOMMENDS}"