Commit Graph

1525 Commits

Author SHA1 Message Date
Hector Palacios 53759cd29c recovery: check variable returned by uboot_getenv() is not NULL
The use of this function, which is a wrapper over libuboot_get_env(),
requires checking if the returned string is NULL.
Manipulations of such string without checking whether it's NULL may lead
to segfault errors.
This was seen during firmware update on a device that didn't have the
'dualboot' variable set.

Reported-by: Chandrababu Pigilam <chandrababu.pigilam@digi.com>
Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://onedigi.atlassian.net/browse/DEL-7645
(cherry picked from commit 8a4484bbd6)
2021-08-27 12:49:16 +02:00
Gabriel Valcazar feec2aa4f7 glib-2.0: backport 2.65 patch to prevent NetworkManager segmentation faults
NetworkManager's main library went through a major overhaul in v1.22, changing
the way it interacts with glib among other things. When using a NetworkManager
version equal or newer than v1.22 along with a glib version between 2.63.3 and
2.65, a race condition can happen, randomly causing segmentation faults.

Since Yocto 3.2 uses NetworkManager 1.22.14 and glib 2.64.5, the race condition
is reproducible, but it can be fixed with the patch introduced in this commit.
The patch in question is commit e4a690f5dd959e74b2d6054826f61509892c8aa7 in the
glib git repo.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-08-16 15:26:40 +02:00
Mike Engel c5b57d3e0c ml-security: update to new version
This commit updates the ML security package to
hardknott-5.10.35-2.0.0 release by NXP.

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2021-08-11 10:39:26 +02:00
Mike Engel 37832e8b3b glibc: upgrade to version 2.33 for eIQ support
Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2021-08-11 10:39:26 +02:00
Mike Engel 11b1aee7e7 opencv: update to latest NXP eIQ version
This commit updates the eIQ support to the hardknott-5.10.35-2.0.0
release by NXP.

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2021-08-11 10:39:25 +02:00
Mike Engel e7921dfd93 distro: set GLIBC preferred version to 2.32
This commit sets the GLIBC version to 2.32. The newest
eIQ packages require a newer glibc, but since said packages
are optional, make sure to use the gatesgarth glibc version
by default.

Signed-off-by: Mike Engel <Mike.Engel@digi.com>

https://onedigi.atlassian.net/browse/DEL-7625
2021-08-11 10:37:55 +02:00
Mike Engel 96b47a48d2 meta-digi-dey: bump distro version to 3.2-r2
Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2021-07-28 17:19:45 +02:00
Mike Engel c47377df22 recovery-utils: add check into recover library if dualboot is enabled
This commit add a verification into the recovery library to avoid
that it is executed when in dualboot mode.

Signed-off-by: Mike Engel <Mike.Engel@digi.com>

https://onedigi.atlassian.net/browse/DEL-7580
(cherry picked from commit 30aa4a7444)
2021-07-28 17:19:44 +02:00
Mike Engel 216d06e723 Merge tag 'dey-3.2-r1.2' into dey-3.2/master
Digi Embedded Yocto 3.2-r1.2

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2021-07-28 17:19:42 +02:00
Gonzalo Ruiz aa92d2d13a meta-digi: update revisions for dey-3.2-r1.2
Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2021-07-07 12:56:23 +02:00
Mike Engel afb57ef521 cloudconnector: move swupdate dependencies into meta-digi-dualboot layer
Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2021-07-06 14:00:02 +02:00
Gonzalo Ruiz 95c8629cba meta-digi: revert revisions to AUTOREV
Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2021-07-02 14:42:26 +02:00
Gonzalo Ruiz d98487a309 meta-digi: update revisions for dey-3.2-r1.1
Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2021-07-02 14:42:09 +02:00
Arturo Buzarra f3791f3bc3 meta-digi: Add Edge TPU Person segmentation example
https://onedigi.atlassian.net/browse/DEL-7603

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2021-07-01 14:49:54 +02:00
Mike Engel e405acfd7d cloudconnector: add swupdate dependencies to build on-the-fly support
Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2021-07-01 13:48:11 +02:00
Gabriel Valcazar a707e98775 swu-images: include compressed .ext4.gz rootfs image in SWU package
swupdate has the necessary logic to handle compressed images, so take advantage
of this to save space and reduce update package transfer times.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-06-29 12:48:26 +02: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
Arturo Buzarra 6316ec9cc5 meta-digi: Add Google Coral support recipes
This commit adds the required libraries and packages to exercise the Google
Coral devices with Digi Embedded Yocto.

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

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2021-06-28 14:52:21 +02:00
Gonzalo Ruiz 3e75c1ed34 recovery-initramfs: launch mdev as daemon
'mdev -s' run on ramfs initialization is able to mount external media already
detected but fails to automatically mount any media detected afterwards.
Running it as a daemon first it will also be able to mount any media detected
after 'mdev -s' is run.

Use argument '-d' to first run mdev as daemon in background.

Move 2 seconds delay to after mdev has been initialized to give external
hardware all the time possible to be successfully detected and mounted.

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

Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2021-06-24 10:46:19 +02:00
Gabriel Valcazar 2a72f64c40 dey.conf: use the latest available versions of WebKit recipes
Otherwise, Yocto will use the recipes in meta-webkit, which are slightly older.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-06-23 12:36:44 +02:00
Gabriel Valcazar 2c7f14ba98 webkit: stop hardcoding versions in .bbappend files
By default, we only support the latest versions of the webkit packages anyway,
so use a wildcard so we don't have to update the recipes every time a new
version is available.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-06-23 12:36:44 +02:00
Gabriel Valcazar 4219e6c36c webkit: upgrade packages to include i.MX performance improvements
Igalia has included performance improvements for i.MX platforms in the latest
versions of different packages related to webkit. Even though the recipes for
these versions are not yet available in meta-webkit, we can add our own to
meta-digi to take advantage of these improvements.

Update the cog patches so they apply cleanly over v0.9.90.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-06-23 12:36:44 +02:00
Francisco Gil Martinez 8722d0c4e6 ccimx6ul: gstreamer: add missing video capture plugins
https://onedigi.atlassian.net/browse/DEL-7596

Signed-off-by: Francisco Gil Martinez <francisco.gilmartinez@digi.com>
2021-06-22 12:54:10 +02:00
Mike Engel 5c77cbb502 recovery: add swupdate parameter to select image description.
This commit adds some swupdate parameter to select the sw-description
configuration depending on the used platform.

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2021-06-08 16:25:04 +02:00
Mike Engel 51babaa55b swu-images: create a common sw-description file.
Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2021-06-08 16:25:04 +02:00
Hector Palacios f2286f3d26 meta-digi: branch to dey-3.2/maint
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2021-06-07 12:56:58 +02:00
Gabriel Valcazar 4e2fc007a1 swupdate: call cml1_do_configure() at least once while configuring
Without this call, swupdate will be built with a default configuration which
is incompatible with our package format. Even though this function is already
called in the original recipe, it was done in the package's "git" directory.
Make sure the function is called at least once so that our defconfig is used in
the build.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-06-07 09:03:05 +02:00
Hector Palacios 098bce03f9 packagegroup-dey-wireless: fix wrong append method on RDEPENDS
Commit 28d9e025ea used += to append
a dependency to RDEPENDS but this was not working fine and was removing
previous dependencies.
Use instead _append override.

Reported-by: Francisco Gil Martinez <francisco.gilmartinez@digi.com>
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2021-06-03 18:34:50 +02:00
Gabriel Valcazar 11558352f0 swu-images: add "installed-directly" flag to sw-description
Otherwise, swupdate will treat the update process like it's an OTA one and it
will try to store the package contents in /tmp, which won't fit.

swupdate commit 8b70ae5796e75c2ff856e8c46b3a3c09cb8fcccd states that all local
SWU packages should include this flag, since the old implementation had this
information implicitly.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-06-02 15:53:46 +02:00
Gabriel Valcazar d5c696fd5b recovery-utils: only print open device warning when encrypting partitions
Technically, partition unencryption is safe to do in open devices, although it
implies that at least one partition has already been encrypted. If we aren't
going to encrypt any partitions, there's no need to print the warning.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-06-02 14:45:00 +02:00
Gabriel Valcazar 8c19cda181 recovery: change way of deciding if platform uses NAND or eMMC
Instead of checking for the existence of /proc/mtd, which might lead to false
positives, check the "root" parameter in /proc/cmdline. Assume eMMC in case of
any error.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-06-02 14:45:00 +02:00
Mike Engel d126006ce3 swupdate: change .config path to build folder
Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2021-06-01 22:11:54 +02:00
Mike Engel 9047b41b09 swupdate: update defconfig to latest version
This commit updates the defconfig that has been
synchronized with the version 2021.04.

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2021-06-01 22:11:54 +02:00
Mike Engel 1c81e377ea swupdate: update recipe to build version 2021.04
Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2021-06-01 22:11:54 +02:00
Arturo Buzarra 8227a49140 systemd: reduce verbosity of sysv-generator
There are some init packages from the poky layer that remain using only a SysV
init script. Systemd converts these init scripts to systemd service format on
boot and shows an ugly warning for each one. To avoid flooding the console with
this kind of messages, we reduce the verbosity of these messages.

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

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2021-06-01 16:26:01 +02:00
Gabriel Valcazar 94551f0c4d recovery-initramfs: correctly set environment variables containing spaces
In the libubootenv implementation of fw_setenv, multiple variables can be set
in one call. When setting a variable with a space-separated list, the app
interprets the list as new variable/value tuples, for example:

    fw_setenv myvar value1 value2 value3

Results in:

    myvar=value1
    value2=value3

This was causing the encrypted eMMC partition mechanism to break, because the
list of encrypted partitions is stored as a space-separated list in an
environment variable. Avoid this by enclosing the variable argument of
set_uboot_var() with double quotes.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-06-01 09:47:39 +02:00
Gabriel Valcazar cf7a87f6c3 wpewebkit: adapt .bbappend to Yocto 3.2
Update version from 2.28.1 to 2.32.0, remove patch that is already included in
the source tarball and stop removing the qtwpe PACKAGECONFIG, since it's no
longer being included by default.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-05-29 21:39:39 +02:00
Gabriel Valcazar 00e1167f7c cog: adapt .bbappend to Yocto 3.2
Update the version from 0.7.1 to 0.8.0 and remove two patches that are already
being applied in meta-webkit.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-05-29 21:39:39 +02:00
Gabriel Valcazar 737230a2f4 recovery-initramfs: automatically set an encryption key if needed
Before using the encrypted partition functionality, users have to manually
install the encryption key in the system. Failing to install said key will
result in errors later on.

Even though the installation isn't a difficult operation from a user's point of
view, the recovery script has the necessary logic to detect cases where a
partition is going to be encrypted with no key installed. Automatically
generate a key in these cases to avoid undesired behavior and to improve the
overall user experience.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-05-27 12:10:44 +02:00
Gabriel Valcazar 158a9e1779 trustfence-tool: update to v2.5
This version adds new functionality to check if an encryption key is installed
as well as a fix for an issue that happens when encrypting partitions with long
names (over 12 characters).

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-05-27 12:10:44 +02:00
Gabriel Valcazar 32984efc90 recovery-utils: ask for confirmation when changing the encryption key
If we trigger a key change while there are partitions that are encrypted,
print a warning and ask for confirmation so users know that the operation will
erase the contents of said partitions.

Like in the partition (un)encryption mechanism, add the possibility to skip
both the warning message and the confirmation prompt.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-05-27 12:10:44 +02:00
Gabriel Valcazar e2cd4f6d9a trustfence-initramfs: remove support for platforms with NAND internal storage
This initramfs only makes sense in platforms with an eMMC as the internal
storage, due to how the partition encryption support is implemented. In
plaatforms that use NAND instead, ths initramfs offers no functionality and
increases the recovery image size, so remove it.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-05-27 12:10:44 +02:00
Gabriel Valcazar a432a6353a recovery-initramfs: make rootfs encryption status changeable via updates only
If we allow users to manually change the encryption status of the rootfs
partition, we run the risk of wiping it without flashing a proper replacement
image. Because of this, rootfs encryption status should be determined
automatically using information from the update package.

Have the recovery script parse the update package's description to determine
whether to encrypt the rootfs or not.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-05-27 12:10:43 +02:00
Gabriel Valcazar 953a376d97 recovery-utils: don't allow manual (un)encryption of rootfs partition
This partition isn't blacklisted, but it should only be (un)encrypted when
providing an update package. Make it so that manual encryption status changes
for this partition aren't possible from the recovery library.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-05-27 12:10:43 +02:00
Gabriel Valcazar bf8c73322b swu: adapt swupdate packages to reworked partition encryption mechanism
Since the recovery script checks the update package before installing it, use
the package's description to indicate if the package is meant to encrypt the
rootfs or not. Also, remove the pre-install script from the ccimx6ul packages,
since the logic in the script to remove the encryption flag from the rootfs is
now in the recovery script.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-05-27 12:10:43 +02:00
Gabriel Valcazar 82a76a7106 trustfence: split filesystem encryption support into two variables
Previously, TRUSTFENCE_INITRAMFS_IMAGE was the only variable used to configure
rootfs encryption. Now that any partition can be encrypted and the rootfs
encryption still needs to be handled differently, use two variables instead.

    * TRUSTFENCE_ENCRYPT_PARTITIONS to control partition encryption in general
    * TRUSTFENCE_ENCRYPT_ROOTFS to control rootfs encryption

As with most trustfence functionality, enable both by default. Leave
TRUSTFENCE_INITRAMFS_IMAGE as an internal variable only.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-05-27 12:10:43 +02:00
Gabriel Valcazar 402f9775b9 recovery-initramfs: manage update partition correctly with partition encryption
Since the update partition might be involved during a software update, we need
to make sure that its contents are accesible and safe when using the partition
encryption feature at the same time.

Mount and unmount the partition correctly if it's encrypted and cancel any
operations that will result in the deletion of the update package.

https://onedigi.atlassian.net/browse/DEL-7174
https://onedigi.atlassian.net/browse/DEL-7422

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-05-27 12:10:43 +02:00
Gabriel Valcazar d54510766a recovery-utils: add partition encryption support
Add a new function to the recovery library to be able to encrypt/unencrypt any
partition on the internal storage media. Since it's a destructive operation,
add a warning message and a confirmation prompt that can be skipped if needed.

Reflect this new functionality in the recovery-reboot app. Change the logic so
that an encryption key can be set even if there's no update package, because
now it's possible to encrypt other partitions while leaving the rootfs intact.
Also change the logic so that the app doesn't reboot into recovery mode if
there's no recovery command set.

Implement the same blacklist as the one in the recovery script.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-05-27 12:10:43 +02:00
Gabriel Valcazar deaeef6c6d swupdate: refactor 'cryptroot' to 'cryptrootfs'
The partition encryption system now uses dynamically generated names for the
decrypted block devices, which are based on the partition name. Reflect this
change in places where the encrypted rootfs is referenced.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-05-27 12:10:43 +02:00
Gabriel Valcazar 59e652ec9b trustfence: extend partition encryption support to any partition
Modify the recovery and trustfence initramfs scripts to be able to encrypt any
partition on the internal storage media, not just the rootfs.

To implement this functionality, add a new recovery command called
'encrypt_partitions'. When used, this command must contain a comma-separated
list of the partitions that are to be encrypted by the end of the recovery
process, including partitions that were already encrypted beforehand. Any
partition that isn't in the list will be unencrypted. If the command is absent,
no changes will be made, but it's possible to pass an empty command to
unencrypt all partitions.

Include a blacklist to avoid encrypting partitions that shouldn't be encrypted,
such as partitions that need to be accessed by the ROM code/U-Boot or
partitions that contain encryption keys.

While at it, remove unnecessary "get_kernel_version" function from the script.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2021-05-27 12:10:43 +02:00