meta-digi-arm: Add custom sign-stm32mp bbclass to fix build issue

This commit imports the sign-stm32mp bbclass from the meta-st-stm32mp layer to
allow customization. The main customization ensures that the search_path()
function does not raise a build exception if the signing tool or keys are not
present in the PATH before starting the build process.

In our case, we do not need to manually install the tools or generate the keys
beforehand, as this is automatically handled by Yocto in our DEY distribution.

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

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
Arturo Buzarra 2025-03-14 10:33:09 +01:00
parent 9106a8c382
commit f27c3364cb
5 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,24 @@
# Copyright (C) 2025, Digi International Inc.
# Overwrite search_path() function in original 'sign-stm2mp.bbclass'
def search_path(file_search, d, err_not_found=False):
"""
Search for <file_search> in BBPATH and return its absolute path.
If the file is not found:
- Returns the original file string if err_not_found is False.
- Otherwise, it triggers a fatal error.
"""
search_path = d.getVar("BBPATH").split(":")
for p in search_path:
file_path = os.path.join(p, file_search)
if os.path.isfile(file_path):
return file_path
# If file is not found
bbpaths = d.getVar('BBPATH').replace(':','\n\t')
bb.debug(1, '\n[sign-stm32mp-digi] Not able to find "%s" path from current BBPATH' % (file_search))
if not err_not_found:
return file_search # Return original file string instead of failing
bb.fatal('\n[sign-stm32mp-digi] Not able to find "%s" path from current BBPATH var:\n\t%s.' % (file_search, bbpaths))

View File

@ -48,6 +48,7 @@ BBMASK += " \
meta-st-stm32mp/recipes-core/busybox/busybox_%.bbappend \
meta-st-stm32mp/recipes-core/systemd/systemd-conf_%.bbappend \
meta-st-stm32mp/recipes-kernel/linux/linux-stm32mp_5.15.bb \
meta-st-stm32mp/recipes-bsp/u-boot/u-boot-stm32mp_2023.10.bb \
"
# Tweak x-linux-ai dependencies to use ST's machine learning packages

View File

@ -2,6 +2,9 @@
# Copyright (C) 2024,2025, Digi International Inc.
#
# Inherit custom DIGI sign class to skip signing tool and key parsing restrictions
inherit sign-stm32mp-digi
# Add optee-usb FIP configuration
STM32MP_DEVICETREE_USB = " ${@' '.join('%s' % dt_file for dt_file in list(dict.fromkeys((d.getVar('STM32MP_DT_FILES_USB') or '').split())))} "
FIP_CONFIG[optee-usb] ?= "optee,${STM32MP_DEVICETREE_USB},default:optee,usb"

View File

@ -2,6 +2,9 @@
# Copyright (C) 2022-2025, Digi International Inc.
#
# Inherit custom DIGI sign class to skip signing tool and key parsing restrictions
inherit sign-stm32mp-digi
# Select internal or Github TF-A repo
TFA_URI_STASH = "${DIGI_MTK_GIT}/emp/arm-trusted-firmware.git;protocol=ssh"
TFA_URI_GITHUB = "${DIGI_GITHUB_GIT}/arm-trusted-firmware.git;protocol=https"

View File

@ -2,6 +2,9 @@
# Copyright (C) 2022-2025, Digi International Inc.
#
# Inherit custom DIGI sign class to skip signing tool and key parsing restrictions
inherit sign-stm32mp-digi
# Select internal or Github OPTEE repo
OPTEE_URI_STASH = "${DIGI_MTK_GIT}/emp/optee_os.git;protocol=ssh"
OPTEE_URI_GITHUB = "${DIGI_GITHUB_GIT}/optee_os.git;protocol=https"