diff options
author | Matthias Hentges <oe@hentges.net> | 2006-01-24 19:36:24 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2006-01-24 19:36:24 +0000 |
commit | 50551644d355edeb132c34a18c36abd7408c3ee1 (patch) | |
tree | 5385f00bb9c073d59cd19a4b449ad9f0f12b62df | |
parent | a3bfe2c3af2d8d6ab64b5d815f2e33b3b455bbaf (diff) |
udev: Add rules for PCMCIA NICs. Only used when pcmciautils is installed.
-rw-r--r-- | packages/udev/files/local.rules | 2 | ||||
-rw-r--r-- | packages/udev/files/network.sh | 26 | ||||
-rw-r--r-- | packages/udev/udev.inc | 2 | ||||
-rw-r--r-- | packages/udev/udev_071.bb | 2 |
4 files changed, 31 insertions, 1 deletions
diff --git a/packages/udev/files/local.rules b/packages/udev/files/local.rules index 95b3e10830..4bcaaa8aba 100644 --- a/packages/udev/files/local.rules +++ b/packages/udev/files/local.rules @@ -1,3 +1,5 @@ SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh" SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh" +SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh" +SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh" diff --git a/packages/udev/files/network.sh b/packages/udev/files/network.sh new file mode 100644 index 0000000000..2cfbfa91b3 --- /dev/null +++ b/packages/udev/files/network.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# Do not run when pcmcia-cs is installed +test -x /sbin/cardctl && exit 0 + +# We get two "add" events for hostap cards due to wifi0 +echo "$INTERFACE" | grep -q wifi && exit 0 + +# +# Code taken from pcmcia-cs:/etc/pcmcia/network +# + +# if this interface has an entry in /etc/network/interfaces, let ifupdown +# handle it +if grep -q "iface \+$INTERFACE" /etc/network/interfaces; then + case $ACTION in + add) + ifup $INTERFACE + ;; + remove) + ifdown $INTERFACE + ;; + esac + + exit 0 +fi diff --git a/packages/udev/udev.inc b/packages/udev/udev.inc index 2387d07945..a3896a6978 100644 --- a/packages/udev/udev.inc +++ b/packages/udev/udev.inc @@ -8,6 +8,7 @@ SRC_URI += " \ file://links.conf \ file://permissions.rules \ file://mount.sh \ + file://network.sh \ file://local.rules \ file://init" @@ -56,4 +57,5 @@ do_install () { install -d ${D}${sysconfdir}/udev/scripts/ install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh + install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts } diff --git a/packages/udev/udev_071.bb b/packages/udev/udev_071.bb index e5f0409b17..4540720fc7 100644 --- a/packages/udev/udev_071.bb +++ b/packages/udev/udev_071.bb @@ -6,7 +6,7 @@ SRC_URI = "http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \ include udev.inc -PR = "r5" +PR = "r6" UDEV_EXTRAS = "extras/firmware/ extras/scsi_id/ extras/volume_id/ extras/run_directory/" |