mirror of
https://github.com/rancher/os.git
synced 2025-09-16 06:59:12 +00:00
Installing 0.7.1, and then rebooting, and doing a ros upgrade to a faked up latest works \o/
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
45
cmd/control/install/syslinux.go
Normal file
45
cmd/control/install/syslinux.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package install
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/rancher/os/log"
|
||||
)
|
||||
|
||||
func syslinuxConfig(menu BootVars) error {
|
||||
log.Debugf("syslinuxConfig")
|
||||
|
||||
filetmpl, err := template.New("syslinuxconfig").Parse(`{{define "syslinuxmenu"}}
|
||||
LABEL {{.Name}}
|
||||
LINUX ../vmlinuz-{{.Version}}-rancheros
|
||||
APPEND {{.KernelArgs}} {{.Append}}
|
||||
INITRD ../initrd-{{.Version}}-rancheros
|
||||
{{end}}
|
||||
TIMEOUT 20 #2 seconds
|
||||
DEFAULT RancherOS-current
|
||||
|
||||
{{- range .Entries}}
|
||||
{{template "syslinuxmenu" .}}
|
||||
{{- end}}
|
||||
|
||||
`)
|
||||
if err != nil {
|
||||
log.Errorf("syslinuxconfig %s", err)
|
||||
return err
|
||||
}
|
||||
|
||||
cfgFile := filepath.Join(menu.BaseName, menu.BootDir+"syslinux/syslinux.cfg")
|
||||
log.Debugf("syslinuxConfig written to %s", cfgFile)
|
||||
f, err := os.Create(cfgFile)
|
||||
if err != nil {
|
||||
log.Errorf("Create(%s) %s", cfgFile, err)
|
||||
return err
|
||||
}
|
||||
err = filetmpl.Execute(f, menu)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user