From 74b2a65a19e1fed19ee615a422c57571feee5f2e Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Wed, 27 Nov 2024 13:01:41 +0100 Subject: [PATCH] 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 --- meta-digi-dey/classes/dey-image-sdk.bbclass | 27 +++++++++++++++++++ meta-digi-dey/classes/dey-image.bbclass | 22 ++------------- .../images/core-image-base.bbappend | 3 --- .../images/dey-image-graphical.inc | 3 --- .../recipes-core/meta/dey-toolchain.bb | 5 +--- 5 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 meta-digi-dey/classes/dey-image-sdk.bbclass diff --git a/meta-digi-dey/classes/dey-image-sdk.bbclass b/meta-digi-dey/classes/dey-image-sdk.bbclass new file mode 100644 index 000000000..619eb7a61 --- /dev/null +++ b/meta-digi-dey/classes/dey-image-sdk.bbclass @@ -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" diff --git a/meta-digi-dey/classes/dey-image.bbclass b/meta-digi-dey/classes/dey-image.bbclass index d18ad95c1..1b44ddb98 100644 --- a/meta-digi-dey/classes/dey-image.bbclass +++ b/meta-digi-dey/classes/dey-image.bbclass @@ -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" diff --git a/meta-digi-dey/recipes-core/images/core-image-base.bbappend b/meta-digi-dey/recipes-core/images/core-image-base.bbappend index f34365cf0..cf4960ebd 100644 --- a/meta-digi-dey/recipes-core/images/core-image-base.bbappend +++ b/meta-digi-dey/recipes-core/images/core-image-base.bbappend @@ -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 diff --git a/meta-digi-dey/recipes-core/images/dey-image-graphical.inc b/meta-digi-dey/recipes-core/images/dey-image-graphical.inc index 8df53d800..5286b1645 100644 --- a/meta-digi-dey/recipes-core/images/dey-image-graphical.inc +++ b/meta-digi-dey/recipes-core/images/dey-image-graphical.inc @@ -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 diff --git a/meta-digi-dey/recipes-core/meta/dey-toolchain.bb b/meta-digi-dey/recipes-core/meta/dey-toolchain.bb index 153b9efe2..10c9cccc8 100644 --- a/meta-digi-dey/recipes-core/meta/dey-toolchain.bb +++ b/meta-digi-dey/recipes-core/meta/dey-toolchain.bb @@ -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}"