Patchwork udev: make sure udev-utils package always includes udevadm

login
register
mail settings
Submitter Marko Kati?
Date Dec. 14, 2012, 4:30 p.m.
Message ID <1355502646.9104.25.camel@dromedary>
Download mbox | patch
Permalink /patch/41029/
State New
Headers show

Comments

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
${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
 }

Patch

diff --git a/meta/recipes-core/udev/udev.inc
b/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
${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