Commit Graph

107 Commits

Author SHA1 Message Date
Arturo Buzarra fc1d3c5f75 trustfence: add TRUSTFENCE_ENCRYPT variable
Add a variable analogous to TRUSTFENCE_SIGN to enable/disable artifact
encryption. Deprecate TRUSTFENCE_DEK_PATH in favor of TRUSTFENCE_KEYS_PATH to
use a more generic name and avoid overloading it as an on/off flag. Add per-key
variables for encryption key filenames to avoid hardcoded names and allow
platform overrides.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2025-10-28 12:39:51 +01:00
Javier Viguera 13f8046d31 meta-digi: clean vfat images dependencies
vfat images need U-Boot scripts, which are always provided by the U-Boot
recipe, even for imx-boot-based machines. Replace the machine-dependent
BOOTLOADER_IMAGE_RECIPE with virtual/bootloader (which is provided by
u-boot recipes).

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

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2025-10-23 11:31:15 +02:00
Javier Viguera 3dfd6b77ef meta-digi: drop legacy SD card image support
Remove obsolete SD card image creation logic and related variables. We
will use WIC images for bootable SD cards.

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

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2025-10-23 11:31:15 +02:00
Javier Viguera 4786ff1c7f meta-digi-dey: add libgpuperfcnt version r50.4
This is the version supporting the i.MX95. This library is a dependence
of the gputop package.

As a requirement to allow building this library for the ccimx95-dvk,
update the fsl-eula-graphics bbclass with the latest changes in meta-imx.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2025-10-09 17:44:04 +02:00
Javier Viguera 35148654c7 u-boot: drop '-dtb' from signed/encrypted image filenames
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2025-07-01 18:21:13 +02:00
Arturo Buzarra f27c3364cb 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>
2025-03-26 08:53:12 +01:00
Arturo Buzarra d29d7149a7 stm-st-stm32mp: remove outdated recipes and unnecessary files
This commit removes all unnecessary files after the integration of the latest
ST BSP, based on the openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06 tag for
Yocto 5.0 (Scarthgap).

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

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2024-12-10 10:19:50 +01:00
Gabriel Valcazar 8d7680d1d6 global: remove IMAGE_NAME_SUFFIX from IMAGE_LINK_NAME
poky has reworked the format of image names, hardcoding the IMAGE_NAME_SUFFIX
(.rootfs) into IMAGE_LINK_NAME, the name used for image symlinks. This would
only be considered a cosmetic change if it weren't for the fact that we have
scripts and test infrastructure that relies on the old image name format, and
this change would force us to rework it all.

Remove the suffix from the link name to maintain our image name format, and
reflect this name in our custom image type scripts. Note that this removes
".rootfs" from several files, for example:

    * .rootfs.ext4.gz is now .ext4.gz
    * .rootfs.cpio.gz.u-boot.tf is now .cpio.gz.u-boot.tf
    * .rootfs.ubifs is now .ubifs
    * .rootfs.sdcard is now .sdcard

However, symlink names and non-rootfs files (.boot.vfat, .recovery.vfat...)
are unchanged.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2024-10-17 13:03:37 +02:00
Gabriel Valcazar a7f48d2574 meta-digi-arm: classes: sync with meta-imx
Sync with the scarthgap-6.6.23-2.0.0 branch of meta-imx, add a few changes to
fsl-eula2-unpack and add a new bbclass fsl-eula-recent

https://onedigi.atlassian.net/browse/DEL-9011
https://onedigi.atlassian.net/browse/DEL-9081

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2024-10-17 13:03:37 +02:00
Mike Engel 11426fcb5b recovery: add initramfs into FIT recovery image
This commit adds the initramfs into the FIT recovery
image. If the RAM disk image is included in the FIT
image we need to create a initramfs file that doesn't
include the u-boot header, because the FIT descriptor
contains all the necessary information to use the
initramfs file.

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

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2024-09-04 11:34:40 +02:00
Arturo Buzarra 0ad2b42f93 stm-st-stm32mp: tf-a: add support to ConnectCore MP25 DVK platform
Add support based on v2.8 version from STM release
openstlinux-6.1-yocto-mickledore-mp2-v23.12.06.

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

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2024-07-22 17:12:33 +02:00
Gabriel Valcazar 3fc0a30115 trustfence: rename variables related to FIT image signing
Different mechanisms are used to sign FIT images on the ccmp1 platforms and the
ccimx93, and we manage each mechanism via a different variable. The variable
names don't really reflect which platform they affect, which makes maintenance
harder.

Rename the variables so that it's easier to identify the platforms/vendors they
affect:

    * Replace TRUSTFENCE_FIT_IMG with TRUSTFENCE_SIGN_FIT_STM
    * Replace TRUSTFENCE_SIGN_FIT_ARTIFACT with TRUSTFENCE_SIGN_FIT_NXP

Don't rename TRUSTFENCE_FIT_IMG_SIGN_KEYNAME

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2024-03-19 13:26:47 +01:00
Javier Viguera e6b67b6bf8 meta-digi: trustfence: support signing a FIT boot artifact
And enable it for the ccimx93.

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

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2024-03-12 18:13:05 +01:00
Javier Viguera 3eed042d80 image_types_digi: restrict boot image artifacts using KERNEL_IMAGETYPE
When we use a fitImage kernel type, all the boot artifacts are inside the
FIT image, so there is no need to add them to the boot image additionally.

We were using TRUSTFENCE_FIT_IMG to do this filtering, which uses
a fitImage kernel type underneath. This commit uses KERNEL_IMAGETYPE
instead, as this way, we can use kernel FIT images out of Trustfence and
still prevent polluting the boot images with not-needed artifacts.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2024-03-04 10:44:58 +01:00
Gabriel Valcazar 604dcbc20f ccimx6ul/ccmp1: compress recovery UBIFS image using zlib to reduce its size
This compression method has a better compression ratio than the default (lzo),
but the (de)compression speed is slower, leading to slower read/write speeds.
However, the recovery partition only gets accessed in specific use cases such
as software updates and partition encryption, and it contains an initramfs. The
UBIFS will only be read at boot time to load its elements, but once the
initramfs is loaded in RAM, there are no more read/write operations to the
UBIFS during runtime, so the speed penalty is minimal.

Take advantage of the improved compression ratio to reduce the size of the
recovery image. On the ccimx6ul, the size is reduced by 248 KiB.

https://onedigi.atlassian.net/browse/DEL-8819
https://onedigi.atlassian.net/browse/DEL-8825

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2024-01-04 11:24:20 +01:00
Mike Engel df9b1cf329 ccmp1: add signed FIT image support
This commit adds signed FIT image support for the CCMP1
platforms when using Trustfence.

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

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2023-10-30 12:58:19 +01:00
Javier Viguera f1bdbe74c8 trustfence: decouple signing external artifacts
Some platforms do not support signing external artifacts (kernel, dtb,
etc.) yet, so we need to decouple the signing of the bootloader from the
signing of the external artifacts.

This commit generalizes the code, so instead of having platform exceptions
scattered along the recipes, we create a new variable used conditionally
to sign or not the external artifacts.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2023-09-25 14:23:40 +02:00
Hector Palacios fad45f44d7 image_types.bbclass: do not try to sign rootfs image for ccmp1x family
Signing of rootfs is not yet supported for ST platforms.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2023-08-10 09:04:56 +02:00
Hector Palacios 43a264284a image_types.bbclass: [cosmetic] tab indent
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2023-08-10 09:04:56 +02:00
Hector Palacios fa1c877758 trustfence: image_types: do not sign artifacts for STM platforms
For the moment, do not sign aditional artifacts, such as the ramdisk,
the kernel or the boot scripts for STM platforms.

In the specific case of the ramdisk, simply copy it over with the
expected filename extension.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2023-05-10 17:33:23 +02:00
Hector Palacios 9b165196bb global: create DIGI_SOM variable and reformulate DIGI_FAMILY variable
Certain platforms share a processor family but need to be differentiated
between them. DEY was using the variable DIGI_FAMILY as the SOM name
rather than the family. It becomes useful to have both (DIGI_SOM as the
more specific, and DIGI_FAMILY as the more generic).

This is the case, for example, of:

- ccmp1 (family)
  - ccmp15 (SOM)
  - ccmp13 (SOM)
- ccimx8m (family)
  - ccimx8mm (SOM)
  - ccimx8mn (SOM)

Both variables are used on the machine overrides.
Where DIGI_FAMILY was used, use now DIGI_SOM.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2023-05-10 17:33:23 +02:00
Javier Viguera 28f57c5fcd remove-pkg-postinst-ontarget: support other runtime packages
A recipe may generate different runtime packages, with names other than
PN. This commit allows removing the ontarget postinst script for those
other runtime package names. To do so, just define REMOVE_POSTINST_RPN
before including this class in the recipe.

The first user is in the following commit.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2023-05-04 10:22:06 +02:00
Javier Viguera adbb511484 meta-digi: remove True option to getVar
True is the default since long time ago, and thus not necessary. This
follows similar changes done in other layers.

Command used:

sed -e 's|\(d\.getVar \?\)( \?\([^,()]*\), \?True)|\1(\2)|g' -i $(git grep -E 'getVar ?\( ?([^,()]*), ?True\)' | cut -d':' -f1 | sort -u)

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2023-02-24 16:24:47 +01:00
Hector Palacios b4c65056fa dey-image-installer: remove boot-artifacts.bbclass
The class 'boot-artifacts.bbclass' was created to generate a
list of the bootable artifacts that must be copied from the
deploy dir to the installer ZIP file, so that the installer
has all the possible bootloader files to update any variant
of the hardware.
The class was somewhat over-engineered to produce the list,
specially for the cc8x, with the variants of SoC revision,
RAM size and width. With the arrival of ST family, it got
more complex, as the artifacts don't even come from U-Boot
recipe.

To remove complexity, this commit removes the bbclass and
moves the list to the platform config file.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2023-01-18 10:55:47 +01:00
Javier Viguera 19d940965d boot-artifacts: fix BOOTABLE_ARTIFACTS for NXP platforms
For platforms that do not define FIP_UBOOT_DTB, the
'd.getVar('FIP_UBOOT_DTB') gets evaluated to None, which is not equal to
"", and thus the code continues in the wrong "if" branch.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2023-01-10 10:31:14 +01:00
Hector Palacios c21dac88a6 uboot: ccmp1: remove deprecated FIP_UBOOT_CONFIG
This variable was removed from meta-st-stm32mp so we need to get rid of it
in meta-digi, too.

Reported-by: Javier Viguera <javier.viguera@digi.com>
Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://onedigi.atlassian.net/browse/DEL-8268
2023-01-02 17:24:59 +01:00
Mike Engel 9812149ca5 tfa: change arm-trusted-firmware build configuration to build only one artifact
This commit changes the arm-trusted-firmware build configuration to only build
one ATF artifact.
It will create an image that boot over USB and NAND.

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

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2022-11-17 11:36:06 +01:00
Gonzalo Ruiz 901c747730 meta-digi-arm: ccmp1: set dey-image-installer bootable-artifacts
For platforms with a FIP artifact, ignore U-Boot artifacts and instead
add to the installer zip file the FIP artifact and the ATF artifacts.

Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2022-11-07 14:41:27 +01:00
Mike Engel 3e84b9007a conf: add new bootloader offset variable to be used on eMMC and SD card images.
This commit adds a new bootloader eMMC and SD card installation offset
variable.

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2022-09-12 14:26:13 +02:00
Mike Engel c3b4cfa5d1 swupdate: add u-boot image into SWU update image
Signed-off-by: Mike Engel <Mike.Engel@digi.com>

https://onedigi.atlassian.net/browse/DEL-7853
2022-09-12 14:26:13 +02:00
Javier Viguera 5c0a8c0040 meta-digi-arm: update/refresh fsl-eula classes from meta-imx
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2022-07-12 18:03:43 +02:00
Javier Viguera 065cf3e9c4 kirkstone migration: general update to the new override syntax
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2022-06-20 11:39:57 +02:00
Arturo Buzarra 8fac0cc46e image_types: fix do_image_boot_ubifs() for ConnectCore MP15 platform
This commit reverts partially the commit 548b8729 ("image_types: add support to
create CCMP15 ubifs images") to fix the boot partition generation.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-05-10 11:29:12 +02:00
Mike Engel 548b8729aa image_types: add support to create CCMP15 ubifs images
Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2022-05-04 14:01:05 +02:00
Gabriel Valcazar 54ddb775c4 trustfence-sign-artifact.sh: remove CONFIG_SIGN_MODE as a mandatory parameter
The sign mode needed for each platform is invariable, and since the platform
is already a mandatory parameter for the script, we can store this information
implicitly. Reflect this change in every recipe where the script is used, but
keep the variable at the Yocto level since it's still needed in several places.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2022-03-22 12:47:32 +01:00
Gabriel Valcazar 8db6ddabd7 hardknott: image_types_digi: shorten VFAT label name
It seems like the version of mkfs.vfat used in Yocto 3.3 has a label name
length limit of 11 characters. All of the labels for our current platforms
surpassed this limit ("Boot ccimxX" alone already occupies 11 characters), so
replace the machine name with "DEY"

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2022-01-05 11:09:46 +01:00
Gabriel Valcazar 8d51d35236 hardknott: fsl-eula-unpack: sync with meta-imx hardknott-5.10.72-2.2.0 branch
This .bbclass is outdated and no longer used in any of NXP's recipes, so remove
it

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2022-01-05 11:09:46 +01:00
Ariel D'Alessandro 68ec34e108 image-type_digi.bbclass: Fix typo in comment
Minor change fixing a typo.

Signed-off-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
(cherry picked from commit 0305b8cb855e347f5147d1b7a1afabffdcf8777b)
2022-01-05 10:31:49 +01:00
Mike Engel 2145614724 images: add function to sign read only rootfs when Trustfence is enabled
Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2021-11-11 13:37:30 +01:00
Javier Viguera c89a66480b meta-digi: remove postinst on target when using read-only-rootfs image feature
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2021-11-05 11:18:16 +01:00
Gabriel Valcazar bbdf745661 dey-image-qt: compress .ext4 images by default
Since these images are highly compressable, this greatly reduces the amount of
space taken up by build artifacts.

Modify the code used to generate the .sdcard and .installer.zip files so that
they contain the decompressed .ext4 image.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-06-29 12:48:26 +02:00
Gonzalo Ruiz 7143ea9534 trustfence: use correct u-boot image for sdcard
When the Bootloader is an 'u-boot' select the correct u-boot
signed image to compose the sdcard artifact.

Signed u-boot artifacts start with 'u-boot-dtb-signed-'.

Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2020-06-15 20:06:00 +02:00
Gonzalo Ruiz e8f721a0b2 trustfence: use correct imx-boot image for sdcard
When the Bootloader is an 'imx-boot', select the correct imx-boot
signed image to compose the sdcard artifact.

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

Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2020-06-15 20:05:40 +02:00
Gonzalo Ruiz ea2ffcfee8 trustfence: introduce AHAB container creation into script
https://jira.digi.com/browse/DEL-7024

Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2020-06-04 19:01:34 +02:00
Gonzalo Ruiz 9b4a03c14c trustfence: [cosmetic] rename script to trustfence-sign-artifact
The signing script is used for signing multiple artifacts, not just the
kernel, so rename it for a broader use.

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

Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2020-06-04 19:01:34 +02:00
Arturo Buzarra da4145dd13 imx-mkimage: move recipe to native and include its binaries in the SDK
imx-mkimage is a host recipe to provide the mkimage_imx8 binaries, required
for the trustfence support with platform based on AHAB (ccimx8x). Since
these binaries are required to the sign process we need to export it in the
SDK to allow the standalone sign mode, and with that we can simplify the
mechanism to share these binaries with another recipes (u-boot, linux).

Also the do_deploy() from imx-mkimage recipe was removed to avoid overriding
the implementation from the native class and allow populating the mkimage
binaries.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2020-06-01 08:56:20 +02:00
Gabriel Valcazar aa68675f45 ccimx8x-sbc-pro: add support for the C0 SOC in the fw installation scripts
The scripts need to know the SOC's revision to be able to select the correct
imx-boot image. Modify the boot-artifacts bbclass so the renamed imx-boot files
are included in the installation .zip.

Also, bypass the SECO fw check in the uSD script so it can install future
versions that aren't recognized by U-Boot's SECO fw checking logic. The UUU
script doesn't require this bypass, since it doesn't use the Digi update
command to flash the bootloader.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2020-05-28 18:03:09 +02:00
Mike Engel 826ca9b63d trustfence: Export variables that are needed by sign tools.
This commit exports variables that are needed by the sign tools to
select the target HAB.

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2020-02-12 18:50:19 +01:00
Hector Palacios 8320168821 trustfence: homogenize SIGN_MODE variables
* prefix TRUSTFENCE_ to variable SIGN_MODE for DEY
* prefix CONFIG_ to variable SIGN_MODE for script

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2020-02-12 18:50:19 +01:00
Arturo Buzarra bb36013e7a dey-image-installer: fix BOOTABLE_ARTIFACTS for ConnectCore 8M Nano platform
The bootable artifacts that must go inside the installer ZIP image, are defined
in the variable BOOTABLE_ARTIFACTS. For platforms without RAM_CONFIGS, these
artifacts are obtained from the UBOOT_CONFIG variable.

This commit fixes the final artifact name added to the BOOTABLE_ARTIFACTS that
for some platform is not strictly the same that the UBOOT_CONFIG name.
For example for the U-Boot configuration "ccimx8mn_dvk", corresponds the
bootable artifact "ccimx8mn-dvk"

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

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2020-02-10 14:22:52 +01:00