Move common SDK modifications to a new bbclass, dey-image-sdk

Our new dey-toolchain recipe was missing the logic needed to create the
"dey-version" file in the SDK's installation path. Move this logic from the
dey-image bbclass to a new bbclass meant exclusively for SDK logic, and inherit
it where needed. While at it, move other common SDK modifications to this
class.

https://onedigi.atlassian.net/browse/DEL-9297

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
Gabriel Valcazar 2024-11-27 13:01:41 +01:00
parent db613ceff9
commit 74b2a65a19
5 changed files with 30 additions and 30 deletions

View File

@ -0,0 +1,27 @@
# Copyright (C) 2024, Digi International Inc.
#
# 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} archive_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"
# Add staticdev packages to SDK
SDKIMAGE_FEATURES:append = " staticdev-pkgs"

View File

@ -30,27 +30,9 @@ 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
# Inherit common DEY SDK traits
#
# '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} archive_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"
inherit dey-image-sdk
create_sw_versions_file() {
local swversionsfile="${IMAGE_ROOTFS}${sysconfdir}/sw-versions"

View File

@ -22,8 +22,5 @@ CORE_IMAGE_BASE_INSTALL += "dey-examples-digiapix"
# non-graphical core-image-base.
CORE_IMAGE_BASE_INSTALL:append:ccimx6ul = " connectcore-demo-example"
# Add staticdev packages to SDK
SDKIMAGE_FEATURES:append = " staticdev-pkgs"
# Add our dey-image tweaks to the final image (like /etc/buildinfo info)
inherit dey-image

View File

@ -29,9 +29,6 @@ IMAGE_FEATURES += " \
${@bb.utils.contains('MACHINE_FEATURES', 'wifi', 'dey-wireless', '', d)} \
"
# Add staticdev packages to SDK
SDKIMAGE_FEATURES:append = " staticdev-pkgs"
IMAGE_LINGUAS = ""
inherit core-image

View File

@ -3,11 +3,8 @@
SUMMARY = "Meta package for building an installable DEY toolchain and SDK"
LICENSE = "MIT"
inherit core-image qt-version
inherit core-image dey-image-sdk qt-version
inherit populate_sdk ${QT_POPULATE_SDK}
# Add staticdev packages to SDK
SDKIMAGE_FEATURES:append = " staticdev-pkgs"
SDK_NAME = "${PN}-${MACHINE}"
TOOLCHAIN_OUTPUTNAME = "${SDK_NAME}-${SDK_VERSION}"