Commit Graph

16 Commits

Author SHA1 Message Date
Arturo Buzarra c5dc142d65 libubootenv: add support for environment encryption on CCMP2
This commit adds support for environment encryption/decryption of the
u-boot environment on the CCMP2 platform in Linux.

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

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
(cherry picked from commit 9b99c0b073)
2026-03-30 13:59:21 +02:00
Javier Viguera a02d48dc78 libubootenv: adjust postinstall script and fix inherit usage
* Replace the hard-coded '/etc' with ${sysconfdir}
* Extend the mmcblk check to prevent updating the environment configuration
  when booting from the EMMC (even though the kernel command line root
  passed is in the form of /dev/mmcblk).
* Switch the conditional inherit to inherit_defer as it depends on
  IMAGE_FEATURES to avoid parse-time ordering issues.

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

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2025-10-22 12:03:08 +02:00
Gonzalo Ruiz 0b6b220804 libubootenv: ccmp2: define same 'fw_env.config' as in ccimx9
Both CC93 and CCMP2 store the environment at the end of BOOT1 partition
and the redundant environment at the end of BOOT2 partition. Reuse the
'fw_env.config' file defined for CC93 for both platforms, and also include
CC91 in the process.

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

Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2024-07-24 11:58:41 +02:00
Hector Palacios 22238772ee Merge tag 'dey-4.0-r6.1' into dey-4.0/master
Digi Embedded Yocto 4.0-r6.1

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2024-07-19 13:35:27 +02:00
Mike Engel d11b291f9a meta-digi: add new CCMX91 platform into DEY
This commits adds the CCMX91 platform to the DEY
build system. Furthermore, it creates generic ccimx9
support to be used for the CCiMX91 and CCiMX93
platform.

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

Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2024-07-19 07:32:00 +02:00
Isaac Hermida 0c642ed7ec Update Digi Copyright header
Standarize the Copyright header according to company policy.

Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
2024-07-15 09:28:58 +02:00
Hector Palacios f55c084064 libubootenv: flush changes to fw_env.config on post inst script
On devices with NAND as storage media, a post install script
modifies the fw_env.config file basing on the NAND geometry.
This only happens once after deployment, typically on production
environments. If the power is removed soon after the post install
script runs (which is a normal procedure on manufacturing
environments), there are chances that pending file system
operations have not been flushed, which may occasionally lead
to the fw_env.config file end up empty on the next reboot.

This commit adds a sync at the end of the post-install script
to guarantee the changes are written to the file system.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://onedigi.atlassian.net/browse/DEL-9059
2024-06-26 11:25:23 +02:00
Javier Viguera 720c5f7218 libubootenv: rework patchset with Digi-specific functionality
* Move Digi code out of the upstream files to minimize conflicts in
  version migrations.
* Remove all the TEE client copied code and use the libteeclient library.
* Some fixes in the Optee-based environment encryption
* Some simplifications in CAAM-based environment encryption.

https://onedigi.atlassian.net/browse/DUB-1079

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2024-05-28 17:57:01 +02:00
Mike Engel b1d20d686e libubootenv: add support for environment encryption on CCMP1
This commit adds support for environment encryption/decryption of the
u-boot environment on the CCMP1 platform in Linux.

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2023-07-28 13:29:51 +02:00
Francisco Gil 8fa29e7698 libubootenv: readonly: add hardcoded configuration for readonly systems
We can't run a post installation script in a readonly file system.

We need to provide a configuration file beforehand.

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

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2023-06-06 13:07:37 +02:00
Hector Palacios 0e61017da8 libubootenv: add fall-back function to read HWID from nvmem
The HWID is populated on the device tree by the boot loader.
This can be used as a key modifier when encrypting the U-Boot
environment. Some old U-Boot versions however, did not populate
the HWID on the device tree. When updating firmware from an
old version to a new one, the library may not be able to read
the HWID from the DT and then be unable to unencrypt the
environment.

This patch implements a fall-back function to read the HWID
directly from the nvmem node (sysfs). Implementation has been
done for ccimx6 family only, where this case of old U-Boot
can happen.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://onedigi.atlassian.net/browse/DEL-8444
(cherry picked from commit 222a91f213)
2023-04-19 09:39:43 +02:00
Arturo Buzarra d4544a7f43 libubootenv: adapt recipe to platforms with bootloader environment in UBI volume
This commit adds support to read bootloader environment from a UBI volume.

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

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-10-20 09:32:24 +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
Hector Palacios 7cd57a40e3 libubootenv: adapt recipe for read-only-rootfs
The config file /etc/fw_env.config is generated dynamically basing on
the partition table and, in the case of NAND-based SOMs, on the NAND
geometry. This is done on a postinst script that modifies the file on the
first boot of the target. Since this is not allowed on read-only-rootfs,
this commit adds a default fw_env.config file to use instead when
read-only-rootfs is enabled.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://onedigi.atlassian.net/browse/DEL-7708
2021-11-05 11:18:16 +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 887fcae052 gatesgarth migration: Add support for libubootenv
This is a replacement for u-boot-fw-utils. Adapt the u-boot-fw-utils patches
to this new library and include the same logic as the u-boot-fw-utils recipe
(generate and install the U-Boot environment configuration file in the rootfs)

For now, remove the u-boot-default-env dependency, since the package doesn't
exist in zeus.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-05-05 19:18:11 +02:00