mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 01:29:07 +00:00
Add a runner for UEFI ISOs
Fixes #480 Signed-off-by: Dave Tucker <dt@docker.com>
This commit is contained in:
parent
4220a65128
commit
6726746484
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,4 @@
|
|||||||
test.log
|
*.log
|
||||||
Dockerfile.media
|
Dockerfile.media
|
||||||
/bin
|
/bin
|
||||||
disk.img.*
|
disk.img.*
|
||||||
|
9
Makefile
9
Makefile
@ -34,13 +34,20 @@ test-initrd.img: bin/moby test/test.yml
|
|||||||
test-bzImage: test-initrd.img
|
test-bzImage: test-initrd.img
|
||||||
|
|
||||||
# interactive versions need to use volume mounts
|
# 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
|
qemu: moby-initrd.img moby-bzImage moby-cmdline
|
||||||
./scripts/qemu.sh moby-initrd.img moby-bzImage "$(shell cat moby-cmdline)"
|
./scripts/qemu.sh moby-initrd.img moby-bzImage "$(shell cat moby-cmdline)"
|
||||||
|
|
||||||
qemu-iso: alpine/mobylinux-bios.iso
|
qemu-iso: alpine/mobylinux-bios.iso
|
||||||
./scripts/qemu.sh $^
|
./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:
|
bin:
|
||||||
mkdir -p $@
|
mkdir -p $@
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
QEMU_IMAGE=mobylinux/qemu:75ef01c780850daf78ee45078606eb740a999edf@sha256:ec93951816b57d86f7a90c129a5580e083093e5a92263d0d2be6822daa2162dd
|
QEMU_IMAGE=mobylinux/qemu:ac2f8d3258d09541f0dab7529f62bb7e9b9bb79c@sha256:b60d1421937b0ebf4846341a1cda1ca00f44a45553d5494080b2ca8aac468773
|
||||||
|
|
||||||
# if not interactive
|
# if not interactive
|
||||||
if [ ! -t 0 -a -z "$1" ]
|
if [ ! -t 0 -a -z "$1" ]
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
FROM alpine:3.5
|
FROM alpine:edge
|
||||||
|
|
||||||
|
COPY repositories /etc/apk/
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
apk update && apk upgrade && \
|
apk update && apk upgrade && \
|
||||||
@ -7,6 +9,7 @@ RUN \
|
|||||||
qemu-img \
|
qemu-img \
|
||||||
qemu-system-arm \
|
qemu-system-arm \
|
||||||
qemu-system-x86_64 \
|
qemu-system-x86_64 \
|
||||||
|
ovmf@testing \
|
||||||
&& true
|
&& true
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
@ -5,7 +5,7 @@ IMAGE=qemu
|
|||||||
|
|
||||||
default: push
|
default: push
|
||||||
|
|
||||||
hash: Dockerfile qemu.sh
|
hash: Dockerfile qemu.sh repositories
|
||||||
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
||||||
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
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/ .*//' > $@
|
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')"
|
TGZ="$(find . -name '*.tgz' -or -name '*.tar.gz')"
|
||||||
[ -n "$TGZ" ] && bsdtar xzf "$TGZ"
|
[ -n "$TGZ" ] && bsdtar xzf "$TGZ"
|
||||||
|
|
||||||
|
EFI_ISO="$(find . -name '*efi.iso')"
|
||||||
ISO="$(find . -name '*.iso')"
|
ISO="$(find . -name '*.iso')"
|
||||||
RAW="$(find . -name '*.raw')"
|
RAW="$(find . -name '*.raw')"
|
||||||
INITRD="$(find . -name '*.img')"
|
INITRD="$(find . -name '*.img')"
|
||||||
KERNEL="$(find . -name vmlinuz64 -or -name '*bzImage')"
|
KERNEL="$(find . -name vmlinuz64 -or -name '*bzImage')"
|
||||||
CMDLINE="$(find . -name '*-cmdline')"
|
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
|
then
|
||||||
ARGS="-cdrom $ISO -drive file=systemdisk.img,format=raw"
|
ARGS="-cdrom $ISO -drive file=systemdisk.img,format=raw"
|
||||||
elif [ -n "$RAW" ]
|
elif [ -n "$RAW" ]
|
||||||
then
|
then
|
||||||
# should test with more drives
|
# should test with more drives
|
||||||
ARGS="-drive file=$RAW,format=raw"
|
ARGS="-drive file=$RAW,format=raw"
|
||||||
elif [ -n "KERNEL" ]
|
elif [ -n "$KERNEL" ]
|
||||||
then
|
then
|
||||||
ARGS="-kernel $KERNEL"
|
ARGS="-kernel $KERNEL"
|
||||||
if [ -n "$INITRD" ]
|
if [ -n "$INITRD" ]
|
||||||
@ -50,4 +54,9 @@ then
|
|||||||
CMDLINE="console=ttyS0"
|
CMDLINE="console=ttyS0"
|
||||||
fi
|
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
|
Loading…
Reference in New Issue
Block a user