runqemu factor archs more

This commit is contained in:
Ciro Santilli
2017-06-28 21:46:46 +01:00
parent 88f1211409
commit e480b0fc64

52
runqemu
View File

@@ -43,45 +43,47 @@ done
shift "$(($OPTIND - 1))"
extra_flags="$extra_flags $@"
images_dir='buildroot/output/images'
buildroot_out_dir='./buildroot/output'
images_dir="$buildroot_out_dir/images"
qemu_common="\
$debug_qemu \
$buildroot_out_dir/host/usr/bin/qemu-system-$arch \
-m 128M \
-monitor telnet::45454,server,nowait \
-net user \
-smp 1 \
"
case "$arch" in
x86_64)
if $kgdb; then
extra_append="$extra_append kgdboc=ttyS0,115200"
fi
cmd="$debug_qemu ./buildroot/output/host/usr/bin/qemu-system-x86_64 \
-M pc \
-append 'root=/dev/vda $extra_append' \
-device edu \
-drive file=${images_dir}/rootfs.ext2,if=virtio,format=raw \
-kernel ${images_dir}/bzImage \
-monitor telnet::45454,server,nowait \
-m 128M \
-net nic,model=virtio \
-net user \
-smp 1 \
$extra_flags
"
;;
if $kgdb; then
extra_append="$extra_append kgdboc=ttyS0,115200"
fi
cmd="$qemu_common \
-M pc \
-append 'root=/dev/vda $extra_append' \
-drive file=${images_dir}/rootfs.ext2,if=virtio,format=raw \
-kernel ${images_dir}/bzImage \
-net nic,model=virtio \
$extra_flags
"
;;
arm)
if $kgdb; then
extra_append="$extra_append kgdboc=ttyAMA0,115200"
fi
cmd="qemu-system-arm \
cmd="$qemu_common \
-M versatilepb \
-append 'root=/dev/sda $extra_append' \
-drive file=${images_dir}/rootfs.ext2,if=scsi,format=raw \
-dtb ${images_dir}/versatile-pb.dtb \
-kernel ${images_dir}/zImage \
-m 128M \
-monitor telnet::45454,server,nowait \
-net nic,model=rtl8139 \
-net user \
-serial stdio \
-smp 1 \
$extra_flags"
;;
$extra_flags
"
;;
esac
echo "$cmd"
if "$debug" && ! "$nographic" && [ ! "$arch" = 'arm' ]; then
eval "$cmd" &>/dev/null &
# TODO: Ctrl +C gets sent to QEMU? Why? Does not happen if I run