aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-core/udev/udev/udev-compat-wrapper-patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2011-03-17 21:41:22 +0100
committerKoen Kooi <koen@dominion.thruhere.net>2011-03-17 21:41:22 +0100
commitc58cc7d3796dcee6e93885c835ed04cb566abeb2 (patch)
tree3eea4d4ef6a4ef79e0f4e025d7012c1a5cc38835 /meta-oe/recipes-core/udev/udev/udev-compat-wrapper-patch
parenteec6ab97f712e06eb52c9f7c99e19ffab3ce9d74 (diff)
downloadmeta-openembedded-contrib-c58cc7d3796dcee6e93885c835ed04cb566abeb2.tar.gz
move layer into meta-oe in preparation for future splits
As per TSC decision Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/recipes-core/udev/udev/udev-compat-wrapper-patch')
-rw-r--r--meta-oe/recipes-core/udev/udev/udev-compat-wrapper-patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/meta-oe/recipes-core/udev/udev/udev-compat-wrapper-patch b/meta-oe/recipes-core/udev/udev/udev-compat-wrapper-patch
new file mode 100644
index 0000000000..c90d05aefa
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/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 | sed 's/^[0-9]*\.[0-9]*\.\([0-9]*\).*$/\1/')"
++ 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
+ }
+