From 4a374eb1753d56d60f524c39b569b6c7ba4957a7 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Wed, 23 Aug 2017 16:08:30 +0100 Subject: [PATCH] Add missing case when running non existent file in hyperkit Signed-off-by: Justin Cormack --- src/cmd/linuxkit/run_hyperkit.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cmd/linuxkit/run_hyperkit.go b/src/cmd/linuxkit/run_hyperkit.go index e58738150..e7ec2477b 100644 --- a/src/cmd/linuxkit/run_hyperkit.go +++ b/src/cmd/linuxkit/run_hyperkit.go @@ -70,7 +70,7 @@ func runHyperKit(args []string) { info, err := os.Stat(path) stat := err == nil - /// ignore a directory + // ignore a directory if stat && info.Mode().IsDir() { stat = false } @@ -111,6 +111,11 @@ func runHyperKit(args []string) { log.Fatalf("Hyperkit requires --uefi to be set to boot an ISO") } isoPaths = append(isoPaths, path) + default: + if !stat { + log.Fatalf("Cannot find file %s to boot", path) + } + log.Fatalf("Unrecognised boot type, please specify on command line") } if *uefiBoot {