Commit Graph

47 Commits

Author SHA1 Message Date
Gabriel Valcazar 291bddcf4c swupdate: explicitly enable SIGALG_RAWRSA when signed images are enabled
In previous versions of swupdate, only one SIGALG_* option could be chosen at
build-time, with SIGALG_RAWRSA being the default option. However, in 2025.12,
multiple SIGALG_* options can now be configured at build-time, allowing users
to choose the signature verification algorithm used at runtime via the
"digest-provider" parameter. We weren't explicitly setting any of these
algorithms in our defconfig, so the resulting builds didn't have any digest
providers, causing swupdate to fail early on when signed images are enabled.

To restore the behavior of previous swupdate versions, explicitly enable
SIGALG_RAWRSA when signed images are enabled. Since we only enable one digest
provider, it will be chosen automatically, without having to explicitly set the
"digest-provider" parameter at runtime.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2026-01-19 15:16:46 +01:00
Gabriel Valcazar 8393625473 swupdate: adapt patches for 2025.12
Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2026-01-16 13:37:38 +01:00
Gabriel Valcazar 5bdd59a647 swupdate: fix regression in 2024.12.1
This version of swupdate has a bug that happens if the root of sw-description
is redirected via a link, which is the case is some of our sw-description
templates (such as the one we use for file updates). Backport a fix from
v2025.05.

https://onedigi.atlassian.net/browse/ADK4A-1957

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2025-05-19 10:42:18 +02:00
Gabriel Valcazar 51655b11dd swupdate: fix build errors in ubivol rdiff handler patch
This patch includes code that only gets compiled for platforms that use a NAND
as the internal storage. Recent changes in swupdate's "copyfile" API caused
this code to stop building.

Using the normal rdiff handler code as reference, update our custom handler to
fix the build errors. While at it, include another change to prevent a warning.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2024-12-04 11:23:05 +01:00
Gabriel Valcazar 655ab0cc36 swupdate: adapt patches to v2024.12
In this version, Config.in files have been renamed to Kconfig, which prevented
one of our patches from applying correctly. Rework the patch to account for
this name change and while at it, update its context.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2024-12-03 12:55:29 +01:00
Javier Viguera 373f061650 dey: cosmetic, mark patches as DEY specific
Our distribution is Digi Embedded Yocto (DEY), so use that to mark the
upstream status of the patches in our layer.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2024-10-22 15:48:00 +02:00
Gabriel Valcazar 2bc985cbea global: add Upstream-Status tag to all patches
This avoids a QA error that is triggered if a patch is missing said tag

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2024-10-17 13:03:37 +02:00
Mike Engel 16525cca53 swupdate: enable SWU authentication when Trustfence is enabled
This commit enables SWU image authentication when TrustFence
is enabled instead of when signing of images is enabled.
This allows the system to authenticate SWU images on images that
have been externally signed.

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

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2024-08-07 10:03:07 +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
Gabriel Valcazar 948e55bde9 swupdate: replace on-the-fly patch with a clearer, equivalent one
The patch we were using comes from the time during dualboot support development
where said feature was selectable at build time. The patch adds a new build
option, giving the impression that it only gets enabled under certain
circumstances, when in reality:

    * The option is never enabled anywhere in our code
    * It's a string option that is treated like a boolean, meaning its
      respective conditional compilation is always getting compiled even when
      disabled

Our current dualboot support is enabled at runtime, so it doesn't make sense to
have a build-time option related to it, especially one that's broken. Replace
the patch with a functionally equivalent one that is less confusing. Also,
remove the related config option from our defconfig.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2024-02-27 18:37:36 +01:00
Gabriel Valcazar b2d9d33cf9 swupdate: reduce default log level in runtime config file
The current log level is very verbose and generates way too much output in some
cases, such as a binary diff update. Reduce the default log level to avoid
this.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2024-02-27 12:37:27 +01:00
Gabriel Valcazar 8430114f4c swupdate: adapt patches to 2023.12.1
https://onedigi.atlassian.net/browse/DEL-8885

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2024-02-26 17:18:23 +01:00
Gabriel Valcazar 32e46e4f9b swupdate: change runtime config file suffix to avoid build-time config errors
We were using the .cfg suffix for both the build-time config fragments and the
runtime configuration file. During do_configure(), all files in SRC_URI ending
in .cfg were being merged together to create the final build configuration,
including said runtime file, which has a completely different syntax. In most
cases, the contents of this file were being ignored, but when tweaking
swupdate's configuration and re-building the package, sometimes strange errors
would prevent the build from finishing.

Change the runtime file's suffix entirely to separate it from the config
fragments and prevent it from being treated as such, and reflect the name
change in the defconfig and the recovery script.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2024-01-02 11:14:23 +01:00
Hector Palacios fd70bf2fce swupdate: use dynamic mtd-blacklist for configuration file
The 'mtd-blacklist' parameter prevents swupdate from acting upon those
partitions that we consider sensitive.
Make such list platform-dependent.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2023-12-01 10:55:05 +01:00
Hector Palacios e9aac1b489 swupdate: install a default config file with optional public-key-file
The swupdate recipe installs by default a systemd service
and a socket to listen for updates coming from a web server.
DEY only makes use of such service during on-the-fly updates from Cloud
Connector web service.

The default swupdate service fails on images with TrustFence because it's
called with no arguments and there doesn't exist a configuration file.
This commit installs a default configuration file and, if TrustFence is
enabled, sets the parameter 'public-key-file' to point to the public
certificate to use to authenticate SWU packages.

While on it, it removes the same file from the recovery-initramfs recipe
that was the only recipe that was adding such config file for recovery
images only.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2023-12-01 10:55:05 +01:00
Hector Palacios 58b3bdb584 swupdate: restore a full defconfig out of a .config
Commit 429125cce0 created a minimal version 'defconfig'
that doesn't include all the default configuration options
of swupdate.

However, an anonymous python function inside the swupdate
repository establishes dependencies basing on configuration
switches it finds (or not) in the 'defconfig' file and any
additional configuration fragments.
For this reason, a minimal 'defconfig' cannot be used in
this recipe and a full configuration file (that also includes
default options) must be used instead.

Reported-by: Stephan Klatt
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Signed-off-by: Javier Viguera  <javier.viguera@digi.com>
2023-09-14 14:00:57 +02:00
David Escalona 3bd1541f09 meta-digi-dey: swupdate: add 'UBIVOL_RDIFFHANDLER' support to MTD based systems
Writing directly into UBI volumes is not allowed, so a special 'rdiff' handler capable of
write data in UBI volumes is required. This commits adds the new handler and enables it in
MTD based systems.

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

Signed-off-by: David Escalona <david.escalona@digi.com>
2023-08-14 10:35:58 +02:00
David Escalona a203487d8f meta-digi-dey: swupdate: add 'RDIFFHANDLER' support to defconfig
The 'RDIFF' handler allows to apply incremental updates using rdiff delta files in the
swu update package. This functionallity is only recommended for read-only file systems,
where the source partition cannot be modified externally by users.

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

Signed-off-by: David Escalona <david.escalona@digi.com>
2023-08-14 10:35:38 +02:00
Javier Viguera e2bbc06fea swupdate: fix non-parallel build
Building swupdate with '-j1' fails with:

swupdate$ make -j1
scripts/kconfig/conf  --silentoldconfig Kconfig
  CC      ipc/network_ipc.o
  CC      ipc/network_ipc-if.o
  CC      ipc/progress_ipc.o
  LD      ipc/built-in.o
  LD      libswupdate.so.0.1
Failed:
aarch64-dey-linux/11.3.0/ld: cannot find ipc-static/lib.a: No such file or directory
collect2: error: ld returned 1 exit status

That's due to trying to link a static library that has not been compiled
yet. That dependence seems spurious and we added it in a patch, so
remove it to fix non-parallel builds.

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

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2023-08-04 13:10:56 +02:00
David Escalona e5392996ed meta-digi-dey: swupdate: enable 'ARCHIVE' handler support to directly install 'tar.gz' files
Signed-off-by: David Escalona <david.escalona@digi.com>
2023-07-06 11:00:05 +02:00
David Escalona 429125cce0 meta-digi-dey: swupdate: clean defconfig file
Make the 'defconfig' file a real defconfig by including only differences with respect default
values. While on it, improve the recipe:

  - Enable 'BOOTLOADERHANDLER' by default in the 'defconfig'. We were unconditionally setting
    this value to 'y' in the recipe, so move it to the default configuration.
  - Move 'UBI' configuration values to 'mtd.cfg' file to be added only when device filesystem is
    MTD based. Until now, 'UBI' support was always added by default.
  - Move the 'SIGNED_IMAGES' configuration entry to a '.cfg' file like we are doing with the rest
    of the functionallity. Use 'oe.utils.conditional' checking 'TRUSTFENCE' feature for this.

Signed-off-by: David Escalona <david.escalona@digi.com>
2023-07-06 11:00:05 +02:00
Arturo Buzarra cecf694073 swupdate: refresh Digi custom patch to support swupdate v2023.05
https://onedigi.atlassian.net/browse/DEL-8554

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2023-05-25 13:48:22 +02:00
Javier Viguera 872cd2b68b swupdate: rename bbappend so it applies to new version
meta-swupdate updated swupdate to version v2022.12, so we need to update
our bbappend to apply to that version. Otherwise firmware update is
failing due to some missing swupdate handlers.

As our bbappend is generic enough, use a wildcard bbappend so it applies
to all swupdate versions.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2023-01-17 17:29:24 +01:00
Mike Engel afc0bc6ef5 swupdate: remove post installation scripts when building squashfs
This commit removes the on-target post installation function for read-only rootfs,
as it will fail trying to edit files.

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2023-01-16 10:29:30 +01:00
Isaac Hermida 22ccaeaa76 swupdate: change logic for service
The variable dualboot might not be defined or well have an invalid
value. Just keep the service running if it is a dualboot model.

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

Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
2023-01-03 13:10:56 +01:00
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
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
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
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 74247d4cab kirkstone migration: update swupdate package
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2022-06-21 16:49:56 +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 be061507f9 swupdate: integrate support from meta-digi-dual boot layer
One patch adds support for building the library statically and the other is a
fix for performing firmware update on the fly. These patches have been moved
from the meta-digi-dualboot layer

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

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
(cherry picked from commit 94018f7402586b916c5c7836eb355a19a78a9c51)
2022-06-03 09:48:22 +02:00
Gabriel Valcazar 73c5dc6662 swupdate: add explicit libgcc runtime dependency
In meta-openembedded commit 35d249bb9a575a5a48491052896e121266d515f0,
libconfig, one of swupdate's dependencies, was split into two packages: one for
the C library and another for the C++ one. swupdate depends only on the C
library, but the C++ library was implicitly pulling in other dependencies, such
as libgcc.

After the commit mentioned above, libgcc stopped being pulled into our recovery
image, causing the following error to appear when swupdate terminates:

libgcc_s.so.1 must be installed for pthread_cancel to work
Aborting

Even if the action carried out by swupdate is successful, our recovery script
detects this as an error and aborts the update operation. Avoid this by
explicitly adding libgcc as a runtime dependency for swupdate.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2022-02-23 13:37:10 +01:00
Gabriel Valcazar 57df5295d6 hardknott: swupdate: update to v2021.11
Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2022-01-05 11:09:46 +01: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
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 0479a31f66 gatesgarth migration: swupdate: update recipe to 2020.04
https://jira.digi.com/browse/DEL-7508

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2021-04-29 20:07:28 +02:00
Arturo Buzarra 940d21a87c zeus migration: swupdate: update recipe to 2019.11
https://jira.digi.com/browse/DEL-7001

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2020-04-27 16:01:07 +02:00
Arturo Buzarra e7a63452ef thud migration: swupdate: update recipe to version 2018.11
https://jira.digi.com/browse/DEL-6412

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2019-02-04 16:52:43 +01:00
Arturo Buzarra 58f76af1c1 swupdate: update recipe to version 2017.11
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2019-01-11 13:26:44 +01:00
Jose Diaz de Grenu 80626aa749 swupdate: update to 2017.07
Rename recipe and fix the path of the progress binary. Also on the
rocko branch of meta-swupdate several signing mechanisms are
supported, and the value is used as a string to determine which one
to use.

Signed-off-by: Jose Diaz de Grenu <Jose.DiazdeGrenu@digi.com>
2018-01-23 14:33:17 +01:00
David Escalona 7222c1d5bb swupdate: enable sign/verify support in swupdate when using trustfence
- The 'sign/verify' feature of swupdate can only be enabled/disabled at
  compile time, it cannot be configured at run time.
- The 'sign/verify' defconfig file is only used  when the images to
  build are configured with 'TRUSTFENCE_SIGN=1'
- This change implies that all swupdate packages generated will have a
  hash for the images to install and will be verified. Sign support is
  only enabled for trustfence images.

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

Signed-off-by: David Escalona <david.escalona@digi.com>
2017-03-07 17:04:21 +01:00
David Escalona 2f7b062d46 swupdate: rename swupdate recipe bbappend to append to the 2017.01 version
- In Jethro, swupdate recipe was using 'swupdate_git.bb' as the main recipe to
  build. In morty that recipe has been disabled and the '2017.01' one is used
  instead, so we have to append to this new recipe by renaming our existing one.
- Our bbappend will now point to the same SHA1 that is being used, so we can
  remove the SRCREV.
- The new code already includes the progress client patch, so it has been removed.

Signed-off-by: David Escalona <david.escalona@digi.com>
2017-03-07 17:04:21 +01:00
David Escalona 2a79bc29d0 swupdate: add patch to include command line support to progress client
- This patch comes from the sw-update upstream and adds command line support
  to the progress client binary.

a11e6f2b80

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

Signed-off-by: David Escalona <david.escalona@digi.com>
2016-12-30 12:41:46 +01:00
Javier Viguera 347960c61c swupdate: use version 2016.10
There is new functionality in that version that we need for our firmware
update solution, so append the git-based recipe and set the revision to
the 2016.10 version.

Also provide a customized build configuration file. Notice that the
defconfig file is actually a full '.config'. It needs to be a full
config file because otherwise the anonymous python function in the
recipe is not able to gather all the build time dependences.

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

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2016-12-19 19:15:31 +01:00