From c1fad649e8410a088793e952fcffa7a7df552d2d Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Sun, 17 Nov 2024 23:41:52 +0900 Subject: [PATCH] app/start: check for cleanup and abort condition Dirty fix. Will rewrite after fsu integration complete. Signed-off-by: Ophestra Umiker --- internal/app/start.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/internal/app/start.go b/internal/app/start.go index 0feb0ae..0b90583 100644 --- a/internal/app/start.go +++ b/internal/app/start.go @@ -251,9 +251,16 @@ func (a *app) Wait() (int, error) { } } - a.shim.AbortWait(errors.New("shim exited")) - if err := a.seal.sys.Revert(ec); err != nil { - return err.(RevertCompoundError) + if a.shim.Unwrap() == nil { + fmsg.VPrintln("fault before shim start") + } else { + a.shim.AbortWait(errors.New("shim exited")) + } + + if a.seal.sys.needRevert { + if err := a.seal.sys.Revert(ec); err != nil { + return err.(RevertCompoundError) + } } return nil