qemu-wrapper.sh 559 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/bin/sh

set -e

if [ -z "$1" ]; then
    echo "Usage: <imagefile> <arch> [uefi_directory]"
    echo "For x86_64, amd64 is also supported."
    exit 1
fi

if [ -n "$2" ]; then
    if [ "$2" = 'amd64' ]; then
        ARCH='x86_64'
    else
        ARCH="$2"
    fi
else
    echo "Specify the architecture of the image"
    echo "Usage: <imagefile> <arch>"
    echo "For x86_64, amd64 is also supported."
    exit 1
fi
UEFI=""
if [ -n "$3" ]; then
    UEFI="-L $3 -monitor none"
fi

qemu-system-${ARCH} -m 1024 ${UEFI} -enable-kvm -drive format=raw,file=./$1