From 8427af09c51734e17482fea116bc8199a5df41e9 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Wed, 15 Mar 2017 15:01:47 +0000 Subject: [PATCH] Make the hyperkit script get the kernel command line if just passed a name This is all slightly annoying, maybe we should make a file for the CLI for hyperkit, but this is better and fixes a bug that the test CLI was coming from moby, and is easier to use with custom builds. Signed-off-by: Justin Cormack --- Makefile | 4 ++-- scripts/hyperkit.sh | 23 +++++++++++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index da32dd383..641732444 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ endif .PHONY: hyperkit hyperkit-test hyperkit: scripts/hyperkit.sh bin/com.docker.hyperkit bin/vpnkit moby-initrd.img moby-bzImage moby.yaml - ./scripts/hyperkit.sh moby "$(shell bin/moby --cmdline moby.yaml)" + ./scripts/hyperkit.sh moby define check_test_log @cat $1 |grep -q 'Moby test suite PASSED' @@ -65,7 +65,7 @@ endef hyperkit-test: scripts/hyperkit.sh bin/com.docker.hyperkit bin/vpnkit test-initrd.img test-bzImage rm -f disk.img - script -q /dev/null ./scripts/hyperkit.sh test "$(shell bin/moby --cmdline moby.yaml)" | tee test.log + script -q /dev/null ./scripts/hyperkit.sh test | tee test.log $(call check_test_log, test.log) .PHONY: test diff --git a/scripts/hyperkit.sh b/scripts/hyperkit.sh index 4521bf4ed..89d718ff5 100755 --- a/scripts/hyperkit.sh +++ b/scripts/hyperkit.sh @@ -2,12 +2,23 @@ set -e -PREFIX="moby" -[ $# -ge 1 ] && PREFIX="$1" - -KERNEL="$PREFIX-bzImage" -INITRD="$PREFIX-initrd.img" -CMDLINE="$2" +if [ $# -eq 0 ] +then + PREFIX="moby" + KERNEL="$PREFIX-bzImage" + INITRD="$PREFIX-initrd.img" + CMDLINE=$(bin/moby --cmdline ${PREFIX}.yaml) +elif [ $# -eq 1 ] +then + PREFIX="$1" + KERNEL="$PREFIX-bzImage" + INITRD="$PREFIX-initrd.img" + CMDLINE=$(bin/moby --cmdline ${PREFIX}.yaml) +else + KERNEL=$1 + INITRD=$2 + CMDLINE=$3 +fi SLIRP_SOCK="$HOME/Library/Containers/com.docker.docker/Data/s50"