[meta-intel] [PATCH] meta-intel: enable qemu and select more suitable virtual machine options

Patrick Ohly patrick.ohly at intel.com
Thu Jan 12 06:19:35 PST 2017


Although the machines definitions in meta-intel are meant to target
real hardware, begin able to start the resulting images under qemu is
nevertheless useful for testing.

Doing that via runqemu depends on a per-image runqemu.conf that
describes how to run qemu for the image. Ineriting qemuboot.bbclass in
image recipes with QB_ variables set for the current architecture via
overrides creates that file.

The new qemuboot-intel.inc was copied from OE-core's qemuboot-x86.inc
and adapted to the three common machines in meta-intel:

$ diff ../openembedded-core/meta/conf/machine/include/qemuboot-x86.inc conf/machine/include/qemuboot-intel.inc
3,5c3,5
< QB_SYSTEM_NAME_x86 = "qemu-system-i386"
< QB_CPU_x86 = "-cpu qemu32"
< QB_CPU_KVM_x86 = "-cpu kvm32"
---
> QB_SYSTEM_NAME_intel-core2-32 = "qemu-system-i386"
> QB_CPU_intel-core2-32 = "-cpu coreduo"
> QB_CPU_KVM_intel-core2-32 = "-cpu kvm32"
7,9c7,13
< QB_SYSTEM_NAME_x86-64 = "qemu-system-x86_64"
< QB_CPU_x86-64 = "-cpu core2duo"
< QB_CPU_KVM_x86-64 = "-cpu kvm64"
---
> QB_SYSTEM_NAME_intel-corei7-64 = "qemu-system-x86_64"
> QB_CPU_intel-corei7-64 = "-cpu Nehalem"
> QB_CPU_KVM_intel-corei7-64 = "-cpu kvm64"
>
> QB_SYSTEM_NAME_intel-quark = "qemu-system-i386"
> QB_CPU_intel-quark = "-cpu coreduo"
> QB_CPU_KVM_intel-quark = "-cpu kvm32"

intel-core2-32 and intel-corei7-64 work (tested with an Ostro OS
derivative with OVMF as firmware), whereas intel-quark hangs while
showing the OVMF/TianoCore logo.

In all three cases there's a (harmless?) warning:
warning: TCG doesn't support requested feature: CPUID.01H:EDX.vme [bit 1]

Including qemu.inc (from OE-core) ensures that qemu gets built when
building an image.

Signed-off-by: Patrick Ohly <patrick.ohly at intel.com>
---
 conf/machine/include/meta-intel.inc     |  6 ++++++
 conf/machine/include/qemuboot-intel.inc | 20 ++++++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 conf/machine/include/qemuboot-intel.inc

diff --git a/conf/machine/include/meta-intel.inc b/conf/machine/include/meta-intel.inc
index fd0a792..437fd38 100644
--- a/conf/machine/include/meta-intel.inc
+++ b/conf/machine/include/meta-intel.inc
@@ -36,3 +36,9 @@ EFI_PROVIDER ?= "rmc-boot"
 
 # Add general MACHINEOVERRIDE for meta-intel
 MACHINEOVERRIDES =. "intel-x86-common:"
+
+# All machine flavors may (or may not) run on qemu...
+require conf/machine/include/qemuboot-intel.inc
+
+# Ensure that the extra tools needed by qemu are built when building images.
+require conf/machine/include/qemu.inc
diff --git a/conf/machine/include/qemuboot-intel.inc b/conf/machine/include/qemuboot-intel.inc
new file mode 100644
index 0000000..82a72ac
--- /dev/null
+++ b/conf/machine/include/qemuboot-intel.inc
@@ -0,0 +1,20 @@
+# For runqemu
+IMAGE_CLASSES += "qemuboot"
+QB_SYSTEM_NAME_intel-core2-32 = "qemu-system-i386"
+QB_CPU_intel-core2-32 = "-cpu coreduo"
+QB_CPU_KVM_intel-core2-32 = "-cpu kvm32"
+
+QB_SYSTEM_NAME_intel-corei7-64 = "qemu-system-x86_64"
+QB_CPU_intel-corei7-64 = "-cpu Nehalem"
+QB_CPU_KVM_intel-corei7-64 = "-cpu kvm64"
+
+QB_SYSTEM_NAME_intel-quark = "qemu-system-i386"
+QB_CPU_intel-quark = "-cpu coreduo"
+QB_CPU_KVM_intel-quark = "-cpu kvm32"
+
+QB_AUDIO_DRV = "alsa"
+QB_AUDIO_OPT = "-soundhw ac97,es1370"
+QB_KERNEL_CMDLINE_APPEND = "vga=0 uvesafb.mode_option=640x480-32 oprofile.timer=1 uvesafb.task_timeout=-1"
+# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
+QB_OPT_APPEND = "-vga vmware -show-cursor -usb -usbdevice tablet -device virtio-rng-pci"
+QB_SLIRP_OPT = "-net nic,model=e1000 -net user,hostfwd=tcp::2222-:22"
-- 
2.1.4



More information about the meta-intel mailing list