1
0
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:
Sven Dowideit
2016-12-20 22:49:34 +10:00
parent bdb0d32235
commit 2a575837b2
15 changed files with 528 additions and 296 deletions

View 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
}