2019-03-08 01:21:29 +00:00
|
|
|
package initboot
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
|
|
|
|
"novit.nc/direktil/inits/pkg/sys"
|
|
|
|
)
|
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|