1
0
mirror of https://github.com/rancher/os.git synced 2025-09-04 08:14:21 +00:00

add some better menu touches, make upgrade also upgrade to the menu, and add a ros config syslinux cmd for editing the global.cfg

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit
2017-06-28 23:58:14 +10:00
parent 204facc395
commit b733bde9cd
7 changed files with 95 additions and 18 deletions

View File

@@ -5,6 +5,7 @@ import (
"io"
"io/ioutil"
"os"
"os/exec"
"sort"
"strings"
"text/template"
@@ -76,6 +77,11 @@ func configSubcommands() []cli.Command {
},
},
},
{
Name: "syslinux",
Usage: "edit Syslinux boot global.cfg",
Action: editSyslinux,
},
{
Name: "validate",
Usage: "validate configuration from stdin",
@@ -146,6 +152,21 @@ func env2map(env []string) map[string]string {
return m
}
func editSyslinux(c *cli.Context) error {
cmd := exec.Command("system-docker", "run", "--rm", "-it",
"-v", "/:/host",
"-w", "/host",
"--entrypoint=vi",
"rancher/os-console:"+config.Version,
"boot/global.cfg")
cmd.Stdout, cmd.Stderr, cmd.Stdin = os.Stdout, os.Stderr, os.Stdin
if err := cmd.Run(); err != nil {
return err
}
return nil
}
func configSet(c *cli.Context) error {
if c.NArg() < 2 {
return nil