Skip to contentSkip to conversation

CentOS 5.x fixes

PATCH Applied Paul Eggleton 2 participants 5 messages Dec 14, 2011 – Dec 15, 2011

lore
Share & tools
lore
#0 lore raw

cover CentOS 5.x fixes

A few fixes I made in the process of testing builds on CentOS 5.7.

The following changes since commit b9dfccc018f32a47fc045f35d5f53d7269d791ed:

gdk-pixbuf: Ensure the binaries can be relocated (2011-12-13 18:00:18 +0000)

are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/qemu-centos5
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/qemu-centos5

Paul Eggleton (3):
qemu: for native, do not fail if kvm is unavailable scripts/runqemu: show an error if /dev/net/tun is unusable scripts/bitbake: add a version >= 2.6 check

 meta/recipes-devtools/qemu/qemu.inc       |   10 ++++++++--
 meta/recipes-devtools/qemu/qemu_0.14.0.bb |    2 +-
 meta/recipes-devtools/qemu/qemu_0.15.1.bb |    2 ++
 meta/recipes-devtools/qemu/qemu_git.bb    |    2 +-
 scripts/bitbake                           |    9 +++++++++
 scripts/runqemu                           |    8 ++++++++
 6 files changed, 29 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/3 qemu: for native, do not fail if kvm is unavailable

When building qemu-native, if the linux kvm header is unavailable (as it is on CentOS 5.x 32-bit) then do not pass the --enable-kvm switch to the configure script, thus avoiding failed do_configure.

---
 meta/recipes-devtools/qemu/qemu.inc       |   10 ++++++++--
 meta/recipes-devtools/qemu/qemu_0.14.0.bb |    2 +-
 meta/recipes-devtools/qemu/qemu_0.15.1.bb |    2 ++
 meta/recipes-devtools/qemu/qemu_git.bb    |    2 +-
 4 files changed, 12 insertions(+), 4 deletions(-)
meta/recipes-devtools/qemu/qemu.inc +8 -2
index 65bd8dc..bd86b4e 100644
@@ -12,7 +12,7 @@ SDL ?= "--disable-sdl"
 SDL_virtclass-native ?= ""
 SDL_virtclass-nativesdk ?= ""
 
-EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror --disable-vnc-tls --enable-kvm --audio-drv-list=oss,alsa --audio-card-list=ac97,es1370 ${SDL}"
+EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror --disable-vnc-tls --audio-drv-list=oss,alsa --audio-card-list=ac97,es1370 ${SDL}"
 
 #EXTRA_OECONF += "--disable-sdl"
 
@@ -39,7 +39,13 @@ do_configure_prepend_virtclass-native() {
 }
 
 do_configure() {
-    ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --disable-strip ${EXTRA_OECONF}
+    # Handle distros such as CentOS 5 32-bit that do not have kvm support
+    KVMOPTS=""
+    if [ "${PN}" != "qemu-native" ] || [ -f /usr/include/linux/kvm.h ] ; then
+        KVMOPTS="--enable-kvm"
+    fi
+
+    ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --disable-strip ${EXTRA_OECONF} $KVMOPTS
     test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh
 }
 
meta/recipes-devtools/qemu/qemu_0.14.0.bb +1 -1
index 5a0cd55..bc0c16b 100644
@@ -3,7 +3,7 @@ require qemu.inc
 LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
                     file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913"
 
-PR = "r4"
+PR = "r5"
 
 FILESPATH = "${FILE_DIRNAME}/qemu-${PV}"
 FILESDIR = "${WORKDIR}"
meta/recipes-devtools/qemu/qemu_0.15.1.bb +2 -0
index 7eea924..ae68327 100644
@@ -3,6 +3,8 @@ require qemu.inc
 LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
                     file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913"
 
+PR = "r1"
+
 FILESPATH = "${FILE_DIRNAME}/qemu-${PV}"
 FILESDIR = "${WORKDIR}"
 
meta/recipes-devtools/qemu/qemu_git.bb +1 -1
index 3b4369b..bcec9bb 100644
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
                     file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913"
 
 PV = "0.14.0"
-PR = "r2"
+PR = "r3"
 
 FILESPATH = "${FILE_DIRNAME}/qemu-${PV}/:${FILE_DIRNAME}/qemu-git/"
 FILESDIR = "${WORKDIR}"
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 2/3 scripts/runqemu: show an error if /dev/net/tun is unusable

In reply to Paul Eggleton

If /dev/net/tun is either not present or is not writable by the user, then show an appropriate error message. (QEMU needs access to this device in order to enable networking; it may be missing if it is not enabled or loaded into the kernel, and some distributions such as CentOS 5.x set restrictive permissions upon it.)

---
 scripts/runqemu |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
scripts/runqemu +8 -0
index 4adeace..bed6a29 100755
@@ -194,6 +194,14 @@ while [ $i -le $# ]; do
     i=$((i + 1))
 done
 
+if [ ! -c /dev/net/tun ] ; then
+	echo "TUN control device /dev/net/tun is unavailable; you may need to enable TUN (e.g. sudo modprobe tun)"
+	exit 1
+elif [ ! -w /dev/net/tun ] ; then
+	echo "TUN control device /dev/net/tun is not writable, please fix (e.g. sudo chmod 666 /dev/net/tun)"
+	exit 1
+fi
+
 YOCTO_KVM_WIKI="https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu"
 # Detect KVM configuration
 if [[ "x$KVM_ENABLED" == "xyes" ]]; then
Signature · 1 line
1.7.5.4
#3 lore raw

PATCH 3/3 scripts/bitbake: add a version >= 2.6 check

In reply to Paul Eggleton

Unfortunately we now have code in BitBake which is parsed before the current version check and is incompatible with Python < 2.6. Rather than fixing this and being eternally vigilant for >= 2.6 feature usage, just add a version check to the wrapper script.

---
 scripts/bitbake |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
scripts/bitbake +9 -0
index 587428c..1c8d4eb 100755
@@ -27,6 +27,15 @@ if [ "$py_v3_check" != "" ]; then
 	exit 1
 fi
 
+# Similarly, we now have code that doesn't parse correctly with older
+# versions of Python, and rather than fixing that and be eternally
+# vigilant for any other new feature use, just check the version here.
+py_v26_check=`python -c 'import sys; print sys.version_info >= (2,6,0)'`
+if [ "$py_v26_check" != "True" ]; then
+	echo "BitBake requires Python 2.6 or later"
+	exit 1
+fi
+
 needtar="1"
 TARVERSION=`tar --version | head -n 1 | cut -d ' ' -f 4`
 float_test() {
Signature · 1 line
1.7.5.4
Applied
#4 lore raw
In reply to Paul Eggleton
Quoted 15 lines · Paul Eggleton

A few fixes I made in the process of testing builds on CentOS 5.7.

The following changes since commit b9dfccc018f32a47fc045f35d5f53d7269d791ed:

gdk-pixbuf: Ensure the binaries can be relocated (2011-12-13 18:00:18 +0000)

are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/qemu-centos5
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/qemu-centos5

Paul Eggleton (3):
qemu: for native, do not fail if kvm is unavailable scripts/runqemu: show an error if /dev/net/tun is unusable scripts/bitbake: add a version>= 2.6 check

Quoted 8 lines
  meta/recipes-devtools/qemu/qemu.inc       |   10 ++++++++--
  meta/recipes-devtools/qemu/qemu_0.14.0.bb |    2 +-
  meta/recipes-devtools/qemu/qemu_0.15.1.bb |    2 ++
  meta/recipes-devtools/qemu/qemu_git.bb    |    2 +-
  scripts/bitbake                           |    9 +++++++++
  scripts/runqemu                           |    8 ++++++++
  6 files changed, 29 insertions(+), 4 deletions(-)

Merged into OE-Core

Thanks
Sau!