Merge pull request #1439 from dave-tucker/uefi

Add a runner for UEFI ISOs
This commit is contained in:
Justin Cormack
2017-04-04 10:52:32 +01:00
committed by GitHub
7 changed files with 29 additions and 8 deletions

View File

@@ -1,4 +1,6 @@
FROM alpine:3.5
FROM alpine:edge
COPY repositories /etc/apk/
RUN \
apk update && apk upgrade && \
@@ -7,6 +9,7 @@ RUN \
qemu-img \
qemu-system-arm \
qemu-system-x86_64 \
ovmf@testing \
&& true
COPY . .

View File

@@ -5,7 +5,7 @@ IMAGE=qemu
default: push
hash: Dockerfile qemu.sh
hash: Dockerfile qemu.sh repositories
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
docker run --rm --entrypoint /bin/sh $(IMAGE):build -c 'cat Dockerfile qemu.sh /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > $@

View File

@@ -11,20 +11,24 @@ cd /tmp
TGZ="$(find . -name '*.tgz' -or -name '*.tar.gz')"
[ -n "$TGZ" ] && bsdtar xzf "$TGZ"
EFI_ISO="$(find . -name '*efi.iso')"
ISO="$(find . -name '*.iso')"
RAW="$(find . -name '*.raw')"
INITRD="$(find . -name '*.img')"
KERNEL="$(find . -name vmlinuz64 -or -name '*bzImage')"
CMDLINE="$(find . -name '*-cmdline')"
if [ -n "$ISO" ]
if [ -n "$EFI_ISO" ]
then
ARGS="-pflash /usr/share/ovmf/bios.bin -usbdevice tablet -cdrom $EFI_ISO -boot d -drive file=systemdisk.img,format=raw"
elif [ -n "$ISO" ]
then
ARGS="-cdrom $ISO -drive file=systemdisk.img,format=raw"
elif [ -n "$RAW" ]
then
# should test with more drives
ARGS="-drive file=$RAW,format=raw"
elif [ -n "KERNEL" ]
elif [ -n "$KERNEL" ]
then
ARGS="-kernel $KERNEL"
if [ -n "$INITRD" ]
@@ -50,4 +54,9 @@ then
CMDLINE="console=ttyS0"
fi
qemu-system-x86_64 -machine q35,accel=kvm:tcg -device virtio-rng-pci -serial stdio -vnc none -m 1024 -append "${CMDLINE}" $ARGS
if [ -z "$EFI_ISO" ] && [ -z "$ISO" ]
then
ARGS="-append ${CMDLINE} ${ARGS}"
fi
qemu-system-x86_64 -machine q35,accel=kvm:tcg -device virtio-rng-pci -nographic -vnc none -m 1024 $ARGS

2
tools/qemu/repositories Normal file
View File

@@ -0,0 +1,2 @@
http://dl-cdn.alpinelinux.org/alpine/edge/main
@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing