mirror of
https://github.com/rancher/os.git
synced 2025-06-28 07:46:49 +00:00
Add friendly tips on ros config syslinux
This commit is contained in:
parent
90e88cf2b4
commit
4cb09e2ac6
@ -1,6 +1,7 @@
|
|||||||
package control
|
package control
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
@ -14,6 +15,7 @@ import (
|
|||||||
"github.com/rancher/os/pkg/log"
|
"github.com/rancher/os/pkg/log"
|
||||||
|
|
||||||
"github.com/codegangsta/cli"
|
"github.com/codegangsta/cli"
|
||||||
|
"github.com/pkg/errors"
|
||||||
"github.com/rancher/os/config"
|
"github.com/rancher/os/config"
|
||||||
"github.com/rancher/os/pkg/util"
|
"github.com/rancher/os/pkg/util"
|
||||||
)
|
)
|
||||||
@ -153,6 +155,22 @@ func env2map(env []string) map[string]string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func editSyslinux(c *cli.Context) error {
|
func editSyslinux(c *cli.Context) error {
|
||||||
|
// check whether is Raspberry Pi or not
|
||||||
|
bytes, err := ioutil.ReadFile("/proc/device-tree/model")
|
||||||
|
if err == nil && strings.Contains(strings.ToLower(string(bytes)), "raspberry") {
|
||||||
|
buf := bufio.NewWriter(os.Stdout)
|
||||||
|
fmt.Fprintln(buf, "raspberry pi can not use this command")
|
||||||
|
buf.Flush()
|
||||||
|
return errors.New("raspberry pi can not use this command")
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err := os.Stat("/proc/1/root/boot/global.cfg"); os.IsNotExist(err) {
|
||||||
|
buf := bufio.NewWriter(os.Stdout)
|
||||||
|
fmt.Fprintln(buf, "global.cfg can not be found")
|
||||||
|
buf.Flush()
|
||||||
|
return errors.New("global.cfg can not be found")
|
||||||
|
}
|
||||||
|
|
||||||
cmd := exec.Command("system-docker", "run", "--rm", "-it",
|
cmd := exec.Command("system-docker", "run", "--rm", "-it",
|
||||||
"-v", "/:/host",
|
"-v", "/:/host",
|
||||||
"-w", "/host",
|
"-w", "/host",
|
||||||
|
Loading…
Reference in New Issue
Block a user