summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-core
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
parenteec6ab97f712e06eb52c9f7c99e19ffab3ce9d74 (diff)
downloadmeta-openembedded-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')
-rw-r--r--meta-oe/recipes-core/dbus/dbus-1.2.24/0001-Make-the-default-DBus-reply-timeout-configurable.patch78
-rw-r--r--meta-oe/recipes-core/dbus/dbus-1.2.24/fix-install-daemon.patch13
-rw-r--r--meta-oe/recipes-core/dbus/dbus-c++-native_git.bb17
-rw-r--r--meta-oe/recipes-core/dbus/dbus-c++/fix-linking.patch13
-rw-r--r--meta-oe/recipes-core/dbus/dbus-c++_git.bb23
-rw-r--r--meta-oe/recipes-core/dbus/dbus-daemon-proxy_git.bb19
-rw-r--r--meta-oe/recipes-core/dbus/dbus.inc104
-rw-r--r--meta-oe/recipes-core/dbus/dbus/add-configurable-reply-timeouts.patch48
-rw-r--r--meta-oe/recipes-core/dbus/dbus/anon.patch13
-rw-r--r--meta-oe/recipes-core/dbus/dbus/dbus-1.init111
-rw-r--r--meta-oe/recipes-core/dbus/dbus/reuseaddr01.patch64
-rw-r--r--meta-oe/recipes-core/dbus/dbus/reuseaddr02.patch38
-rw-r--r--meta-oe/recipes-core/dbus/dbus/tmpdir.patch30
-rw-r--r--meta-oe/recipes-core/dbus/dbus_1.2.24.bb19
-rw-r--r--meta-oe/recipes-core/dbus/dbus_1.4.0.bb18
-rw-r--r--meta-oe/recipes-core/fakeroot/fakeroot-native_1.12.4.bb21
-rw-r--r--meta-oe/recipes-core/fakeroot/fakeroot/configure-libtool.patch20
-rw-r--r--meta-oe/recipes-core/fakeroot/fakeroot/fix-prefix.patch15
-rw-r--r--meta-oe/recipes-core/fakeroot/fakeroot_1.12.4.bb26
-rw-r--r--meta-oe/recipes-core/udev/udev-165/akita/default4
-rw-r--r--meta-oe/recipes-core/udev/udev-165/bug/10-mx31.rules49
-rw-r--r--meta-oe/recipes-core/udev/udev-165/bug/30-BUG.rules26
-rw-r--r--meta-oe/recipes-core/udev/udev-165/bug/bmi_eventpipe.sh8
-rw-r--r--meta-oe/recipes-core/udev/udev-165/c7x0/default4
-rw-r--r--meta-oe/recipes-core/udev/udev-165/cache22
-rw-r--r--meta-oe/recipes-core/udev/udev-165/default4
-rw-r--r--meta-oe/recipes-core/udev/udev-165/init73
-rw-r--r--meta-oe/recipes-core/udev/udev-165/local.rules35
-rw-r--r--meta-oe/recipes-core/udev/udev-165/omap3-pandora/local.rules40
-rw-r--r--meta-oe/recipes-core/udev/udev-165/permissions.rules110
-rw-r--r--meta-oe/recipes-core/udev/udev-165/run.rules14
-rw-r--r--meta-oe/recipes-core/udev/udev-165/spitz/default4
-rw-r--r--meta-oe/recipes-core/udev/udev-165/tosa/default4
-rw-r--r--meta-oe/recipes-core/udev/udev-165/udev-replace-le16toh.patch21
-rw-r--r--meta-oe/recipes-core/udev/udev-165/udev-replace-lutimes.patch25
-rw-r--r--meta-oe/recipes-core/udev/udev-165/udev.rules113
-rw-r--r--meta-oe/recipes-core/udev/udev.inc101
-rw-r--r--meta-oe/recipes-core/udev/udev/50-hostap_cs.rules4
-rw-r--r--meta-oe/recipes-core/udev/udev/akita/mount.blacklist6
-rw-r--r--meta-oe/recipes-core/udev/udev/angstrom/mount.sh72
-rw-r--r--meta-oe/recipes-core/udev/udev/c7x0/mount.blacklist6
-rw-r--r--meta-oe/recipes-core/udev/udev/devfs-udev.rules108
-rwxr-xr-xmeta-oe/recipes-core/udev/udev/init212
-rw-r--r--meta-oe/recipes-core/udev/udev/links.conf24
-rw-r--r--meta-oe/recipes-core/udev/udev/local.rules22
-rw-r--r--meta-oe/recipes-core/udev/udev/mount.blacklist3
-rw-r--r--meta-oe/recipes-core/udev/udev/mount.sh72
-rw-r--r--meta-oe/recipes-core/udev/udev/network.sh58
-rw-r--r--meta-oe/recipes-core/udev/udev/noasmlinkage.patch38
-rw-r--r--meta-oe/recipes-core/udev/udev/nokia900/10-cmt_speech.rules1
-rw-r--r--meta-oe/recipes-core/udev/udev/nokia900/70-persistent-net.rules9
-rw-r--r--meta-oe/recipes-core/udev/udev/nokia900/nokia-n900-mac-hack.sh23
-rw-r--r--meta-oe/recipes-core/udev/udev/nokia900/udev-rules-nokia-n900-hacks.rules8
-rw-r--r--meta-oe/recipes-core/udev/udev/nokia900/udev-rules-nokia-n900-snd.rules10
-rw-r--r--meta-oe/recipes-core/udev/udev/omap3-pandora/local.rules27
-rw-r--r--meta-oe/recipes-core/udev/udev/permissions.rules79
-rw-r--r--meta-oe/recipes-core/udev/udev/shr/mount.blacklist4
-rw-r--r--meta-oe/recipes-core/udev/udev/slugos/mount.blacklist5
-rw-r--r--meta-oe/recipes-core/udev/udev/slugos/mount.sh83
-rw-r--r--meta-oe/recipes-core/udev/udev/spitz/mount.blacklist7
-rw-r--r--meta-oe/recipes-core/udev/udev/tosa/mount.blacklist6
-rw-r--r--meta-oe/recipes-core/udev/udev/udev-compat-wrapper-patch37
-rw-r--r--meta-oe/recipes-core/udev/udev/udev.rules98
-rw-r--r--meta-oe/recipes-core/udev/udev/udev_network_queue.sh35
-rw-r--r--meta-oe/recipes-core/udev/udev/udevsynthesize.patch776
-rw-r--r--meta-oe/recipes-core/udev/udev/udevsynthesize.sh51
-rw-r--r--meta-oe/recipes-core/udev/udev_165.bb181
67 files changed, 3412 insertions, 0 deletions
diff --git a/meta-oe/recipes-core/dbus/dbus-1.2.24/0001-Make-the-default-DBus-reply-timeout-configurable.patch b/meta-oe/recipes-core/dbus/dbus-1.2.24/0001-Make-the-default-DBus-reply-timeout-configurable.patch
new file mode 100644
index 000000000..a38e3db0d
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus-1.2.24/0001-Make-the-default-DBus-reply-timeout-configurable.patch
@@ -0,0 +1,78 @@
1From fb546488e93a1638d377b228bbb0d2ab58462168 Mon Sep 17 00:00:00 2001
2From: Daniel Willmann <daniel@totalueberwachung.de>
3Date: Thu, 2 Oct 2008 15:50:17 +0800
4Subject: [PATCH] Make the default DBus reply timeout configurable
5
6This patch adds an option --with-dbus-default-reply-timeout to configure
7that will set the default reply timeout used by libdbus in milliseconds.
8autoconf and autoheader need to be rerun in order to regenerate the
9correct configure and config.h.in files.
10---
11 configure.in | 9 +++++++++
12 dbus/dbus-connection-internal.h | 3 ---
13 dbus/dbus-pending-call.c | 1 +
14 3 files changed, 10 insertions(+), 3 deletions(-)
15
16diff --git a/configure.in b/configure.in
17index 62ac387..5c912d7 100644
18--- a/configure.in
19+++ b/configure.in
20@@ -88,6 +88,7 @@ AC_ARG_WITH(console-auth-dir, AS_HELP_STRING([--with-console-auth-dir=[dirname]]
21 AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filename]],[file whose owner determines current console owner]))
22 AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=<user>],[User for running the DBUS daemon (messagebus)]))
23 AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon]))
24+AC_ARG_WITH(dbus_default_reply_timeout, AS_HELP_STRING([--with-dbus-default-reply-timeout=[milliseconds]],[Default reply timeout for DBus method calls]))
25
26 AC_DEFINE(DBUS_UNIX,1,[dbus on unix])
27
28@@ -986,6 +987,13 @@ if test x$have_libaudit = xyes ; then
29 AC_DEFINE(HAVE_LIBAUDIT,1,[audit daemon SELinux support])
30 fi
31
32+if test -z "$with_dbus_default_reply_timeout" ; then
33+ DBUS_DEFAULT_REPLY_TIMEOUT=25000
34+else
35+ DBUS_DEFAULT_REPLY_TIMEOUT=$with_dbus_default_reply_timeout
36+fi
37+AC_DEFINE_UNQUOTED(_DBUS_DEFAULT_TIMEOUT_VALUE,$DBUS_DEFAULT_REPLY_TIMEOUT,[default timeout value for dbus calls])
38+
39 #### Set up final flags
40 DBUS_CLIENT_CFLAGS=
41 DBUS_CLIENT_LIBS="$THREAD_LIBS"
42@@ -1348,6 +1356,7 @@ echo "
43 Gettext libs (empty OK): ${INTLLIBS}
44 Using XML parser: ${with_xml}
45 Init scripts style: ${with_init_scripts}
46+ Default reply timeout: ${DBUS_DEFAULT_REPLY_TIMEOUT}
47 Abstract socket names: ${ac_cv_have_abstract_sockets}
48 System bus socket: ${DBUS_SYSTEM_SOCKET}
49 System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
50diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h
51index df54412..5fe536b 100644
52--- a/dbus/dbus-connection-internal.h
53+++ b/dbus/dbus-connection-internal.h
54@@ -41,9 +41,6 @@ typedef enum
55 DBUS_ITERATION_BLOCK = 1 << 2 /**< Block if nothing to do. */
56 } DBusIterationFlags;
57
58-/** default timeout value when waiting for a message reply, 25 seconds */
59-#define _DBUS_DEFAULT_TIMEOUT_VALUE (25 * 1000)
60-
61 void _dbus_connection_lock (DBusConnection *connection);
62 void _dbus_connection_unlock (DBusConnection *connection);
63 DBusConnection * _dbus_connection_ref_unlocked (DBusConnection *connection);
64diff --git a/dbus/dbus-pending-call.c b/dbus/dbus-pending-call.c
65index 51b9378..5a7a5f4 100644
66--- a/dbus/dbus-pending-call.c
67+++ b/dbus/dbus-pending-call.c
68@@ -21,6 +21,7 @@
69 *
70 */
71
72+#include <config.h>
73 #include "dbus-internals.h"
74 #include "dbus-connection-internal.h"
75 #include "dbus-pending-call-internal.h"
76--
771.5.6.4
78
diff --git a/meta-oe/recipes-core/dbus/dbus-1.2.24/fix-install-daemon.patch b/meta-oe/recipes-core/dbus/dbus-1.2.24/fix-install-daemon.patch
new file mode 100644
index 000000000..5e25d1227
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus-1.2.24/fix-install-daemon.patch
@@ -0,0 +1,13 @@
1Index: dbus-0.94/bus/Makefile.am
2===================================================================
3--- dbus-0.94.orig/bus/Makefile.am 2006-10-01 17:36:18.000000000 +0200
4+++ dbus-0.94/bus/Makefile.am 2006-10-14 21:40:05.000000000 +0200
5@@ -110,7 +110,7 @@
6 $(mkinstalldirs) $(DESTDIR)$(DBUS_DAEMONDIR); \
7 chmod 755 $(DESTDIR)$(DBUS_DAEMONDIR); \
8 fi
9- $(INSTALL_PROGRAM) dbus-daemon $(DESTDIR)$(DBUS_DAEMONDIR)
10+ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) dbus-daemon $(DESTDIR)$(DBUS_DAEMONDIR)
11 $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus
12 $(mkinstalldirs) $(DESTDIR)$(configdir)/system.d
13 $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
diff --git a/meta-oe/recipes-core/dbus/dbus-c++-native_git.bb b/meta-oe/recipes-core/dbus/dbus-c++-native_git.bb
new file mode 100644
index 000000000..eba80b2e9
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus-c++-native_git.bb
@@ -0,0 +1,17 @@
1require dbus-c++_git.bb
2inherit native
3
4FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/dbus-c++"
5# actually dbus-native and expat-native, but even the bearest build machine should have that nowadays...
6DEPENDS = ""
7
8do_compile() {
9 oe_runmake -C src libdbus-c++-1.la
10 oe_runmake -C tools dbusxx-xml2cpp
11 install -m 0755 tools/dbusxx-xml2cpp ${STAGING_BINDIR_NATIVE}
12}
13
14do_install() {
15 :
16}
17
diff --git a/meta-oe/recipes-core/dbus/dbus-c++/fix-linking.patch b/meta-oe/recipes-core/dbus/dbus-c++/fix-linking.patch
new file mode 100644
index 000000000..822216916
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus-c++/fix-linking.patch
@@ -0,0 +1,13 @@
1Index: dbus/tools/Makefile.am
2===================================================================
3--- dbus.orig/tools/Makefile.am
4+++ dbus/tools/Makefile.am
5@@ -16,7 +16,7 @@ endif
6 bin_PROGRAMS = dbusxx-xml2cpp dbusxx-introspect
7
8 dbusxx_xml2cpp_SOURCES = xml.h xml.cpp xml2cpp.h xml2cpp.cpp
9-dbusxx_xml2cpp_LDADD = $(libdbus_cxx_la)
10+dbusxx_xml2cpp_LDADD = $(libdbus_cxx_la) -lexpat
11
12 dbusxx_introspect_SOURCES = introspect.h introspect.cpp
13 dbusxx_introspect_LDADD = $(libdbus_cxx_la)
diff --git a/meta-oe/recipes-core/dbus/dbus-c++_git.bb b/meta-oe/recipes-core/dbus/dbus-c++_git.bb
new file mode 100644
index 000000000..64598238d
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus-c++_git.bb
@@ -0,0 +1,23 @@
1DESCRIPTION = "C++ bindings for dbus"
2LICENSE = "LGPLv2.1+"
3SECTION = "libs"
4DEPENDS = "dbus dbus-c++-native expat"
5SRCREV = "530a887913d3b0dd7091eabb8eef8e3c279e3bb8"
6
7PE = "1"
8PV = "0.5.0+gitr${SRCPV}"
9
10SRC_URI = "git://gitorious.org/dbus-cplusplus/mainline.git;protocol=git"
11# file://fix-linking.patch"
12S = "${WORKDIR}/git"
13
14inherit autotools pkgconfig
15
16do_compile_prepend() {
17 find . -name "Makefile.am" |xargs sed -i -e 's,$(top_builddir)/tools/dbusxx-xml2cpp,dbusxx-xml2cpp,'
18}
19
20FILES_${PN}-dbg += "${bindir}/dbusxx-xml2cpp ${bindir}/dbusxx-introspect"
21FILES_${PN}-dev += "${bindir}/.dev"
22FILES_${PN} = "${libdir}/*.so.*"
23
diff --git a/meta-oe/recipes-core/dbus/dbus-daemon-proxy_git.bb b/meta-oe/recipes-core/dbus/dbus-daemon-proxy_git.bb
new file mode 100644
index 000000000..32ed7dbfd
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus-daemon-proxy_git.bb
@@ -0,0 +1,19 @@
1DESCRIPTION = "dbus forwarding daemon"
2LICENSE = "LGPLv2.1+"
3DEPENDS = "dbus dbus-glib"
4SRCREV = "1226a0a1374628ff191f6d8a56000be5e53e7608"
5PV = "0.0.0+gitr${SRCPV}"
6PR = "r1"
7
8SRC_URI = "git://git.collabora.co.uk/git/user/alban/dbus-daemon-proxy;protocol=git"
9S = "${WORKDIR}/git"
10
11do_compile() {
12 ${CC} ${LDFLAGS} `pkg-config --cflags --libs dbus-glib-1` -o dbus-daemon-proxy dbus-daemon-proxy.c
13}
14
15do_install() {
16 install -d ${D}${bindir}
17 install -m 0755 dbus-daemon-proxy ${D}${bindir}
18}
19
diff --git a/meta-oe/recipes-core/dbus/dbus.inc b/meta-oe/recipes-core/dbus/dbus.inc
new file mode 100644
index 000000000..40a670aac
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus.inc
@@ -0,0 +1,104 @@
1DESCRIPTION = "A message bus system for inter-process communication"
2HOMEPAGE = "http://dbus.freedesktop.org"
3SECTION = "base"
4LICENSE = "AFL2.1 | GPLv2+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
6 file://dbus/dbus.h;firstline=6;endline=20;md5=6eea2e0c7750dd8e620dcb1437312fa5"
7DEPENDS = "expat virtual/libintl libsm libice virtual/libx11"
8
9INC_PR = "r20"
10
11SRC_URI = "\
12 http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz;name=dbus \
13 file://cross.patch \
14 file://tmpdir.patch \
15 file://fix-install-daemon.patch \
16 file://0001-Make-the-default-DBus-reply-timeout-configurable.patch \
17 file://dbus-1.init \
18"
19
20S = "${WORKDIR}/dbus-${PV}"
21
22inherit autotools pkgconfig update-rc.d gettext
23
24EXTRA_OECONF_X = "--with-x"
25
26EXTRA_OECONF = "\
27 --disable-qt \
28 --disable-qt3 \
29 --disable-gtk \
30 --disable-tests \
31 --disable-checks \
32 --disable-xml-docs \
33 --disable-doxygen-docs \
34 --disable-libaudit \
35 --with-xml=expat \
36 --with-dbus-default-reply-timeout=200000 \
37 ${EXTRA_OECONF_X} \
38"
39
40# On mipsel, D-Bus fails to link with --gc-sections and segfaults before main()
41# when built with -fPIE/-pie.
42do_configure_prepend_mipsel() {
43 sed -i -e 's/\-fPIE//' \
44 -e 's/\-pie\ \-Wl\,\-z\,relro//' \
45 -e 's/-Wl,--gc-sections//' \
46 ${S}/configure.in
47}
48
49do_install_append() {
50 install -d ${D}${sysconfdir}/init.d
51 install -m 0755 ${WORKDIR}/dbus-1.init ${D}${sysconfdir}/init.d/dbus-1
52 # the stock install seems to install the libtool wrapper script, so we have to copy this manually :M:
53 if [ -e bus/.libs/dbus-daemon-launch-helper ]; then
54 install -d ${D}${libexecdir}/
55 install -m 0755 bus/.libs/dbus-daemon-launch-helper ${D}${libexecdir}/
56 fi
57}
58
59RDEPENDS_${PN}-x11 = "${PN}"
60RRECOMMENDS_${PN}-lib = "${PN}"
61RCONFLICTS_${PN} = "dbus-1"
62RREPLACES_${PN} = "dbus-1"
63RPROVIDES_${PN} = "dbus-1"
64
65PACKAGES =+ "${PN}-lib ${PN}-x11"
66
67FILES_${PN} = "\
68${bindir}/dbus-daemon* \
69${bindir}/dbus-uuidgen \
70${bindir}/dbus-cleanup-sockets \
71${bindir}/dbus-send \
72${bindir}/dbus-monitor \
73${libexecdir}/dbus* \
74${sysconfdir} \
75${datadir}/dbus-1/services \
76${datadir}/dbus-1/system-services \
77"
78FILES_${PN}-lib = "${libdir}/lib*.so.*"
79FILES_${PN}-x11 = "\
80${bindir}/dbus-launch \
81"
82FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool ${libdir}/"
83
84pkg_postinst_${PN}() {
85#!/bin/sh
86# can't do adduser stuff offline
87if [ "x$D" != "x" ]; then
88 exit 1
89fi
90MESSAGEUSER=messagebus
91MESSAGEHOME=/var/run/dbus
92mkdir -p $MESSAGEHOME || true
93grep -q ^$MESSAGEUSER: /etc/group || addgroup "$MESSAGEUSER"
94chgrp "$MESSAGEUSER" "$MESSAGEHOME"
95grep -q ^$MESSAGEUSER: /etc/passwd || adduser --system --home "$MESSAGEHOME" --no-create-home --disabled-password --ingroup "$MESSAGEUSER" "$MESSAGEUSER"
96chown "$MESSAGEUSER"."$MESSAGEUSER" "$MESSAGEHOME"
97grep -q netdev: /etc/group || addgroup netdev
98chmod u+s /usr/libexec/dbus-daemon-launch-helper
99}
100
101CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
102
103INITSCRIPT_NAME = "dbus-1"
104INITSCRIPT_PARAMS = "start 02 5 2 . stop 20 0 1 6 ."
diff --git a/meta-oe/recipes-core/dbus/dbus/add-configurable-reply-timeouts.patch b/meta-oe/recipes-core/dbus/dbus/add-configurable-reply-timeouts.patch
new file mode 100644
index 000000000..9cca38ddc
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus/add-configurable-reply-timeouts.patch
@@ -0,0 +1,48 @@
1Index: dbus-1.3.1/configure.in
2===================================================================
3--- dbus-1.3.1.orig/configure.in
4+++ dbus-1.3.1/configure.in
5@@ -137,6 +137,7 @@
6 AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filename]],[file whose owner determines current console owner]))
7 AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=<user>],[User for running the DBUS daemon (messagebus)]))
8 AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon]))
9+AC_ARG_WITH(dbus_default_reply_timeout, AS_HELP_STRING([--with-dbus-default-reply-timeout=[milliseconds]],[Default reply timeout for DBus method calls]))
10
11 dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
12 dnl and also some stuff in the test/ subdir
13@@ -984,6 +985,13 @@
14 fi
15 fi
16
17+if test -z "$with_dbus_default_reply_timeout" ; then
18+ DBUS_DEFAULT_REPLY_TIMEOUT=25000
19+else
20+ DBUS_DEFAULT_REPLY_TIMEOUT=$with_dbus_default_reply_timeout
21+fi
22+AC_DEFINE_UNQUOTED(_DBUS_DEFAULT_TIMEOUT_VALUE,$DBUS_DEFAULT_REPLY_TIMEOUT,[default timeout value for dbus calls])
23+
24 #### Set up final flags
25 DBUS_CLIENT_CFLAGS=
26 DBUS_CLIENT_LIBS="$THREAD_LIBS $NETWORK_libs"
27@@ -1625,6 +1633,7 @@
28 Gettext libs (empty OK): ${INTLLIBS}
29 Using XML parser: ${with_xml}
30 Init scripts style: ${with_init_scripts}
31+ Default reply timeout: ${DBUS_DEFAULT_REPLY_TIMEOUT}
32 Abstract socket names: ${ac_cv_have_abstract_sockets}
33 System bus socket: ${DBUS_SYSTEM_SOCKET}
34 System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
35Index: dbus-1.3.1/dbus/dbus-connection-internal.h
36===================================================================
37--- dbus-1.3.1.orig/dbus/dbus-connection-internal.h
38+++ dbus-1.3.1/dbus/dbus-connection-internal.h
39@@ -41,9 +41,6 @@
40 DBUS_ITERATION_BLOCK = 1 << 2 /**< Block if nothing to do. */
41 } DBusIterationFlags;
42
43-/** default timeout value when waiting for a message reply, 25 seconds */
44-#define _DBUS_DEFAULT_TIMEOUT_VALUE (25 * 1000)
45-
46 void _dbus_connection_lock (DBusConnection *connection);
47 void _dbus_connection_unlock (DBusConnection *connection);
48 DBusConnection * _dbus_connection_ref_unlocked (DBusConnection *connection);
diff --git a/meta-oe/recipes-core/dbus/dbus/anon.patch b/meta-oe/recipes-core/dbus/dbus/anon.patch
new file mode 100644
index 000000000..c9bf7bfa6
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus/anon.patch
@@ -0,0 +1,13 @@
1diff -Naur dbus-1.2.1.orig/dbus/dbus-transport.c dbus-1.2.1/dbus/dbus-transport.c
2--- dbus-1.2.1.orig/dbus/dbus-transport.c 2008-09-16 15:10:02.000000000 +0000
3+++ dbus-1.2.1/dbus/dbus-transport.c 2008-09-16 15:10:10.000000000 +0000
4@@ -747,6 +747,9 @@
5 dbus_bool_t allow;
6 DBusCredentials *auth_identity;
7
8+ // allow anonymous connections
9+ _dbus_transport_set_allow_anonymous(transport, TRUE);
10+
11 auth_identity = _dbus_auth_get_identity (transport->auth);
12 _dbus_assert (auth_identity != NULL);
13
diff --git a/meta-oe/recipes-core/dbus/dbus/dbus-1.init b/meta-oe/recipes-core/dbus/dbus/dbus-1.init
new file mode 100644
index 000000000..a70e7a237
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus/dbus-1.init
@@ -0,0 +1,111 @@
1#! /bin/sh
2# -*- coding: utf-8 -*-
3# Debian init.d script for D-BUS
4# Copyright © 2003 Colin Walters <walters@debian.org>
5# Copyright 2008 OE Team
6
7set -e
8
9DAEMON=/usr/bin/dbus-daemon
10NAME=dbus
11DAEMONUSER=messagebus
12RUNDIR=/var/run/dbus
13PIDFILE=/var/run/dbus/pid
14UUIDDIR=/var/lib/dbus
15DESC="system message bus"
16EVENTDIR=/etc/dbus-1/event.d
17
18test -x $DAEMON || exit 0
19
20# Source defaults file; edit that file to configure this script.
21ENABLED=1
22PARAMS=""
23if [ -e /etc/default/dbus ]; then
24 . /etc/default/dbus
25fi
26
27test "$ENABLED" != "0" || exit 0
28
29start_it_up()
30{
31 if [ ! -d $RUNDIR ]; then
32 mkdir -p $RUNDIR
33 chown $DAEMONUSER $RUNDIR
34 chgrp $DAEMONUSER $RUNDIR
35 fi
36 if [ -e $PIDFILE ]; then
37 PIDDIR=/proc/$(cat $PIDFILE)
38 if [ -d ${PIDDIR} -a "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then
39 echo "$DESC already started; not starting."
40 else
41 echo "Removing stale PID file $PIDFILE."
42 rm -f $PIDFILE
43 fi
44 fi
45
46 if [ ! -d $UUIDDIR ]; then
47 mkdir -p $UUIDDIR
48 chown $DAEMONUSER $UUIDDIR
49 chgrp $DAEMONUSER $UUIDDIR
50 fi
51
52 dbus-uuidgen --ensure
53
54 echo -n "Starting $DESC: "
55 start-stop-daemon --start --pidfile $PIDFILE \
56 --user $DAEMONUSER --exec $DAEMON -- --system $PARAMS
57 echo "$NAME."
58 if [ -d $EVENTDIR ]; then
59 run-parts --arg=start $EVENTDIR
60 fi
61}
62
63shut_it_down()
64{
65 if [ -d $EVENTDIR ]; then
66 # TODO: --reverse when busybox supports it
67 run-parts --arg=stop $EVENTDIR
68 fi
69 echo -n "Stopping $DESC: "
70 start-stop-daemon --stop --oknodo --pidfile $PIDFILE \
71 --user $DAEMONUSER
72 # We no longer include these arguments so that start-stop-daemon
73 # can do its job even given that we may have been upgraded.
74 # We rely on the pidfile being sanely managed
75 # --exec $DAEMON -- --system $PARAMS
76 echo "$NAME."
77 rm -f $PIDFILE
78}
79
80reload_it()
81{
82 echo -n "Reloading $DESC config: "
83 dbus-send --print-reply --system --type=method_call \
84 --dest=org.freedesktop.DBus \
85 / org.freedesktop.DBus.ReloadConfig > /dev/null
86 # hopefully this is enough time for dbus to reload it's config file.
87 echo "done."
88}
89
90case "$1" in
91 start)
92 start_it_up
93 ;;
94 stop)
95 shut_it_down
96 ;;
97 reload|force-reload)
98 reload_it
99 ;;
100 restart)
101 shut_it_down
102 sleep 1
103 start_it_up
104 ;;
105 *)
106 echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2
107 exit 1
108 ;;
109esac
110
111exit 0
diff --git a/meta-oe/recipes-core/dbus/dbus/reuseaddr01.patch b/meta-oe/recipes-core/dbus/dbus/reuseaddr01.patch
new file mode 100644
index 000000000..e291bb894
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus/reuseaddr01.patch
@@ -0,0 +1,64 @@
1From 8f5f340b77b51fed1f036a9ee9f70a31b201f2c9 Mon Sep 17 00:00:00 2001
2From: Sledz <sledz@MOBIL-400-586.intern.dresearch.de>
3Date: Tue, 29 Jun 2010 21:04:15 +0000
4Subject: sysdeps-unix: enable address reuse on TCP sockets
5
6This helps to avoid 'Address already in use' problems if server has been shut
7down, and then restarted while sockets are still active on its port.
8
9Signed-off-by: Steffen Sledz <sledz@dresearch.de>
10---
11diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
12index ce3475a..b58d09a 100644
13--- a/dbus/dbus-sysdeps-unix.c
14+++ b/dbus/dbus-sysdeps-unix.c
15@@ -623,6 +623,7 @@ _dbus_listen_unix_socket (const char *path,
16 int listen_fd;
17 struct sockaddr_un addr;
18 size_t path_len;
19+ unsigned int reuseaddr;
20
21 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
22
23@@ -696,7 +697,15 @@ _dbus_listen_unix_socket (const char *path,
24
25 strncpy (addr.sun_path, path, path_len);
26 }
27-
28+
29+ reuseaddr = 1;
30+ if (setsockopt (listen_fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr))==-1)
31+ {
32+ dbus_set_error (error, _dbus_error_from_errno (errno),
33+ "Failed to set socket option\"%s\": %s",
34+ path, _dbus_strerror (errno));
35+ }
36+
37 if (bind (listen_fd, (struct sockaddr*) &addr, _DBUS_STRUCT_OFFSET (struct sockaddr_un, sun_path) + path_len) < 0)
38 {
39 dbus_set_error (error, _dbus_error_from_errno (errno),
40@@ -870,6 +879,7 @@ _dbus_listen_tcp_socket (const char *host,
41 int nlisten_fd = 0, *listen_fd = NULL, res, i;
42 struct addrinfo hints;
43 struct addrinfo *ai, *tmp;
44+ unsigned int reuseaddr;
45
46 *fds_p = NULL;
47 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
48@@ -915,6 +925,14 @@ _dbus_listen_tcp_socket (const char *host,
49 }
50 _DBUS_ASSERT_ERROR_IS_CLEAR(error);
51
52+ reuseaddr = 1;
53+ if (setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr))==-1)
54+ {
55+ dbus_set_error (error, _dbus_error_from_errno (errno),
56+ "Failed to set socket option \"%s:%s\": %s",
57+ host ? host : "*", port, _dbus_strerror (errno));
58+ }
59+
60 if (bind (fd, (struct sockaddr*) tmp->ai_addr, tmp->ai_addrlen) < 0)
61 {
62 _dbus_close(fd, NULL);
63--
64cgit v0.8.3-6-g21f6
diff --git a/meta-oe/recipes-core/dbus/dbus/reuseaddr02.patch b/meta-oe/recipes-core/dbus/dbus/reuseaddr02.patch
new file mode 100644
index 000000000..10bc7edfd
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus/reuseaddr02.patch
@@ -0,0 +1,38 @@
1From d365dd8141e709222f3a619d7b04ec4ded6429fd Mon Sep 17 00:00:00 2001
2From: Havoc Pennington <hp@pobox.com>
3Date: Tue, 31 Aug 2010 15:59:09 +0000
4Subject: Change failure of setsockopt SO_REUSEADDR to be a warning, not set an error
5
6It was previously setting an error but then continuing, which is
7not allowed since errors can't be "piled up"
8---
9diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
10index e4ff6ee..3205bed 100644
11--- a/dbus/dbus-sysdeps-unix.c
12+++ b/dbus/dbus-sysdeps-unix.c
13@@ -980,9 +980,8 @@ _dbus_listen_unix_socket (const char *path,
14 reuseaddr = 1;
15 if (setsockopt (listen_fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr))==-1)
16 {
17- dbus_set_error (error, _dbus_error_from_errno (errno),
18- "Failed to set socket option\"%s\": %s",
19- path, _dbus_strerror (errno));
20+ _dbus_warn ("Failed to set socket option\"%s\": %s",
21+ path, _dbus_strerror (errno));
22 }
23
24 if (bind (listen_fd, (struct sockaddr*) &addr, _DBUS_STRUCT_OFFSET (struct sockaddr_un, sun_path) + path_len) < 0)
25@@ -1335,9 +1334,8 @@ _dbus_listen_tcp_socket (const char *host,
26 reuseaddr = 1;
27 if (setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr))==-1)
28 {
29- dbus_set_error (error, _dbus_error_from_errno (errno),
30- "Failed to set socket option \"%s:%s\": %s",
31- host ? host : "*", port, _dbus_strerror (errno));
32+ _dbus_warn ("Failed to set socket option \"%s:%s\": %s",
33+ host ? host : "*", port, _dbus_strerror (errno));
34 }
35
36 if (bind (fd, (struct sockaddr*) tmp->ai_addr, tmp->ai_addrlen) < 0)
37--
38cgit v0.8.3-6-g21f6
diff --git a/meta-oe/recipes-core/dbus/dbus/tmpdir.patch b/meta-oe/recipes-core/dbus/dbus/tmpdir.patch
new file mode 100644
index 000000000..838b903f0
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus/tmpdir.patch
@@ -0,0 +1,30 @@
1--- dbus-0.22/configure.in.orig 2004-08-13 00:57:16.000000000 +0200
2+++ dbus-0.22/configure.in 2004-12-30 21:15:57.000000000 +0100
3@@ -1047,15 +1048,18 @@
4 AC_SUBST(ABSOLUTE_TOP_BUILDDIR)
5
6 #### Find socket directories
7-if ! test -z "$TMPDIR" ; then
8- DEFAULT_SOCKET_DIR=$TMPDIR
9-elif ! test -z "$TEMP" ; then
10- DEFAULT_SOCKET_DIR=$TEMP
11-elif ! test -z "$TMP" ; then
12- DEFAULT_SOCKET_DIR=$TMP
13-else
14- DEFAULT_SOCKET_DIR=/tmp
15-fi
16+#if ! test -z "$TMPDIR" ; then
17+# DEFAULT_SOCKET_DIR=$TMPDIR
18+#elif ! test -z "$TEMP" ; then
19+# DEFAULT_SOCKET_DIR=$TEMP
20+#elif ! test -z "$TMP" ; then
21+# DEFAULT_SOCKET_DIR=$TMP
22+#else
23+# DEFAULT_SOCKET_DIR=/tmp
24+#fi
25+
26+# checks disabled to avoid expanding this at build time
27+DEFAULT_SOCKET_DIR=/tmp
28
29 if ! test -z "$with_test_socket_dir" ; then
30 TEST_SOCKET_DIR="$with_test_socket_dir"
diff --git a/meta-oe/recipes-core/dbus/dbus_1.2.24.bb b/meta-oe/recipes-core/dbus/dbus_1.2.24.bb
new file mode 100644
index 000000000..75825514b
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus_1.2.24.bb
@@ -0,0 +1,19 @@
1include dbus.inc
2
3PR = "${INC_PR}.1"
4
5SRC_URI = "\
6 http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz;name=dbus \
7 file://tmpdir.patch \
8 file://fix-install-daemon.patch \
9 file://0001-Make-the-default-DBus-reply-timeout-configurable.patch \
10 file://dbus-1.init \
11 file://reuseaddr01.patch \
12 file://reuseaddr02.patch \
13"
14
15SRC_URI_append_hipox = "file://anon.patch"
16
17SRC_URI[dbus.md5sum] = "565346cecd9cfecf1463540c6086cc2c"
18SRC_URI[dbus.sha256sum] = "f12c748f4a703655e3d4c3db94cdf5a752a0cd0b36958c715804373bd3595c48"
19
diff --git a/meta-oe/recipes-core/dbus/dbus_1.4.0.bb b/meta-oe/recipes-core/dbus/dbus_1.4.0.bb
new file mode 100644
index 000000000..2c4943b4f
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus_1.4.0.bb
@@ -0,0 +1,18 @@
1include dbus.inc
2PR = "${INC_PR}.0"
3
4BBCLASSEXTEND = "native"
5
6SRC_URI = "\
7 http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
8 \
9 file://tmpdir.patch \
10 file://add-configurable-reply-timeouts.patch \
11 file://dbus-1.init \
12"
13
14# This needs more testing before pushing as default dbus
15DEFAULT_PREFERENCE = "-1"
16
17SRC_URI[md5sum] = "f59618b18d2fb2bd1fce9e1c5a2a3282"
18SRC_URI[sha256sum] = "c96d2f86d40e158e2bf405925a0a42cce0533a8466098e2f2238aa1614926652"
diff --git a/meta-oe/recipes-core/fakeroot/fakeroot-native_1.12.4.bb b/meta-oe/recipes-core/fakeroot/fakeroot-native_1.12.4.bb
new file mode 100644
index 000000000..e6add2bb2
--- /dev/null
+++ b/meta-oe/recipes-core/fakeroot/fakeroot-native_1.12.4.bb
@@ -0,0 +1,21 @@
1require fakeroot_${PV}.bb
2
3SRC_URI += "file://fix-prefix.patch"
4S = "${WORKDIR}/fakeroot-${PV}"
5
6inherit native
7
8EXTRA_OECONF = "--program-prefix="
9
10# Compatability for the rare systems not using or having SYSV
11python () {
12 if bb.data.getVar('HOST_NONSYSV', d, True) and bb.data.getVar('HOST_NONSYSV', d, True) != '0':
13 bb.data.setVar('EXTRA_OECONF', ' --with-ipc=tcp --program-prefix= ', d)
14}
15
16NATIVE_INSTALL_WORKS = "1"
17
18RDEPENDS_${PN} = "util-linux-native"
19
20SRC_URI[md5sum] = "aaefede2405a40c87438e7e833d69b70"
21SRC_URI[sha256sum] = "dbcab1f495b857e67feff882e018ca59958b8d189ff1f76684d28e35463ec29d"
diff --git a/meta-oe/recipes-core/fakeroot/fakeroot/configure-libtool.patch b/meta-oe/recipes-core/fakeroot/fakeroot/configure-libtool.patch
new file mode 100644
index 000000000..46f7df702
--- /dev/null
+++ b/meta-oe/recipes-core/fakeroot/fakeroot/configure-libtool.patch
@@ -0,0 +1,20 @@
1Index: fakeroot-1.12.1/configure.ac
2===================================================================
3--- fakeroot-1.12.1.orig/configure.ac
4+++ fakeroot-1.12.1/configure.ac
5@@ -2,14 +2,12 @@
6 AC_INIT([fakeroot],[FAKEROOT_VERSION],[schizo@debian.org],[fakeroot])
7 AC_PREREQ(2.61)
8 AC_CONFIG_MACRO_DIR([build-aux])
9-LT_PREREQ(2.1a)
10 AC_CANONICAL_TARGET
11 AM_INIT_AUTOMAKE
12 AM_MAINTAINER_MODE
13 AC_CONFIG_HEADERS([config.h])
14 AC_PROG_MAKE_SET
15-LT_INIT
16-LT_LANG(C)
17+AC_PROG_LIBTOOL
18
19 AH_BOTTOM([#if ! HAVE_BUILTIN_EXPECT
20 #define __builtin_expect(x, expected_value) (x)
diff --git a/meta-oe/recipes-core/fakeroot/fakeroot/fix-prefix.patch b/meta-oe/recipes-core/fakeroot/fakeroot/fix-prefix.patch
new file mode 100644
index 000000000..3c47bd765
--- /dev/null
+++ b/meta-oe/recipes-core/fakeroot/fakeroot/fix-prefix.patch
@@ -0,0 +1,15 @@
1Index: fakeroot-1.12.1/scripts/fakeroot.in
2===================================================================
3--- fakeroot-1.12.1.orig/scripts/fakeroot.in
4+++ fakeroot-1.12.1/scripts/fakeroot.in
5@@ -30,8 +30,8 @@
6 }
7
8 # strip /bin/fakeroot to find install prefix
9-PREFIX=@prefix@
10-BINDIR=@bindir@
11+BINDIR=`dirname $0`
12+PREFIX=`dirname ${BINDIR}`
13
14 USEABSLIBPATH=@LDPRELOADABS@
15 LIB=lib@fakeroot_transformed@@DLSUFFIX@
diff --git a/meta-oe/recipes-core/fakeroot/fakeroot_1.12.4.bb b/meta-oe/recipes-core/fakeroot/fakeroot_1.12.4.bb
new file mode 100644
index 000000000..c265749f6
--- /dev/null
+++ b/meta-oe/recipes-core/fakeroot/fakeroot_1.12.4.bb
@@ -0,0 +1,26 @@
1DESCRIPTION = "Gives a fake root environment"
2HOMEPAGE = "http://fakeroot.alioth.debian.org"
3SECTION = "base"
4LICENSE = "GPL"
5PR = "r2"
6
7SRC_URI = "\
8 ${DEBIAN_MIRROR}/main/f/fakeroot/fakeroot_${PV}.tar.gz \
9 file://configure-libtool.patch \
10"
11
12inherit autotools
13
14do_install_append() {
15 install -d ${D}${includedir}/fakeroot
16 install -m 644 *.h ${D}${includedir}/fakeroot
17 install -d ${D}${libdir}/libfakeroot/
18 oe_libinstall -so libfakeroot ${D}${libdir}/libfakeroot/
19}
20
21# fakeroot needs getopt which is provided by the util-linux package
22RDEPENDS_${PN} = "util-linux"
23
24
25SRC_URI[md5sum] = "aaefede2405a40c87438e7e833d69b70"
26SRC_URI[sha256sum] = "dbcab1f495b857e67feff882e018ca59958b8d189ff1f76684d28e35463ec29d"
diff --git a/meta-oe/recipes-core/udev/udev-165/akita/default b/meta-oe/recipes-core/udev/udev-165/akita/default
new file mode 100644
index 000000000..d0050b873
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/akita/default
@@ -0,0 +1,4 @@
1# Default for /etc/init.d/udev
2
3# Comment this out to disable device cache
4#DEVCACHE="/etc/dev.tar"
diff --git a/meta-oe/recipes-core/udev/udev-165/bug/10-mx31.rules b/meta-oe/recipes-core/udev/udev-165/bug/10-mx31.rules
new file mode 100644
index 000000000..de427fc8b
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/bug/10-mx31.rules
@@ -0,0 +1,49 @@
1KERNEL=="ttyS[0-9]", NAME="tts/%n", SYMLINK+="tts%n"
2KERNEL=="ttymxc[0-9]", NAME="ttymxc/%n", SYMLINK+="ttymxc%n"
3
4KERNEL=="mxc_mu[0-9]", NAME="mxc_mu/%n", SYMLINK+="mxc_mu%n"
5KERNEL=="fb*", NAME="fb/%n", SYMLINK+="fb%n"
6KERNEL=="i2c*", NAME="i2c/%n"
7KERNEL=="mxc_ipc*", NAME="mxc_ipc/%n"
8KERNEL=="video*", NAME="v4l/video%n"
9
10KERNEL=="rtc", NAME="misc/rtc"
11KERNEL=="watchdog", NAME="misc/watchdog"
12
13KERNEL=="mc13783_adc", NAME="mc13783_adc", SYMLINK+="ts"
14KERNEL=="pmic_adc", NAME="pmic_adc", SYMLINK+="ts"
15
16# The long class name gets cut off to be mc13783_connectiv in
17# /sys/class/mc13783_connectivity/mc13783_connectivit
18KERNEL=="mc13783_connectiv*", NAME="mc13783_connectivity"
19
20KERNEL=="mxc_ssi[0-9]*", NAME="mxc_ssi/%n", SYMLINK+="mxc_ssi%n"
21KERNEL=="spi[0-9]*", NAME="spi/%n", SYMLINK+="spi%n"
22
23KERNEL=="mtdblock*", NAME="mtdblock/%n" SYMLINK+="mtdblock%n"
24KERNEL=="mtd[0-9]", NAME="mtd/%n"
25
26# A more elegant way of doing this must exist...
27KERNEL=="mtd0ro", NAME="mtd/0ro"
28KERNEL=="mtd1ro", NAME="mtd/1ro"
29KERNEL=="mtd2ro", NAME="mtd/2ro"
30KERNEL=="mtd3ro", NAME="mtd/3ro"
31KERNEL=="mtd4ro", NAME="mtd/4ro"
32KERNEL=="mtd5ro", NAME="mtd/5ro"
33KERNEL=="mtd6ro", NAME="mtd/6ro"
34KERNEL=="mtd7ro", NAME="mtd/7ro"
35KERNEL=="mtd8ro", NAME="mtd/8ro"
36KERNEL=="mtd9ro", NAME="mtd/9ro"
37
38# Note that we want /dev/dsp linked to /dev/sound/dsp1...
39KERNEL=="dsp", NAME="sound/dsp"
40KERNEL=="dspW", NAME="sound/dspW"
41KERNEL=="dsp1", NAME="sound/dsp1", SYMLINK+="dsp"
42KERNEL=="mixer", NAME="sound/mixer", SYMLINK+="mixer"
43KERNEL=="sequencer", NAME="sound/sequencer"
44KERNEL=="sequencer2", NAME="sound/sequencer2"
45
46KERNEL=="ram[0-9]*", NAME="ram/%n", SYMLINK+="ram%n"
47
48KERNEL=="dvfs_dptc", NAME="dvfs_dptc", SYMLINK+="dptc dvfs"
49
diff --git a/meta-oe/recipes-core/udev/udev-165/bug/30-BUG.rules b/meta-oe/recipes-core/udev/udev-165/bug/30-BUG.rules
new file mode 100644
index 000000000..06faa6bb9
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/bug/30-BUG.rules
@@ -0,0 +1,26 @@
1##
2## BUG/BMI specific
3##
4KERNEL=="event*", ATTRS{name}=="bugnav", SYMLINK+="input/bugnav"
5KERNEL=="event*", ATTRS{name}=="bmi_motion", SYMLINK+="input/bmi_motion"
6KERNEL=="event*", ATTRS{name}=="bug_cam", SYMLINK+="input/bmi_cam"
7KERNEL=="event*", ATTRS{name}=="bmi_audio_status_m1", SYMLINK+="input/bmi_audio_m1"
8KERNEL=="event*", ATTRS{name}=="bmi_audio_status_m2", SYMLINK+="input/bmi_audio_m2"
9KERNEL=="event*", ATTRS{name}=="bmi_audio_status_m3", SYMLINK+="input/bmi_audio_m3"
10KERNEL=="event*", ATTRS{name}=="bmi_audio_status_m4", SYMLINK+="input/bmi_audio_m4"
11DEVPATH=="/devices/platform/bugfb.0", SYMLINK+="bugfb"
12KERNEL=="rtc0", SYMLINK+="rtc"
13KERNEL=="event*", ATTRS{name}=="bmi_lcd_ts0", SYMLINK+="input/bmi_lcd_ts0"
14KERNEL=="event*", ATTRS{name}=="bmi_lcd_ts1", SYMLINK+="input/bmi_lcd_ts1"
15KERNEL=="event*", ATTRS{name}=="bmi_lcd_ts2", SYMLINK+="input/bmi_lcd_ts2"
16KERNEL=="event*", ATTRS{name}=="bmi_lcd_ts3", SYMLINK+="input/bmi_lcd_ts3"
17KERNEL=="event*", ATTRS{name}=="bmi_lcd_ts4", SYMLINK+="input/bmi_lcd_ts4"
18KERNEL=="event*", ATTRS{name}=="bmi_lcd_ts5", SYMLINK+="input/bmi_lcd_ts5"
19KERNEL=="event*", ATTRS{name}=="bmi_lcd_ts6", SYMLINK+="input/bmi_lcd_ts6"
20ACTION=="add", DEVPATH=="/devices/conn*", RUN+="/bin/sh /etc/udev/scripts/bmi_eventpipe.sh"
21ACTION=="remove", DEVPATH=="/devices/conn*", RUN+="/bin/sh /etc/udev/scripts/bmi_eventpipe.sh"
22#
23# For USB PBPSD, which we've arbitrarily decided will be module F001
24#
25ACTION=="remove", SUBSYSTEM=="usb", DRIVERS=="psd_driver", ENV{BMIBUS_PRODUCT}="F001", ENV{BMIBUS_SLOT}="%n", RUN+="/bin/sh /etc/udev/scripts/bmi_eventpipe.sh"
26ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="psd_driver", ENV{BMIBUS_PRODUCT}="F001", ENV{BMIBUS_SLOT}="%n", RUN+="/bin/sh /etc/udev/scripts/bmi_eventpipe.sh"
diff --git a/meta-oe/recipes-core/udev/udev-165/bug/bmi_eventpipe.sh b/meta-oe/recipes-core/udev/udev-165/bug/bmi_eventpipe.sh
new file mode 100644
index 000000000..acbae5611
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/bug/bmi_eventpipe.sh
@@ -0,0 +1,8 @@
1#!/bin/sh
2#
3# This script passes BMI state variables to the running JVM.
4#
5if [ ${BMIBUS_PRODUCT} != "" ] && [ ${BMIBUS_SLOT} != "" ] && [ ${ACTION} != "" ];
6then
7 echo $BMIBUS_PRODUCT 0 $BMIBUS_SLOT $ACTION > /tmp/eventpipe
8fi
diff --git a/meta-oe/recipes-core/udev/udev-165/c7x0/default b/meta-oe/recipes-core/udev/udev-165/c7x0/default
new file mode 100644
index 000000000..d0050b873
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/c7x0/default
@@ -0,0 +1,4 @@
1# Default for /etc/init.d/udev
2
3# Comment this out to disable device cache
4#DEVCACHE="/etc/dev.tar"
diff --git a/meta-oe/recipes-core/udev/udev-165/cache b/meta-oe/recipes-core/udev/udev-165/cache
new file mode 100644
index 000000000..c0d400b44
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/cache
@@ -0,0 +1,22 @@
1#!/bin/sh -e
2
3export TZ=/etc/localtime
4
5[ -f /etc/default/udev ] && . /etc/default/udev
6
7echo "Caching udev devnodes"
8
9if [ "$DEVCACHE" != "" ]; then
10 echo -n "Populating dev cache"
11 (cd /; tar cf $DEVCACHE dev)
12 mv /tmp/uname /etc/udev/saved.uname
13 mv /tmp/cmdline /etc/udev/saved.cmdline
14 mv /tmp/atags /etc/udev/saved.atags
15 echo
16else
17 rm -f /tmp/uname
18 rm -f /tmp/cmdline
19 rm -f /tmp/atags
20fi
21
22exit 0
diff --git a/meta-oe/recipes-core/udev/udev-165/default b/meta-oe/recipes-core/udev/udev-165/default
new file mode 100644
index 000000000..5c4937a9a
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/default
@@ -0,0 +1,4 @@
1# Default for /etc/init.d/udev
2
3# Comment this out to disable device cache
4DEVCACHE="/etc/dev.tar"
diff --git a/meta-oe/recipes-core/udev/udev-165/init b/meta-oe/recipes-core/udev/udev-165/init
new file mode 100644
index 000000000..7ec32afd0
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/init
@@ -0,0 +1,73 @@
1#!/bin/sh -e
2
3### BEGIN INIT INFO
4# Provides: udev
5# Required-Start: mountvirtfs
6# Required-Stop:
7# Default-Start: S
8# Default-Stop:
9# Short-Description: Start udevd, populate /dev and load drivers.
10### END INIT INFO
11
12export TZ=/etc/localtime
13
14[ -d /sys/class ] || exit 1
15[ -r /proc/mounts ] || exit 1
16[ -x /sbin/udevd ] || exit 1
17[ -f /etc/default/udev ] && . /etc/default/udev
18[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
19
20kill_udevd() {
21 if [ -x /sbin/pidof ]; then
22 pid=`/sbin/pidof -x udevd`
23 [ -n "$pid" ] && kill $pid
24 fi
25}
26
27export ACTION=add
28# propagate /dev from /sys
29echo "Starting udev"
30
31# mount the tmpfs on /dev, if not already done
32LANG=C awk "\$2 == \"/dev\" && \$3 == \"tmpfs\" { exit 1 }" /proc/mounts && {
33 mount -n -o mode=0755 -t tmpfs none "/dev"
34 mkdir -m 0755 /dev/pts
35 mkdir -m 1777 /dev/shm
36}
37
38if [ "$DEVCACHE" != "" ]; then
39 # Invalidate udev cache if the kernel or its bootargs/cmdline have changed
40 [ -x /bin/uname ] && /bin/uname -mrspv > /tmp/uname || touch /tmp/uname
41 [ -r /proc/cmdline ] && cat /proc/cmdline > /tmp/cmdline || touch /tmp/cmdline
42 [ -r /proc/atags ] && cat /proc/atags > /tmp/atags || touch /tmp/atags
43 if [ -e $DEVCACHE ] && \
44 cmp -s /tmp/uname /etc/udev/saved.uname && \
45 cmp -s /tmp/cmdline /etc/udev/saved.cmdline && \
46 cmp -s /tmp/atags /etc/udev/saved.atags; then
47 (cd /; tar xf $DEVCACHE > /dev/null 2>&1)
48 not_first_boot=1
49 fi
50fi
51
52if [ ! -e "/lib/modules/$(uname -r)"/modules.dep ] ; then
53 mkdir -p /lib/modules/$(uname -r)
54 depmod -ae
55fi
56
57# make_extra_nodes
58kill_udevd > "/dev/null" 2>&1
59
60 # trigger the sorted events
61 echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
62 /sbin/udevd -d
63
64 /sbin/udevadm control --env STARTUP=1
65 if [ "$not_first_boot" != "" ];then
66 /sbin/udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux --subsystem-nomatch=platform
67 (/sbin/udevadm settle --timeout=8; /sbin/udevadm control --env STARTUP=)&
68 else
69 /sbin/udevadm trigger
70 /sbin/udevadm settle
71 fi
72
73exit 0
diff --git a/meta-oe/recipes-core/udev/udev-165/local.rules b/meta-oe/recipes-core/udev/udev-165/local.rules
new file mode 100644
index 000000000..da4b38593
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/local.rules
@@ -0,0 +1,35 @@
1# There are a number of modifiers that are allowed to be used in some
2# of the different fields. They provide the following subsitutions:
3#
4# %n the "kernel number" of the device.
5# For example, 'sda3' has a "kernel number" of '3'
6# %e the smallest number for that name which does not matches an existing node
7# %k the kernel name for the device
8# %M the kernel major number for the device
9# %m the kernel minor number for the device
10# %b the bus id for the device
11# %c the string returned by the PROGRAM
12# %s{filename} the content of a sysfs attribute
13# %% the '%' char itself
14#
15
16# Media automounting
17SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh"
18SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
19
20# Handle network interface setup
21SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh"
22SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh"
23
24# The first rtc device is symlinked to /dev/rtc
25KERNEL=="rtc0", SYMLINK+="rtc"
26
27#The first framebuffer is symlinked to /dev/fb
28KERNEL=="fb0", SYMLINK+="fb"
29
30# Try and modprobe for drivers for new hardware
31ACTION=="add", DEVPATH=="/devices/*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}"
32
33# Create a symlink to any touchscreen input device
34SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0"
35SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen0"
diff --git a/meta-oe/recipes-core/udev/udev-165/omap3-pandora/local.rules b/meta-oe/recipes-core/udev/udev-165/omap3-pandora/local.rules
new file mode 100644
index 000000000..e433cf959
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/omap3-pandora/local.rules
@@ -0,0 +1,40 @@
1# There are a number of modifiers that are allowed to be used in some
2# of the different fields. They provide the following subsitutions:
3#
4# %n the "kernel number" of the device.
5# For example, 'sda3' has a "kernel number" of '3'
6# %e the smallest number for that name which does not matches an existing node
7# %k the kernel name for the device
8# %M the kernel major number for the device
9# %m the kernel minor number for the device
10# %b the bus id for the device
11# %c the string returned by the PROGRAM
12# %s{filename} the content of a sysfs attribute
13# %% the '%' char itself
14#
15
16# Media automounting
17SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh"
18SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
19
20# Handle network interface setup
21SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh"
22SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh"
23
24# The first rtc device is symlinked to /dev/rtc
25KERNEL=="rtc0", SYMLINK+="rtc"
26
27#The first framebuffer is symlinked to /dev/fb
28KERNEL=="fb0", SYMLINK+="fb"
29
30# Try and modprobe for drivers for new hardware
31ACTION=="add", DEVPATH=="/devices/*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}"
32
33# Create a symlink to any touchscreen input device
34SUBSYSTEM=="input", KERNEL=="event[0-9]*", SYSFS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0"
35SUBSYSTEM=="input", KERNEL=="event[0-9]*", SYSFS{modalias}=="ads7846", SYMLINK+="input/touchscreen0"
36
37# Local UDEV rule changes for the Pandora system.
38
39# Let all users access the event devices using EVDEV (the OpenPandora is not multiuser after all).
40KERNEL=="event[0-9]",MODE="0666" \ No newline at end of file
diff --git a/meta-oe/recipes-core/udev/udev-165/permissions.rules b/meta-oe/recipes-core/udev/udev-165/permissions.rules
new file mode 100644
index 000000000..f4f94a6db
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/permissions.rules
@@ -0,0 +1,110 @@
1ACTION!="add", GOTO="permissions_end"
2
3# devices needed to load the drivers providing them
4KERNEL=="tun", OPTIONS+="ignore_remove"
5KERNEL=="ppp", OPTIONS+="ignore_remove"
6KERNEL=="loop[0-9]*", OPTIONS+="ignore_remove"
7
8# default permissions for block devices
9SUBSYSTEM=="block", GROUP="disk"
10# the aacraid driver is broken and reports that disks removable (see #404927)
11SUBSYSTEM=="block", ATTRS{removable}=="1", \
12 DRIVERS!="aacraid", GROUP="floppy"
13# all block devices on these buses are "removable"
14SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394|mmc|pcmcia", GROUP="floppy"
15
16# IDE devices
17KERNEL=="hd[a-z]|pcd[0-9]*", DRIVERS=="ide-cdrom|pcd", \
18 IMPORT{program}="cdrom_id --export $tempnode"
19ENV{ID_CDROM}=="?*", GROUP="cdrom"
20KERNEL=="ht[0-9]*", GROUP="tape"
21KERNEL=="nht[0-9]*", GROUP="tape"
22
23# SCSI devices
24KERNEL=="sr[0-9]*", IMPORT{program}="cdrom_id --export $tempnode"
25SUBSYSTEMS=="scsi", ATTRS{type}=="1", GROUP="tape"
26SUBSYSTEMS=="scsi", ATTRS{type}=="4", GROUP="cdrom"
27SUBSYSTEMS=="scsi", ATTRS{type}=="5", GROUP="cdrom"
28SUBSYSTEMS=="scsi", ATTRS{type}=="8", GROUP="tape"
29
30# USB devices
31KERNEL=="legousbtower*", MODE="0666"
32KERNEL=="lp[0-9]*", SUBSYSTEMS=="usb", GROUP="lp"
33
34# usbfs-like devices
35SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
36 MODE="0664"
37
38# iRiver music players
39SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="plugdev", \
40 ATTRS{idVendor}=="4102", ATTRS{idProduct}=="10[01][135789]"
41
42# serial devices
43SUBSYSTEM=="tty", GROUP="dialout"
44SUBSYSTEM=="capi", GROUP="dialout"
45SUBSYSTEM=="slamr", GROUP="dialout"
46SUBSYSTEM=="zaptel", GROUP="dialout"
47
48# vc devices (all members of the tty subsystem)
49KERNEL=="ptmx", MODE="0666", GROUP="root"
50KERNEL=="console", MODE="0600", GROUP="root"
51KERNEL=="tty", MODE="0666", GROUP="root"
52KERNEL=="tty[0-9]*", GROUP="root"
53KERNEL=="pty*", MODE="0666", GROUP="tty"
54
55# video devices
56SUBSYSTEM=="video4linux", GROUP="video"
57SUBSYSTEM=="drm", GROUP="video"
58SUBSYSTEM=="dvb", GROUP="video"
59SUBSYSTEM=="em8300", GROUP="video"
60SUBSYSTEM=="graphics", GROUP="video"
61SUBSYSTEM=="nvidia", GROUP="video"
62
63# misc devices
64KERNEL=="random", MODE="0666"
65KERNEL=="urandom", MODE="0666"
66KERNEL=="mem", MODE="0640", GROUP="kmem"
67KERNEL=="kmem", MODE="0640", GROUP="kmem"
68KERNEL=="port", MODE="0640", GROUP="kmem"
69KERNEL=="full", MODE="0666"
70KERNEL=="null", MODE="0666"
71KERNEL=="zero", MODE="0666"
72KERNEL=="inotify", MODE="0666"
73KERNEL=="sgi_fetchop", MODE="0666"
74KERNEL=="sonypi", MODE="0666"
75KERNEL=="agpgart", GROUP="video"
76KERNEL=="rtc|rtc[0-9]*", GROUP="audio"
77KERNEL=="kqemu", MODE="0666"
78KERNEL=="tun", MODE="0666",
79
80KERNEL=="cdemu[0-9]*", GROUP="cdrom"
81KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
82KERNEL=="pktcdvd", MODE="0644"
83
84# printers and parallel devices
85SUBSYSTEM=="printer", GROUP="lp"
86SUBSYSTEM=="ppdev", GROUP="lp"
87KERNEL=="irlpt*", GROUP="lp"
88KERNEL=="pt[0-9]*", GROUP="tape"
89KERNEL=="pht[0-9]*", GROUP="tape"
90
91# sound devices
92SUBSYSTEM=="sound", GROUP="audio"
93
94# ieee1394 devices
95KERNEL=="raw1394", GROUP="disk"
96KERNEL=="dv1394*", GROUP="video"
97KERNEL=="video1394*", GROUP="video"
98
99# input devices
100KERNEL=="event[0-9]*", ATTRS{name}=="*dvb*|*DVB*|* IR *" \
101 MODE="0664", GROUP="video"
102KERNEL=="js[0-9]*", MODE="0664"
103KERNEL=="lirc[0-9]*", GROUP="video"
104
105# AOE character devices
106SUBSYSTEM=="aoe", MODE="0220", GROUP="disk"
107SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440"
108
109LABEL="permissions_end"
110
diff --git a/meta-oe/recipes-core/udev/udev-165/run.rules b/meta-oe/recipes-core/udev/udev-165/run.rules
new file mode 100644
index 000000000..75d71375b
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/run.rules
@@ -0,0 +1,14 @@
1# debugging monitor
2RUN+="socket:/org/kernel/udev/monitor"
3
4# run a command on remove events
5ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}"
6
7# ignore the events generated by virtual consoles
8KERNEL=="ptmx", OPTIONS+="last_rule"
9KERNEL=="console", OPTIONS+="last_rule"
10KERNEL=="tty" , OPTIONS+="last_rule"
11KERNEL=="tty[0-9]*", OPTIONS+="last_rule"
12KERNEL=="pty*", OPTIONS+="last_rule"
13SUBSYSTEM=="vc", OPTIONS+="last_rule"
14
diff --git a/meta-oe/recipes-core/udev/udev-165/spitz/default b/meta-oe/recipes-core/udev/udev-165/spitz/default
new file mode 100644
index 000000000..d0050b873
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/spitz/default
@@ -0,0 +1,4 @@
1# Default for /etc/init.d/udev
2
3# Comment this out to disable device cache
4#DEVCACHE="/etc/dev.tar"
diff --git a/meta-oe/recipes-core/udev/udev-165/tosa/default b/meta-oe/recipes-core/udev/udev-165/tosa/default
new file mode 100644
index 000000000..d0050b873
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/tosa/default
@@ -0,0 +1,4 @@
1# Default for /etc/init.d/udev
2
3# Comment this out to disable device cache
4#DEVCACHE="/etc/dev.tar"
diff --git a/meta-oe/recipes-core/udev/udev-165/udev-replace-le16toh.patch b/meta-oe/recipes-core/udev/udev-165/udev-replace-le16toh.patch
new file mode 100644
index 000000000..7776c9a10
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/udev-replace-le16toh.patch
@@ -0,0 +1,21 @@
1This patch is needed on uclibc.
2
3-Khem
4
5Index: udev-151/extras/ata_id/ata_id.c
6===================================================================
7--- udev-151.orig/extras/ata_id/ata_id.c 2010-06-04 14:08:41.912730501 -0700
8+++ udev-151/extras/ata_id/ata_id.c 2010-06-04 14:09:31.492734527 -0700
9@@ -168,7 +168,11 @@ static void disk_identify_fixup_uint16 (
10 uint16_t *p;
11
12 p = (uint16_t *) identify;
13- p[offset_words] = le16toh (p[offset_words]);
14+#if __BYTE_ORDER == __LITTLE_ENDIAN
15+ p[offset_words] = p[offset_words];
16+#else
17+ p[offset_words] = __bswap_16 (p[offset_words]);
18+#endif
19 }
20
21 /**
diff --git a/meta-oe/recipes-core/udev/udev-165/udev-replace-lutimes.patch b/meta-oe/recipes-core/udev/udev-165/udev-replace-lutimes.patch
new file mode 100644
index 000000000..dd7789734
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/udev-replace-lutimes.patch
@@ -0,0 +1,25 @@
1This patch is needed on uclibc
2
3-Khem
4Index: udev-151/udev/udev-node.c
5===================================================================
6--- udev-151.orig/udev/udev-node.c 2010-06-04 14:18:59.082727182 -0700
7+++ udev-151/udev/udev-node.c 2010-06-04 14:20:27.485282812 -0700
8@@ -57,7 +57,7 @@ int udev_node_mknod(struct udev_device *
9 preserve = 1;
10 udev_selinux_lsetfilecon(udev, file, mode);
11 /* update time stamp when we re-use the node, like on media change events */
12- utimes(file, NULL);
13+ utimensat(AT_FDCWD, file, NULL, 0);
14 } else {
15 char file_tmp[UTIL_PATH_SIZE + sizeof(TMP_FILE_EXT)];
16
17@@ -178,7 +178,7 @@ static int node_symlink(struct udev *ude
18 info(udev, "preserve already existing symlink '%s' to '%s'\n",
19 slink, target);
20 udev_selinux_lsetfilecon(udev, slink, S_IFLNK);
21- lutimes(slink, NULL);
22+ utimensat(AT_FDCWD, slink, NULL, AT_SYMLINK_NOFOLLOW);
23 goto exit;
24 }
25 }
diff --git a/meta-oe/recipes-core/udev/udev-165/udev.rules b/meta-oe/recipes-core/udev/udev-165/udev.rules
new file mode 100644
index 000000000..c20cdcc15
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev-165/udev.rules
@@ -0,0 +1,113 @@
1# There are a number of modifiers that are allowed to be used in some
2# of the different fields. They provide the following subsitutions:
3#
4# %n the "kernel number" of the device.
5# For example, 'sda3' has a "kernel number" of '3'
6# %e the smallest number for that name which does not matches an existing node
7# %k the kernel name for the device
8# %M the kernel major number for the device
9# %m the kernel minor number for the device
10# %b the bus id for the device
11# %c the string returned by the PROGRAM
12# %s{filename} the content of a sysfs attribute
13# %% the '%' char itself
14#
15
16# workaround for devices which do not report media changes
17SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", \
18 ENV{ID_MODEL}=="IOMEGA_ZIP*", OPTIONS+="all_partitions"
19SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTRS{media}=="floppy", \
20 OPTIONS+="all_partitions"
21
22# SCSI devices
23SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", NAME="scd%n", SYMLINK+="sr%n"
24
25# USB devices
26SUBSYSTEMS=="usb", KERNEL=="auer[0-9]*", NAME="usb/%k"
27SUBSYSTEMS=="usb", KERNEL=="cpad[0-9]*", NAME="usb/%k"
28SUBSYSTEMS=="usb", KERNEL=="dabusb*", NAME="usb/%k"
29SUBSYSTEMS=="usb", KERNEL=="hiddev*", NAME="usb/%k"
30SUBSYSTEMS=="usb", KERNEL=="legousbtower*", NAME="usb/%k"
31SUBSYSTEMS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k"
32SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", \
33 ATTRS{product}=="Palm Handheld*|Handspring Visor|palmOne Handheld", \
34 SYMLINK+="pilot"
35
36# usbfs-like devices
37SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", ACTION=="add", \
38 NAME="%c"
39SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}"
40
41# serial devices
42KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20"
43KERNEL=="capi[0-9]*", NAME="capi/%n"
44
45# video devices
46KERNEL=="dvb*", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}", ACTION=="add", \
47 NAME="%c"
48KERNEL=="card[0-9]*", NAME="dri/%k"
49
50# misc devices
51KERNEL=="hw_random", NAME="hwrng"
52KERNEL=="tun", NAME="net/%k"
53KERNEL=="evtchn", NAME="xen/%k"
54
55KERNEL=="cdemu[0-9]*", NAME="cdemu/%n"
56KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%n"
57KERNEL=="pktcdvd", NAME="pktcdvd/control"
58
59KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid"
60KERNEL=="msr[0-9]*", NAME="cpu/%n/msr"
61KERNEL=="microcode", NAME="cpu/microcode"
62
63KERNEL=="umad*", NAME="infiniband/%k"
64KERNEL=="issm*", NAME="infiniband/%k"
65KERNEL=="uverbs*", NAME="infiniband/%k"
66KERNEL=="ucm*", NAME="infiniband/%k"
67KERNEL=="rdma_ucm", NAME="infiniband/%k"
68
69# ALSA devices
70KERNEL=="controlC[0-9]*", NAME="snd/%k"
71KERNEL=="hwC[D0-9]*", NAME="snd/%k"
72KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k"
73KERNEL=="midiC[D0-9]*", NAME="snd/%k"
74KERNEL=="timer", NAME="snd/%k"
75KERNEL=="seq", NAME="snd/%k"
76
77# ieee1394 devices
78KERNEL=="dv1394*", NAME="dv1394/%n"
79KERNEL=="video1394*", NAME="video1394/%n"
80
81# input devices
82KERNEL=="mice", NAME="input/%k"
83KERNEL=="mouse[0-9]*", NAME="input/%k"
84KERNEL=="event[0-9]*", NAME="input/%k"
85KERNEL=="js[0-9]*", NAME="input/%k"
86KERNEL=="ts[0-9]*", NAME="input/%k"
87KERNEL=="uinput", NAME="input/%k"
88
89# Zaptel
90KERNEL=="zapctl", NAME="zap/ctl"
91KERNEL=="zaptimer", NAME="zap/timer"
92KERNEL=="zapchannel", NAME="zap/channel"
93KERNEL=="zappseudo", NAME="zap/pseudo"
94KERNEL=="zap[0-9]*", NAME="zap/%n"
95
96# AOE character devices
97SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k"
98SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k"
99SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k"
100SUBSYSTEM=="aoe", KERNEL=="revalidate", NAME="etherd/%k"
101
102# device mapper creates its own device nodes, so ignore these
103KERNEL=="dm-[0-9]*", OPTIONS+="ignore_device"
104KERNEL=="device-mapper", NAME="mapper/control"
105
106KERNEL=="rfcomm[0-9]*", GROUP="users", MODE="0660"
107
108# Samsung UARTS
109KERNEL=="s3c2410_serial[0-9]", NAME="ttySAC%n"
110
111# MXC UARTs
112KERNEL=="ttymxc[0-4]", NAME="ttymxc%n"
113
diff --git a/meta-oe/recipes-core/udev/udev.inc b/meta-oe/recipes-core/udev/udev.inc
new file mode 100644
index 000000000..0c8a66229
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev.inc
@@ -0,0 +1,101 @@
1DESCRIPTION ?= "udev is a program which dynamically creates and removes device nodes from \
2/dev/. It responds to /sbin/hotplug device events and requires a 2.6 kernel."
3
4LICENSE = "GPLv2+"
5
6SRC_URI = "http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
7 file://udev.rules \
8 file://devfs-udev.rules \
9 file://links.conf \
10 file://permissions.rules \
11 file://mount.sh \
12 file://network.sh \
13 file://local.rules \
14 file://init \
15 file://udev-compat-wrapper-patch"
16
17INC_PR = "r30"
18
19inherit update-rc.d autotools pkgconfig
20
21PARALLEL_MAKE = ""
22UDEV_DEVFS_RULES ?= "0"
23PKG_libvolume-id-dev = "libvolume-id-dev"
24
25RDEPENDS_${PN} += "module-init-tools-depmod udev-utils"
26
27INITSCRIPT_NAME = "udev"
28INITSCRIPT_PARAMS = "start 03 S ."
29
30export CROSS = "${TARGET_PREFIX}"
31export HOSTCC = "${BUILD_CC}"
32export udevdir ?= "/dev"
33# Put stuff in /lib and /sbin
34export bindir := "${base_bindir}"
35export sbindir := "${base_sbindir}"
36export usrbindir := "${bindir}"
37export usrsbindir := "${sbindir}"
38export etcdir := "${sysconfdir}"
39
40TARGET_CC_ARCH += "${LDFLAGS}"
41UDEV_EXTRAS = "<override me>"
42EXTRA_OEMAKE = "-e \
43 'EXTRAS=${UDEV_EXTRAS}' \
44 'STRIP=echo'"
45
46RPROVIDES_udev_append = " udev-compat-wrapper"
47RDEPENDS_udev_spitz += "udev-compat"
48do_unpack_append_spitz() {
49 bb.build.exec_func('do_apply_compat_wrapper', d)
50}
51RDEPENDS_udev_akita += "udev-compat"
52do_unpack_append_akita() {
53 bb.build.exec_func('do_apply_compat_wrapper', d)
54}
55RDEPENDS_udev_c7x0 += "udev-compat"
56do_unpack_append_c7x0() {
57 bb.build.exec_func('do_apply_compat_wrapper', d)
58}
59RDEPENDS_udev_poodle += "udev-compat"
60do_unpack_append_poodle() {
61 bb.build.exec_func('do_apply_compat_wrapper', d)
62}
63
64# Modify init script on platforms that need to boot old kernels:
65do_apply_compat_wrapper() {
66 cd ${WORKDIR}
67 sed -i "s:/sbin/udevd:\$UDEVD:g;s:/sbin/udevadm:\$UDEVADM:g" init
68 patch <udev-compat-wrapper-patch
69 cd -
70}
71
72do_install () {
73 install -d ${D}${usrsbindir} \
74 ${D}${sbindir}
75 oe_runmake 'DESTDIR=${D}' INSTALL=install install
76 install -d ${D}${sysconfdir}/init.d
77 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
78
79 install -d ${D}${sysconfdir}/udev/rules.d/
80
81 install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
82 install -m 0644 ${WORKDIR}/permissions.rules ${D}${sysconfdir}/udev/rules.d/permissions.rules
83 install -m 0644 ${WORKDIR}/udev.rules ${D}${sysconfdir}/udev/rules.d/udev.rules
84 if [ "${UDEV_DEVFS_RULES}" = "1" ]; then
85 install -m 0644 ${WORKDIR}/devfs-udev.rules ${D}${sysconfdir}/udev/rules.d/devfs-udev.rules
86 fi
87
88 install -d ${D}${sysconfdir}/udev/scripts/
89
90 install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh
91 install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts
92 install -m 0644 ${S}/extras/volume_id/lib/libvolume_id.h ${D}${includedir}
93 oe_libinstall -C extras/volume_id/lib libvolume_id ${D}${libdir}
94}
95
96PACKAGES =+ "udev-utils libvolume-id libvolume-id-dev"
97FILES_libvolume-id-dev = "${includedir}/libvolume_id.h ${libdir}/libvolume_id.a ${libdir}/libvolume_id.so ${libdir}/pkgconfig/libvolume_id.pc"
98FILES_udev-utils = "${usrbindir}/udevinfo ${usrbindir}/udevtest ${sbindir}/udevadm"
99FILES_libvolume-id = "${base_libdir}/libvolume_id.so.*"
100FILES_${PN} += "${usrbindir}/* ${usrsbindir}/udevd"
101FILES_${PN}-dbg += "${usrbindir}/.debug ${usrsbindir}/.debug"
diff --git a/meta-oe/recipes-core/udev/udev/50-hostap_cs.rules b/meta-oe/recipes-core/udev/udev/50-hostap_cs.rules
new file mode 100644
index 000000000..efefdc58f
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/50-hostap_cs.rules
@@ -0,0 +1,4 @@
1# hostap_cs needs ignore_cis_vcc=1 set - this should handle all cards
2#
3ACTION=="add", DEVICE=="hostap_cs", \
4 SYSFS{func_id}=="0x06", RUN+="/sbin/modprobe hostap_cs ignore_cis_vcc=1"
diff --git a/meta-oe/recipes-core/udev/udev/akita/mount.blacklist b/meta-oe/recipes-core/udev/udev/akita/mount.blacklist
new file mode 100644
index 000000000..7e351bc98
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/akita/mount.blacklist
@@ -0,0 +1,6 @@
1# This is a grep pattern matched against the device name
2# Any matched pattern will _not_ be mounted / removed by udevd
3
4/dev/mtdblock
5/dev/loop
6/dev/ram \ No newline at end of file
diff --git a/meta-oe/recipes-core/udev/udev/angstrom/mount.sh b/meta-oe/recipes-core/udev/udev/angstrom/mount.sh
new file mode 100644
index 000000000..81bcfba5e
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/angstrom/mount.sh
@@ -0,0 +1,72 @@
1#!/bin/sh
2#
3# Called from udev
4# Attemp to mount any added block devices
5# and remove any removed devices
6#
7
8MOUNT="/bin/mount"
9PMOUNT="/usr/bin/pmount"
10UMOUNT="/bin/umount"
11name="`basename "$DEVNAME"`"
12
13for line in `cat /etc/udev/mount.blacklist | grep -v ^#`
14do
15 if ( echo "$DEVNAME" | grep -q "$line" )
16 then
17 logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring"
18 exit 0
19 fi
20done
21
22automount() {
23 ! test -d "/media/$name" && mkdir -p "/media/$name"
24
25 if ! $MOUNT -t auto -o async,relatime $DEVNAME "/media/$name"
26 then
27 #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/media/$name\" failed!"
28 rm_dir "/media/$name"
29 else
30 logger "mount.sh/automount" "Auto-mount of [/media/$name] successful"
31 touch "/tmp/.automount-$name"
32 fi
33}
34
35rm_dir() {
36 # We do not want to rm -r populated directories
37 if test "`find "$1" | wc -l | tr -d " "`" -lt 2 -a -d "$1"
38 then
39 ! test -z "$1" && rm -r "$1"
40 else
41 logger "mount.sh/automount" "Not removing non-empty directory [$1]"
42 fi
43}
44
45if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ]; then
46 if [ -x "$PMOUNT" ]; then
47 $PMOUNT $DEVNAME 2> /dev/null
48 elif [ -x $MOUNT ]; then
49 $MOUNT $DEVNAME 2> /dev/null
50 fi
51
52 # If the device isn't mounted at this point, it isn't configured in fstab
53 # 20061107: Small correction: The rootfs partition may be called just "rootfs" and not by
54 # its true device name so this would break. If the rootfs is mounted on two places
55 # during boot, it confuses the heck out of fsck. So Im auto-adding the root-partition
56 # to /etc/udev/mount.blacklist via postinst
57
58 cat /proc/mounts | awk '{print $1}' | grep -q "^$DEVNAME$" || automount
59
60fi
61
62
63
64if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
65 for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " `
66 do
67 $UMOUNT -l $mnt
68 done
69
70 # Remove empty directories from auto-mounter
71 test -e "/tmp/.automount-$name" && rm_dir "/media/$name"
72fi
diff --git a/meta-oe/recipes-core/udev/udev/c7x0/mount.blacklist b/meta-oe/recipes-core/udev/udev/c7x0/mount.blacklist
new file mode 100644
index 000000000..7e351bc98
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/c7x0/mount.blacklist
@@ -0,0 +1,6 @@
1# This is a grep pattern matched against the device name
2# Any matched pattern will _not_ be mounted / removed by udevd
3
4/dev/mtdblock
5/dev/loop
6/dev/ram \ No newline at end of file
diff --git a/meta-oe/recipes-core/udev/udev/devfs-udev.rules b/meta-oe/recipes-core/udev/udev/devfs-udev.rules
new file mode 100644
index 000000000..0ba1ad4e7
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/devfs-udev.rules
@@ -0,0 +1,108 @@
1# The use of these rules is not recommended or supported.
2# In a world where devices can come and go at any time, the devfs scheme
3# of simple device enumeration does not help _anything_. Just forget about
4# it. Use custom rules to name your device or look at the persistent device
5# naming scheme, which is implemented for disks and add your subsystem.
6
7# ide block devices
8BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK="%c{1} %c{2}"
9
10# md block devices
11KERNEL="md[0-9]*", NAME="md/%n"
12
13# floppy devices
14KERNEL="fd[0-9]*", NAME="floppy/%n"
15
16# tty devices
17KERNEL="tty[0-9]*", NAME="vc/%n", SYMLINK="%k"
18KERNEL="ttyS[0-9]*", NAME="tts/%n", SYMLINK="%k"
19KERNEL="ttyUSB[0-9]*", NAME="tts/USB%n"
20
21# vc devices
22KERNEL="vcs", NAME="vcc/0"
23KERNEL="vcs[0-9]*", NAME="vcc/%n"
24KERNEL="vcsa", NAME="vcc/a0"
25KERNEL="vcsa[0-9]*", NAME="vcc/a%n"
26
27# v4l devices
28KERNEL="video[0-9]*", NAME="v4l/video%n"
29KERNEL="radio[0-9]*", NAME="v4l/radio%n"
30KERNEL="vbi[0-9]*", NAME="v4l/vbi%n"
31KERNEL="vtx[0-9]*", NAME="v4l/vtx%n"
32
33# dm devices (ignore them)
34KERNEL="dm-[0-9]*", NAME=""
35
36# i2c devices
37KERNEL="i2c-[0-9]*", NAME="i2c/%n", SYMLINK="%k"
38
39# loop devices
40KERNEL="loop[0-9]*", NAME="loop/%n", SYMLINK="%k"
41
42# ramdisks
43KERNEL="ram[0-9]*", NAME="rd/%n", SYMLINK="%k"
44
45# framebuffer devices
46KERNEL="fb[0-9]*", NAME="fb/%n", SYMLINK="%k"
47
48# misc
49KERNEL="rtc", NAME="misc/%k", SYMLINK="%k"
50KERNEL="psaux", NAME="misc/%k", SYMLINK="%k"
51KERNEL="agpgart", NAME="misc/%k", SYMLINK="%k"
52KERNEL="rtc", NAME="misc/%k", SYMLINK="%k"
53KERNEL="psaux", NAME="misc/%k", SYMLINK="%k"
54KERNEL="uinput", NAME="misc/%k", SYMLINK="%k"
55
56# alsa devices
57KERNEL="controlC[0-9]*", NAME="snd/%k"
58KERNEL="hw[CD0-9]*", NAME="snd/%k"
59KERNEL="pcm[CD0-9cp]*", NAME="snd/%k"
60KERNEL="midi[CD0-9]*", NAME="snd/%k"
61KERNEL="timer", NAME="snd/%k"
62KERNEL="seq", NAME="snd/%k"
63
64# oss devices
65KERNEL="audio*", NAME="sound/%k", SYMLINK="%k"
66KERNEL="dmmidi", NAME="sound/%k", SYMLINK="%k"
67KERNEL="dsp*", NAME="sound/%k", SYMLINK="%k"
68KERNEL="midi*", NAME="sound/%k", SYMLINK="%k"
69KERNEL="mixer*", NAME="sound/%k", SYMLINK="%k"
70KERNEL="sequencer*", NAME="sound/%k", SYMLINK="%k"
71
72# input devices
73KERNEL="mice", NAME="input/%k"
74KERNEL="mouse*", NAME="input/%k"
75KERNEL="event*", NAME="input/%k"
76KERNEL="js*", NAME="input/%k"
77KERNEL="ts*", NAME="input/%k"
78
79# USB devices
80KERNEL="hiddev*", NAME="usb/%k"
81KERNEL="auer*", NAME="usb/%k"
82KERNEL="legousbtower*", NAME="usb/%k"
83KERNEL="dabusb*", NAME="usb/%k"
84BUS="usb", KERNEL="lp[0-9]*", NAME="usb/%k"
85
86# netlink devices
87KERNEL="route", NAME="netlink/%k"
88KERNEL="skip", NAME="netlink/%k"
89KERNEL="usersock", NAME="netlink/%k"
90KERNEL="fwmonitor", NAME="netlink/%k"
91KERNEL="tcpdiag", NAME="netlink/%k"
92KERNEL="nflog", NAME="netlink/%k"
93KERNEL="xfrm", NAME="netlink/%k"
94KERNEL="arpd", NAME="netlink/%k"
95KERNEL="route6", NAME="netlink/%k"
96KERNEL="ip6_fw", NAME="netlink/%k"
97KERNEL="dnrtmsg", NAME="netlink/%k"
98KERNEL="tap*", NAME="netlink/%k"
99
100# CAPI devices
101KERNEL="capi", NAME="capi20", SYMLINK="isdn/capi20"
102KERNEL="capi*", NAME="capi/%n"
103
104# Network devices
105KERNEL="tun", NAME="net/%k"
106
107# raw devices
108KERNEL="raw[0-9]*", NAME="raw/%k"
diff --git a/meta-oe/recipes-core/udev/udev/init b/meta-oe/recipes-core/udev/udev/init
new file mode 100755
index 000000000..a13b9afcd
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/init
@@ -0,0 +1,212 @@
1#!/bin/sh
2
3UDEVSTART=/sbin/udevstart
4
5# defaults
6tmpfs_size="2M"
7udev_root="/dev"
8
9[ -x $UDEVSTART ] || exit 0
10
11. /etc/udev/udev.conf
12
13##############################################################################
14
15# we need to unmount /dev/pts/ and remount it later over the tmpfs
16unmount_devpts() {
17 if mountpoint -q /dev/pts/; then
18 umount -l /dev/pts/
19 fi
20
21 if mountpoint -q /dev/shm/; then
22 umount -l /dev/shm/
23 fi
24}
25
26# mount a tmpfs over /dev, if somebody did not already do it
27mount_tmpfs() {
28 if grep -E -q "^[^[:space:]]+ /dev tmpfs" /proc/mounts; then
29 return 0
30 fi
31
32 # /dev/.static/dev/ is used by MAKEDEV to access the real /dev/ directory.
33 # /etc/udev/ is recycled as a temporary mount point because it's the only
34 # directory which is guaranteed to be available.
35 mount -n -o bind /dev /etc/udev
36
37 if ! mount -n -o size=$tmpfs_size,mode=0755 -t tmpfs tmpfs /dev; then
38 umount /etc/udev
39 echo "udev requires tmpfs support, not started."
40 exit 1
41 fi
42
43 # using ln to test if /dev works, because touch is in /usr/bin/
44 if ln -s test /dev/test-file; then
45 rm /dev/test-file
46 else
47 echo "udev requires tmpfs support, not started."
48 umount /etc/udev
49 umount /dev
50 exit 1
51 fi
52
53 mkdir -p /dev/.static/dev
54 chmod 700 /dev/.static/
55 # The mount options in busybox are non-standard...
56 if test -x /bin/mount.util-linux
57 then
58 /bin/mount.util-linux --move /etc/udev /dev/.static/dev
59 elif test -x /bin/busybox
60 then
61 busybox mount -n -o move /etc/udev /dev/.static/dev
62 else
63 echo "udev requires an identifiable mount command, not started."
64 umount /etc/udev
65 umount /dev
66 exit 1
67 fi
68}
69
70# I hate this hack. -- Md
71make_extra_nodes() {
72 [ -e /etc/udev/links.conf ] || return 0
73 grep '^[^#]' /etc/udev/links.conf | \
74 while read type name arg1; do
75 [ "$type" -a "$name" -a ! -e "/dev/$name" -a ! -L "/dev/$name" ] ||continue
76 case "$type" in
77 L) ln -s $arg1 /dev/$name ;;
78 D) mkdir -p /dev/$name ;;
79 M) mknod -m 600 /dev/$name $arg1 ;;
80 *) echo "links.conf: unparseable line ($type $name $arg1)" ;;
81 esac
82 done
83}
84
85# this function is duplicated in preinst, postinst and d-i
86supported_kernel() {
87 case "$(uname -r)" in
88 2.[012345].*|2.6.[0-9]|2.6.[0-9][!0-9]*) return 1 ;;
89 2.6.1[01]|2.6.1[01][!0-9]*) return 1 ;;
90 esac
91 return 0
92}
93
94# shell version of /usr/bin/tty
95my_tty() {
96 [ -x /bin/readlink ] || return 0
97 [ -e /proc/self/fd/0 ] || return 0
98 readlink --silent /proc/self/fd/0 || true
99}
100
101warn_if_interactive() {
102 if [ "$RUNLEVEL" = "S" -a "$PREVLEVEL" = "N" ]; then
103 return 0
104 fi
105
106 TTY=$(my_tty)
107 if [ -z "$TTY" -o "$TTY" = "/dev/console" ]; then
108 return 0
109 fi
110
111 printf "\n\n\nIt has been detected that the command\n\n\t$0 $*\n\n"
112 printf "has been run from an interactive shell.\n"
113 printf "It will probably not do what you expect, so this script will wait\n"
114 printf "60 seconds before continuing. Press ^C to stop it.\n"
115 printf "RUNNING THIS COMMAND IS HIGHLY DISCOURAGED!\n\n\n\n"
116 sleep 60
117}
118
119##############################################################################
120
121if ! supported_kernel; then
122 echo "udev requires a kernel >= 2.6.12, not started."
123 exit 1
124fi
125
126if [ ! -e /proc/filesystems ]; then
127 echo "udev requires a mounted procfs, not started."
128 exit 1
129fi
130
131if ! grep -q '[[:space:]]tmpfs$' /proc/filesystems; then
132 echo "udev requires tmpfs support, not started."
133 exit 1
134fi
135
136if [ ! -d /sys/class/ ]; then
137 echo "udev requires a mounted sysfs, not started."
138 exit 1
139fi
140
141if [ ! -e /proc/sys/kernel/hotplug ] && [ ! -e /sys/kernel/uevent_helper ]; then
142 echo "udev requires hotplug support, not started."
143 exit 1
144fi
145
146##############################################################################
147
148# When modifying this script, do not forget that between the time that
149# the new /dev has been mounted and udevstart has been run there will be
150# no /dev/null. This also means that you cannot use the "&" shell command.
151
152case "$1" in
153 start)
154 if [ -e "$udev_root/.udevdb" ]; then
155 if mountpoint -q /dev/; then
156 TMPFS_MOUNTED=1
157 else
158 echo ".udevdb already exists on the old $udev_root!"
159 fi
160 fi
161 warn_if_interactive
162
163 #echo /sbin/udevsend > /proc/sys/kernel/hotplug
164 if [ -e /sys/kernel/uevent_helper ] ; then
165 echo "" > /sys/kernel/uevent_helper
166 else
167 echo "" > /proc/sys/kernel/hotplug
168 fi
169 udevsend
170 if [ "$UDEV_DISABLED" = "yes" ]; then
171 echo "udev disabled on the kernel command line, not started."
172 exit 0
173 fi
174
175 if [ ! "$TMPFS_MOUNTED" ]; then
176 unmount_devpts
177 mount_tmpfs
178 [ -d /proc/1 ] || mount -n /proc
179 # if this directory is not present /dev will not be updated by udev
180 mkdir /dev/.udevdb/
181 echo "Creating initial device nodes..."
182 udevstart
183 fi
184 make_extra_nodes
185 ;;
186 stop)
187 warn_if_interactive
188 start-stop-daemon --stop --exec /sbin/udevd --quiet
189 unmount_devpts
190 if [ -d /dev/.static/dev/ ]; then
191 umount -l /dev/.static/dev/ || true
192 fi
193 echo "Unmounting /dev..."
194 # unmounting with -l should never fail
195 if ! umount -l /dev; then
196 exit 1
197 fi
198 ;;
199 restart|force-reload)
200 start-stop-daemon --stop --exec /sbin/udevd --quiet
201 log_begin_msg "Recreating device nodes..."
202 udevstart
203 make_extra_nodes
204 log_end_msg 0
205 ;;
206 *)
207 echo "Usage: /etc/init.d/udev {start|stop|restart|force-reload}"
208 exit 1
209 ;;
210esac
211
212exit 0
diff --git a/meta-oe/recipes-core/udev/udev/links.conf b/meta-oe/recipes-core/udev/udev/links.conf
new file mode 100644
index 000000000..a9f8b58b2
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/links.conf
@@ -0,0 +1,24 @@
1# This file does not exist. Please do not ask the debian maintainer about it.
2# You may use it to do strange and wonderful things, at your risk.
3
4L fd /proc/self/fd
5L stdin /proc/self/fd/0
6L stdout /proc/self/fd/1
7L stderr /proc/self/fd/2
8L core /proc/kcore
9L sndstat /proc/asound/oss/sndstat
10L MAKEDEV /sbin/MAKEDEV
11
12D pts
13D shm
14
15M null c 1 3
16M console c 5 1
17
18# Hic sunt leones.
19M ppp c 108 0
20D loop
21M loop/0 b 7 0
22D net
23M net/tun c 10 200
24
diff --git a/meta-oe/recipes-core/udev/udev/local.rules b/meta-oe/recipes-core/udev/udev/local.rules
new file mode 100644
index 000000000..5f2efbeb0
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/local.rules
@@ -0,0 +1,22 @@
1# There are a number of modifiers that are allowed to be used in some
2# of the different fields. They provide the following subsitutions:
3#
4# %n the "kernel number" of the device.
5# For example, 'sda3' has a "kernel number" of '3'
6# %e the smallest number for that name which does not matches an existing node
7# %k the kernel name for the device
8# %M the kernel major number for the device
9# %m the kernel minor number for the device
10# %b the bus id for the device
11# %c the string returned by the PROGRAM
12# %s{filename} the content of a sysfs attribute
13# %% the '%' char itself
14#
15
16# Media automounting
17SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh"
18SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
19
20# Handle network interface setup
21SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh"
22SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh"
diff --git a/meta-oe/recipes-core/udev/udev/mount.blacklist b/meta-oe/recipes-core/udev/udev/mount.blacklist
new file mode 100644
index 000000000..d3ebb1717
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/mount.blacklist
@@ -0,0 +1,3 @@
1/dev/loop
2/dev/ram
3/dev/mtdblock
diff --git a/meta-oe/recipes-core/udev/udev/mount.sh b/meta-oe/recipes-core/udev/udev/mount.sh
new file mode 100644
index 000000000..440dcee57
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/mount.sh
@@ -0,0 +1,72 @@
1#!/bin/sh
2#
3# Called from udev
4# Attemp to mount any added block devices
5# and remove any removed devices
6#
7
8MOUNT="/bin/mount"
9PMOUNT="/usr/bin/pmount"
10UMOUNT="/bin/umount"
11name="`basename "$DEVNAME"`"
12
13for line in `cat /etc/udev/mount.blacklist | grep -v ^#`
14do
15 if ( echo "$DEVNAME" | grep -q "$line" )
16 then
17 logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring"
18 exit 0
19 fi
20done
21
22automount() {
23 ! test -d "/media/$name" && mkdir -p "/media/$name"
24
25 if ! $MOUNT -t auto -o sync $DEVNAME "/media/$name"
26 then
27 #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/media/$name\" failed!"
28 rm_dir "/media/$name"
29 else
30 logger "mount.sh/automount" "Auto-mount of [/media/$name] successful"
31 touch "/tmp/.automount-$name"
32 fi
33}
34
35rm_dir() {
36 # We do not want to rm -r populated directories
37 if test "`find "$1" | wc -l | tr -d " "`" -lt 2 -a -d "$1"
38 then
39 ! test -z "$1" && rm -r "$1"
40 else
41 logger "mount.sh/automount" "Not removing non-empty directory [$1]"
42 fi
43}
44
45if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ]; then
46 if [ -x "$PMOUNT" ]; then
47 $PMOUNT $DEVNAME 2> /dev/null
48 elif [ -x $MOUNT ]; then
49 $MOUNT $DEVNAME 2> /dev/null
50 fi
51
52 # If the device isn't mounted at this point, it isn't configured in fstab
53 # 20061107: Small correction: The rootfs partition may be called just "rootfs" and not by
54 # its true device name so this would break. If the rootfs is mounted on two places
55 # during boot, it confuses the heck out of fsck. So Im auto-adding the root-partition
56 # to /etc/udev/mount.blacklist via postinst
57
58 cat /proc/mounts | awk '{print $1}' | grep -q "^$DEVNAME$" || automount
59
60fi
61
62
63
64if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
65 for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " `
66 do
67 $UMOUNT -l $mnt
68 done
69
70 # Remove empty directories from auto-mounter
71 test -e "/tmp/.automount-$name" && rm_dir "/media/$name"
72fi
diff --git a/meta-oe/recipes-core/udev/udev/network.sh b/meta-oe/recipes-core/udev/udev/network.sh
new file mode 100644
index 000000000..182c26d86
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/network.sh
@@ -0,0 +1,58 @@
1#!/bin/sh
2
3# udevd does clearenv(). Export shell PATH to children.
4export PATH
5
6# Do not run when pcmcia-cs is installed
7test -x /sbin/cardctl && exit 0
8
9# We get two "add" events for hostap cards due to wifi0
10echo "$INTERFACE" | grep -q wifi && exit 0
11
12
13# Check if /etc/init.d/network has been run yet to see if we are
14# called by starting /etc/rcS.d/S03udev and not by hotplugging a device
15#
16# At this stage, network interfaces should not be brought up
17# automatically because:
18# a) /etc/init.d/network has not been run yet (security issue)
19# b) /var has not been populated yet so /etc/resolv,conf points to
20# oblivion, making the network unusable
21#
22
23spoofp="`grep ^spoofprotect /etc/network/options`"
24if test -z "$spoofp"
25then
26 # This is the default from /etc/init.d/network
27 spoofp_val=yes
28else
29 spoofp_val=${spoofp#spoofprotect=}
30fi
31
32test "$spoofp_val" = yes && spoofp_val=1 || spoofp_val=0
33
34# I think it is safe to assume that "lo" will always be there ;)
35if test "`cat /proc/sys/net/ipv4/conf/lo/rp_filter`" != "$spoofp_val" -a -n "$spoofp_val"
36then
37 echo "$INTERFACE" >> /dev/udev_network_queue
38 exit 0
39fi
40
41#
42# Code taken from pcmcia-cs:/etc/pcmcia/network
43#
44
45# if this interface has an entry in /etc/network/interfaces, let ifupdown
46# handle it
47if grep -q "iface \+$INTERFACE" /etc/network/interfaces; then
48 case $ACTION in
49 add)
50 ifconfig | grep -q "^$INTERFACE" || ifup $INTERFACE
51 ;;
52 remove)
53 ifdown $INTERFACE
54 ;;
55 esac
56
57 exit 0
58fi
diff --git a/meta-oe/recipes-core/udev/udev/noasmlinkage.patch b/meta-oe/recipes-core/udev/udev/noasmlinkage.patch
new file mode 100644
index 000000000..0d8e854c0
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/noasmlinkage.patch
@@ -0,0 +1,38 @@
1
2#
3# Patch managed by http://www.holgerschurig.de/patcher.html
4#
5
6--- udev-062/udev.c~noasmlinkage.patch
7+++ udev-062/udev.c
8@@ -54,7 +54,7 @@
9 }
10 #endif
11
12-static void asmlinkage sig_handler(int signum)
13+static void sig_handler(int signum)
14 {
15 switch (signum) {
16 case SIGALRM:
17--- udev-062/udevd.c~noasmlinkage.patch
18+++ udev-062/udevd.c
19@@ -639,7 +639,7 @@
20 return msg;
21 }
22
23-static void asmlinkage sig_handler(int signum)
24+static void sig_handler(int signum)
25 {
26 int rc;
27
28--- udev-062/udevstart.c~noasmlinkage.patch
29+++ udev-062/udevstart.c
30@@ -323,7 +323,7 @@
31 exec_list(&device_list);
32 }
33
34-static void asmlinkage sig_handler(int signum)
35+static void sig_handler(int signum)
36 {
37 switch (signum) {
38 case SIGALRM:
diff --git a/meta-oe/recipes-core/udev/udev/nokia900/10-cmt_speech.rules b/meta-oe/recipes-core/udev/udev/nokia900/10-cmt_speech.rules
new file mode 100644
index 000000000..25f46efea
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/nokia900/10-cmt_speech.rules
@@ -0,0 +1 @@
KERNEL=="cmt_speech", MODE="0777"
diff --git a/meta-oe/recipes-core/udev/udev/nokia900/70-persistent-net.rules b/meta-oe/recipes-core/udev/udev/nokia900/70-persistent-net.rules
new file mode 100644
index 000000000..b68f47c5f
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/nokia900/70-persistent-net.rules
@@ -0,0 +1,9 @@
1# This file was automatically generated by the /lib/udev/write_net_rules
2# # program, run by the persistent-net-generator.rules rules file.
3# #
4# # You can modify it, as long as you keep each rule on a single
5# # line, and change only the value of the NAME= key.
6#
7# # net device ()
8SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1f:df:*", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
9
diff --git a/meta-oe/recipes-core/udev/udev/nokia900/nokia-n900-mac-hack.sh b/meta-oe/recipes-core/udev/udev/nokia900/nokia-n900-mac-hack.sh
new file mode 100644
index 000000000..c0b8251ae
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/nokia900/nokia-n900-mac-hack.sh
@@ -0,0 +1,23 @@
1#!/bin/sh
2
3if [ $# -ne 2 ]; then
4 echo "Usage: $0 iface newmac"
5 echo " newmac is only saved if /etc/<iface>MAC is not found"
6 exit 1
7fi
8
9iface="$1"
10newmac="$2"
11macfile=/etc/"$iface"mac
12
13# If no MAC is found, save the one given as argument
14if [ ! -e $macfile ]; then
15 /bin/echo "$newmac" > $macfile
16# Otherwise load MAC from file
17else
18 newmac=`/bin/cat $macfile`
19fi
20
21# Configure interface
22/sbin/ifconfig "$iface" down
23/sbin/ifconfig "$iface" hw ether $newmac
diff --git a/meta-oe/recipes-core/udev/udev/nokia900/udev-rules-nokia-n900-hacks.rules b/meta-oe/recipes-core/udev/udev/nokia900/udev-rules-nokia-n900-hacks.rules
new file mode 100644
index 000000000..fa2ddb809
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/nokia900/udev-rules-nokia-n900-hacks.rules
@@ -0,0 +1,8 @@
1# MAC address hack
2# forces n900 to always use the same MAC address that is generated in the first boot
3SUBSYSTEM=="net",KERNEL=="wlan0", RUN+="/etc/udev/scripts/nokia-n900-mac-hack.sh %k $attr{address}"
4
5# Create inputdev symlinks for kbslider contextkit plugin
6SUBSYSTEM=="input" ATTRS{name}=="TWL4030 Keypad" SYMLINK+="input/keypad"
7SUBSYSTEM=="input" ATTRS{name}=="gpio-keys" SYMLINK+="input/gpio-keys"
8
diff --git a/meta-oe/recipes-core/udev/udev/nokia900/udev-rules-nokia-n900-snd.rules b/meta-oe/recipes-core/udev/udev/nokia900/udev-rules-nokia-n900-snd.rules
new file mode 100644
index 000000000..413c1656f
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/nokia900/udev-rules-nokia-n900-snd.rules
@@ -0,0 +1,10 @@
1# ALSA devices
2KERNEL=="controlC[0-9]*", NAME="snd/%k"
3KERNEL=="hwC[D0-9]*", NAME="snd/%k"
4KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k"
5KERNEL=="midiC[D0-9]*", NAME="snd/%k"
6KERNEL=="timer", NAME="snd/%k"
7KERNEL=="seq", NAME="snd/%k"
8
9KERNEL=="snd", SUBSYSTEM=="module", ACTION=="add", \
10 RUN+="/bin/ln -sf /proc/asound/oss/sndstat $root/sndstat"
diff --git a/meta-oe/recipes-core/udev/udev/omap3-pandora/local.rules b/meta-oe/recipes-core/udev/udev/omap3-pandora/local.rules
new file mode 100644
index 000000000..266c3ff85
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/omap3-pandora/local.rules
@@ -0,0 +1,27 @@
1# There are a number of modifiers that are allowed to be used in some
2# of the different fields. They provide the following subsitutions:
3#
4# %n the "kernel number" of the device.
5# For example, 'sda3' has a "kernel number" of '3'
6# %e the smallest number for that name which does not matches an existing node
7# %k the kernel name for the device
8# %M the kernel major number for the device
9# %m the kernel minor number for the device
10# %b the bus id for the device
11# %c the string returned by the PROGRAM
12# %s{filename} the content of a sysfs attribute
13# %% the '%' char itself
14#
15
16# Media automounting
17SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh"
18SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
19
20# Handle network interface setup
21SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh"
22SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh"
23
24# Local UDEV rule changes for the Pandora system.
25
26# Let all users access the event devices using EVDEV (the OpenPandora is not multiuser after all).
27KERNEL=="event[0-9]",MODE="0666" \ No newline at end of file
diff --git a/meta-oe/recipes-core/udev/udev/permissions.rules b/meta-oe/recipes-core/udev/udev/permissions.rules
new file mode 100644
index 000000000..efbe568a2
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/permissions.rules
@@ -0,0 +1,79 @@
1# default permissions for block devices
2SUBSYSTEM=="block", GROUP="disk"
3SUBSYSTEM=="block", SYSFS{removable}=="1", GROUP="floppy"
4
5# IDE devices
6BUS=="ide", KERNEL=="hd[a-z]", SYSFS{removable}="1", \
7 PROGRAM="/bin/cat /proc/ide/%k/media", RESULT=="cdrom*", GROUP="cdrom"
8BUS=="ide", KERNEL=="ht[0-9]*", GROUP="tape"
9BUS=="ide", KERNEL=="nht[0-9]*", GROUP="tape"
10
11# SCSI devices
12BUS=="scsi", SYSFS{type}=="1", GROUP="tape"
13BUS=="scsi", SYSFS{type}=="5", GROUP="cdrom"
14
15# USB devices
16BUS=="usb", KERNEL=="legousbtower*", MODE="0666"
17BUS=="usb", KERNEL=="lp[0-9]*", GROUP="lp"
18
19# serial devices
20SUBSYSTEM=="tty", GROUP="dialout"
21SUBSYSTEM=="capi", GROUP="dialout"
22SUBSYSTEM=="slamr", GROUP="dialout"
23
24# vc devices (all members of the tty subsystem)
25KERNEL=="ptmx", MODE="0666", GROUP="root"
26KERNEL=="console", MODE="0600", GROUP="root"
27KERNEL=="tty", MODE="0666", GROUP="root"
28KERNEL=="tty[0-9]*", GROUP="root"
29KERNEL=="pty*", MODE="0666", GROUP="tty"
30
31# video devices
32SUBSYSTEM=="video4linux", GROUP="video"
33SUBSYSTEM=="drm", GROUP="video"
34SUBSYSTEM=="dvb", GROUP="video"
35SUBSYSTEM=="em8300", GROUP="video"
36SUBSYSTEM=="graphics", GROUP="video"
37SUBSYSTEM=="nvidia", GROUP="video"
38
39# misc devices
40KERNEL=="random", MODE="0666"
41KERNEL=="urandom", MODE="0444"
42KERNEL=="mem", MODE="0640", GROUP="kmem"
43KERNEL=="kmem", MODE="0640", GROUP="kmem"
44KERNEL=="port", MODE="0640", GROUP="kmem"
45KERNEL=="full", MODE="0666"
46KERNEL=="null", MODE="0666"
47KERNEL=="zero", MODE="0666"
48KERNEL=="inotify", MODE="0666"
49KERNEL=="sgi_fetchop", MODE="0666"
50KERNEL=="sonypi", MODE="0666"
51KERNEL=="agpgart", GROUP="video"
52KERNEL=="rtc", MODE="0660", GROUP="audio"
53
54KERNEL=="cdemu[0-9]*", GROUP="cdrom"
55KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
56KERNEL=="pktcdvd", MODE="0644"
57
58# printers and parallel devices
59SUBSYSTEM=="printer", GROUP="lp"
60SUBSYSTEM=="ppdev", GROUP="lp"
61KERNEL=="pt[0-9]*", GROUP="tape"
62KERNEL=="pht[0-9]*", GROUP="tape"
63
64# sound devices
65SUBSYSTEM=="sound", GROUP="audio"
66
67# ieee1394 devices
68KERNEL=="raw1394", GROUP="disk"
69KERNEL=="dv1394*", GROUP="video"
70KERNEL=="video1394*", GROUP="video"
71
72# input devices
73KERNEL=="event[0-9]*", MODE="0664"
74KERNEL=="js[0-9]*", MODE="0664"
75
76# AOE character devices
77SUBSYSTEM=="aoe", MODE="0220", GROUP="disk"
78SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440"
79
diff --git a/meta-oe/recipes-core/udev/udev/shr/mount.blacklist b/meta-oe/recipes-core/udev/udev/shr/mount.blacklist
new file mode 100644
index 000000000..117ac9b86
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/shr/mount.blacklist
@@ -0,0 +1,4 @@
1/dev/loop
2/dev/ram
3/dev/mtdblock
4/dev/mmcblk
diff --git a/meta-oe/recipes-core/udev/udev/slugos/mount.blacklist b/meta-oe/recipes-core/udev/udev/slugos/mount.blacklist
new file mode 100644
index 000000000..d9da5cfd7
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/slugos/mount.blacklist
@@ -0,0 +1,5 @@
1ram[0-9]$
2mtdblock[0-9]$
3hd[a-z]$
4sd[a-z]$
5loop[0-9]$
diff --git a/meta-oe/recipes-core/udev/udev/slugos/mount.sh b/meta-oe/recipes-core/udev/udev/slugos/mount.sh
new file mode 100644
index 000000000..b5298e97a
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/slugos/mount.sh
@@ -0,0 +1,83 @@
1#!/bin/sh
2#
3# Called from udev
4# Attemp to mount any added block devices
5# and remove any removed devices
6#
7
8MOUNT="/bin/mount"
9PMOUNT="/usr/bin/pmount"
10UMOUNT="/bin/umount"
11name="`basename "$DEVNAME"`"
12
13if ( blkid "$DEVNAME" | grep -q 'TYPE="mdraid"' )
14then
15 logger "udev/mount.sh" "[$DEVNAME] is a member of an array, ignoring"
16 exit 0
17fi
18
19for line in `cat /etc/udev/mount.blacklist | grep -v ^#`
20do
21 if ( echo "$DEVNAME" | grep -q "$line" )
22 then
23 logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring"
24 exit 0
25 fi
26done
27
28automount() {
29 ! test -d "/media/$name" && mkdir -p "/media/$name"
30
31 if ! $MOUNT -t auto -o sync $DEVNAME "/media/$name"
32 then
33 #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/media/$name\" failed!"
34 rm_dir "/media/$name"
35 else
36 logger "mount.sh/automount" "Auto-mount of [/media/$name] successful"
37 touch "/tmp/.automount-$name"
38 fi
39}
40
41rm_dir() {
42 # We do not want to rm -r populated directories
43 if test "`find "$1" | wc -l | tr -d " "`" -lt 2 -a -d "$1"
44 then
45 ! test -z "$1" && rm -r "$1"
46 else
47 logger "mount.sh/automount" "Not removing non-empty directory [$1]"
48 fi
49}
50
51if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ]; then
52 # SlugOS: we pivot to the rootfs based on UUID, not on fstab -- so the fstab may not
53 # be correct at this point in the boot. So we must not let udev mount devices based
54 # soley on the fstab, lest we mount overtop the real rootfs. For now we just comment
55 # out the logic below and let the automount logic (far below) deal with all udev mount
56 # operations.
57 #if [ -x "$PMOUNT" ]; then
58 # $PMOUNT $DEVNAME 2> /dev/null
59 #elif [ -x $MOUNT ]; then
60 # $MOUNT $DEVNAME 2> /dev/null
61 #fi
62
63 # If the device isn't mounted at this point, it isn't configured in fstab
64 # 20061107: Small correction: The rootfs partition may be called just "rootfs" and not by
65 # its true device name so this would break. If the rootfs is mounted on two places
66 # during boot, it confuses the heck out of fsck. So Im auto-adding the root-partition
67 # to /etc/udev/mount.blacklist via postinst
68
69 cat /proc/mounts | awk '{print $1}' | grep -q "^$DEVNAME$" || automount
70
71fi
72
73
74
75if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
76 for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " `
77 do
78 $UMOUNT -l $mnt
79 done
80
81 # Remove empty directories from auto-mounter
82 test -e "/tmp/.automount-$name" && rm_dir "/media/$name"
83fi
diff --git a/meta-oe/recipes-core/udev/udev/spitz/mount.blacklist b/meta-oe/recipes-core/udev/udev/spitz/mount.blacklist
new file mode 100644
index 000000000..38c7aa4b3
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/spitz/mount.blacklist
@@ -0,0 +1,7 @@
1# This is a grep pattern matched against the device name
2# Any matched pattern will _not_ be mounted / removed by udevd
3
4/dev/mtdblock
5/dev/hda
6/dev/loop
7/dev/ram \ No newline at end of file
diff --git a/meta-oe/recipes-core/udev/udev/tosa/mount.blacklist b/meta-oe/recipes-core/udev/udev/tosa/mount.blacklist
new file mode 100644
index 000000000..7e351bc98
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/tosa/mount.blacklist
@@ -0,0 +1,6 @@
1# This is a grep pattern matched against the device name
2# Any matched pattern will _not_ be mounted / removed by udevd
3
4/dev/mtdblock
5/dev/loop
6/dev/ram \ No newline at end of file
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 000000000..c90d05aef
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/udev-compat-wrapper-patch
@@ -0,0 +1,37 @@
1This patch should be applied on platforms which support kernels < 2.6.27 and need udev-compat package.
2
3It should be applied after:
4sed -i "s:/sbin/udevd:\$UDEVD:g;s:/sbin/udevadm:\$UDEVADM:g" init
5
6It has not .patch suffix, because such files would not be copied to
7WORKDIR and cannot be selectively applied on another source file.
8
9--- init
10+++ init
11@@ -11,6 +11,17 @@
12
13 export TZ=/etc/localtime
14
15+UDEVD="/sbin/udevd"
16+UDEVADM="/sbin/udevadm"
17+# If we are running an old kernel and have a static udev present use that instead
18+if [ -e /sbin/udevd-compat ] ; then
19+ KERNELMICROVER="$(uname -r | sed 's/^[0-9]*\.[0-9]*\.\([0-9]*\).*$/\1/')"
20+ if [ $KERNELMICROVER -lt 27 ] ; then
21+ UDEVD="/sbin/udevd-compat"
22+ UDEVADM="/sbin/udevadm-compat"
23+ fi
24+fi
25+
26 [ -d /sys/class ] || exit 1
27 [ -r /proc/mounts ] || exit 1
28 [ -x $UDEVD ] || exit 1
29@@ -21,6 +32,8 @@
30 if [ -x /sbin/pidof ]; then
31 pid=`/sbin/pidof -x udevd`
32 [ -n "$pid" ] && kill $pid
33+ pid=`/sbin/pidof -x udevd-compat`
34+ [ -n "$pid" ] && kill $pid
35 fi
36 }
37
diff --git a/meta-oe/recipes-core/udev/udev/udev.rules b/meta-oe/recipes-core/udev/udev/udev.rules
new file mode 100644
index 000000000..5c566f6ce
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/udev.rules
@@ -0,0 +1,98 @@
1# There are a number of modifiers that are allowed to be used in some
2# of the different fields. They provide the following subsitutions:
3#
4# %n the "kernel number" of the device.
5# For example, 'sda3' has a "kernel number" of '3'
6# %e the smallest number for that name which does not matches an existing node
7# %k the kernel name for the device
8# %M the kernel major number for the device
9# %m the kernel minor number for the device
10# %b the bus id for the device
11# %c the string returned by the PROGRAM
12# %s{filename} the content of a sysfs attribute
13# %% the '%' char itself
14#
15
16# SCSI devices
17BUS=="scsi", KERNEL=="sr[0-9]*", NAME="scd%n", SYMLINK+="sr%n"
18
19# USB devices
20BUS=="usb", KERNEL=="auer[0-9]*", NAME="usb/%k"
21BUS=="usb", KERNEL=="cpad[0-9]*", NAME="usb/%k"
22BUS=="usb", KERNEL=="dabusb*", NAME="usb/%k"
23BUS=="usb", KERNEL=="hiddev*", NAME="usb/%k"
24BUS=="usb", KERNEL=="legousbtower*", NAME="usb/%k"
25BUS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k"
26BUS=="usb", KERNEL=="ttyUSB*", SYSFS{product}=="Palm Handheld*", \
27 SYMLINK+="pilot"
28
29# usbfs-like devices
30SUBSYSTEM=="usb_device", \
31 PROGRAM="/bin/sh -c 'export X=%k; export X=$${X#usbdev}; export B=$${X%%%%.*}; export D=$${X#*.}; echo bus/usb/$$B/$$D'", SYMLINK+="%c"
32
33# serial devices
34KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20"
35KERNEL=="capi[0-9]*", NAME="capi/%n"
36
37# video devices
38KERNEL=="card[0-9]*", NAME="dri/%k"
39
40# misc devices
41KERNEL=="hw_random", NAME="hwrng"
42KERNEL=="tun", NAME="net/%k"
43
44KERNEL=="cdemu[0-9]*", NAME="cdemu/%n"
45KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%n"
46KERNEL=="pktcdvd", NAME="pktcdvd/control"
47
48KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid"
49KERNEL=="msr[0-9]*", NAME="cpu/%n/msr"
50KERNEL=="microcode", NAME="cpu/microcode"
51
52KERNEL=="umad*", NAME="infiniband/%k"
53KERNEL=="issm*", NAME="infiniband/%k"
54KERNEL=="uverbs*", NAME="infiniband/%k"
55KERNEL=="ucm", NAME="infiniband/%k"
56
57KERNEL=="buzzer", NAME="misc/buzzer"
58
59# ALSA devices
60KERNEL=="controlC[0-9]*", NAME="snd/%k"
61KERNEL=="hwC[D0-9]*", NAME="snd/%k"
62KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k"
63KERNEL=="midiC[D0-9]*", NAME="snd/%k"
64KERNEL=="timer", NAME="snd/%k"
65KERNEL=="seq", NAME="snd/%k"
66
67# ieee1394 devices
68KERNEL=="dv1394*", NAME="dv1394/%n"
69KERNEL=="video1394*", NAME="video1394/%n"
70
71# input devices
72KERNEL=="mice", NAME="input/%k"
73KERNEL=="mouse[0-9]*", NAME="input/%k"
74KERNEL=="event[0-9]*", NAME="input/%k"
75KERNEL=="js[0-9]*", NAME="input/%k"
76KERNEL=="ts[0-9]*", NAME="input/%k"
77KERNEL=="uinput", NAME="input/%k"
78
79# Zaptel
80KERNEL=="zapctl", NAME="zap/ctl"
81KERNEL=="zaptimer", NAME="zap/timer"
82KERNEL=="zapchannel", NAME="zap/channel"
83KERNEL=="zappseudo", NAME="zap/pseudo"
84KERNEL=="zap[0-9]*", NAME="zap/%n"
85
86# AOE character devices
87SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k"
88SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k"
89SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k"
90
91# device mapper creates its own device nodes, so ignore these
92KERNEL=="dm-[0-9]*", OPTIONS+="ignore_device"
93KERNEL=="device-mapper", NAME="mapper/control"
94
95KERNEL="rfcomm[0-9]*", NAME="%k", GROUP="users", MODE="0660"
96
97# Firmware Helper
98ACTION=="add", SUBSYSTEM=="firmware", RUN+="/sbin/firmware_helper"
diff --git a/meta-oe/recipes-core/udev/udev/udev_network_queue.sh b/meta-oe/recipes-core/udev/udev/udev_network_queue.sh
new file mode 100644
index 000000000..05e08e9d1
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/udev_network_queue.sh
@@ -0,0 +1,35 @@
1#! /bin/sh
2#
3# Copyright Matthias Hentges <devel@hentges.net> (c) 2006
4# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license)
5#
6# Filename: udev_network_queue.sh
7# Date: 03-May-06
8
9do_start() {
10 if test -e /dev/udev_network_queue
11 then
12 echo "Activating queued NICs..."
13 for NIC in `cat /dev/udev_network_queue`
14 do
15 export INTERFACE="$NIC" ; export ACTION=add
16 /etc/udev/scripts/network.sh
17 done
18 echo ""
19 else
20 echo "No NICs queued"
21 fi
22}
23
24do_stop() {
25 /bin/true
26}
27
28case "$1" in
29start) do_start;;
30stop) do_stop;;
31restart) do_stop
32 do_start;;
33*) echo "Usage: `basename $0` [ start | stop | restart ]"
34 exit 0;;
35esac
diff --git a/meta-oe/recipes-core/udev/udev/udevsynthesize.patch b/meta-oe/recipes-core/udev/udev/udevsynthesize.patch
new file mode 100644
index 000000000..781118848
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/udevsynthesize.patch
@@ -0,0 +1,776 @@
1--- udev-081/udevsynthesize.c.orig 2006-01-29 12:22:45.000000000 +0100
2+++ udev-081/udevsynthesize.c 2006-01-29 12:22:40.000000000 +0100
3@@ -0,0 +1,763 @@
4+/*
5+ * udevcoldplug.c
6+ *
7+ * Copyright (C) 2005 SUSE Linux Products GmbH
8+ *
9+ * Author:
10+ * Kay Sievers <kay.sievers@vrfy.org>
11+ *
12+ * Synthesize kernel events from sysfs information and pass them
13+ * to the udevd daemon.
14+ *
15+ * This program is free software; you can redistribute it and/or modify it
16+ * under the terms of the GNU General Public License as published by the
17+ * Free Software Foundation version 2 of the License.
18+ *
19+ * This program is distributed in the hope that it will be useful, but
20+ * WITHOUT ANY WARRANTY; without even the implied warranty of
21+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22+ * General Public License for more details.
23+ *
24+ * You should have received a copy of the GNU General Public License along
25+ * with this program; if not, write to the Free Software Foundation, Inc.,
26+ * 675 Mass Ave, Cambridge, MA 02139, USA.
27+ *
28+ */
29+
30+#include <stdlib.h>
31+#include <stddef.h>
32+#include <string.h>
33+#include <stdio.h>
34+#include <unistd.h>
35+#include <errno.h>
36+#include <ctype.h>
37+#include <fcntl.h>
38+#include <dirent.h>
39+#include <signal.h>
40+#include <syslog.h>
41+#include <sys/socket.h>
42+#include <sys/un.h>
43+#include <sys/wait.h>
44+#include <sys/stat.h>
45+#include <sys/types.h>
46+
47+#include "udev_libc_wrapper.h"
48+#include "udev.h"
49+#include "udevd.h"
50+#include "udev_version.h"
51+#include "logging.h"
52+
53+#include "list.h"
54+
55+#ifndef DT_DIR
56+#define DT_DIR 4
57+#endif
58+
59+static const char *udev_log_str;
60+static int udevd_sock = -1;
61+
62+#ifdef USE_LOG
63+void log_message(int priority, const char *format, ...)
64+{
65+ va_list args;
66+
67+ if (priority > udev_log_priority)
68+ return;
69+
70+ va_start(args, format);
71+ vsyslog(priority, format, args);
72+ va_end(args);
73+}
74+#endif
75+
76+struct device {
77+ struct list_head node;
78+ struct udevd_msg msg;
79+ size_t bufpos;
80+ char *path;
81+};
82+
83+static dev_t read_devt(const char *path)
84+{
85+ char filename[PATH_SIZE];
86+ char majorminor[64];
87+ unsigned int major, minor;
88+ ssize_t count;
89+ int fd;
90+
91+ snprintf(filename, sizeof(filename), "%s/%s", path, "dev");
92+ filename[sizeof(filename)-1] = '\0';
93+
94+ fd = open(filename, O_RDONLY);
95+ if (fd < 0)
96+ return 0;
97+
98+ count = read(fd, majorminor, sizeof(majorminor));
99+ close(fd);
100+ majorminor[count] = '\0';
101+ if (sscanf(majorminor, "%u:%u", &major, &minor) != 2)
102+ return 0;
103+ dbg("found major=%d, minor=%d", major, minor);
104+
105+ return makedev(major, minor);
106+}
107+
108+static ssize_t read_file(const char *directory, const char *file, char *str, size_t len)
109+{
110+ char filename[PATH_SIZE];
111+ ssize_t count;
112+ int fd;
113+
114+ memset(filename, 0, sizeof(filename));
115+ snprintf(filename, sizeof(filename), "%s/%s", directory, file);
116+ filename[sizeof(filename)-1] = '\0';
117+
118+ fd = open(filename, O_RDONLY);
119+ if (fd < 0)
120+ return -1;
121+
122+ count = read(fd, str, len-1);
123+ close(fd);
124+
125+ if (count > (ssize_t)len)
126+ count = len;
127+ str[count-1] = '\0';
128+
129+ return count;
130+}
131+
132+static ssize_t read_link(const char *directory, const char *file, char *str, size_t size)
133+{
134+ char filename[PATH_SIZE];
135+ char target[PATH_SIZE];
136+ int len;
137+ char *back;
138+ char *strip;
139+ int level = 1;
140+
141+ snprintf(filename, sizeof(filename), "%s/%s", directory, file);
142+ filename[sizeof(filename)-1] = '\0';
143+
144+ len = readlink(filename, target, sizeof(target)-1);
145+ if (len < 0)
146+ return -1;
147+ target[len] = '\0';
148+
149+ back = target;
150+ while (strncmp(back, "../", 3) == 0) {
151+ back += 3;
152+ level++;
153+ }
154+ while(level--) {
155+ strip = strrchr(filename, '/');
156+ if (!strip)
157+ return -1;
158+ strip[0] = '\0';
159+ }
160+
161+ snprintf(str, size, "%s/%s", filename, back);
162+ str[size-1] = '\0';
163+
164+ return len;
165+}
166+
167+static char *add_env_key(struct device *device, const char *key, const char *value)
168+{
169+ size_t pos = device->bufpos;
170+ device->bufpos += sprintf(&device->msg.envbuf[device->bufpos], "%s=%s", key, value)+1;
171+ return &device->msg.envbuf[pos];
172+}
173+
174+static struct device *device_create(const char *path, const char *subsystem, dev_t devt)
175+{
176+ struct device *device;
177+ const char *devpath = &path[strlen(sysfs_path)];
178+ char target[PATH_SIZE];
179+
180+ device = malloc(sizeof(struct device));
181+ if (device == NULL) {
182+ dbg("error malloc");
183+ return NULL;
184+ }
185+ memset(device, 0x00, sizeof(struct device));
186+
187+ device->path = add_env_key(device, "DEVPATH", devpath);
188+ device->path += strlen("DEVPATH=");
189+ add_env_key(device, "SUBSYSTEM", subsystem);
190+ add_env_key(device, "ACTION", "add");
191+ add_env_key(device, "UDEV_COLDPLUG", "1");
192+
193+ if (major(devt)) {
194+ char number[32];
195+ sprintf(number, "%u", major(devt));
196+ add_env_key(device, "MAJOR", number);
197+ sprintf(number, "%u", minor(devt));
198+ add_env_key(device, "MINOR", number);
199+ }
200+
201+ if (strncmp(devpath, "/block/", strlen("/block/")) == 0 ||
202+ strncmp(devpath, "/class/", strlen("/class/")) == 0) {
203+ char physpath[PATH_SIZE];
204+
205+ if (read_link(path, "device", physpath, sizeof(physpath)) > (ssize_t)strlen(sysfs_path)) {
206+ add_env_key(device, "PHYSDEVPATH", &physpath[strlen(sysfs_path)]);
207+ if (read_link(physpath, "driver", target, sizeof(target)) > (ssize_t)strlen(sysfs_path)) {
208+ char *pos = strrchr(target, '/');
209+ if (pos)
210+ add_env_key(device, "PHYSDEVDRIVER", &pos[1]);
211+ }
212+ if (read_link(physpath, "bus", target, sizeof(target)) > (ssize_t)strlen(sysfs_path)) {
213+ char *pos = strrchr(target, '/');
214+ if (pos)
215+ add_env_key(device, "PHYSDEVBUS", &pos[1]);
216+ }
217+ }
218+ } else if (strncmp(devpath, "/devices/", strlen("/devices/")) == 0) {
219+ if (read_link(path, "driver", target, sizeof(target)) > (ssize_t)strlen(sysfs_path)) {
220+ char *pos = strrchr(target, '/');
221+ if (pos)
222+ add_env_key(device, "PHYSDEVDRIVER", &pos[1]);
223+ }
224+ if (read_link(path, "bus", target, sizeof(target)) > (ssize_t)strlen(sysfs_path)) {
225+ char *pos = strrchr(target, '/');
226+ if (pos)
227+ add_env_key(device, "PHYSDEVBUS", &pos[1]);
228+ }
229+ }
230+
231+ return device;
232+}
233+
234+static int device_list_insert(struct list_head *device_list, struct device *device)
235+{
236+ struct device *loop_device;
237+
238+ dbg("insert: '%s'", device->path);
239+
240+ /* sort files in lexical order */
241+ list_for_each_entry(loop_device, device_list, node)
242+ if (strcmp(loop_device->path, device->path) > 0)
243+ break;
244+
245+ list_add_tail(&device->node, &loop_device->node);
246+
247+ return 0;
248+}
249+
250+static int add_device_udevd(struct device *device)
251+{
252+ size_t msg_len;
253+ struct sockaddr_un saddr;
254+ socklen_t addrlen;
255+ int retval;
256+
257+ memset(&saddr, 0x00, sizeof(struct sockaddr_un));
258+ saddr.sun_family = AF_LOCAL;
259+ /* use abstract namespace for socket path */
260+ strcpy(&saddr.sun_path[1], UDEVD_SOCK_PATH);
261+ addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(saddr.sun_path+1) + 1;
262+
263+ strcpy(device->msg.magic, UDEV_MAGIC);
264+ device->msg.type = UDEVD_UEVENT_UDEVSEND;
265+
266+ msg_len = offsetof(struct udevd_msg, envbuf) + device->bufpos;
267+ dbg("msg_len=%i", msg_len);
268+
269+ retval = sendto(udevd_sock, &device->msg, msg_len, 0, (struct sockaddr *)&saddr, addrlen);
270+ if (retval < 0)
271+ return -1;
272+
273+ return 0;
274+}
275+
276+static void exec_list(struct list_head *device_list, const char *first[], const char *last[])
277+{
278+ struct device *loop_device;
279+ struct device *tmp_device;
280+ int i;
281+
282+ /* handle the "first" type devices first */
283+ if (first)
284+ list_for_each_entry_safe(loop_device, tmp_device, device_list, node) {
285+ for (i = 0; first[i] != NULL; i++) {
286+ if (strncmp(loop_device->path, first[i], strlen(first[i])) == 0) {
287+ add_device_udevd(loop_device);
288+ list_del(&loop_device->node);
289+ free(loop_device);
290+ break;
291+ }
292+ }
293+ }
294+
295+ /* handle the devices we are allowed to, excluding the "last" type devices */
296+ if (last)
297+ list_for_each_entry_safe(loop_device, tmp_device, device_list, node) {
298+ int found = 0;
299+ for (i = 0; last[i] != NULL; i++) {
300+ if (strncmp(loop_device->path, last[i], strlen(last[i])) == 0) {
301+ found = 1;
302+ break;
303+ }
304+ }
305+ if (found)
306+ continue;
307+
308+ add_device_udevd(loop_device);
309+ list_del(&loop_device->node);
310+ free(loop_device);
311+ }
312+
313+ /* handle the rest of the devices */
314+ list_for_each_entry_safe(loop_device, tmp_device, device_list, node) {
315+ add_device_udevd(loop_device);
316+ list_del(&loop_device->node);
317+ free(loop_device);
318+ }
319+}
320+
321+static int udev_scan_class(void)
322+{
323+ char base[PATH_SIZE];
324+ DIR *dir;
325+ struct dirent *dent;
326+ LIST_HEAD(device_list);
327+
328+ /* we want /dev/null and /dev/console first */
329+ const char *first[] = {
330+ "/class/mem",
331+ "/class/tty",
332+ NULL,
333+ };
334+
335+ snprintf(base, sizeof(base), "%s/class", sysfs_path);
336+ base[sizeof(base)-1] = '\0';
337+
338+ dir = opendir(base);
339+ if (!dir)
340+ return -1;
341+
342+ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
343+ char dirname[PATH_SIZE];
344+ DIR *dir2;
345+ struct dirent *dent2;
346+
347+ if (dent->d_name[0] == '.')
348+ continue;
349+
350+ snprintf(dirname, sizeof(dirname), "%s/%s", base, dent->d_name);
351+ dirname[sizeof(dirname)-1] = '\0';
352+
353+ dir2 = opendir(dirname);
354+ if (!dir2)
355+ continue;
356+ for (dent2 = readdir(dir2); dent2 != NULL; dent2 = readdir(dir2)) {
357+ char dirname2[PATH_SIZE];
358+ struct device *device;
359+ dev_t devt;
360+
361+ if (dent2->d_name[0] == '.')
362+ continue;
363+ if (dent2->d_type != DT_DIR)
364+ continue;
365+
366+ snprintf(dirname2, sizeof(dirname2), "%s/%s", dirname, dent2->d_name);
367+ dirname2[sizeof(dirname2)-1] = '\0';
368+ devt = read_devt(dirname2);
369+ device = device_create(dirname2, dent->d_name, devt);
370+
371+ if (strcmp(dent->d_name, "net") == 0 ||
372+ strcmp(dent->d_name, "bluetooth") == 0) {
373+ add_env_key(device, "INTERFACE", dent2->d_name);
374+ } else if (strcmp(dent->d_name, "pcmcia_socket") == 0 &&
375+ strlen(dent->d_name) > 14) {
376+ add_env_key(device, "SOCKET_NO",
377+ dent2->d_name + 14);
378+ }
379+
380+ device_list_insert(&device_list, device);
381+ }
382+ closedir(dir2);
383+ }
384+ closedir(dir);
385+ exec_list(&device_list, first, NULL);
386+
387+ return 0;
388+}
389+
390+static int udev_scan_block(void)
391+{
392+ char base[PATH_SIZE];
393+ DIR *dir;
394+ struct dirent *dent;
395+ LIST_HEAD(device_list);
396+
397+ /* dm wants to have the block devices around before it */
398+ const char *last[] = {
399+ "/block/dm",
400+ NULL,
401+ };
402+
403+ snprintf(base, sizeof(base), "%s/block", sysfs_path);
404+ base[sizeof(base)-1] = '\0';
405+
406+ dir = opendir(base);
407+ if (!dir)
408+ return -1;
409+
410+ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
411+ char dirname[PATH_SIZE];
412+ struct device *device;
413+ struct dirent *dent2;
414+ DIR *dir2;
415+ dev_t devt;
416+
417+ if (dent->d_name[0] == '.')
418+ continue;
419+ if (dent->d_type != DT_DIR)
420+ continue;
421+
422+ snprintf(dirname, sizeof(dirname), "%s/%s", base, dent->d_name);
423+ dirname[sizeof(dirname)-1] = '\0';
424+ devt = read_devt(dirname);
425+ if (major(devt)) {
426+ device = device_create(dirname, "block", devt);
427+ device_list_insert(&device_list, device);
428+ }
429+
430+ /* look for partitions */
431+ dir2 = opendir(dirname);
432+ if (!dir2)
433+ continue;
434+ for (dent2 = readdir(dir2); dent2 != NULL; dent2 = readdir(dir2)) {
435+ char dirname2[PATH_SIZE];
436+
437+ if (dent2->d_name[0] == '.')
438+ continue;
439+ if (dent2->d_type != DT_DIR)
440+ continue;
441+
442+ snprintf(dirname2, sizeof(dirname2), "%s/%s", dirname, dent2->d_name);
443+ dirname2[sizeof(dirname2)-1] = '\0';
444+ devt = read_devt(dirname2);
445+ if (major(devt)) {
446+ device = device_create(dirname2, "block", devt);
447+ device_list_insert(&device_list, device);
448+ continue;
449+ }
450+ }
451+ closedir(dir2);
452+ }
453+ closedir(dir);
454+ exec_list(&device_list, NULL, last);
455+
456+ return 0;
457+}
458+
459+static int pci_handler(struct device *device)
460+{
461+ char path[PATH_SIZE];
462+ char value[PATH_SIZE];
463+ char vendor[PATH_SIZE];
464+ char product[PATH_SIZE];
465+ const char *name;
466+
467+ snprintf(path, sizeof(path), "%s%s", sysfs_path, device->path);
468+ path[sizeof(path)-1] = '\0';
469+
470+ if (read_file(path, "modalias", value, sizeof(value)) > 0)
471+ add_env_key(device, "MODALIAS", value);
472+
473+ name = strrchr(device->path, '/');
474+ if (name)
475+ add_env_key(device, "PCI_SLOT_NAME", &name[1]);
476+
477+ if (read_file(path, "class", value, sizeof(value)) > 0)
478+ add_env_key(device, "PCI_CLASS", &value[2]);
479+
480+ if (read_file(path, "vendor", vendor, sizeof(vendor)) > 0 &&
481+ read_file(path, "device", product, sizeof(product)) > 0) {
482+ snprintf(value, sizeof(value), "%s:%s", &vendor[2], &product[2]);
483+ path[sizeof(value)-1] = '\0';
484+ add_env_key(device, "PCI_ID", value);
485+ }
486+
487+ if (read_file(path, "subsystem_vendor", vendor, sizeof(vendor)) > 0 &&
488+ read_file(path, "subsystem_device", product, sizeof(product)) > 0) {
489+ snprintf(value, sizeof(value), "%s:%s", &vendor[2], &product[2]);
490+ path[sizeof(value)-1] = '\0';
491+ add_env_key(device, "PCI_SUBSYS_ID", value);
492+ }
493+
494+ return 0;
495+}
496+
497+static int usb_handler(struct device *device)
498+{
499+ char path[PATH_SIZE];
500+ char value[PATH_SIZE];
501+ char str1[PATH_SIZE];
502+ char str2[PATH_SIZE];
503+ char str3[PATH_SIZE];
504+ unsigned int int1;
505+ unsigned int int2;
506+ unsigned int int3;
507+ char *pos;
508+
509+ snprintf(path, sizeof(path), "%s%s", sysfs_path, device->path);
510+ path[sizeof(path)-1] = '\0';
511+
512+ /* device events have : in their directory name */
513+ pos = strrchr(path, '/');
514+ if (!strchr(pos, ':'))
515+ return 0; /* and do not have other variables */
516+
517+ if (read_file(path, "modalias", value, sizeof(value)) > 0)
518+ add_env_key(device, "MODALIAS", value);
519+
520+ if (read_file(path, "bInterfaceClass", str1, sizeof(str1)) > 0 &&
521+ read_file(path, "bInterfaceSubClass", str2, sizeof(str2)) > 0 &&
522+ read_file(path, "bInterfaceProtocol", str3, sizeof(str3)) > 0) {
523+ int1 = (int) strtol(str1, NULL, 16);
524+ int2 = (int) strtol(str2, NULL, 16);
525+ int3 = (int) strtol(str3, NULL, 16);
526+ snprintf(value, sizeof(value), "%u/%u/%u", int1, int2, int3);
527+ path[sizeof(value)-1] = '\0';
528+ add_env_key(device, "INTERFACE", value);
529+ }
530+
531+ /* move to the parent directory */
532+ pos[0] = '\0';
533+
534+ if (read_file(path, "idVendor", str1, sizeof(str1)) > 0 &&
535+ read_file(path, "idProduct", str2, sizeof(str2)) > 0 &&
536+ read_file(path, "bcdDevice", str3, sizeof(str3)) > 0) {
537+ int1 = (int) strtol(str1, NULL, 16);
538+ int2 = (int) strtol(str2, NULL, 16);
539+ int3 = (int) strtol(str3, NULL, 16);
540+ snprintf(value, sizeof(value), "%x/%x/%x", int1, int2, int3);
541+ path[sizeof(value)-1] = '\0';
542+ add_env_key(device, "PRODUCT", value);
543+ }
544+
545+ if (read_file(path, "bDeviceClass", str1, sizeof(str1)) > 0 &&
546+ read_file(path, "bDeviceSubClass", str2, sizeof(str2)) > 0 &&
547+ read_file(path, "bDeviceProtocol", str3, sizeof(str3)) > 0) {
548+ int1 = (int) strtol(str1, NULL, 16);
549+ int2 = (int) strtol(str2, NULL, 16);
550+ int3 = (int) strtol(str3, NULL, 16);
551+ snprintf(value, sizeof(value), "%u/%u/%u", int1, int2, int3);
552+ path[sizeof(value)-1] = '\0';
553+ add_env_key(device, "TYPE", value);
554+ }
555+
556+ if (read_file(path, "devnum", str2, sizeof(str2)) > 0) {
557+ pos = strrchr(path, 'b');
558+ int1 = (int) strtol(pos + 1, NULL, 16);
559+ int2 = (int) strtol(str2, NULL, 16);
560+ snprintf(value, sizeof(value),
561+ "/proc/bus/usb/%03d/%03d", int1, int2);
562+ path[sizeof(value)-1] = '\0';
563+ add_env_key(device, "DEVICE", value);
564+ }
565+
566+ return 0;
567+}
568+
569+static int serio_handler(struct device *device)
570+{
571+ char path[PATH_SIZE];
572+ char value[PATH_SIZE];
573+
574+ snprintf(path, sizeof(path), "%s%s", sysfs_path, device->path);
575+ path[sizeof(path)-1] = '\0';
576+
577+ if (read_file(path, "modalias", value, sizeof(value)) > 0)
578+ add_env_key(device, "MODALIAS", value);
579+
580+ if (read_file(path, "id/type", value, sizeof(value)) > 0)
581+ add_env_key(device, "SERIO_TYPE", value);
582+
583+ if (read_file(path, "id/proto", value, sizeof(value)) > 0)
584+ add_env_key(device, "SERIO_PROTO", value);
585+
586+ if (read_file(path, "id/id", value, sizeof(value)) > 0)
587+ add_env_key(device, "SERIO_ID", value);
588+
589+ if (read_file(path, "id/extra", value, sizeof(value)) > 0)
590+ add_env_key(device, "SERIO_EXTRA", value);
591+
592+ return 0;
593+}
594+
595+static int ccw_handler(struct device *device)
596+{
597+ char path[PATH_SIZE];
598+ char value[PATH_SIZE], *tmp;
599+
600+ snprintf(path, sizeof(path), "%s%s", sysfs_path, device->path);
601+ path[sizeof(path)-1] = '\0';
602+
603+ if (read_file(path, "modalias", value, sizeof(value)) > 0)
604+ add_env_key(device, "MODALIAS", value);
605+
606+ if (read_file(path, "cutype", value, sizeof(value)) > 0) {
607+ value[4] = 0;
608+ tmp = &value[5];
609+ add_env_key(device, "CU_TYPE", value);
610+ add_env_key(device, "CU_MODEL", tmp);
611+ }
612+
613+ if (read_file(path, "devtype", value, sizeof(value)) > 0) {
614+ if (value[0] == 'n') {
615+ add_env_key(device, "DEV_TYPE", "0000");
616+ add_env_key(device, "DEV_MODEL", "00");
617+ }
618+ else {
619+ value[4] = 0;
620+ tmp = &value[5];
621+ add_env_key(device, "DEV_TYPE", value);
622+ add_env_key(device, "DEV_MODEL", tmp);
623+ }
624+ }
625+
626+ return 0;
627+}
628+
629+static int modalias_handler(struct device *device)
630+{
631+ char path[PATH_SIZE];
632+ char value[PATH_SIZE];
633+
634+ snprintf(path, sizeof(path), "%s%s", sysfs_path, device->path);
635+ path[sizeof(path)-1] = '\0';
636+
637+ if (read_file(path, "modalias", value, sizeof(value)) > 0)
638+ add_env_key(device, "MODALIAS", value);
639+
640+ return 0;
641+}
642+
643+static int udev_scan_bus(const char *bus, int bus_handler(struct device *device))
644+{
645+ char base[PATH_SIZE];
646+ DIR *dir;
647+ struct dirent *dent;
648+ LIST_HEAD(device_list);
649+
650+ snprintf(base, sizeof(base), "%s/bus/%s/devices", sysfs_path, bus);
651+ base[sizeof(base)-1] = '\0';
652+
653+ dir = opendir(base);
654+ if (!dir)
655+ return -1;
656+ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
657+ char devpath[PATH_SIZE];
658+ struct device *device;
659+
660+ if (dent->d_name[0] == '.')
661+ continue;
662+
663+ if (read_link(base, dent->d_name, devpath, sizeof(devpath)) < 0)
664+ continue;
665+
666+ device = device_create(devpath, bus, makedev(0, 0));
667+ if (bus_handler) {
668+ if (bus_handler(device) < 0) {
669+ dbg("'%s' bus handler skipped event", devpath);
670+ free(device);
671+ continue;
672+ }
673+ }
674+
675+ device_list_insert(&device_list, device);
676+ }
677+ closedir(dir);
678+ exec_list(&device_list, NULL, NULL);
679+
680+ return 0;
681+}
682+
683+static int udev_scan_devices(void)
684+{
685+ char base[PATH_SIZE];
686+ DIR *dir;
687+ struct dirent *dent;
688+
689+ snprintf(base, sizeof(base), "%s/bus", sysfs_path);
690+ base[sizeof(base)-1] = '\0';
691+
692+ dir = opendir(base);
693+ if (!dir)
694+ return -1;
695+
696+ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
697+ if (dent->d_name[0] == '.')
698+ continue;
699+ if (dent->d_type != DT_DIR)
700+ continue;
701+
702+ /* add bus specific env values */
703+ if (strcmp(dent->d_name, "pci") == 0)
704+ udev_scan_bus("pci", pci_handler);
705+ else if (strcmp(dent->d_name, "usb") == 0)
706+ udev_scan_bus("usb", usb_handler);
707+ else if (strcmp(dent->d_name, "serio") == 0)
708+ udev_scan_bus("serio", serio_handler);
709+ else if (strcmp(dent->d_name, "ccw") == 0)
710+ udev_scan_bus("ccw", ccw_handler);
711+ else
712+ udev_scan_bus(dent->d_name, modalias_handler);
713+ }
714+ closedir(dir);
715+
716+ return 0;
717+}
718+
719+int main(int argc, char *argv[], char *envp[])
720+{
721+ LIST_HEAD(device_list);
722+ int i;
723+
724+ logging_init("udevcoldplug");
725+ udev_config_init(); sysfs_init();
726+ dbg("version %s", UDEV_VERSION);
727+
728+ udev_log_str = getenv("UDEV_LOG");
729+
730+ /* disable all logging if not explicitely requested */
731+ if (udev_log_str == NULL)
732+ udev_log_priority = 0;
733+
734+ for (i = 1 ; i < argc; i++) {
735+ char *arg = argv[i];
736+
737+ if (strcmp(arg, "help") == 0 || strcmp(arg, "--help") == 0 || strcmp(arg, "-h") == 0) {
738+ printf("Usage: udevcoldplug \n"
739+ " --help print this help text\n\n");
740+ exit(0);
741+ } else {
742+ fprintf(stderr, "unknown option\n\n");
743+ exit(1);
744+ }
745+ }
746+
747+ udevd_sock = socket(AF_LOCAL, SOCK_DGRAM, 0);
748+ if (udevd_sock < 0) {
749+ err("error getting socket");
750+ return 1;
751+ }
752+
753+ /* create nodes for already available devices */
754+ udev_scan_class();
755+ udev_scan_block();
756+
757+ /* synthesize events for bus devices
758+ * may load modules or configure the device */
759+ udev_scan_devices();
760+
761+ if (udevd_sock >= 0)
762+ close(udevd_sock);
763+ logging_close();
764+
765+ return 0;
766+}
767--- udev-081/Makefile
768+++ udev-081/Makefile
769@@ -58,6 +58,7 @@ PROGRAMS = \
770 udevmonitor \
771 udevinfo \
772 udevtest \
773+ udevsynthesize \
774 udevstart
775
776 HEADERS = \
diff --git a/meta-oe/recipes-core/udev/udev/udevsynthesize.sh b/meta-oe/recipes-core/udev/udev/udevsynthesize.sh
new file mode 100644
index 000000000..d58217c14
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/udevsynthesize.sh
@@ -0,0 +1,51 @@
1#!/bin/sh -e
2
3load_input_modules() {
4 for module in mousedev evdev joydev; do
5 modprobe -q $module || true
6 done
7}
8
9if [ ! -e /sys/class/mem/null/uevent ]; then # <= 2.6.14
10 /lib/udev/udevsynthesize
11 load_input_modules
12 exit 0
13fi
14
15# replace $IFS with something which is not likely to appear in a sysfs path,
16# because some buggy drivers have spaces in their names
17oldifs="$IFS"
18IFS="|"
19
20for file in /sys/bus/*/devices/*/uevent /sys/class/*/*/uevent \
21 /sys/block/*/uevent /sys/block/*/*/uevent; do
22 case "$file" in
23 */device/uevent) ;; # skip followed device symlinks
24 */\*/*) ;;
25
26 */class/mem/*) # for /dev/null
27 first="$first${IFS}$file" ;;
28
29 */block/md[0-9]*)
30 last="$last${IFS}$file" ;;
31
32 *)
33 default="$default${IFS}$file" ;;
34 esac
35done
36
37for file in $first${IFS}$default${IFS}$last; do
38 [ "$file" ] || continue
39 echo 'add' > "$file" || true
40done
41
42IFS="$oldifs"
43
44case "$(uname -r)" in
45 2.6.1[0-5]|2.6.1[0-5][!0-9]*) # <= 2.6.15
46 load_input_modules
47 ;;
48esac
49
50exit 0
51
diff --git a/meta-oe/recipes-core/udev/udev_165.bb b/meta-oe/recipes-core/udev/udev_165.bb
new file mode 100644
index 000000000..2c4171d65
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev_165.bb
@@ -0,0 +1,181 @@
1DESCRIPTION = "udev is a daemon which dynamically creates and removes device nodes from \
2/dev/, handles hotplug events and loads drivers at boot time. It replaces \
3the hotplug package and requires a kernel not older than 2.6.12."
4
5LICENSE = "GPLv2+ & LGPLv2.1+"
6LICENSE_${PN} = "GPLv2+"
7LICENSE_libudev = "LGPLv2.1+"
8LICENSE_libgudev = "LGPLv2.1+"
9LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
10 file://libudev/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
11 file://extras/gudev/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343"
12
13PR = "r2"
14
15# Untested
16DEFAULT_PREFERENCE = "-1"
17
18# Needed for udev-extras
19DEPENDS = "gperf-native usbutils acl glib-2.0"
20RDEPENDS_${PN} += "module-init-tools-depmod udev-utils"
21
22SRC_URI = "http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
23 file://mount.blacklist \
24 file://run.rules \
25 "
26
27SRC_URI[md5sum] = "b8cf77be693fd09ccfcf26d3e4e23e97"
28SRC_URI[sha256sum] = "5c271f43d8a28176050abbc6b4e4354203b6a7d810c72c18afefd1ee100485c3"
29
30SRC_URI += " \
31 file://udev.rules \
32 file://devfs-udev.rules \
33 file://links.conf \
34 file://permissions.rules \
35 file://mount.sh \
36 file://network.sh \
37 file://local.rules \
38 file://default \
39 file://init \
40 file://cache \
41 file://udev-compat-wrapper-patch \
42"
43
44SRC_URI_append_h2200 = " file://50-hostap_cs.rules "
45PACKAGE_ARCH_h2200 = "h2200"
46
47#buglabs's bug device
48SRC_URI_append_bug = " \
49 file://30-BUG.rules \
50 file://10-mx31.rules \
51 file://bmi_eventpipe.sh "
52
53SRC_URI_append_nokia900 = " \
54 file://10-cmt_speech.rules \
55 file://70-persistent-net.rules \
56 file://udev-rules-nokia-n900-hacks.rules \
57 file://udev-rules-nokia-n900-snd.rules \
58 file://nokia-n900-mac-hack.sh \
59"
60
61PACKAGE_ARCH_bug = "bug"
62
63inherit update-rc.d autotools
64
65EXTRA_OECONF += " --with-udev-prefix= \
66 --with-libdir-name=${base_libdir} \
67 --with-pci-ids-path=/usr/share/misc \
68 --disable-introspection \
69 ac_cv_file__usr_share_pci_ids=no \
70 ac_cv_file__usr_share_hwdata_pci_ids=no \
71 ac_cv_file__usr_share_misc_pci_ids=yes \
72 --sbindir=${base_sbindir} \
73 --libexecdir=${base_libdir}/udev \
74 --with-rootlibdir=${base_libdir} \
75"
76
77INITSCRIPT_NAME = "udev"
78INITSCRIPT_PARAMS = "start 03 S ."
79
80PACKAGES =+ "libudev libgudev udev-utils"
81
82FILES_libudev = "${base_libdir}/libudev.so.*"
83FILES_libgudev = "${base_libdir}/libgudev*.so.*"
84
85FILES_udev-utils = "${bindir}/udevinfo ${bindir}/udevtest ${base_sbindir}/udevadm"
86
87RPROVIDES_${PN} = "hotplug"
88FILES_${PN} += "${usrbindir}/* ${usrsbindir}/udevd"
89FILES_${PN}-dbg += "${usrbindir}/.debug ${usrsbindir}/.debug"
90
91# udev installs binaries under $(udev_prefix)/lib/udev, even if ${libdir}
92# is ${prefix}/lib64
93FILES_${PN} += "/lib/udev* ${libdir}/ConsoleKit"
94FILES_${PN}-dbg += "/lib/udev/.debug"
95
96RPROVIDES_udev_append = " udev-compat-wrapper"
97RDEPENDS_udev_append_spitz = " udev-compat"
98do_unpack_append_spitz() {
99 bb.build.exec_func('do_apply_compat_wrapper', d)
100}
101RDEPENDS_udev_append_akita = " udev-compat"
102do_unpack_append_akita() {
103 bb.build.exec_func('do_apply_compat_wrapper', d)
104}
105RDEPENDS_udev_append_c7x0 = " udev-compat"
106do_unpack_append_c7x0() {
107 bb.build.exec_func('do_apply_compat_wrapper', d)
108}
109RDEPENDS_udev_append_poodle = " udev-compat"
110do_unpack_append_poodle() {
111 bb.build.exec_func('do_apply_compat_wrapper', d)
112}
113
114# Modify init script on platforms that need to boot old kernels:
115do_apply_compat_wrapper() {
116 cd ${WORKDIR}
117 sed -i "s:/sbin/udevd:\$UDEVD:g;s:/sbin/udevadm:\$UDEVADM:g" init
118 patch <udev-compat-wrapper-patch
119 cd -
120}
121
122do_install () {
123 install -d ${D}${usrsbindir} \
124 ${D}${sbindir}
125 oe_runmake 'DESTDIR=${D}' INSTALL=install install
126 install -d ${D}${sysconfdir}/init.d
127 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
128 install -m 0755 ${WORKDIR}/cache ${D}${sysconfdir}/init.d/udev-cache
129
130 install -d ${D}${sysconfdir}/default
131 install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/udev
132
133 cp ${S}/rules/rules.d/* ${D}${sysconfdir}/udev/rules.d/
134
135 install -m 0644 ${WORKDIR}/mount.blacklist ${D}${sysconfdir}/udev/
136 install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
137 install -m 0644 ${WORKDIR}/permissions.rules ${D}${sysconfdir}/udev/rules.d/permissions.rules
138 install -m 0644 ${WORKDIR}/run.rules ${D}${sysconfdir}/udev/rules.d/run.rules
139 install -m 0644 ${WORKDIR}/udev.rules ${D}${sysconfdir}/udev/rules.d/udev.rules
140 install -m 0644 ${WORKDIR}/links.conf ${D}${sysconfdir}/udev/links.conf
141 if [ "${UDEV_DEVFS_RULES}" = "1" ]; then
142 install -m 0644 ${WORKDIR}/devfs-udev.rules ${D}${sysconfdir}/udev/rules.d/devfs-udev.rules
143 fi
144
145 touch ${D}${sysconfdir}/udev/saved.uname
146 touch ${D}${sysconfdir}/udev/saved.cmdline
147 touch ${D}${sysconfdir}/udev/saved.atags
148
149 install -d ${D}${sysconfdir}/udev/scripts/
150
151 install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh
152 install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts
153}
154
155do_install_append_h2200() {
156 install -m 0644 ${WORKDIR}/50-hostap_cs.rules ${D}${sysconfdir}/udev/rules.d/50-hostap_cs.rules
157}
158
159do_install_append_bug() {
160 install -m 0644 ${WORKDIR}/30-BUG.rules ${D}${sysconfdir}/udev/rules.d/30-BUG.rules
161 install -m 0644 ${WORKDIR}/10-mx31.rules ${D}${sysconfdir}/udev/rules.d/10-mx31.rules
162 install -m 0644 ${WORKDIR}/bmi_eventpipe.sh ${D}${sysconfdir}/udev/scripts/bmi_eventpipe.sh
163}
164
165do_install_append_nokia900() {
166 install -m 0644 ${WORKDIR}/10-cmt_speech.rules ${D}${sysconfdir}/udev/rules.d/10-cmt_speech.rules
167 install -m 0644 ${WORKDIR}/70-persistent-net.rules ${D}${sysconfdir}/udev/rules.d/70-persistent-net.rules
168 install -m 0644 ${WORKDIR}/udev-rules-nokia-n900-hacks.rules ${D}${sysconfdir}/udev/rules.d/udev-rules-nokia-n900-hacks.rules
169 install -m 0644 ${WORKDIR}/udev-rules-nokia-n900-snd.rules ${D}${sysconfdir}/udev/rules.d/udev-rules-nokia-n900-snd.rules
170 install -m 0755 ${WORKDIR}/nokia-n900-mac-hack.sh ${D}${sysconfdir}/udev/scripts/nokia-n900-mac-hack.sh
171}
172
173# Create the cache after checkroot has run
174pkg_postinst_udev_append() {
175 if test "x$D" != "x"; then
176 OPT="-r $D"
177 else
178 OPT="-s"
179 fi
180 update-rc.d $OPT udev-cache start 12 S .
181}