diff options
| author | Martin Jansa <martin.jansa@gmail.com> | 2012-07-30 17:03:14 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-04 14:08:35 +0100 |
| commit | 0cc01a67f1c0bf1bff491c9c644348d6be318a72 (patch) | |
| tree | 2c090dc35a587707b0944162cd265a4c7574b4e9 | |
| parent | c5003a45d9c54a7a6d1c78799b8c2e3962cf1e52 (diff) | |
| download | poky-0cc01a67f1c0bf1bff491c9c644348d6be318a72.tar.gz | |
udev-extraconf: Merge with udev-extra-rules from meta-oe
* Move parts of local.rules from udev to udev-extraconf
* Move mount.sh and network.sh to udev-extraconf along with rule fragments
* Add mount.blacklist to CONFFILES
* Change PV to 1.0 and bump PR to provide upgrade path from meta-oe's udev-extra-rules
including RREPLACE/RPROVIDES/RCONFLICTS trio
(From OE-Core rev: 0ca3a7823e97c4e4af6e89d852f98d29ed6193d7)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-core/udev/udev-extraconf/automount.rules | 19 | ||||
| -rw-r--r-- | meta/recipes-core/udev/udev-extraconf/autonet.rules | 19 | ||||
| -rw-r--r-- | meta/recipes-core/udev/udev-extraconf/localextra.rules | 21 | ||||
| -rw-r--r-- | meta/recipes-core/udev/udev-extraconf/mount.sh (renamed from meta/recipes-core/udev/udev/mount.sh) | 3 | ||||
| -rw-r--r-- | meta/recipes-core/udev/udev-extraconf/network.sh (renamed from meta/recipes-core/udev/udev/network.sh) | 2 | ||||
| -rw-r--r-- | meta/recipes-core/udev/udev-extraconf_0.0.bb | 15 | ||||
| -rw-r--r-- | meta/recipes-core/udev/udev-extraconf_1.0.bb | 43 | ||||
| -rw-r--r-- | meta/recipes-core/udev/udev/local.rules | 14 |
8 files changed, 105 insertions, 31 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 | ||
| 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/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 | ||
| 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/recipes-core/udev/udev-extraconf/localextra.rules b/meta/recipes-core/udev/udev-extraconf/localextra.rules new file mode 100644 index 0000000000..4eaa8ca9b0 --- /dev/null +++ b/meta/recipes-core/udev/udev-extraconf/localextra.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 | # 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/recipes-core/udev/udev/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh index c13b8bbb3b..2eb9affcc8 100644 --- a/meta/recipes-core/udev/udev/mount.sh +++ b/meta/recipes-core/udev/udev-extraconf/mount.sh | |||
| @@ -8,8 +8,7 @@ | |||
| 8 | MOUNT="/bin/mount" | 8 | MOUNT="/bin/mount" |
| 9 | PMOUNT="/usr/bin/pmount" | 9 | PMOUNT="/usr/bin/pmount" |
| 10 | UMOUNT="/bin/umount" | 10 | UMOUNT="/bin/umount" |
| 11 | 11 | for line in `grep -v ^# /etc/udev/mount.blacklist` | |
| 12 | for line in `cat /etc/udev/mount.blacklist` | ||
| 13 | do | 12 | do |
| 14 | if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ]; | 13 | if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ]; |
| 15 | then | 14 | then |
diff --git a/meta/recipes-core/udev/udev/network.sh b/meta/recipes-core/udev/udev-extraconf/network.sh index bccd422dbf..3ee92714af 100644 --- a/meta/recipes-core/udev/udev/network.sh +++ b/meta/recipes-core/udev/udev-extraconf/network.sh | |||
| @@ -3,6 +3,8 @@ | |||
| 3 | # We get two "add" events for hostap cards due to wifi0 | 3 | # We get two "add" events for hostap cards due to wifi0 |
| 4 | echo "$INTERFACE" | grep -q wifi && exit 0 | 4 | echo "$INTERFACE" | grep -q wifi && exit 0 |
| 5 | 5 | ||
| 6 | # udevd does clearenv(). Export shell PATH to children. | ||
| 7 | export PATH | ||
| 6 | 8 | ||
| 7 | # Check if /etc/init.d/network has been run yet to see if we are | 9 | # Check if /etc/init.d/network has been run yet to see if we are |
| 8 | # called by starting /etc/rcS.d/S03udev and not by hotplugging a device | 10 | # called by starting /etc/rcS.d/S03udev and not by hotplugging a device |
diff --git a/meta/recipes-core/udev/udev-extraconf_0.0.bb b/meta/recipes-core/udev/udev-extraconf_0.0.bb deleted file mode 100644 index d0d0e84276..0000000000 --- a/meta/recipes-core/udev/udev-extraconf_0.0.bb +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | SUMMARY = "Extra machine specific configuration files" | ||
| 2 | DESCRIPTION = "Extra machine specific configuration files for udev, specifically blacklist information." | ||
| 3 | LICENSE = "GPLv2" | ||
| 4 | LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe" | ||
| 5 | |||
| 6 | PR = "r2" | ||
| 7 | |||
| 8 | SRC_URI = "file://mount.blacklist \ | ||
| 9 | file://COPYING.GPL" | ||
| 10 | |||
| 11 | do_install () { | ||
| 12 | install -d ${D}${sysconfdir}/udev/ | ||
| 13 | |||
| 14 | install -m 0644 ${WORKDIR}/mount.blacklist ${D}${sysconfdir}/udev/ | ||
| 15 | } | ||
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..ca079f132c --- /dev/null +++ b/meta/recipes-core/udev/udev-extraconf_1.0.bb | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | SUMMARY = "Extra machine specific configuration files" | ||
| 2 | DESCRIPTION = "Extra machine specific configuration files for udev, specifically blacklist information." | ||
| 3 | LICENSE = "GPLv2" | ||
| 4 | LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe" | ||
| 5 | |||
| 6 | inherit allarch | ||
| 7 | |||
| 8 | PR = "r5" | ||
| 9 | |||
| 10 | SRC_URI = " \ | ||
| 11 | file://automount.rules \ | ||
| 12 | file://mount.sh \ | ||
| 13 | file://mount.blacklist \ | ||
| 14 | file://autonet.rules \ | ||
| 15 | file://network.sh \ | ||
| 16 | file://localextra.rules \ | ||
| 17 | file://COPYING.GPL \ | ||
| 18 | " | ||
| 19 | |||
| 20 | |||
| 21 | do_install() { | ||
| 22 | install -d ${D}${sysconfdir}/udev/rules.d | ||
| 23 | |||
| 24 | install -m 0644 ${WORKDIR}/automount.rules ${D}${sysconfdir}/udev/rules.d/automount.rules | ||
| 25 | install -m 0644 ${WORKDIR}/autonet.rules ${D}${sysconfdir}/udev/rules.d/autonet.rules | ||
| 26 | install -m 0644 ${WORKDIR}/localextra.rules ${D}${sysconfdir}/udev/rules.d/localextra.rules | ||
| 27 | |||
| 28 | install -m 0644 ${WORKDIR}/mount.blacklist ${D}${sysconfdir}/udev/ | ||
| 29 | |||
| 30 | install -d ${D}${sysconfdir}/udev/scripts/ | ||
| 31 | |||
| 32 | install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh | ||
| 33 | install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts | ||
| 34 | } | ||
| 35 | |||
| 36 | FILES_${PN} = "${sysconfdir}/udev" | ||
| 37 | RDEPENDS_${PN} = "udev" | ||
| 38 | CONFFILES_${PN} = "${sysconfdir}/udev/mount.blacklist" | ||
| 39 | |||
| 40 | # to replace udev-extra-rules from meta-oe | ||
| 41 | RPROVIDES_${PN} = "udev-extra-rules" | ||
| 42 | RREPLACES_${PN} = "udev-extra-rules" | ||
| 43 | RCONFLICTS_${PN} = "udev-extra-rules" | ||
diff --git a/meta/recipes-core/udev/udev/local.rules b/meta/recipes-core/udev/udev/local.rules index 625e49acb1..72d92ef627 100644 --- a/meta/recipes-core/udev/udev/local.rules +++ b/meta/recipes-core/udev/udev/local.rules | |||
| @@ -13,20 +13,6 @@ | |||
| 13 | # %% the '%' char itself | 13 | # %% the '%' char itself |
| 14 | # | 14 | # |
| 15 | 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 | |||
| 20 | # Handle network interface setup | ||
| 21 | SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh" | ||
| 22 | SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh" | ||
| 23 | |||
| 24 | # The first framebuffer is symlinked to /dev/fb | ||
| 25 | KERNEL=="fb0", SYMLINK+="fb" | ||
| 26 | |||
| 27 | # The first rtc device is symlinked to /dev/rtc | ||
| 28 | KERNEL=="rtc0", SYMLINK+="rtc" | ||
| 29 | |||
| 30 | # Try and modprobe for drivers for new hardware | 16 | # Try and modprobe for drivers for new hardware |
| 31 | ACTION=="add", DEVPATH=="/devices/*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}" | 17 | ACTION=="add", DEVPATH=="/devices/*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}" |
| 32 | 18 | ||
