diff options
author | Thomas Bächler | 2017-03-05 00:00:01 +0100 |
---|---|---|
committer | Thomas Bächler | 2017-03-05 00:00:01 +0100 |
commit | ddd426c4ba5d81098596717ef8b50af69d4ec3b9 (patch) | |
tree | 4bb7b12eb8a0a1f33003321ac4108029530bd328 /test-netboot | |
parent | 7923ed00b56e559eb9e8e6380fb8e4dc299f60ad (diff) | |
download | aur-ddd426c4ba5d81098596717ef8b50af69d4ec3b9.tar.gz |
Update to the latest ipxe version, remove trust from the startcom root certificate, add a test script based on qemu and ovmf
Diffstat (limited to 'test-netboot')
-rwxr-xr-x | test-netboot | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test-netboot b/test-netboot new file mode 100755 index 000000000000..95784be935cf --- /dev/null +++ b/test-netboot @@ -0,0 +1,36 @@ +#!/bin/bash +set -euo pipefail + +OVMFDIR=/usr/share/ovmf +OVMF_CODE=${OVMFDIR}/ovmf_code_x64.bin +OVMF_VARS=${OVMFDIR}/ovmf_vars_x64.bin +IPXE_IMAGE=/usr/share/ipxe-netboot/ipxe.efi + +if [[ ! -f ${OVMF_CODE} ]]; then + echo "ERROR: ${OVMF_CODE} is missing, install the ovmf package." >&2 + exit 1 +fi +if [[ ! -f ${OVMF_VARS} ]]; then + echo "ERROR: ${OVMF_VARS} is missing, install the ovmf package." >&2 + exit 1 +fi +if [[ ! -f ${IPXE_IMAGE} ]]; then + echo "ERROR: ${IPXE_IMAGE} is missing." >&2 + exit 1 +fi + +WORKDIR=$(mktemp -d --tmpdir netboot.XXXXXX) +cd "${WORKDIR}" + +cp "${OVMF_VARS}" efivars +mkdir -p ./fat/EFI/Boot/ +cp "${IPXE_IMAGE}" ./fat/EFI/Boot/bootx64.efi + +exec qemu-system-x86_64 \ + -enable-kvm \ + -device virtio-net-pci,netdev=n -netdev user,ipv4,id=n \ + -m 2G \ + -drive if=pflash,format=raw,readonly,file="${OVMF_CODE}" \ + -drive if=pflash,format=raw,file=efivars \ + -usb -usbdevice disk:format=raw:fat:./fat \ + "$@" |