sparkles: Boot options (#91)

*  Add grub_options to config

Split post-install into hooks

* 🤖 Adapt test to latest releases
This commit is contained in:
Ettore Di Giacinto
2022-09-08 15:39:26 +02:00
committed by Itxaka
parent 01c6a99577
commit b7fec41fe3
5 changed files with 109 additions and 7 deletions

View File

@@ -0,0 +1,24 @@
package hook
import (
config "github.com/c3os-io/c3os/pkg/config"
)
type Interface interface {
Run(c config.Config) error
}
var All = []Interface{
&RunStage{}, // Shells out to stages defined from the container image
&GrubOptions{}, // Set custom GRUB options
&Lifecycle{}, // Handles poweroff/reboot by config options
}
func Run(c config.Config, hooks ...Interface) error {
for _, h := range hooks {
if err := h.Run(c); err != nil {
return err
}
}
return nil
}