Output kernel command line to a file in the kernel+initrd output case

Trying to find the relevant yaml file was an issue as we now support
`--name` and it might be in a different directory, so although it is
a bit verbose outputing a whole file at least it is more consistent.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack
2017-03-20 12:16:34 +00:00
parent b8aff953f0
commit 9208496d82
7 changed files with 24 additions and 20 deletions

11
main.go
View File

@@ -223,13 +223,11 @@ func build(m *Moby, name string) {
}
var (
conf string
cmdline bool
name string
conf string
name string
)
func main() {
flag.BoolVar(&cmdline, "cmdline", false, "Print the kernel command line and exit")
flag.StringVar(&name, "name", "", "Name to use for output files")
flag.Parse()
@@ -256,10 +254,5 @@ func main() {
log.Fatalf("Invalid config: %v", err)
}
if cmdline {
fmt.Printf("%s\n", m.Kernel.Cmdline)
return
}
build(m, name)
}