1
0
mirror of https://github.com/rancher/os.git synced 2025-09-12 13:17:17 +00:00
Files
os/pkg/init/bootstrap/bootstrap.go
Olli Janatuinen 872f1cd6da Initiate Burmilla OS project
- Use burmilla GitHub repos
- Release under burmilla Docker Hub
- GitHub action for create releases
- Updated boot image and login banner
- Use Debian as default console
- Updated system-cron to v0.5.0
- Updated services to latest versions
- Bump up kernel to 4.14.206
- Include burmilla/os-debianconsole:v1.9.0 to initrd
2021-02-18 20:07:36 +02:00

40 lines
960 B
Go

package bootstrap
import (
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/compose"
"github.com/burmilla/os/pkg/init/docker"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/sysinit"
"github.com/burmilla/os/pkg/util"
)
func bootstrapServices(cfg *config.CloudConfig) (*config.CloudConfig, error) {
if util.ResolveDevice(cfg.Rancher.State.Dev) != "" && len(cfg.Bootcmd) == 0 {
log.Info("NOT Running Bootstrap")
return cfg, nil
}
log.Info("Running Bootstrap")
_, err := compose.RunServiceSet("bootstrap", cfg, cfg.Rancher.BootstrapContainers)
return cfg, err
}
func Bootstrap(cfg *config.CloudConfig) error {
log.Info("Launching Bootstrap Docker")
c, err := docker.Start(cfg)
if err != nil {
return err
}
defer docker.Stop(c)
_, err = config.ChainCfgFuncs(cfg,
[]config.CfgFuncData{
{"bootstrap loadImages", sysinit.LoadBootstrapImages},
{"bootstrap Services", bootstrapServices},
})
return err
}