mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-01 15:08:33 +00:00
Add a runner for UEFI ISOs
Fixes #480 Signed-off-by: Dave Tucker <dt@docker.com>
This commit is contained in:
@@ -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 . .
|
||||
|
@@ -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/ .*//' > $@
|
||||
|
@@ -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
2
tools/qemu/repositories
Normal file
@@ -0,0 +1,2 @@
|
||||
http://dl-cdn.alpinelinux.org/alpine/edge/main
|
||||
@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing
|
Reference in New Issue
Block a user