From: Andreas Reichel <[email protected]>

If in_progress is set in the latest environment, do not boot from it, as
a current update process may have been interrupted and this environment
is currently used by software update.  Instead, boot from the 2nd latest
revision.

Signed-off-by: Andreas Reichel <[email protected]>
---
 env/fatvars.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/env/fatvars.c b/env/fatvars.c
index 5d391c7..2c84700 100644
--- a/env/fatvars.c
+++ b/env/fatvars.c
@@ -191,8 +191,12 @@ BG_STATUS load_config(BG_LOADER_PARAMS *bglp)
        /* Assume we boot with the latest configuration */
        current_partition = latest_idx;
 
+       /* Test if this environment is currently 'in_progress'. If yes,
+        * do not boot from it, instead ignore it */
+       if (env[latest_idx].in_progress == 1) {
+               current_partition = pre_latest_idx;
+       } else if (env[latest_idx].ustate == USTATE_TESTING) {
        /* Test if this configuration is in test mode */
-       if (env[latest_idx].ustate == USTATE_TESTING) {
                /* If it has already been booted, this indicates a failed
                 * update. In this case, mark it as failed by giving a
                 * zero-revision */
-- 
2.15.0

-- 
You received this message because you are subscribed to the Google Groups "EFI 
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/20171122115942.960-4-andreas.reichel.ext%40siemens.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to