udev: make sure udev-utils package always includes udevadm

Submitted by Marko Kati? on Dec. 14, 2012, 4:30 p.m. | Patch ID: 41029


Message ID 1355502646.9104.25.camel@dromedary
State New
Headers show

Commit Message

Marko Kati? Dec. 14, 2012, 4:30 p.m.
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.
This can break do_rootfs stages when building images
that depend on udev since we have RRECOMMENDS += udev-utils.
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 Kati? <dromede@gmail.com>
${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 from udev v176, udevadm is by default installed in
+	#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

Patch hide | download patch | download mbox

diff --git a/meta/recipes-core/udev/udev.inc
index 4705b9b..b46ad2c 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
 FILES_udev-acl = "${base_libdir}/udev/udev-acl
-FILES_udev-utils = "${bindir}/udevinfo ${bindir}/udevtest
+FILES_udev-utils = "${bindir}/udevinfo ${bindir}/udevtest