udev: make sure udev-utils package always contains udevadm

Submitted by Marko Kati? on Dec. 19, 2012, 9:44 p.m. | Patch ID: 41365


Message ID 1355953462-16689-1-git-send-email-dromede@gmail.com
State New
Headers show

Commit Message

Marko Kati? Dec. 19, 2012, 9:44 p.m.
From: Marko Katic <dromede@gmail.com>

Default installation path of udevadm was changed
from ${base_sbindir} to ${bindir} in udev v176.

Also, udevinfo and udevtest no longer exist in
current (v182) udev sources.

This can break udev-utils packaging since udev-utils
package expects udevadm only in ${base_sbindir}.
And since udevinfo and udevtest no longer exist in
current udev versions, udev-utils could be empty
and thus will not be created.

We should also make sure that udevadm stays in udev-utils
since it might be needed for other packages i.e, busybox
and mdev.

Udev.inc should support all versions of udev. This patch
makes udevadm always available in udev-utils package and
it also makes sure that udevadm is available in both
${base_sbindir} and ${bindir} paths.

Signed-off-by: Marko Katic <dromede@gmail.com>
 meta/recipes-core/udev/udev.inc |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/meta/recipes-core/udev/udev.inc b/meta/recipes-core/udev/udev.inc
index 4705b9b..a0f9f3b 100644
--- a/meta/recipes-core/udev/udev.inc
+++ b/meta/recipes-core/udev/udev.inc
@@ -74,7 +74,7 @@  FILES_udev-cache = "${sysconfdir}/init.d/udev-cache ${sysconfdir}/default/udev-c
 FILES_udev-acl = "${base_libdir}/udev/udev-acl ${base_libdir}/udev/rules.d/70-acl.rules"
-FILES_udev-utils = "${bindir}/udevinfo ${bindir}/udevtest ${base_sbindir}/udevadm"
+FILES_udev-utils = "${bindir}/udevinfo ${bindir}/udevtest ${base_sbindir}/udevadm ${bindir}/udevadm"
 RDEPENDS_udev-consolekit += "udev-acl"
 FILES_udev-consolekit = "${libdir}/ConsoleKit"
@@ -97,4 +97,19 @@  do_install_append () {
 	rm -f ${D}${base_libdir}/udev/hid2hci
 	echo 'udev_run="/var/run/udev"' >> ${D}${sysconfdir}/udev/udev.conf
+	#Starting with udev v176, udevadm is by default installed in ${bindir}
+	#Make sure udevadm is available both in ${bindir} and ${base_sbindir}
+	#so we can support all versions of udev.
+       if [ "${PV}" -gt "175" ]
+       then
+               install -d ${D}${base_sbindir}
+               ln -s ${bindir}/udevadm ${D}${base_sbindir}/udevadm
+       else
+               install -d ${D}${bindir}
+               ln -s ${base_sbindir}/udevadm ${D}${bindir}/udevadm
+       fi