]> xenbits.xensource.com Git - people/sstabellini/mojo.git/.git/commitdiff
Introduce runtime support for aarch64
authorStefano Stabellini <sstabellini@kernel.org>
Sat, 20 Jan 2018 00:23:53 +0000 (16:23 -0800)
committerStefano Stabellini <sstabellini@kernel.org>
Mon, 22 Jan 2018 22:57:29 +0000 (14:57 -0800)
Introduce two new containers:
- qemu-system-aarch64-builder: it builds a qemu system binary capable
  of running Xen on ARM
- qemu-system-aarch64: the runnable container with the
  qemu-system-aarch64 binary and the run script

Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
run-aarch64.sh [new file with mode: 0755]
runtime/qemu-system-aarch64-builder/Dockerfile [new file with mode: 0644]
runtime/qemu-system-aarch64-builder/build.yml [new file with mode: 0644]
runtime/qemu-system-aarch64-builder/run.sh [new file with mode: 0755]
runtime/qemu-system-aarch64/Dockerfile [new file with mode: 0644]
runtime/qemu-system-aarch64/build.yml [new file with mode: 0644]
runtime/qemu-system-aarch64/run.sh [new file with mode: 0755]
runtime/series

diff --git a/run-aarch64.sh b/run-aarch64.sh
new file mode 100755 (executable)
index 0000000..c02482f
--- /dev/null
@@ -0,0 +1 @@
+docker run -v `pwd`/out:/out -it mojoos/qemu-system-aarch64:qemu-system-aarch64 /root/run.sh /out/image
diff --git a/runtime/qemu-system-aarch64-builder/Dockerfile b/runtime/qemu-system-aarch64-builder/Dockerfile
new file mode 100644 (file)
index 0000000..f6e902c
--- /dev/null
@@ -0,0 +1,17 @@
+FROM alpine:3.6 as qemu-system-aarch64
+
+ENV SOURCE_DIR=/root
+ENV OUT_DIR=/out
+ENV QEMU_VERSION=2.11.0
+
+RUN \
+    apk update && \
+    apk add curl make gcc musl-dev zlib-dev glib-dev pixman-dev libcap-dev libattr flex bison && \
+    cd $SOURCE_DIR && \
+    curl -fsSLO https://download.qemu.org/qemu-$QEMU_VERSION.tar.xz && \
+    tar xvJf qemu-$QEMU_VERSION.tar.xz && \
+    cd qemu-$QEMU_VERSION && \
+    ./configure --target-list=aarch64-softmmu --disable-virtfs && \
+    make -j "$(getconf _NPROCESSORS_ONLN)" && \
+    make DESTDIR=$OUT_DIR install
+
diff --git a/runtime/qemu-system-aarch64-builder/build.yml b/runtime/qemu-system-aarch64-builder/build.yml
new file mode 100644 (file)
index 0000000..d5ff72d
--- /dev/null
@@ -0,0 +1,3 @@
+image: qemu-system-aarch64-builder
+org: mojoos
+network: yes
diff --git a/runtime/qemu-system-aarch64-builder/run.sh b/runtime/qemu-system-aarch64-builder/run.sh
new file mode 100755 (executable)
index 0000000..0ec3360
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+DISK1=$1
+
+qemu-system-aarch64 -machine virt,gic_version=3 \
+    -machine virtualization=true \
+    -cpu cortex-a57 -machine type=virt \
+    -smp 4 -m 2048 \
+    -serial stdio monitor -none \
+    -bios /root/QEMU_EFI.fd \
+    -netdev user,id=hostnet0 -device virtio-net-device,netdev=hostnet0 \
+    -drive if=none,file=$DISK1,id=hd0 -device virtio-blk-device,drive=hd0
diff --git a/runtime/qemu-system-aarch64/Dockerfile b/runtime/qemu-system-aarch64/Dockerfile
new file mode 100644 (file)
index 0000000..a170d2b
--- /dev/null
@@ -0,0 +1,13 @@
+FROM alpine:3.6 as qemu-system-aarch64
+
+COPY run.sh /root
+COPY --from=mojoos/qemu-system-aarch64-builder:qemu-system-aarch64-builder /out/ /
+
+ENV QEMU_FD_URL="http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-AARCH64/RELEASE_GCC5/QEMU_EFI.fd"
+
+RUN \
+    apk update && \
+    apk add curl && \
+    cd /root && curl -fsSLO $QEMU_FD_URL && \
+    apk add libbz2 glib pixman
+
diff --git a/runtime/qemu-system-aarch64/build.yml b/runtime/qemu-system-aarch64/build.yml
new file mode 100644 (file)
index 0000000..9c0af99
--- /dev/null
@@ -0,0 +1,3 @@
+image: qemu-system-aarch64
+org: mojoos
+network: yes
diff --git a/runtime/qemu-system-aarch64/run.sh b/runtime/qemu-system-aarch64/run.sh
new file mode 100755 (executable)
index 0000000..b29810d
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+DISK1=$1
+
+qemu-system-aarch64 -machine virt,gic_version=3 \
+    -machine virtualization=true \
+    -cpu cortex-a57 -machine type=virt \
+    -smp 4 -m 2048 \
+    -serial stdio -monitor none \
+    -bios /root/QEMU_EFI.fd \
+    -netdev user,id=hostnet0 -device virtio-net-device,netdev=hostnet0 \
+    -drive if=none,file=$DISK1,id=hd0 -device virtio-blk-device,drive=hd0
index 0e38e1b478663155c22521215a1e4628a8362bc7..07ca6dfdd36f9f7a3bdd982f6ada5c875d38ace2 100644 (file)
@@ -1 +1,3 @@
 qemu-system-x86_64
+qemu-system-aarch64-builder
+qemu-system-aarch64