[oe-commits] Stanislav Brabec : udev: Added support for udev-compat.

git version control git at git.openembedded.org
Sat Jul 24 13:59:39 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: bf242510ce91aef3472a1ac4521410a867ea0964
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=bf242510ce91aef3472a1ac4521410a867ea0964

Author: Stanislav Brabec <sbrabec at suse.cz>
Date:   Sat Jul 24 15:37:21 2010 +0200

udev: Added support for udev-compat.
* http://lists.linuxtogo.org/pipermail/openembedded-devel/2010-July/021662.html

Signed-off-by: Stanislav Brabec <utx at penguin.cz>
Acked-by: Andrea Adami <andrea.adami at gmail.com>

---

 recipes/udev/files/udev-compat-wrapper-patch |   37 ++++++++++++++++++++++++++
 recipes/udev/udev.inc                        |   19 ++++++++++++-
 recipes/udev/udev_151.bb                     |   17 ++++++++++++
 recipes/udev/udev_154.bb                     |   17 ++++++++++++
 4 files changed, 89 insertions(+), 1 deletions(-)

diff --git a/recipes/udev/files/udev-compat-wrapper-patch b/recipes/udev/files/udev-compat-wrapper-patch
new file mode 100644
index 0000000..a3e312d
--- /dev/null
+++ b/recipes/udev/files/udev-compat-wrapper-patch
@@ -0,0 +1,37 @@
+This patch should be applied on platforms which support kernels < 2.6.27 and need udev-compat package.
+
+It should be applied after:
+sed -i "s:/sbin/udevd:\$UDEVD:g;s:/sbin/udevadm:\$UDEVADM:g" init
+
+It has not .patch suffix, because such files would not be copied to
+WORKDIR and cannot be selectively applied on another source file.
+
+--- init
++++ init
+@@ -11,6 +11,17 @@
+ 
+ export TZ=/etc/localtime
+ 
++UDEVD="/sbin/udevd"
++UDEVADM="/sbin/udevadm"
++# If we are running an old kernel and have a static udev present use that instead
++if [ -e /sbin/udevd-compat ] ; then
++	KERNELMICROVER="$(uname -r | awk -F. '{print $3}')"
++	if [ $KERNELMICROVER -lt 27 ] ; then
++		UDEVD="/sbin/udevd-compat"
++		UDEVADM="/sbin/udevadm-compat"
++	fi
++fi
++
+ [ -d /sys/class ] || exit 1
+ [ -r /proc/mounts ] || exit 1
+ [ -x $UDEVD ] || exit 1
+@@ -21,6 +32,8 @@
+         if [ -x /sbin/pidof ]; then
+                 pid=`/sbin/pidof -x udevd`
+                 [ -n "$pid" ] && kill $pid
++                pid=`/sbin/pidof -x udevd-compat`
++                [ -n "$pid" ] && kill $pid
+         fi
+ }
+ 
diff --git a/recipes/udev/udev.inc b/recipes/udev/udev.inc
index c79da97..f4f1c40 100644
--- a/recipes/udev/udev.inc
+++ b/recipes/udev/udev.inc
@@ -11,7 +11,8 @@ SRC_URI = "http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
 	   file://mount.sh \
 	   file://network.sh \
 	   file://local.rules \
-           file://init"
+           file://init \
+	   file://udev-compat-wrapper-patch"
 
 INC_PR = "r27"
 
@@ -42,6 +43,22 @@ EXTRA_OEMAKE = "-e \
 		'EXTRAS=${UDEV_EXTRAS}' \
 		'STRIP=echo'"
 
+RPROVIDES_udev_spitz = "udev-compat-wrapper"
+do_unpack_append_spitz() {
+	bb.build.exec_func('do_apply_compat_wrapper', d)
+}
+RPROVIDES_udev_akita = "udev-compat-wrapper"
+do_unpack_append_akita() {
+	bb.build.exec_func('do_apply_compat_wrapper', d)
+}
+# Modify init script on platforms that need to boot old kernels:
+do_apply_compat_wrapper() {
+	cd ${WORKDIR}
+	sed -i "s:/sbin/udevd:\$UDEVD:g;s:/sbin/udevadm:\$UDEVADM:g" init
+	patch <udev-compat-wrapper-patch
+	cd -
+}
+
 do_install () {
 	install -d ${D}${usrsbindir} \
 		   ${D}${sbindir}
diff --git a/recipes/udev/udev_151.bb b/recipes/udev/udev_151.bb
index 7be56d2..ce97a7b 100644
--- a/recipes/udev/udev_151.bb
+++ b/recipes/udev/udev_151.bb
@@ -29,6 +29,7 @@ SRC_URI += " \
        file://default \
        file://init \
        file://cache \
+       file://udev-compat-wrapper-patch \
 "
 
 SRC_URI_append_h2200 = " file://50-hostap_cs.rules "
@@ -74,6 +75,22 @@ FILES_${PN}-dbg += "${usrbindir}/.debug ${usrsbindir}/.debug"
 FILES_${PN} += "/lib/udev* ${libdir}/ConsoleKit"
 FILES_${PN}-dbg += "/lib/udev/.debug"
 
+RPROVIDES_udev_spitz = "udev-compat-wrapper"
+do_unpack_append_spitz() {
+	bb.build.exec_func('do_apply_compat_wrapper', d)
+}
+RPROVIDES_udev_akita = "udev-compat-wrapper"
+do_unpack_append_akita() {
+	bb.build.exec_func('do_apply_compat_wrapper', d)
+}
+# Modify init script on platforms that need to boot old kernels:
+do_apply_compat_wrapper() {
+	cd ${WORKDIR}
+	sed -i "s:/sbin/udevd:\$UDEVD:g;s:/sbin/udevadm:\$UDEVADM:g" init
+	patch <udev-compat-wrapper-patch
+	cd -
+}
+
 do_install () {
 	install -d ${D}${usrsbindir} \
 		   ${D}${sbindir}
diff --git a/recipes/udev/udev_154.bb b/recipes/udev/udev_154.bb
index 5e90e88..6032215 100644
--- a/recipes/udev/udev_154.bb
+++ b/recipes/udev/udev_154.bb
@@ -30,6 +30,7 @@ SRC_URI += " \
        file://default \
        file://init \
        file://cache \
+       file://udev-compat-wrapper-patch \
 "
 
 SRC_URI_append_h2200 = " file://50-hostap_cs.rules "
@@ -75,6 +76,22 @@ FILES_${PN}-dbg += "${usrbindir}/.debug ${usrsbindir}/.debug"
 FILES_${PN} += "/lib/udev* ${libdir}/ConsoleKit"
 FILES_${PN}-dbg += "/lib/udev/.debug"
 
+RPROVIDES_udev_spitz = "udev-compat-wrapper"
+do_unpack_append_spitz() {
+	bb.build.exec_func('do_apply_compat_wrapper', d)
+}
+RPROVIDES_udev_akita = "udev-compat-wrapper"
+do_unpack_append_akita() {
+	bb.build.exec_func('do_apply_compat_wrapper', d)
+}
+# Modify init script on platforms that need to boot old kernels:
+do_apply_compat_wrapper() {
+	cd ${WORKDIR}
+	sed -i "s:/sbin/udevd:\$UDEVD:g;s:/sbin/udevadm:\$UDEVADM:g" init
+	patch <udev-compat-wrapper-patch
+	cd -
+}
+
 do_install () {
 	install -d ${D}${usrsbindir} \
 		   ${D}${sbindir}





More information about the Openembedded-commits mailing list