fwu: Allow code to properly decode trial state
authorMichal Simek <michal.simek@amd.com>
Thu, 13 Jul 2023 14:35:24 +0000 (16:35 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 25 Jul 2023 16:44:46 +0000 (12:44 -0400)
commita6dd927f5b1c61e7b6afc8059378408c8c8db2c8
tree2c26b96837acb9b6af8497174208dfe7ac8506c8
parentd6c0d7087f0d17d954a39e0f6af406cfb2d7d43a
fwu: Allow code to properly decode trial state

Current code after capsule update (mtd write) is not changing active_index
in mdata to previous_active_index.
On the reboot this is shown but showing message
"Boot idx 1 is not matching active idx 0, changing active_idx"
which is changing active_idx and writing mdata to flash.

But when this message is visible it is not checking which state that images
are. If they have acceptance bit setup to yes everything is fine and valid
images are booted (doesn't mean the latest one).
But if acceptance bit is no and images are in trial state in_trial variable
is never setup. Which means that from new flashed image stable image can be
rewritten because in_trial is not setup properly.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
lib/fwu_updates/fwu.c