Improve boot attempts message showing not only the current boot attempt
but also the limit:
(boot attempt 1/3)
Print the message only when the bootcount mechanism is active, i.e. when
the bootlimit is defined (not zero), and when bootcount is > 0.
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
https://onedigi.atlassian.net/browse/DUB-1056
Until now, for dualboot systems, all boot variables were calculated on each boot depending on the value of the
'active_system'. These variables are used to boot the device but were not saved, which could lead to a missmatch
between their value in the environment and their required values to correctly boot the system. This commit
simplifies a bit the variables calculation and adds a block to synchronize their value in the environment.
Signed-off-by: David Escalona <david.escalona@digi.com>
The 'bootcount' value is now incremented and stored in the system on every boot and
not only then the 'upgrade_available' flag is set. Also, ensure the value is cleared
when the 'altboot' script is executed by running the new U-Boot command 'bootcount reset'.
https://onedigi.atlassian.net/browse/DEL-8506
Signed-off-by: David Escalona <david.escalona@digi.com>
Number of bootup logos is now configured using fbcon=logo-count parameter,
so use it instead of our deprecated custom code in the kernel.
For backwards compatibility, we add this parameter in the u-boot boot
script for all platforms but the ccimx93, where this is directly handled
by u-boot (v2022.04).
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
U-Boot has embedded support to handle bootcount tries.
When the limit of tries is reached, U-Boot runs the script
in `altbootcmd` rather than the usual `bootcmd`.
This other script resides on meta-digi-dualboot layer.
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
When DualBoot mechanism is enabled and an update is pending,
the boot script needs to change certain variables and save the
environment.
The regular boot script already changes a number of variables,
such as 'extra_bootargs' and 'overlays' by appending strings to
the already existing values. Saving the envionment may make these
grow endlessly with each iteration of the boot script.
For this reason, move the DualBoot check as the first thing in
the script, save the environment if needed, and then continue
with the normal flow, that changes variables before booting
but doesn't save them.
On certain scripts, this allows us to get rid of some instructions
for resetting the overlays variable.
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
The support for dualboot was integrated on meta-digi-dualboot layer, but it
really depends only on environment variable 'dualboot' so we'd better
integrate the support on the scripts in meta-digi, to avoid synchonization
problems between both layers.
This also allows to be able to easily enable dualboot in U-Boot with the
variable, without needing to update the script on the linux partition.
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
With the generalization done in previous commits, we have now several files
that are identical and can be merged into a common SOM or SOM family
folder.
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Create global variables:
DEFAULT_IMAGE_NAME
GRAPHICAL_IMAGES
to have them substituted on the U-Boot install scripts for better
generalization.
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
U-Boot install scripts (from uSD and USB) were hard-coded to dey-image-qt.
Allow to install other image files by setting a new variable 'image-name'
which defaults to 'dey-image-qt' if not defined, except for the CC6UL
SBC Express, that defaults to 'core-image-base'.
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
https://jira.digi.com/browse/DEL-7385https://jira.digi.com/browse/DEL-7333
On these boot scripts, this variable is not used, so we can remove it.
Besides, it's generated by U-Boot code.
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Use ##MACHINE## placeholder to have it later substituted by the recipe
using Yocto ${MACHINE} variable.
This will help later reducing the number of files to have one per SOM
(or even family) instead of one per platform.
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Non-graphical images (core-image-base, dey-image-aws) don't contain the
graphic-backend on their filenames.
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
- Determine first the filenames and abort if any does not exist.
- Print a warning message about the erasing of the media with a list
of partitions and files to use for the update
- Sync the different scripts so they look more similar
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
https://jira.digi.com/browse/DEL-7333
Similar to how it's done on the ccimx6ul, create a function for updating
a partition with a file, that also prints a message.
Rename the function to be the same in all scripts.
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
https://jira.digi.com/browse/DEL-7333
Previously, this script only allowed the U-Boot filename as parameter.
This commit makes use of getopts() to pass the following options to the
script:
-h, for help
-i, to pass the dey image name that prefixes the firmware filenames
-n, to skip the 10 seconds delay that allow you to cancel the process
-u, to pass the U-Boot filename
The default image name (if none passed) keeps being 'dey-image-qt' but the
new option allows reusing this script to install dey-image-webkit or
dey-image-aws images.
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
https://jira.digi.com/browse/DEL-7385
This overlay added cooling devices for all quad cores.
On the latest BSP, the SoC device tree include contains all four
cooling devices and the newest U-Boot is able to delete the nodes
for non-existing cores, so there's no need for this overlay
anymore.
Signed-off-by: Hector Palacios <hector.palacios@digi.com>