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
commit 4d9bd63b1b
7 changed files with 29 additions and 8 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
test.log
*.log
Dockerfile.media
/bin
disk.img.*

View File

@ -34,13 +34,20 @@ test-initrd.img: bin/moby test/test.yml
test-bzImage: test-initrd.img
# interactive versions need to use volume mounts
.PHONY: qemu qemu-iso
.PHONY: qemu qemu-iso qemu-efi test-qemu-efi
qemu: moby-initrd.img moby-bzImage moby-cmdline
./scripts/qemu.sh moby-initrd.img moby-bzImage "$(shell cat moby-cmdline)"
qemu-iso: alpine/mobylinux-bios.iso
./scripts/qemu.sh $^
qemu-efi: moby-efi.iso
./scripts/qemu.sh $^
test-qemu-efi: test-efi.iso
./scripts/qemu.sh $^ 2>&1 | tee test-efi.log
$(call check_test_log, test-efi.log)
bin:
mkdir -p $@

View File

@ -1,6 +1,6 @@
#!/bin/sh
QEMU_IMAGE=mobylinux/qemu:75ef01c780850daf78ee45078606eb740a999edf@sha256:ec93951816b57d86f7a90c129a5580e083093e5a92263d0d2be6822daa2162dd
QEMU_IMAGE=mobylinux/qemu:ac2f8d3258d09541f0dab7529f62bb7e9b9bb79c@sha256:b60d1421937b0ebf4846341a1cda1ca00f44a45553d5494080b2ca8aac468773
# if not interactive
if [ ! -t 0 -a -z "$1" ]

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