2022-09-08 15:39:26 +02:00
|
|
|
package hook
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2023-03-15 15:45:00 +01:00
|
|
|
"github.com/kairos-io/kairos-sdk/system"
|
2023-07-10 14:39:48 +02:00
|
|
|
config "github.com/kairos-io/kairos-agent/v2/pkg/config"
|
2022-09-08 15:39:26 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type GrubOptions struct{}
|
|
|
|
|
|
|
|
func (b GrubOptions) Run(c config.Config) error {
|
2022-10-23 20:22:32 +02:00
|
|
|
err := system.Apply(system.SetGRUBOptions(c.Install.GrubOptions))
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
2022-09-08 15:39:26 +02:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
2022-10-24 08:34:49 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|