Commit Graph

3945 Commits

Author SHA1 Message Date
Javier Viguera 8df1b0c246 swupdate: do not run swupdate daemon on non-dualboot devices
On recovery based devices, the swupdate process is executed in the
recovery, so there is no need to have the swupdate daemon running on the
rootfs.

Add a on-target post installation script to disable the swupdate
bootscript on the normal rootfs. This has the side effect of failing in
the recovery initramfs because the initramfs does not have a complete
SysV init system. For that case add a rootfs postprocess function to
delete the postinst script.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2022-11-23 10:23:25 +01:00
Arturo Buzarra 2d34c34619 README: Update dey-4.0-r1 changelog
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-22 17:08:20 +01:00
Gonzalo Ruiz d9563ea54e u-boot-dey: add config to select whether to build the scripts
Add configuration 'BUILD_UBOOT_SCRIPTS' to select whether to build the
boot and install scripts or not, and set it to 'true' by default.

This allows removing the scripts on upper Yocto layers.

Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2022-11-22 15:38:49 +01:00
Gonzalo Ruiz b8f8174579 ccmp1: define DIGI_FAMILY variable
DIGI_FAMILY is "ccmp1" and is common to both CCMP15 and CCMP13.

Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2022-11-22 14:09:30 +01:00
Francisco Gil f308ccfa66 update-firmware: rename the firmware-update from recovery-utils
There is a problem when building the SDK because two binaries
have the same name (update-firmware) and makes the compilation
to fail.

Change the name to update-firmware.recovery and create a wrapper
over the update-firmware to check if the system is not dual boot
to call it.

Rework the code to make it more reliable.

Remove the umount of the alternative linux partition, now it is
not needed because only the active linux partition is mounted now.

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2022-11-22 11:42:39 +01:00
Francisco Gil cae4c1f1dc recovery: change the name of the file descriptor to check
Now in the file descriptor we have three different names:
platform, primary and secondary.
Also a link from 'platform' to 'single' to keep backward
compatibility.

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2022-11-22 11:42:39 +01:00
Francisco Gil 0328295ea8 dualboot: run the script only in dualboot systems
Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2022-11-22 11:42:39 +01:00
Francisco Gil 6ffbbb390a dualboot: get rid of DUALBOOT_ENABLED configuration
All the dualboot logic will be checked in run time.
To do this:
* Include the altboot.src by default in all the images
* Create a post installation script to change the
firmware_download_path in the cloud connector
* Unify the swupdate file descriptor for dual and single boot

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2022-11-22 11:42:39 +01:00
Arturo Buzarra 9ad980e0d7 ccmp1: remove unused build artifacts
This commit removes duplicated and unused build artifacts for the ccmp1
platforms. Also fixes a build warning related with flashlayout config file.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-22 09:01:45 +01:00
Arturo Buzarra 0efbb07107 meta-digi: branch to dey-4.0/maint
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-21 17:44:48 +01:00
Tatiana Leon 063a946e7c cc6ul: cloudconnector: use 'remotemanager.digi.com' not to use certificates
This commit modifies the cloud connector configuration to use
'remotemanager.digi.com' URL since it does not use certificates for the
connection.
'edp12.devicecloud.com' only allows connections with certificates.
The certificate is downloaded during the first device connection to DRM and
stored in '/etc/ssl/certs' directory inside the 'rootfs' partition.
Following connections must use this certificate.

After a firmware update 'rootfs' partition is re-programmed (standard boot)
or changed to use the corresponding partition of the other block (dual boot). In
any case the certificate downloaded is not available anymore, so the device is
not able to reconnect.

Currently there is no a 'immutable' partition to store the certificate, that is,
a place where the certificate is not removed during a firmware update and can
be used by the cloud connector (similar to the 'data' partition on a ccmp1)

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
2022-11-21 12:39:05 +01:00
Tatiana Leon fd94f10c0b ccmp1: cloudconnector: use '/mnt/data' as the place to store the certificate
The directory '/etc/ssl/certs' is in the 'rootfs_x' partition for dual boot or
'rootfs' for standard boot. In any case this certificate cannot be used after
updating because it is stored in the other block partition (for dual boot) or
because the whole partition has be re-programmed (for standard boot).
So, after a firmware update the device will not be able to reconnect to DRM
unless the user revokes the certificate.

This commit changes the certificate directory to be '/mnt/data' where 'data'
partition is mounted. This is not erased during a firmware update, so cloud
connector can use the already downloaded certificate and the device is able to
reconnect to DRM.

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
2022-11-21 12:38:59 +01:00
Tatiana Leon 1d813fe460 cc6ul: mount_digiparts.sh: fix mount of 'update' partition
This commit fixes the issue in Jira
https://onedigi.atlassian.net/browse/DEL-7827 (and in GitHub
91bfa01a52#),
that is being manifest again in a CC6UL with 1GB although it may affect other
hardware.

Partitions are mounted:
   * For multi-MTD systems, when an MTD subsystem event is received.
   * For single-MTD systems, when a UBI subsystem event is received.

This commit avoids process UBI subsystem events in multi-MTD systems.
The automount rules filter UBI subsystem events to only process 'ubi0*' (the
only UBI device/volumes in a single-MTD) and then the executed script
'mount_digiparts.sh' checks for the existance of '/dev/ubi1' node to consider
the system multi-MTD instead of using 'singlemtdsys' U-Boot variable that only
exists on CC6UL.

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
2022-11-18 14:41:17 +01:00
Tatiana Leon 883141830a mount_digiparts.sh: some script improvements
* Use 'MOUNT' variable instead of 'mount' command
* On the MTD subsystem event, stop looping once the UBI device number is found

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
2022-11-18 14:41:17 +01:00
Javier Viguera ff06521485 ccmp1x-dvk: add stm32mp1common override
This override is used in STM BSP layer on some recipes. Adding it to our
machines fix a build failure on the gcnano-driver-stm32mp recipe.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2022-11-18 14:32:37 +01:00
Hector Palacios c70917b24c uuu installer: increase the timeout for rootfs update
Increase the timeout from 90 to 120s since it's a large image
and it may take more time on different NANDs.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2022-11-18 12:45:26 +01:00
Hector Palacios 2cf902f8d7 installer scripts: cover case where U-Boot env does not exist
The U-Boot environment resides on a UBI volume. The uuu script
relies on the environment to save part of the commands that
U-Boot needs to execute after reboot in the middle of the
installation. If the UBI volume 'uboot_config' does not exist
the installer fails.

This commit:
- Creates a function -on the uuu script only- for obtaining
  the result of running any U-Boot command (0=success, 1=error).
- Checks the existance of 'uboot_config' volume.
- Runs 'ubivolscript' script to create the UBI volumes layout
  that generates the environment volume if it doesn't exist.
- Increases the timeout for running the 'ubivolscript' since
  there are occasions in which 'ubi part' (which is part of the
  script) takes more time (if it cannot find the fastmap).

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2022-11-18 12:45:26 +01:00
Arturo Buzarra 26535326f9 udev-extraconf: create mount points only for read-only filesystems
Commit b8d46f01 ("read_only: create folders in build time") creates
unconditionally default folders in spite of we are in a read-only filesystem or
not, however there are different models (dual boot, single boot..) where these
partitions exist or not, so this commit only creates these default partitions
for a read-only filesystem.

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

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-17 17:48:34 +01:00
Arturo Buzarra 4d07069448 mount_digiparts.sh: add support to dualboot volumes on read-only mode
This commit allows to mount only the linux partition active in read-only mode.

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

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-17 17:48:34 +01:00
Arturo Buzarra 5be7db1f9f mount_digiparts.sh: fix support to UBI volumes on systemd
According to udev documentation running programs that access to mount/umount
filesystems is not allowed due to the default sandbox that is enforced on
systemd-udevd.service, so on systemd systems we must to use systemd-mount
binary instead of mount. Also systemd-mount does not support mount ubi devices
by volume name, so we need to use the absolute device path.

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

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-17 17:48:34 +01:00
Arturo Buzarra 120005ceeb ccmp1: add udev-extraconf recipe for ccmp1 platforms
This commit adds the extra machine specific configuration files for udev on
ccmp1 platforms to allow, for example, automount storage devices.

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

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-17 17:48:34 +01:00
Javier Viguera bbd58825c4 recovery-utils: relax command mode check
As a result of the dualboot support we may end up with two
'update-firmware' commands in the rootfs. To prevent file name clashing,
we may need to install the recovery-utils update-firmware as
update-firmware.recovery, and then the current command mode check would
fail.

Relax the check, by just looking at the first character.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2022-11-17 16:24:52 +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
Tatiana Leon 8f92f634c3 meta-digi-dey: crank: crank-demos: add variables to set the tarballs SHA256
As we are going to document how to build Crank images using our own recipes, we
need a way for customers to provide the sha256 of the engine and demos tarballs:

  * Storyboard Engines are not available as a compressed file, it is a directory
    available after the installation of the whole Storyboard software, next to
    Storyboard Designer, samples, and other resources. The installer is only
    available after filling a form and receiving an email with the link and a
    license key valid for 1 month.

    To use our 'crank-sbengine_7.2.bb' recipe, users must create the tarball
    from this directory and provide its path in the 'CRANK_ENGINE_TARBALL_PATH'
    and its sha256 in 'CRANK_ENGINE_TARBALL_SHA256'.

  * Regarding Storyboard applications, the included demo in the prebuilt image
    is not publicly available, but customers can use the same recipe to install
    their own applications.

    To use our 'crank-demos_7.2.bb' recipe, users must create a tarball with
    the exported application from Storyboard Designer and provide its path in
    the 'CRANK_DEMOS_TARBALL_PATH' and its sha256 in
    'CRANK_DEMOS_TARBALL_SHA256'.
    There are also other configurable parameters such as 'CRANK_DEMO_PATH' or
    'CRANK_DEMO_OPTIONS'.

The process of adding support to Crank Storyboard applications will be fully
documented as new topics.

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
2022-11-17 10:09:02 +01:00
Gonzalo Ruiz 2a40141c88 udev: fix RTC rule filename
Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2022-11-16 17:43:40 +01:00
Mike Engel 501a0dbd21 swupdate: add CONFIG_MTD only when platform supports NAND device
https://onedigi.atlassian.net/browse/DEL-7280

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2022-11-16 13:46:35 +01:00
Mike Engel 81faeb3a05 udev: enable external RTC as wakeup source
Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2022-11-16 12:22:32 +01:00
Arturo Buzarra cf6b49096c ccmp1: rename ccmp1 platforms on U-Boot to match with Linux
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-15 17:21:02 +01:00
Arturo Buzarra d8efac02bf u-boot-dey: move dualboot boot script to common ccmp1 folder to fix ccmp13 build
By default ccmp1 platforms have dualboot mode by default, however the required
boot script was added to ccmp15 platform only, so this commit fixes it.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-15 16:21:25 +01:00
Arturo Buzarra 7d9f278c41 swupdate: add config fragment to fix systemd initialization
Since commit 554b97a ("swupdate: Set service type to notify") in meta-swupdate
layer, the swupdate service fails on boot due to the following timeout error:

    swupdate.sh[2708]: [TRACE] : SWUPDATE running :  [listener_create] : creating socket at /tmp/swupdateprog
    swupdate.sh[2708]: [TRACE] : SWUPDATE running :  [listener_create] : creating socket at /tmp/sockinstctrl
    systemd[1]: swupdate.service: start operation timed out. Terminating.
    systemd[1]: swupdate.service: Failed with result 'timeout'.
    systemd[1]: Failed to start SWUpdate daemon.

This commit adds a config fragment to enable systemd support to swupdate daemon.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-15 13:34:48 +01:00
Francisco Gil b7cd473b39 dualboot: add missing altboot.txt needed by dualboot
Once you enabled dualboot in the ccmp15 you need this file
for the altbootcmd.

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2022-11-15 07:55:16 +01:00
Francisco Gil 7c07b15370 update-firmware: change the way to determine nand device
The partition "environment" is not available in the ccmp15.

The solution suggested is read the "/proc/mounts" and check if
the "rootfs" is "ubifs" mounted.

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2022-11-15 07:54:26 +01:00
Francisco Gil 305789730e ccmp1: enable dualboot by default in stm platforms
Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2022-11-15 07:51:46 +01:00
Francisco Gil 116cb2ac26 swu-images: fix sha256 entry from sw-description file in dualboot
This commit fixes the following build warning with the swupdate v2022.05:

WARNING: dey-image-qt-swu-1.0-r0 do_swuimage: Syntax for sha256 changed,
please use $swupdate_get_sha256(dey-image-qt-wayland-ccmp15-dvk.boot.ubifs)
WARNING: dey-image-qt-swu-1.0-r0 do_swuimage: Syntax for sha256 changed,
please use $swupdate_get_sha256(dey-image-qt-wayland-ccmp15-dvk.ubifs)
WARNING: dey-image-qt-swu-1.0-r0 do_swuimage: Syntax for sha256 changed,
please use $swupdate_get_sha256(dey-image-qt-wayland-ccmp15-dvk.boot.ubifs)
WARNING: dey-image-qt-swu-1.0-r0 do_swuimage: Syntax for sha256 changed,
please use $swupdate_get_sha256(dey-image-qt-wayland-ccmp15-dvk.ubifs)
WARNING: dey-image-qt-swu-1.0-r0 do_swuimage: Syntax for sha256 changed,
please use $swupdate_get_sha256(dey-image-qt-wayland-ccmp15-dvk.boot.ubifs)
WARNING: dey-image-qt-swu-1.0-r0 do_swuimage: Syntax for sha256 changed,
please use $swupdate_get_sha256(dey-image-qt-wayland-ccmp15-dvk.ubifs)
WARNING: dey-image-qt-swu-1.0-r0 do_swuimage: Syntax for sha256 changed,
please use $swupdate_get_sha256(dey-image-qt-wayland-ccmp15-dvk.boot.ubifs)
WARNING: dey-image-qt-swu-1.0-r0 do_swuimage: Syntax for sha256 changed,
please use $swupdate_get_sha256(dey-image-qt-wayland-ccmp15-dvk.ubifs)


Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2022-11-15 07:51:05 +01:00
Francisco Gil b52339d591 dualboot: move the things to the corresponding class
we can get rid of dualboot.bbclass moving things to different
layers.

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2022-11-15 07:49:17 +01:00
Javier Viguera 272edd8af7 meta-digi: remove obsolete overlayed recipes
Code clean up, remove recipes that have been updated in meta-freescale.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2022-11-14 11:09:43 +01:00
Arturo Buzarra 9936c192d2 dualboot: fix initialization systemd service
According to the Yocto reference manual, we need to specify the package name
override to indicate the package to which the value applies.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-14 10:20:02 +01:00
Tatiana Leon 13f2924399 ccmp15: crank: remove some features from crank image to reduce its size
Generated Crank rootfs image for the ConnectCore MP15 is too big to fit in a
dual boot system. This commit removes gstreamer and package-management features.

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
2022-11-11 10:08:34 +01:00
Tatiana Leon e951c89073 meta-digi-dey: crank: update to Crank engine 7.2 and demo
This commit updates:

   * Crank engine version to the latest one (7.2)
   * Crank demo to the provided one instead of the Thermostat example.
     New demo is a launcher that includes 3 applications:
        * Electrical vehicle charger demo
        * Robot arm demo
        * Medical demo

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
2022-11-11 10:05:43 +01:00
Gonzalo Ruiz b1ee0307cc u-boot-dey: ccmp1: update install scripts for CCMP1 platform
Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2022-11-11 09:39:28 +01:00
Gonzalo Ruiz 44a05a819e u-boot-dey: fix install scripts for dual boot
The first time the 'dualboot' variable is tested it is directly run in
the script and doesn't need to escape the special characters.

Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2022-11-10 14:09:25 +01:00
Gonzalo Ruiz 0e221d2ce3 u-boot-dey: ccmp1/cc6ul: ensure 'rootfsvol' value in every case
When Dual Boot is not enabled, 'rootfsvol' variable must point to the
single boot system rootfs partition 'rootfs'.

Explicitly set this value. Otherwise the script relays on the default
rootfsvol value, which may be a Dual Boot partition.

Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2022-11-10 11:19:52 +01:00
Arturo Buzarra 49dbae051e dey-image-installer: fix recipe to add USB driver installation script
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-10 10:57:16 +01:00
Arturo Buzarra feab76d675 dey-image-installer: fix ZIP installer generation for ccmp1 platforms
The ccmp1 build generates ubifs images for the NAND on the device and vfat and
ext4 images for the SD card. This commit reuses the already implemented
mechanism to match only ubifs images for the ccmp1 platforms.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-10 10:57:16 +01:00
Arturo Buzarra ea4277e2c9 ccmp1: move common CCMP1 headers to common configuration file
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-10 10:57:16 +01:00
Hector Palacios 373931f36e ccmp13/ccmp15: rename MikroE device tree overlays
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2022-11-09 09:50:08 +01:00
Francisco Gil 19bf22059f ccmp15: dey-examples: update the configuration file for ccmp15
https://onedigi.atlassian.net/browse/DEL-8151

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2022-11-09 08:13:51 +01:00
Javier Viguera df572d0ef3 meta-digi: delete linux 5.4 recipe
No supported platform is using kernel version 5.4.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2022-11-08 14:20:51 +01:00
Javier Viguera e5acc6f84a firmware-imx: make bbappend version agnostic
meta-freescale updated the base recipe and that broke the build:

ERROR: No recipes in default available for:
  meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/firmware-imx/firmware-imx_8.16.bbappend

The differences in our bbappend are simple enough that we can make a
version agnostic bbappend.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2022-11-08 14:07:43 +01:00
Tatiana Leon 9b1008c7fd libdigiapix: ccimx6ulsbc: update user button GPIO
Cloud Connector opens USER_BUTTON GPIO as an interrupt to listen for rising and
falling edge events and upload them to Remote Manager as data point values.
Having MCA_IO1 as user button and opened by the Cloud Connector (or any other
software) prevents the device to go to sleep when it is not connected (all
MCA GPIOs are wake-up sources when configured as interrupt)

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

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
2022-11-07 18:43:44 +01:00