From d3ee6402f69e54964966bdfd0622b0c4cc30f7d7 Mon Sep 17 00:00:00 2001 From: Vincent Legoll Date: Fri, 11 Aug 2017 11:59:41 +0200 Subject: [PATCH] Make QEMU & kernel parameters handling easier to understand --- qemu-pi.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qemu-pi.sh b/qemu-pi.sh index e516620..2308a44 100755 --- a/qemu-pi.sh +++ b/qemu-pi.sh @@ -138,10 +138,15 @@ if [[ $QEMU_MAJOR < 2 ]] ; then sed -i '/^[^#].*libarmm umount -l tmpmnt rmdir tmpmnt &>/dev/null +PARAMS_KERNEL="root=/dev/sda2 panic=1" +if [[ "$NO_GRAPHIC" == "1" ]]; then + PARAMS_QEMU="-nographic" + PARAMS_KERNEL="$PARAMS_KERNEL vga=normal console=ttyAMA0" +fi + # do it qemu-system-arm -kernel $KERNEL -cpu arm1176 -m 256 -M versatilepb $NET_ARGS \ - $( [[ "$NO_GRAPHIC" != "1" ]] || printf %s '-nographic' ) \ - -no-reboot -append "root=/dev/sda2 panic=1 $( [[ "$NO_GRAPHIC" != "1" ]] || printf %s 'vga=normal console=ttyAMA0' )" -drive format=raw,file=$IMG \ + $PARAMS_QEMU -no-reboot -drive format=raw,file=$IMG -append "$PARAMS_KERNEL" # restore network to what it was [[ "$NO_NETWORK" != "1" ]] && {