diff options
author | Cristian Iorga <cristian.iorga@intel.com> | 2014-02-13 17:26:51 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-13 17:53:30 +0000 |
commit | a2a20adbfd03ed9f07a3aa38ee2c9a8d962d4bf9 (patch) | |
tree | cfd1efd8619eeb5b56bbbb2fb9d53beee93489a3 /scripts | |
parent | 6a6cdadf31ce382a14a8f9cd83dfaa18062447de (diff) | |
download | poky-a2a20adbfd03ed9f07a3aa38ee2c9a8d962d4bf9.tar.gz |
runqemu: enforce right CPU type for qemux86/x86-64
Set in accordance with qemu machines configs.
Fixes [YOCTO #5817].
(From OE-Core rev: 0e5cfef90ff762b33da6dc301dfc9cb3947c8a02)
Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu | 9 | ||||
-rwxr-xr-x | scripts/runqemu-internal | 13 |
2 files changed, 14 insertions, 8 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 9272b6f2d5..0db7ad63ca 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -68,6 +68,8 @@ SCRIPT_QEMU_OPT="" | |||
68 | SCRIPT_QEMU_EXTRA_OPT="" | 68 | SCRIPT_QEMU_EXTRA_OPT="" |
69 | SCRIPT_KERNEL_OPT="" | 69 | SCRIPT_KERNEL_OPT="" |
70 | SERIALSTDIO="" | 70 | SERIALSTDIO="" |
71 | KVM_ENABLED="no" | ||
72 | KVM_ACTIVE="no" | ||
71 | 73 | ||
72 | # Determine whether the file is a kernel or QEMU image, and set the | 74 | # Determine whether the file is a kernel or QEMU image, and set the |
73 | # appropriate variables | 75 | # appropriate variables |
@@ -103,7 +105,6 @@ process_filename() { | |||
103 | 105 | ||
104 | # Parse command line args without requiring specific ordering. It's a | 106 | # Parse command line args without requiring specific ordering. It's a |
105 | # bit more complex, but offers a great user experience. | 107 | # bit more complex, but offers a great user experience. |
106 | KVM_ENABLED="no" | ||
107 | while true; do | 108 | while true; do |
108 | arg=${1} | 109 | arg=${1} |
109 | case "$arg" in | 110 | case "$arg" in |
@@ -266,11 +267,7 @@ if [ "x$KVM_ENABLED" = "xyes" ]; then | |||
266 | exit 1; | 267 | exit 1; |
267 | fi | 268 | fi |
268 | if [ -w /dev/kvm -a -r /dev/kvm ]; then | 269 | if [ -w /dev/kvm -a -r /dev/kvm ]; then |
269 | if [ "x$MACHINE" = "xqemux86" ]; then | 270 | SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -enable-kvm" |
270 | SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -enable-kvm -cpu kvm32" | ||
271 | elif [ "x$MACHINE" = "xqemux86-64" ]; then | ||
272 | SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -enable-kvm -cpu kvm64" | ||
273 | fi | ||
274 | KVM_ACTIVE="yes" | 271 | KVM_ACTIVE="yes" |
275 | else | 272 | else |
276 | echo "You have no rights on /dev/kvm." | 273 | echo "You have no rights on /dev/kvm." |
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal index 08931074ec..f9ca380f26 100755 --- a/scripts/runqemu-internal +++ b/scripts/runqemu-internal | |||
@@ -360,6 +360,11 @@ fi | |||
360 | 360 | ||
361 | if [ "$MACHINE" = "qemux86" ]; then | 361 | if [ "$MACHINE" = "qemux86" ]; then |
362 | QEMU=qemu-system-i386 | 362 | QEMU=qemu-system-i386 |
363 | if [ "$KVM_ACTIVE" = "yes" ]; then | ||
364 | CPU_SUBTYPE=kvm32 | ||
365 | else | ||
366 | CPU_SUBTYPE=qemu32 | ||
367 | fi | ||
363 | if [ ! -z "$vga_option" ]; then | 368 | if [ ! -z "$vga_option" ]; then |
364 | QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS" | 369 | QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS" |
365 | else | 370 | else |
@@ -367,7 +372,7 @@ if [ "$MACHINE" = "qemux86" ]; then | |||
367 | fi | 372 | fi |
368 | if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then | 373 | if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then |
369 | KERNCMDLINE="vga=0 uvesafb.mode_option=640x480-32 root=$DROOT rw mem=$QEMU_MEMORY $KERNEL_NETWORK_CMD" | 374 | KERNCMDLINE="vga=0 uvesafb.mode_option=640x480-32 root=$DROOT rw mem=$QEMU_MEMORY $KERNEL_NETWORK_CMD" |
370 | QEMUOPTIONS="$QEMU_NETWORK_CMD $ROOTFS_OPTIONS $QEMU_UI_OPTIONS" | 375 | QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE $ROOTFS_OPTIONS $QEMU_UI_OPTIONS" |
371 | fi | 376 | fi |
372 | if [ "$FSTYPE" = "nfs" ]; then | 377 | if [ "$FSTYPE" = "nfs" ]; then |
373 | if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then | 378 | if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then |
@@ -388,7 +393,11 @@ fi | |||
388 | 393 | ||
389 | if [ "$MACHINE" = "qemux86-64" ]; then | 394 | if [ "$MACHINE" = "qemux86-64" ]; then |
390 | QEMU=qemu-system-x86_64 | 395 | QEMU=qemu-system-x86_64 |
391 | CPU_SUBTYPE=core2duo | 396 | if [ "$KVM_ACTIVE" = "yes" ]; then |
397 | CPU_SUBTYPE=kvm64 | ||
398 | else | ||
399 | CPU_SUBTYPE=core2duo | ||
400 | fi | ||
392 | if [ ! -z "$vga_option" ]; then | 401 | if [ ! -z "$vga_option" ]; then |
393 | QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS" | 402 | QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS" |
394 | else | 403 | else |