From 11fcf087ca8aa112c6d5abcde4959286023a028b Mon Sep 17 00:00:00 2001
From: Dave Tucker
Date: Thu, 20 Apr 2017 13:40:28 +0100
Subject: [PATCH] makefile: Use moby run qemu
This deprectes scripts/qemu.sh as moby run qemu can now safely be run in
CI, where we currently used the qemu container
Signed-off-by: Dave Tucker
---
Makefile | 4 ++--
scripts/qemu.sh | 47 -----------------------------------------------
2 files changed, 2 insertions(+), 49 deletions(-)
delete mode 100755 scripts/qemu.sh
diff --git a/Makefile b/Makefile
index 6552ccd94..56a7e43c7 100644
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,7 @@ test-bzImage: test-initrd.img
# interactive versions need to use volume mounts
.PHONY: test-qemu-efi
test-qemu-efi: test-efi.iso
- ./scripts/qemu.sh $^ 2>&1 | tee test-efi.log
+ script -q /dev/null $(MOBY) run $^ | tee test-efi.log
$(call check_test_log, test-efi.log)
bin:
@@ -68,7 +68,7 @@ test-gcp: $(MOBY) test.img.tar.gz
.PHONY: test
test: test-initrd.img test-bzImage test-cmdline
- tar cf - $^ | ./scripts/qemu.sh 2>&1 | tee test.log
+ script -q /dev/null $(MOBY) run test | tee test.log
$(call check_test_log, test.log)
test-ltp.img.tar.gz: $(MOBY) test/ltp/test-ltp.yml
diff --git a/scripts/qemu.sh b/scripts/qemu.sh
deleted file mode 100755
index f7b59bf8f..000000000
--- a/scripts/qemu.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-
-QEMU_IMAGE=linuxkit/qemu:4563d58e97958f4941fbef9e74cabc08bd402144@sha256:b2db0b13ba1cbb6b48218f088fe0a4d860e1db2c4c6381b5416536f48a612230
-
-# if not interactive
-if [ ! -t 0 -a -z "$1" ]
-then
- # non interactive, tarball input
- docker run -i --rm "$QEMU_IMAGE"
- exit $?
-fi
-
-FILE=$1
-FILE2=$2
-CMDLINE=$3
-[ -z "$FILE" ] && FILE="$PWD/moby"
-
-BASE=$(basename "$FILE")
-DIR=$(dirname "$FILE")
-if [ ! -f "$FILE" -a -f $DIR/$BASE-initrd.img -a -f $DIR/$BASE-bzImage ]
-then
- FILE=$DIR/$BASE-initrd.img
- FILE2=$DIR/$BASE-bzImage
-fi
-
-echo "$FILE" | grep -q '^/' || FILE="$PWD/$FILE"
-if [ ! -z "$FILE2" ]
-then
- echo "$FILE2" | grep -q '^/' || FILE2="$PWD/$FILE2"
-fi
-if [ ! -z "$CMDLINE" ]
-then
- echo "$CMDLINE" | grep -q '^/' || CMDLINE="$PWD/$CMDLINE"
-fi
-
-if [ -c "/dev/kvm" ] ; then
- DEVKVM="--device=/dev/kvm"
-fi
-BASE=$(basename "$FILE")
-MOUNTS="-v $FILE:/tmp/$BASE"
-BASE2=$(basename "$FILE2")
-BASE3=$(basename "$CMDLINE")
-
-[ ! -z "$FILE2" ] && MOUNTS="$MOUNTS -v $FILE2:/tmp/$BASE2"
-[ ! -z "$CMDLINE" ] && MOUNTS="$MOUNTS -v $CMDLINE:/tmp/$BASE3"
-
-docker run -it --rm $MOUNTS $DEVKVM "$QEMU_IMAGE"