allow hyperkit console input/output to be redirected

Signed-off-by: Dave Protasowski <dprotaso@gmail.com>
Signed-off-by: Steve Hiehn <shiehn@pivotal.io>
This commit is contained in:
Dave Protasowski 2017-11-14 11:44:51 -05:00 committed by Steve Hiehn
parent ea6ed3c354
commit f598d9aff2

View File

@ -57,6 +57,9 @@ func runHyperKit(args []string) {
isoBoot := flags.Bool("iso", false, "Boot image is an ISO") isoBoot := flags.Bool("iso", false, "Boot image is an ISO")
kernelBoot := flags.Bool("kernel", false, "Boot image is kernel+initrd+cmdline 'path'-kernel/-initrd/-cmdline") kernelBoot := flags.Bool("kernel", false, "Boot image is kernel+initrd+cmdline 'path'-kernel/-initrd/-cmdline")
// Hyperkit settings
consoleToFile := flags.Bool("console-file", false, "Output the console to a tty file")
// Paths and settings for UEFI firmware // Paths and settings for UEFI firmware
// Note, the default uses the firmware shipped with Docker for Mac // Note, the default uses the firmware shipped with Docker for Mac
fw := flags.String("fw", "/Applications/Docker.app/Contents/Resources/uefi/UEFI.fd", "Path to OVMF firmware for UEFI boot") fw := flags.String("fw", "/Applications/Docker.app/Contents/Resources/uefi/UEFI.fd", "Path to OVMF firmware for UEFI boot")
@ -197,6 +200,10 @@ func runHyperKit(args []string) {
log.Fatalln("Error creating hyperkit: ", err) log.Fatalln("Error creating hyperkit: ", err)
} }
if *consoleToFile {
h.Console = hyperkit.ConsoleFile
}
for i, d := range disks { for i, d := range disks {
id := "" id := ""
if i != 0 { if i != 0 {