mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-06-03 01:44:53 +00:00

* 🎨 Do not need to prefix '.' on queries * ✨ Add recovery to stateapi * ✨ Add cloudconfig SDK * ✨ Unify post-install/firstboot hooks This also adds capabilities to add grub option at first boot rather than after installation as for bundles. * 🤖 Optimize tests to wait for state to change
29 lines
534 B
Go
29 lines
534 B
Go
package hook
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
config "github.com/kairos-io/kairos/pkg/config"
|
|
"github.com/kairos-io/kairos/sdk/system"
|
|
)
|
|
|
|
type GrubOptions struct{}
|
|
|
|
func (b GrubOptions) Run(c config.Config) error {
|
|
err := system.Apply(system.SetGRUBOptions(c.Install.GrubOptions))
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type GrubPostInstallOptions struct{}
|
|
|
|
func (b GrubPostInstallOptions) Run(c config.Config) error {
|
|
err := system.Apply(system.SetGRUBOptions(c.GrubOptions))
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
return nil
|
|
}
|