diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2012-07-30 13:09:48 +0200 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2012-07-31 00:13:52 +0200 |
commit | 5f56dbb05992e4d7d35b604829b171326b1029b7 (patch) | |
tree | 0ee4a07506c2f1da7bc55a82f7eed09dda838ed7 /meta-oe | |
parent | 038f3264060fcb6d09a7b20b401772f671139cb9 (diff) | |
download | meta-openembedded-5f56dbb05992e4d7d35b604829b171326b1029b7.tar.gz |
udev-extra-rules: drop in favor of udev-extraconf from oe-core
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe')
7 files changed, 0 insertions, 220 deletions
diff --git a/meta-oe/recipes-core/udev/udev-extra-rules.bb b/meta-oe/recipes-core/udev/udev-extra-rules.bb deleted file mode 100644 index 7f9ca85f5..000000000 --- a/meta-oe/recipes-core/udev/udev-extra-rules.bb +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | DESCRIPTION = "Extra udev rules" | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" | ||
4 | |||
5 | inherit allarch | ||
6 | |||
7 | PR = "r4" | ||
8 | |||
9 | SRC_URI = " \ | ||
10 | file://automount.rules \ | ||
11 | file://mount.sh \ | ||
12 | file://mount.blacklist \ | ||
13 | file://autonet.rules \ | ||
14 | file://network.sh \ | ||
15 | file://local.rules \ | ||
16 | " | ||
17 | |||
18 | |||
19 | do_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}/local.rules ${D}${sysconfdir}/udev/rules.d/local.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 | |||
34 | FILES_${PN} = "${sysconfdir}/udev" | ||
35 | RDEPENDS_${PN} = "udev" | ||
36 | CONFFILES_${PN} = "${sysconfdir}/udev/mount.blacklist" | ||
diff --git a/meta-oe/recipes-core/udev/udev-extra-rules/automount.rules b/meta-oe/recipes-core/udev/udev-extra-rules/automount.rules deleted file mode 100644 index 7e844c31b..000000000 --- a/meta-oe/recipes-core/udev/udev-extra-rules/automount.rules +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
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 | ||
17 | SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh" | ||
18 | SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh" | ||
19 | |||
diff --git a/meta-oe/recipes-core/udev/udev-extra-rules/autonet.rules b/meta-oe/recipes-core/udev/udev-extra-rules/autonet.rules deleted file mode 100644 index 19676aa13..000000000 --- a/meta-oe/recipes-core/udev/udev-extra-rules/autonet.rules +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
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 | ||
17 | SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh" | ||
18 | SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh" | ||
19 | |||
diff --git a/meta-oe/recipes-core/udev/udev-extra-rules/local.rules b/meta-oe/recipes-core/udev/udev-extra-rules/local.rules deleted file mode 100644 index 4eaa8ca9b..000000000 --- a/meta-oe/recipes-core/udev/udev-extra-rules/local.rules +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
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 | ||
17 | KERNEL=="rtc0", SYMLINK+="rtc" | ||
18 | |||
19 | #The first framebuffer is symlinked to /dev/fb | ||
20 | KERNEL=="fb0", SYMLINK+="fb" | ||
21 | |||
diff --git a/meta-oe/recipes-core/udev/udev-extra-rules/mount.blacklist b/meta-oe/recipes-core/udev/udev-extra-rules/mount.blacklist deleted file mode 100644 index d3ebb1717..000000000 --- a/meta-oe/recipes-core/udev/udev-extra-rules/mount.blacklist +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | /dev/loop | ||
2 | /dev/ram | ||
3 | /dev/mtdblock | ||
diff --git a/meta-oe/recipes-core/udev/udev-extra-rules/mount.sh b/meta-oe/recipes-core/udev/udev-extra-rules/mount.sh deleted file mode 100644 index 67c2b4b50..000000000 --- a/meta-oe/recipes-core/udev/udev-extra-rules/mount.sh +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Called from udev | ||
4 | # Attemp to mount any added block devices | ||
5 | # and remove any removed devices | ||
6 | # | ||
7 | |||
8 | MOUNT="/bin/mount" | ||
9 | PMOUNT="/usr/bin/pmount" | ||
10 | UMOUNT="/bin/umount" | ||
11 | name="`basename "$DEVNAME"`" | ||
12 | |||
13 | for line in `grep -v ^# /etc/udev/mount.blacklist` | ||
14 | do | ||
15 | if ( echo "$DEVNAME" | grep -q "$line" ) | ||
16 | then | ||
17 | logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring" | ||
18 | exit 0 | ||
19 | fi | ||
20 | done | ||
21 | |||
22 | automount() { | ||
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 | |||
35 | rm_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 | |||
45 | if [ "$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 | # Avoid remounting devices (e.g: rootfs) | ||
53 | awk '{print $1}' /proc/mounts | grep -q "^$DEVNAME$" || automount | ||
54 | fi | ||
55 | |||
56 | if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then | ||
57 | for mnt in `grep "$DEVNAME" /proc/mounts | cut -f 2 -d " " ` | ||
58 | do | ||
59 | $UMOUNT -l $mnt | ||
60 | done | ||
61 | |||
62 | # Remove empty directories from auto-mounter | ||
63 | test -e "/tmp/.automount-$name" && rm_dir "/media/$name" | ||
64 | fi | ||
diff --git a/meta-oe/recipes-core/udev/udev-extra-rules/network.sh b/meta-oe/recipes-core/udev/udev-extra-rules/network.sh deleted file mode 100644 index 182c26d86..000000000 --- a/meta-oe/recipes-core/udev/udev-extra-rules/network.sh +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # udevd does clearenv(). Export shell PATH to children. | ||
4 | export PATH | ||
5 | |||
6 | # Do not run when pcmcia-cs is installed | ||
7 | test -x /sbin/cardctl && exit 0 | ||
8 | |||
9 | # We get two "add" events for hostap cards due to wifi0 | ||
10 | echo "$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 | |||
23 | spoofp="`grep ^spoofprotect /etc/network/options`" | ||
24 | if test -z "$spoofp" | ||
25 | then | ||
26 | # This is the default from /etc/init.d/network | ||
27 | spoofp_val=yes | ||
28 | else | ||
29 | spoofp_val=${spoofp#spoofprotect=} | ||
30 | fi | ||
31 | |||
32 | test "$spoofp_val" = yes && spoofp_val=1 || spoofp_val=0 | ||
33 | |||
34 | # I think it is safe to assume that "lo" will always be there ;) | ||
35 | if test "`cat /proc/sys/net/ipv4/conf/lo/rp_filter`" != "$spoofp_val" -a -n "$spoofp_val" | ||
36 | then | ||
37 | echo "$INTERFACE" >> /dev/udev_network_queue | ||
38 | exit 0 | ||
39 | fi | ||
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 | ||
47 | if 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 | ||
58 | fi | ||