summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/udev')
-rw-r--r--meta/recipes-core/udev/udev-extraconf/automount.rules19
-rw-r--r--meta/recipes-core/udev/udev-extraconf/autonet.rules19
-rw-r--r--meta/recipes-core/udev/udev-extraconf/localextra.rules23
-rw-r--r--meta/recipes-core/udev/udev-extraconf/mount.blacklist5
-rw-r--r--meta/recipes-core/udev/udev-extraconf/mount.sh91
-rw-r--r--meta/recipes-core/udev/udev-extraconf/network.sh54
-rw-r--r--meta/recipes-core/udev/udev-extraconf_1.0.bb41
-rw-r--r--meta/recipes-core/udev/udev.inc110
-rw-r--r--meta/recipes-core/udev/udev/0001-Fixing-keyboard_force_release.sh-shell-script-path.patch35
-rw-r--r--meta/recipes-core/udev/udev/add-install-ptest.patch60
-rw-r--r--meta/recipes-core/udev/udev/avoid-mouse-autosuspend.patch25
-rw-r--r--meta/recipes-core/udev/udev/devfs-udev.rules108
-rw-r--r--meta/recipes-core/udev/udev/init131
-rw-r--r--meta/recipes-core/udev/udev/links.conf21
-rw-r--r--meta/recipes-core/udev/udev/local.rules21
-rw-r--r--meta/recipes-core/udev/udev/permissions.rules131
-rw-r--r--meta/recipes-core/udev/udev/run-ptest3
-rw-r--r--meta/recipes-core/udev/udev/run.rules14
-rw-r--r--meta/recipes-core/udev/udev/udev-cache32
-rw-r--r--meta/recipes-core/udev/udev/udev-cache.default4
-rw-r--r--meta/recipes-core/udev/udev/udev.rules116
-rw-r--r--meta/recipes-core/udev/udev_182.bb9
22 files changed, 1072 insertions, 0 deletions
diff --git a/meta/recipes-core/udev/udev-extraconf/automount.rules b/meta/recipes-core/udev/udev-extraconf/automount.rules
new file mode 100644
index 0000000000..7e844c31bd
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/automount.rules
@@ -0,0 +1,19 @@
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
diff --git a/meta/recipes-core/udev/udev-extraconf/autonet.rules b/meta/recipes-core/udev/udev-extraconf/autonet.rules
new file mode 100644
index 0000000000..19676aa13b
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/autonet.rules
@@ -0,0 +1,19 @@
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# Handle network interface setup
17SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh"
18SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh"
19
diff --git a/meta/recipes-core/udev/udev-extraconf/localextra.rules b/meta/recipes-core/udev/udev-extraconf/localextra.rules
new file mode 100644
index 0000000000..3d51d3e395
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/localextra.rules
@@ -0,0 +1,23 @@
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# The first rtc device is symlinked to /dev/rtc
17KERNEL=="rtc0", SYMLINK+="rtc"
18
19#The first framebuffer is symlinked to /dev/fb
20KERNEL=="fb0", SYMLINK+="fb"
21
22# Make all input devices read-write to the input group
23SUBSYSTEM=="input", GROUP="input", MODE="660"
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.blacklist b/meta/recipes-core/udev/udev-extraconf/mount.blacklist
new file mode 100644
index 0000000000..e49349428b
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/mount.blacklist
@@ -0,0 +1,5 @@
1/dev/loop
2/dev/ram
3/dev/mtdblock
4/dev/md
5/dev/dm-*
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
new file mode 100644
index 0000000000..cb57e47a90
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -0,0 +1,91 @@
1#!/bin/sh
2#
3# Called from udev
4#
5# Attempt to mount any added block devices and umount any removed devices
6
7
8MOUNT="/bin/mount"
9PMOUNT="/usr/bin/pmount"
10UMOUNT="/bin/umount"
11for line in `grep -v ^# /etc/udev/mount.blacklist`
12do
13 if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ];
14 then
15 logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring"
16 exit 0
17 fi
18done
19
20automount() {
21 name="`basename "$DEVNAME"`"
22
23 ! test -d "/media/$name" && mkdir -p "/media/$name"
24 # Silent util-linux's version of mounting auto
25 if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ;
26 then
27 MOUNT="$MOUNT -o silent"
28 fi
29
30 # If filesystem type is vfat, change the ownership group to 'disk', and
31 # grant it with w/r/x permissions.
32 case $ID_FS_TYPE in
33 vfat|fat)
34 MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`"
35 ;;
36 # TODO
37 *)
38 ;;
39 esac
40
41 if ! $MOUNT -t auto $DEVNAME "/media/$name"
42 then
43 #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/media/$name\" failed!"
44 rm_dir "/media/$name"
45 else
46 logger "mount.sh/automount" "Auto-mount of [/media/$name] successful"
47 touch "/tmp/.automount-$name"
48 fi
49}
50
51rm_dir() {
52 # We do not want to rm -r populated directories
53 if test "`find "$1" | wc -l | tr -d " "`" -lt 2 -a -d "$1"
54 then
55 ! test -z "$1" && rm -r "$1"
56 else
57 logger "mount.sh/automount" "Not removing non-empty directory [$1]"
58 fi
59}
60
61# No ID_FS_TYPE for cdrom device, yet it should be mounted
62name="`basename "$DEVNAME"`"
63[ -e /sys/block/$name/device/media ] && media_type=`cat /sys/block/$name/device/media`
64
65if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ -n "$ID_FS_TYPE" -o "$media_type" = "cdrom" ]; then
66 if [ -x "$PMOUNT" ]; then
67 $PMOUNT $DEVNAME 2> /dev/null
68 elif [ -x $MOUNT ]; then
69 $MOUNT $DEVNAME 2> /dev/null
70 fi
71
72 # If the device isn't mounted at this point, it isn't
73 # configured in fstab (note the root filesystem can show up as
74 # /dev/root in /proc/mounts, so check the device number too)
75 if expr $MAJOR "*" 256 + $MINOR != `stat -c %d /`; then
76 grep -q "^$DEVNAME " /proc/mounts || automount
77 fi
78fi
79
80
81
82if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
83 for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " `
84 do
85 $UMOUNT $mnt
86 done
87
88 # Remove empty directories from auto-mounter
89 name="`basename "$DEVNAME"`"
90 test -e "/tmp/.automount-$name" && rm_dir "/media/$name"
91fi
diff --git a/meta/recipes-core/udev/udev-extraconf/network.sh b/meta/recipes-core/udev/udev-extraconf/network.sh
new file mode 100644
index 0000000000..3ee92714af
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/network.sh
@@ -0,0 +1,54 @@
1#!/bin/sh
2
3# We get two "add" events for hostap cards due to wifi0
4echo "$INTERFACE" | grep -q wifi && exit 0
5
6# udevd does clearenv(). Export shell PATH to children.
7export PATH
8
9# Check if /etc/init.d/network has been run yet to see if we are
10# called by starting /etc/rcS.d/S03udev and not by hotplugging a device
11#
12# At this stage, network interfaces should not be brought up
13# automatically because:
14# a) /etc/init.d/network has not been run yet (security issue)
15# b) /var has not been populated yet so /etc/resolv,conf points to
16# oblivion, making the network unusable
17#
18
19spoofp="`grep ^spoofprotect /etc/network/options`"
20if test -z "$spoofp"
21then
22 # This is the default from /etc/init.d/network
23 spoofp_val=yes
24else
25 spoofp_val=${spoofp#spoofprotect=}
26fi
27
28test "$spoofp_val" = yes && spoofp_val=1 || spoofp_val=0
29
30# I think it is safe to assume that "lo" will always be there ;)
31if test "`cat /proc/sys/net/ipv4/conf/lo/rp_filter`" != "$spoofp_val" -a -n "$spoofp_val"
32then
33 echo "$INTERFACE" >> /dev/udev_network_queue
34 exit 0
35fi
36
37#
38# Code taken from pcmcia-cs:/etc/pcmcia/network
39#
40
41# if this interface has an entry in /etc/network/interfaces, let ifupdown
42# handle it
43if grep -q "iface \+$INTERFACE" /etc/network/interfaces; then
44 case $ACTION in
45 add)
46 ifconfig | grep -q "^$INTERFACE" || ifup $INTERFACE
47 ;;
48 remove)
49 ifdown $INTERFACE
50 ;;
51 esac
52
53 exit 0
54fi
diff --git a/meta/recipes-core/udev/udev-extraconf_1.0.bb b/meta/recipes-core/udev/udev-extraconf_1.0.bb
new file mode 100644
index 0000000000..fd9a333fe6
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf_1.0.bb
@@ -0,0 +1,41 @@
1SUMMARY = "Extra machine specific configuration files"
2DESCRIPTION = "Extra machine specific configuration files for udev, specifically blacklist information."
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
5 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
6
7PR = "r8"
8
9SRC_URI = " \
10 file://automount.rules \
11 file://mount.sh \
12 file://mount.blacklist \
13 file://autonet.rules \
14 file://network.sh \
15 file://localextra.rules \
16"
17
18
19do_install() {
20 install -d ${D}${sysconfdir}/udev/rules.d
21
22 install -m 0644 ${WORKDIR}/automount.rules ${D}${sysconfdir}/udev/rules.d/automount.rules
23 install -m 0644 ${WORKDIR}/autonet.rules ${D}${sysconfdir}/udev/rules.d/autonet.rules
24 install -m 0644 ${WORKDIR}/localextra.rules ${D}${sysconfdir}/udev/rules.d/localextra.rules
25
26 install -m 0644 ${WORKDIR}/mount.blacklist ${D}${sysconfdir}/udev/
27
28 install -d ${D}${sysconfdir}/udev/scripts/
29
30 install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh
31 install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts
32}
33
34FILES_${PN} = "${sysconfdir}/udev"
35RDEPENDS_${PN} = "udev"
36CONFFILES_${PN} = "${sysconfdir}/udev/mount.blacklist"
37
38# to replace udev-extra-rules from meta-oe
39RPROVIDES_${PN} = "udev-extra-rules"
40RREPLACES_${PN} = "udev-extra-rules"
41RCONFLICTS_${PN} = "udev-extra-rules"
diff --git a/meta/recipes-core/udev/udev.inc b/meta/recipes-core/udev/udev.inc
new file mode 100644
index 0000000000..0e0917d187
--- /dev/null
+++ b/meta/recipes-core/udev/udev.inc
@@ -0,0 +1,110 @@
1SUMMARY = "/dev/ and hotplug management daemon"
2DESCRIPTION = "udev is a daemon which dynamically creates and removes device nodes from \
3/dev/, handles hotplug events and loads drivers at boot time."
4HOMEPAGE = "http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html"
5LICENSE = "GPLv2.0+ & LGPLv2.1+"
6LICENSE_${PN} = "GPLv2.0+"
7LICENSE_libudev = "LGPLv2.1+"
8LICENSE_libgudev = "LGPLv2.1+"
9LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
10 file://src/COPYING;md5=17c4e5fb495e6707ac92a3864926f979 \
11 file://src/gudev/COPYING;md5=fb494485a7d0505308cb68e4997cc266"
12
13LDFLAGS += "-lrt"
14
15DEPENDS = "acl glib-2.0 libusb usbutils pciutils gperf-native libxslt-native util-linux"
16RPROVIDES_${PN} = "hotplug"
17
18SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
19 file://0001-Fixing-keyboard_force_release.sh-shell-script-path.patch \
20 file://avoid-mouse-autosuspend.patch \
21 file://run.rules \
22 file://udev.rules \
23 file://devfs-udev.rules \
24 file://links.conf \
25 file://permissions.rules \
26 file://local.rules \
27 file://udev-cache \
28 file://udev-cache.default \
29 file://init \
30 file://add-install-ptest.patch \
31 file://run-ptest \
32 "
33
34inherit autotools pkgconfig update-rc.d ptest
35
36libexecdir = "${base_libdir}"
37EXTRA_OECONF = "--disable-introspection \
38 --with-rootlibdir=${base_libdir} \
39 --with-pci-ids-path=${datadir}/pci.ids \
40 ac_cv_file__usr_share_pci_ids=no \
41 ac_cv_file__usr_share_hwdata_pci_ids=no \
42 ac_cv_file__usr_share_misc_pci_ids=yes \
43 --sbindir=${base_sbindir} \
44 --libexecdir=${nonarch_base_libdir} \
45 --with-rootlibdir=${base_libdir} \
46 --with-rootprefix= \
47 --without-systemdsystemunitdir \
48 "
49
50PACKAGES =+ "udev-utils udev-cache"
51PACKAGES =+ "libudev libudev-dev libudev-dbg"
52PACKAGES =+ "libgudev libgudev-dev libgudev-dbg"
53
54INITSCRIPT_PACKAGES = "udev udev-cache"
55INITSCRIPT_NAME_udev = "udev"
56INITSCRIPT_PARAMS_udev = "start 03 S ."
57INITSCRIPT_NAME_udev-cache = "udev-cache"
58INITSCRIPT_PARAMS_udev-cache = "start 36 S ."
59
60FILES_${PN} += "${libexecdir} ${libdir}/ConsoleKit ${nonarch_base_libdir}/udev"
61RRECOMMENDS_${PN} += "udev-utils udev-cache"
62
63FILES_${PN}-dbg += "${libexecdir}/.debug"
64FILES_${PN}-dbg += "${base_libdir}/udev/.debug/"
65FILES_${PN}-dbg += "${base_libdir}/udev/.debug/*"
66FILES_${PN}-dbg += "${nonarch_base_libdir}/udev/.debug/*"
67FILES_${PN}-dev = "${datadir}/pkgconfig/udev.pc"
68FILES_libudev = "${base_libdir}/libudev.so.*"
69FILES_libudev-dbg = "${base_libdir}/.debug/libudev.so.*"
70FILES_libudev-dev = "${includedir}/libudev.h ${libdir}/libudev.so ${libdir}/libudev.la \
71 ${libdir}/libudev.a ${libdir}/pkgconfig/libudev.pc"
72FILES_libgudev = "${base_libdir}/libgudev*.so.* ${libdir}/libgudev*.so.*"
73FILES_libgudev-dbg = "${base_libdir}/.debug/libgudev*.so.* ${libdir}/.debug/libgudev*.so.*"
74FILES_libgudev-dev = "${includedir}/gudev* ${libdir}/libgudev*.so ${libdir}/libgudev*.la \
75 ${libdir}/libgudev*.a ${libdir}/pkgconfig/gudev*.pc"
76FILES_udev-cache = "${sysconfdir}/init.d/udev-cache ${sysconfdir}/default/udev-cache"
77
78FILES_udev-utils = "${bindir}/udevadm"
79
80do_install_append () {
81 install -d ${D}${sysconfdir}/init.d
82 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
83 install -m 0755 ${WORKDIR}/udev-cache ${D}${sysconfdir}/init.d/udev-cache
84 sed -i s%@UDEVD@%${nonarch_base_libdir}/udev/udevd% ${D}${sysconfdir}/init.d/udev
85 sed -i s%@UDEVD@%${nonarch_base_libdir}/udev/udevd% ${D}${sysconfdir}/init.d/udev-cache
86
87 install -d ${D}${sysconfdir}/default
88 install -m 0755 ${WORKDIR}/udev-cache.default ${D}${sysconfdir}/default/udev-cache
89
90 touch ${D}${sysconfdir}/udev/cache.data
91
92 install -d ${D}${sysconfdir}/udev/rules.d/
93
94 install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
95
96 # hid2hci has moved to bluez4. removed in udev as of version 169
97 rm -f ${D}${base_libdir}/udev/hid2hci
98
99 echo 'udev_run="/var/run/udev"' >> ${D}${sysconfdir}/udev/udev.conf
100}
101
102# As systemd also builds udev, skip this package if we're doing a systemd build.
103python () {
104 if oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
105 raise bb.parse.SkipPackage("'systemd' in DISTRO_FEATURES")
106}
107
108do_compile_ptest() {
109 oe_runmake test-udev
110}
diff --git a/meta/recipes-core/udev/udev/0001-Fixing-keyboard_force_release.sh-shell-script-path.patch b/meta/recipes-core/udev/udev/0001-Fixing-keyboard_force_release.sh-shell-script-path.patch
new file mode 100644
index 0000000000..41deafa918
--- /dev/null
+++ b/meta/recipes-core/udev/udev/0001-Fixing-keyboard_force_release.sh-shell-script-path.patch
@@ -0,0 +1,35 @@
1From 0f8290c943da298abd269ca60fd8375dfb219971 Mon Sep 17 00:00:00 2001
2From: Alexandru DAMIAN <alexandru.damian@intel.com>
3Date: Thu, 12 Jul 2012 12:54:48 +0300
4Subject: [PATCH] Fixing keyboard_force_release.sh shell script path
5
6With the introduction of rootprefix, the keyboard-force-release.sh.in
7was modified to be executed with @rootprefix@/bin/sh, which is wrong
8because @rootprefix@ defaults to /usr (which is correct), but the
9shell is always at /bin/sh (IEEE Std 1003.2-1992).
10
11Therefore the interpreter for shell scripts needs to be /bin/sh at all times.
12
13The upstream moved to configurable root prefix, this patch taclkes a
14transition bug, and will not be applied upstream.
15
16Upstream-Status: Inappropriate [legacy version]
17
18Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
19---
20 src/keymap/keyboard-force-release.sh.in | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23diff --git a/src/keymap/keyboard-force-release.sh.in b/src/keymap/keyboard-force-release.sh.in
24index dd040ce..597a3a6 100755
25--- a/src/keymap/keyboard-force-release.sh.in
26+++ b/src/keymap/keyboard-force-release.sh.in
27@@ -1,4 +1,4 @@
28-#!@rootprefix@/bin/sh -e
29+#!/bin/sh -e
30 # read list of scancodes, convert hex to decimal and
31 # append to the atkbd force_release sysfs attribute
32 # $1 sysfs devpath for serioX
33--
341.7.9.5
35
diff --git a/meta/recipes-core/udev/udev/add-install-ptest.patch b/meta/recipes-core/udev/udev/add-install-ptest.patch
new file mode 100644
index 0000000000..45ec676ef5
--- /dev/null
+++ b/meta/recipes-core/udev/udev/add-install-ptest.patch
@@ -0,0 +1,60 @@
1Adjustements for ptest:
2
3- Add 'install-ptest' rule.
4- Print a standard result line for each test.
5- Replace the use of "tree" with "find".
6
7Signed-off-by: Björn Stenberg <bjst@enea.com>
8Upstream-status: Pending
9
10--- a/Makefile.am 2012-03-18 16:28:14.000000000 +0100
11+++ b/Makefile.am 2013-02-18 10:03:36.531101244 +0100
12@@ -708,3 +708,11 @@
13 for i in src/docs/html/*.{html,css,png}; do echo $$i; kup put $$i $$i.sign /pub/linux/utils/kernel/hotplug/libudev/; done
14 for i in src/gudev/docs/html/*.{html,css,png}; do rm -f $$i.sign; gpg --armor --detach-sign --output=$$i.sign $$i; done
15 for i in src/gudev/docs/html/*.{html,css,png}; do echo $$i; kup put $$i $$i.sign /pub/linux/utils/kernel/hotplug/gudev/; done
16+
17+install-ptest:
18+ install test-udev $(DESTDIR)
19+ cp Makefile $(DESTDIR)
20+ sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
21+ $(MKDIR_P) $(DESTDIR)/test
22+ (cd $(top_srcdir) && install $(TESTS) $(DESTDIR)/test)
23+ tar -C $(DESTDIR)/test/ -xJf $(top_srcdir)/test/sys.tar.xz
24--- a/test/udev-test.pl 2012-03-18 16:43:36.000000000 +0100
25+++ b/test/udev-test.pl 2013-02-18 10:31:29.706357321 +0100
26@@ -1459,11 +1459,13 @@
27 print "add: error";
28 if ($rules->{exp_add_error}) {
29 print " as expected\n";
30+ print "XFAIL: TEST $number: $rules->{desc}: add\n";
31 } else {
32 print "\n";
33- system("tree $udev_root");
34+ system("find $udev_root");
35 print "\n";
36 $error++;
37+ print "FAIL: TEST $number: $rules->{desc}: add\n";
38 sleep(1);
39 }
40 }
41@@ -1479,15 +1481,18 @@
42 print "remove: error";
43 if ($rules->{exp_rem_error}) {
44 print " as expected\n";
45+ print "XFAIL: TEST $number: $rules->{desc}: remove\n";
46 } else {
47 print "\n";
48- system("tree $udev_root");
49+ system("find $udev_root");
50 print "\n";
51 $error++;
52+ print "FAIL: TEST $number: $rules->{desc}: remove\n";
53 sleep(1);
54 }
55 } else {
56 print "remove: ok\n";
57+ print "PASS: TEST $number: $rules->{desc}: remove\n";
58 }
59
60 print "\n";
diff --git a/meta/recipes-core/udev/udev/avoid-mouse-autosuspend.patch b/meta/recipes-core/udev/udev/avoid-mouse-autosuspend.patch
new file mode 100644
index 0000000000..2c31b33b02
--- /dev/null
+++ b/meta/recipes-core/udev/udev/avoid-mouse-autosuspend.patch
@@ -0,0 +1,25 @@
1Source: http://cgit.freedesktop.org/systemd/systemd/commit/rules/42-usb-hid-pm.rules?id=e0386cf2809219bbdd30895f46f1f567b56902b6
2
3Some USB ports on external hubs may be reported as "fixed". We only want
4to auto-enable this on ports that are internal to the machine, so check
5the parent state as well.
6
7Upstream-Status: backport
8
9Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
102013/09/13
11
12Index: udev-182/rules/42-usb-hid-pm.rules
13===================================================================
14--- udev-182.orig/rules/42-usb-hid-pm.rules
15+++ udev-182/rules/42-usb-hid-pm.rules
16@@ -46,4 +46,9 @@ ACTION=="add", SUBSYSTEM=="usb", ATTRS{i
17 ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="14dd", ATTR{idProduct}="0002", TEST=="power/control", ATTR{power/control}="auto"
18
19 # USB HID devices that are internal to the machine should also be safe to autosuspend
20+# And skip it for devices which are external but say "fixed"
21+ACTION=="add", SUBSYSTEM=="usb", SUBSYSTEMS=="usb", ATTRS{removable}=="removable", GOTO="usb_hid_pm_end"
22+ACTION=="add", SUBSYSTEM=="usb", SUBSYSTEMS=="usb", ATTRS{removable}=="unknown", GOTO="usb_hid_pm_end"
23 ACTION=="add", SUBSYSTEM=="usb", ATTR{bInterfaceClass}=="03", ATTRS{removable}=="fixed", TEST=="../power/control", ATTR{../power/control}="auto"
24+LABEL="usb_hid_pm_end"
25+
diff --git a/meta/recipes-core/udev/udev/devfs-udev.rules b/meta/recipes-core/udev/udev/devfs-udev.rules
new file mode 100644
index 0000000000..0ba1ad4e7f
--- /dev/null
+++ b/meta/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/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
new file mode 100644
index 0000000000..e048a171da
--- /dev/null
+++ b/meta/recipes-core/udev/udev/init
@@ -0,0 +1,131 @@
1#!/bin/sh
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 @UDEVD@ ] || exit 1
17[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
18[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
19[ -f /etc/default/rcS ] && . /etc/default/rcS
20
21readfiles () {
22 READDATA=""
23 for filename in $@; do
24 if [ -r $filename ]; then
25 while read line; do
26 READDATA="$READDATA$line"
27 done < $filename
28 fi
29 done
30}
31
32kill_udevd () {
33 pid=`pidof -x udevd`
34 [ -n "$pid" ] && kill $pid
35}
36
37case "$1" in
38 start)
39 export ACTION=add
40 # propagate /dev from /sys
41 echo "Starting udev"
42
43 # Check for requireed devtmpfs before trying to start udev and
44 # mount a no-existant fs.
45 if ! grep -q devtmpfs /proc/filesystems
46 then
47 echo "Missing devtmpfs, which is required for udev to run";
48 echo "Halting..."
49 halt
50 fi
51 # mount the devtmpfs on /dev, if not already done
52 LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && {
53 mount -n -o mode=0755 -t devtmpfs none "/dev"
54 }
55 [ -e /dev/pts ] || mkdir -m 0755 /dev/pts
56 [ -e /dev/shm ] || mkdir -m 1777 /dev/shm
57 mount -a -t tmpfs 2>/dev/null
58 mkdir -p /var/volatile/tmp
59
60 # Cache handling.
61 # A list of files which are used as a criteria to judge whether the udev cache could be reused.
62 CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags"
63 if [ "$DEVCACHE" != "" ]; then
64 if [ -e $DEVCACHE ]; then
65 readfiles $CMP_FILE_LIST
66 NEWDATA="$READDATA"
67 readfiles /etc/udev/cache.data
68 OLDDATA="$READDATA"
69 if [ "$OLDDATA" = "$NEWDATA" ]; then
70 (cd /; tar xf $DEVCACHE > /dev/null 2>&1)
71 not_first_boot=1
72 [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
73 [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache
74 else
75 # Output detailed reason why the cached /dev is not used
76 if [ "$VERBOSE" != "no" ]; then
77 echo "udev: udev cache not used"
78 echo "udev: we use $CMP_FILE_LIST as criteria to judge whether the cache /dev could be resued"
79 echo "udev: olddata: $OLDDATA"
80 echo "udev: newdata: $NEWDATA"
81 fi
82 echo "$NEWDATA" > /dev/shm/udev.cache
83 fi
84 else
85 if [ "$ROOTFS_READ_ONLY" != "yes" ]; then
86 # If rootfs is not read-only, it's possible that a new udev cache would be generated;
87 # otherwise, we do not bother to read files.
88 readfiles $CMP_FILE_LIST
89 echo "$READDATA" > /dev/shm/udev.cache
90 fi
91 fi
92 fi
93
94 # make_extra_nodes
95 kill_udevd > "/dev/null" 2>&1
96
97 # trigger the sorted events
98 echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
99 @UDEVD@ -d
100
101 udevadm control --env=STARTUP=1
102 if [ "$not_first_boot" != "" ];then
103 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
104 (udevadm settle --timeout=3; udevadm control --env=STARTUP=)&
105 else
106 udevadm trigger --action=add
107 udevadm settle
108 fi
109 ;;
110 stop)
111 echo "Stopping udevd"
112 start-stop-daemon --stop --name udevd --quiet
113 ;;
114 restart)
115 $0 stop
116 sleep 1
117 $0 start
118 ;;
119 status)
120 pid=`pidof -x udevd`
121 if [ -n "$pid" ]; then
122 echo "udevd (pid $pid) is running ..."
123 else
124 echo "udevd is stopped"
125 fi
126 ;;
127 *)
128 echo "Usage: $0 {start|stop|status|restart}"
129 exit 1
130esac
131exit 0
diff --git a/meta/recipes-core/udev/udev/links.conf b/meta/recipes-core/udev/udev/links.conf
new file mode 100644
index 0000000000..8fff922db6
--- /dev/null
+++ b/meta/recipes-core/udev/udev/links.conf
@@ -0,0 +1,21 @@
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
15# Hic sunt leones.
16M ppp c 108 0
17D loop
18M loop/0 b 7 0
19D net
20M net/tun c 10 200
21
diff --git a/meta/recipes-core/udev/udev/local.rules b/meta/recipes-core/udev/udev/local.rules
new file mode 100644
index 0000000000..72d92ef627
--- /dev/null
+++ b/meta/recipes-core/udev/udev/local.rules
@@ -0,0 +1,21 @@
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# Try and modprobe for drivers for new hardware
17ACTION=="add", DEVPATH=="/devices/*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}"
18
19# Create a symlink to any touchscreen input device
20SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0"
21
diff --git a/meta/recipes-core/udev/udev/permissions.rules b/meta/recipes-core/udev/udev/permissions.rules
new file mode 100644
index 0000000000..205b733292
--- /dev/null
+++ b/meta/recipes-core/udev/udev/permissions.rules
@@ -0,0 +1,131 @@
1ACTION!="add", GOTO="permissions_end"
2
3# workarounds needed to synchronize with sysfs
4# only needed for kernels < v2.6.18-rc1
5ENV{PHYSDEVPATH}!="?*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
6SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", WAIT_FOR_SYSFS="ioerr_cnt"
7# only needed for kernels < 2.6.16
8SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"
9# only needed for kernels < 2.6.17
10SUBSYSTEM=="net", ENV{DRIVER}=="?*", WAIT_FOR_SYSFS="device/driver"
11
12# devices needed to load the drivers providing them
13KERNEL=="tun", OPTIONS+="ignore_remove"
14KERNEL=="ppp", OPTIONS+="ignore_remove"
15KERNEL=="loop[0-9]*", OPTIONS+="ignore_remove"
16
17# default permissions for block devices
18SUBSYSTEM=="block", GROUP="disk"
19# the aacraid driver is broken and reports that disks removable (see #404927)
20SUBSYSTEM=="block", ATTRS{removable}=="1", \
21 DRIVERS!="aacraid", GROUP="floppy"
22# all block devices on these buses are "removable"
23SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394|mmc|pcmcia", GROUP="floppy"
24
25# IDE devices
26KERNEL=="hd[a-z]|pcd[0-9]*", DRIVERS=="ide-cdrom|pcd", \
27 IMPORT{program}="cdrom_id --export $tempnode"
28ENV{ID_CDROM}=="?*", GROUP="cdrom"
29KERNEL=="ht[0-9]*", GROUP="tape"
30KERNEL=="nht[0-9]*", GROUP="tape"
31
32# SCSI devices
33KERNEL=="sr[0-9]*", IMPORT{program}="cdrom_id --export $tempnode"
34SUBSYSTEMS=="scsi", ATTRS{type}=="1", GROUP="tape"
35SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="HP", GROUP="scanner"
36SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="Epson", GROUP="scanner"
37SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="EPSON", GROUP="scanner"
38SUBSYSTEMS=="scsi", ATTRS{type}=="4", GROUP="cdrom"
39SUBSYSTEMS=="scsi", ATTRS{type}=="5", GROUP="cdrom"
40SUBSYSTEMS=="scsi", ATTRS{type}=="6", GROUP="scanner"
41SUBSYSTEMS=="scsi", ATTRS{type}=="8", GROUP="tape"
42
43# USB devices
44KERNEL=="legousbtower*", MODE="0666"
45KERNEL=="lp[0-9]*", SUBSYSTEMS=="usb", GROUP="lp"
46
47# usbfs-like devices
48SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
49 MODE="0664"
50
51# iRiver music players
52SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="plugdev", \
53 ATTRS{idVendor}=="4102", ATTRS{idProduct}=="10[01][135789]"
54
55# serial devices
56SUBSYSTEM=="tty", GROUP="dialout"
57SUBSYSTEM=="capi", GROUP="dialout"
58SUBSYSTEM=="slamr", GROUP="dialout"
59SUBSYSTEM=="zaptel", GROUP="dialout"
60
61# vc devices (all members of the tty subsystem)
62KERNEL=="ptmx", MODE="0666", GROUP="root"
63KERNEL=="console", MODE="0600", GROUP="root"
64KERNEL=="tty", MODE="0666", GROUP="root"
65KERNEL=="tty[0-9]*", GROUP="root"
66KERNEL=="pty*", MODE="0666", GROUP="tty"
67
68# video devices
69SUBSYSTEM=="video4linux", GROUP="video"
70SUBSYSTEM=="drm", GROUP="video"
71SUBSYSTEM=="dvb", GROUP="video"
72SUBSYSTEM=="em8300", GROUP="video"
73SUBSYSTEM=="graphics", GROUP="video"
74SUBSYSTEM=="nvidia", GROUP="video"
75
76# misc devices
77KERNEL=="random", MODE="0666"
78KERNEL=="urandom", MODE="0666"
79KERNEL=="mem", MODE="0640", GROUP="kmem"
80KERNEL=="kmem", MODE="0640", GROUP="kmem"
81KERNEL=="port", MODE="0640", GROUP="kmem"
82KERNEL=="full", MODE="0666"
83KERNEL=="null", MODE="0666"
84KERNEL=="zero", MODE="0666"
85KERNEL=="inotify", MODE="0666"
86KERNEL=="sgi_fetchop", MODE="0666"
87KERNEL=="sonypi", MODE="0666"
88KERNEL=="agpgart", GROUP="video"
89KERNEL=="nvram", GROUP="nvram"
90KERNEL=="rtc|rtc[0-9]*", GROUP="audio"
91KERNEL=="tpm*", MODE="0600", OWNER="tss", GROUP="tss"
92KERNEL=="fuse", GROUP="fuse"
93KERNEL=="kqemu", MODE="0666"
94KERNEL=="kvm", GROUP="kvm"
95KERNEL=="tun", MODE="0666",
96
97KERNEL=="cdemu[0-9]*", GROUP="cdrom"
98KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
99KERNEL=="pktcdvd", MODE="0644"
100
101KERNEL=="uverbs*", GROUP="rdma"
102KERNEL=="ucm*", GROUP="rdma"
103KERNEL=="rdma_ucm", GROUP="rdma"
104
105# printers and parallel devices
106SUBSYSTEM=="printer", GROUP="lp"
107SUBSYSTEM=="ppdev", GROUP="lp"
108KERNEL=="irlpt*", GROUP="lp"
109KERNEL=="pt[0-9]*", GROUP="tape"
110KERNEL=="pht[0-9]*", GROUP="tape"
111
112# sound devices
113SUBSYSTEM=="sound", GROUP="audio"
114
115# ieee1394 devices
116KERNEL=="raw1394", GROUP="disk"
117KERNEL=="dv1394*", GROUP="video"
118KERNEL=="video1394*", GROUP="video"
119
120# input devices
121KERNEL=="event[0-9]*", ATTRS{name}=="*dvb*|*DVB*|* IR *" \
122 MODE="0664", GROUP="video"
123KERNEL=="js[0-9]*", MODE="0664"
124KERNEL=="lirc[0-9]*", GROUP="video"
125
126# AOE character devices
127SUBSYSTEM=="aoe", MODE="0220", GROUP="disk"
128SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440"
129
130LABEL="permissions_end"
131
diff --git a/meta/recipes-core/udev/udev/run-ptest b/meta/recipes-core/udev/udev/run-ptest
new file mode 100644
index 0000000000..6817ef70e6
--- /dev/null
+++ b/meta/recipes-core/udev/udev/run-ptest
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3make -k check-TESTS \ No newline at end of file
diff --git a/meta/recipes-core/udev/udev/run.rules b/meta/recipes-core/udev/udev/run.rules
new file mode 100644
index 0000000000..75d71375bb
--- /dev/null
+++ b/meta/recipes-core/udev/udev/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/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache
new file mode 100644
index 0000000000..db5a513e14
--- /dev/null
+++ b/meta/recipes-core/udev/udev/udev-cache
@@ -0,0 +1,32 @@
1#!/bin/sh -e
2
3### BEGIN INIT INFO
4# Provides: udev-cache
5# Required-Start: mountall
6# Required-Stop:
7# Default-Start: S
8# Default-Stop:
9# Short-Description: cache /dev to speedup the udev next boot
10### END INIT INFO
11
12export TZ=/etc/localtime
13
14[ -r /proc/mounts ] || exit 1
15[ -x @UDEVD@ ] || exit 1
16[ -d /sys/class ] || exit 1
17
18[ -f /etc/default/rcS ] && . /etc/default/rcS
19[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
20
21if [ "$ROOTFS_READ_ONLY" = "yes" ]; then
22 [ "$VERBOSE" != "no" ] && echo "udev-cache: read-only rootfs, skip generating udev-cache"
23 exit 0
24fi
25
26if [ "$DEVCACHE" != "" -a -e /dev/shm/udev.cache ]; then
27 echo "Populating dev cache"
28 (cd /; tar cf "$DEVCACHE" dev)
29 mv /dev/shm/udev.cache /etc/udev/cache.data
30fi
31
32exit 0
diff --git a/meta/recipes-core/udev/udev/udev-cache.default b/meta/recipes-core/udev/udev/udev-cache.default
new file mode 100644
index 0000000000..5c4937a9a0
--- /dev/null
+++ b/meta/recipes-core/udev/udev/udev-cache.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/recipes-core/udev/udev/udev.rules b/meta/recipes-core/udev/udev/udev.rules
new file mode 100644
index 0000000000..a19d4a0bf6
--- /dev/null
+++ b/meta/recipes-core/udev/udev/udev.rules
@@ -0,0 +1,116 @@
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*", NAME="%k", 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]*", NAME="%k", GROUP="users", MODE="0660"
107
108# Firmware Helper
109ACTION=="add", SUBSYSTEM=="firmware", RUN+="/lib/udev/firmware.sh"
110
111# Samsung UARTS
112KERNEL=="s3c2410_serial[0-9]", NAME="ttySAC%n"
113
114# MXC UARTs
115KERNEL=="ttymxc[0-4]", NAME="ttymxc%n"
116
diff --git a/meta/recipes-core/udev/udev_182.bb b/meta/recipes-core/udev/udev_182.bb
new file mode 100644
index 0000000000..d66292ed7a
--- /dev/null
+++ b/meta/recipes-core/udev/udev_182.bb
@@ -0,0 +1,9 @@
1include udev.inc
2
3PR = "r7"
4
5# module-init-tools from kmod_git will provide libkmod runtime
6DEPENDS += "module-init-tools"
7
8SRC_URI[md5sum] = "1b964456177fbf48023dfee7db3a708d"
9SRC_URI[sha256sum] = "7857ed19fafd8f3ca8de410194e8c7336e9eb8a20626ea8a4ba6449b017faba4"