Really fix make qemu

Previously, the cmdline file was never sent in the build context which
caused the script to pick the default options.

Also, when mulitple options are specified (not the default) the right
escaping needs to be used.

Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
This commit is contained in:
Thomas Gazagnaire
2017-04-06 16:03:00 +02:00
parent 4a1b8a3e32
commit 7f0761c5f1
2 changed files with 16 additions and 8 deletions

View File

@@ -45,18 +45,18 @@ echo "$ARGS" | grep -q systemdisk && qemu-img create -f raw systemdisk.img 256M
if [ -n "${CMDLINE}" ]
then
CMDLINE="$(cat $CMDLINE)"
APPEND="$(cat $CMDLINE)"
else
CMDLINE="$*"
APPEND="$*"
fi
if [ -z "${CMDLINE}" ]
if [ -z "${APPEND}" ]
then
CMDLINE="console=ttyS0"
APPEND="console=ttyS0"
fi
if [ -z "$EFI_ISO" ] && [ -z "$ISO" ]
then
ARGS="-append ${CMDLINE} ${ARGS}"
ARGS="-append \"${APPEND}\" ${ARGS}"
fi
qemu-system-x86_64 -machine q35,accel=kvm:tcg -device virtio-rng-pci -nographic -vnc none -m 1024 $ARGS
eval qemu-system-x86_64 -machine q35,accel=kvm:tcg -device virtio-rng-pci -nographic -vnc none -m 1024 $ARGS