inits/pkg/cmd/init/boot/boot.go

38 lines
549 B
Go
Raw Normal View History

2019-03-08 01:21:29 +00:00
package initboot
import (
"log"
"github.com/spf13/cobra"
2024-01-20 13:20:51 +00:00
"novit.tech/direktil/inits/pkg/sys"
2019-03-08 01:21:29 +00:00
)
var (
doNetwork bool
)
func Command() (c *cobra.Command) {
c = &cobra.Command{
Use: "boot",
Short: "boot stage",
Run: run,
}
return
}
func run(c *cobra.Command, args []string) {
2019-03-13 05:01:34 +00:00
step("files", setupFiles)
step("modules", setupModules)
step("network", setupNetworking)
step("lvm", setupLVM)
2019-03-08 01:21:29 +00:00
}
func setupModules() {
for _, mod := range sys.Config().Modules {
log.Print("loading module ", mod)
sys.Run("modprobe", mod)
}
}