[oe-commits] Ross Burton : xserver-xorg: add runtime provides for the driver ABI version

git at git.openembedded.org git at git.openembedded.org
Mon Oct 22 11:43:51 UTC 2012


Module: openembedded-core.git
Branch: master-next
Commit: 0f5d79fef8341ddbfda0b4181911b422f15d3fca
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=0f5d79fef8341ddbfda0b4181911b422f15d3fca

Author: Ross Burton <ross.burton at intel.com>
Date:   Mon Oct 22 10:37:24 2012 +0100

xserver-xorg: add runtime provides for the driver ABI version

The xserver driver ABIs can and do change in a way that is unrelated to the
version of xserver, so it's entirely possible to build an image that has a
mismatch between the server ABI version and the version that the drivers were
built against.  xserver detects this and refuses to load the modules.

By adding RPROVIDEs to the xserver package that describe the ABI versions it has
(such as xorg-abi-video-13, xorg-abi-input-11), drivers can RDEPEND on the
version that they were built against.  This means that when the ABIs change,
there will be package dependency errors at image time instead of images that
build fine but don't work.

Signed-off-by: Ross Burton <ross.burton at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 .../recipes-graphics/xorg-xserver/xserver-xorg.inc |   27 +++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc b/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc
index b45cb44..33564eb 100644
--- a/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc
@@ -13,7 +13,7 @@ PROVIDES = "virtual/xserver-xf86"
 PROVIDES += "virtual/xserver"
 
 PE = "2"
-INC_PR = "r2"
+INC_PR = "r3"
 
 XORG_PN = "xorg-server"
 SRC_URI = "${XORG_MIRROR}/individual/xserver/${XORG_PN}-${PV}.tar.bz2"
@@ -132,3 +132,28 @@ do_install_append () {
 	# Its assumed base-files creates this for us
 	rmdir ${D}${localstatedir}/log/
 }
+
+# Add runtime provides for the ABI versions of the video and input subsystems,
+# so that drivers can depend on the relevant version.
+python populate_packages_prepend() {
+    import subprocess
+
+    # Set PKG_CONFIG_PATH so pkg-config looks at the .pc files that are going
+    # into the new package, not the staged ones.
+    newenv = dict(os.environ)
+    newenv["PKG_CONFIG_PATH"] = d.expand("${PKGD}${libdir}/pkgconfig/")
+
+    def get_abi(name):
+        abis = {
+          "video": "abi_videodrv",
+          "input": "abi_xinput"
+        }
+        p = subprocess.Popen(args="pkg-config --variable=%s xorg-server" % abis[name],
+                             shell=True, env=newenv, stdout=subprocess.PIPE)
+        output = p.communicate()[0]
+        return "xorg-abi-%s-%s" % (name, output.split(".")[0])
+
+    pn = d.getVar("PN", True)
+    d.appendVar("RPROVIDES_" + pn, " " + get_abi("input"))
+    d.appendVar("RPROVIDES_" + pn, " " + get_abi("video"))
+}





More information about the Openembedded-commits mailing list