mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-09-12 12:36:56 +00:00
Add shim to choose next entry to boot from (#230)
This commit is contained in:
@@ -3,6 +3,7 @@ package uki
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/kairos-io/kairos-agent/v2/pkg/action"
|
||||
"github.com/kairos-io/kairos-agent/v2/pkg/config"
|
||||
"github.com/kairos-io/kairos-agent/v2/pkg/constants"
|
||||
"github.com/kairos-io/kairos-agent/v2/pkg/elemental"
|
||||
@@ -70,6 +71,12 @@ func (r *ResetAction) Run() (err error) {
|
||||
if err != nil {
|
||||
return fmt.Errorf("copying recovery to active: %w", err)
|
||||
}
|
||||
// SelectBootEntry sets the default boot entry to the selected entry
|
||||
err = action.SelectBootEntry(r.cfg, "active")
|
||||
// Should we fail? Or warn?
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_ = elementalUtils.RunStage(r.cfg, "kairos-uki-reset.after")
|
||||
_ = events.RunHookScript("/usr/bin/kairos-agent.uki.reset.after.hook") //nolint:errcheck
|
||||
|
Reference in New Issue
Block a user