Patchwork qemu-nativesdk: fix the build failure that linux/kvm.h not found

login
register
mail settings
Submitter Yao Zhao
Date July 18, 2012, 12:44 a.m.
Message ID <1342572286-18552-1-git-send-email-yao.zhao@windriver.com>
Download mbox | patch
Permalink /patch/32337/
State Accepted
Commit 7d49af3a811472a2a47453bef0813b89c6331ae7
Headers show

Comments

Yao Zhao - July 18, 2012, 12:44 a.m.
qemu.inc: on older kernel build hosts that have < 2.6.20 which
doesn't support kvm yet, build will fail. Add a check in do_configure
to make sure whether linux/kvm.h exists for nativesdk build.

Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
---
 meta/recipes-devtools/qemu/qemu.inc |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Saul Wold - July 19, 2012, 12:01 a.m.
On 07/17/2012 05:44 PM, Yao Zhao wrote:
> qemu.inc: on older kernel build hosts that have < 2.6.20 which
> doesn't support kvm yet, build will fail. Add a check in do_configure
> to make sure whether linux/kvm.h exists for nativesdk build.
>
> Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
> ---
>   meta/recipes-devtools/qemu/qemu.inc |    5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
> index 707493e..713674e 100644
> --- a/meta/recipes-devtools/qemu/qemu.inc
> +++ b/meta/recipes-devtools/qemu/qemu.inc
> @@ -22,8 +22,9 @@ inherit autotools
>   do_configure() {
>       # Handle distros such as CentOS 5 32-bit that do not have kvm support
>       KVMOPTS="--disable-kvm"
> -    if [ "${PN}" != "qemu-native" ] || [ -f /usr/include/linux/kvm.h ] ; then
> -        KVMOPTS="--enable-kvm"
> +    if [ "${PN}" != "qemu-native" -a "${PN}" != "qemu-nativesdk" ] \
> +       || [ -f /usr/include/linux/kvm.h ] ; then
> +       KVMOPTS="--enable-kvm"
>       fi
>
>       ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --disable-strip ${EXTRA_OECONF} $KVMOPTS
>
Merged into OE-Core

Thanks
	Sau!

Patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 707493e..713674e 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -22,8 +22,9 @@  inherit autotools
 do_configure() {
     # Handle distros such as CentOS 5 32-bit that do not have kvm support
     KVMOPTS="--disable-kvm"
-    if [ "${PN}" != "qemu-native" ] || [ -f /usr/include/linux/kvm.h ] ; then
-        KVMOPTS="--enable-kvm"
+    if [ "${PN}" != "qemu-native" -a "${PN}" != "qemu-nativesdk" ] \
+       || [ -f /usr/include/linux/kvm.h ] ; then
+       KVMOPTS="--enable-kvm"
     fi
 
     ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --disable-strip ${EXTRA_OECONF} $KVMOPTS