summaryrefslogtreecommitdiff
path: root/packages/udev/files
diff options
context:
space:
mode:
authorMatthias Hentges <oe@hentges.net>2006-01-24 19:36:24 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-01-24 19:36:24 +0000
commit50551644d355edeb132c34a18c36abd7408c3ee1 (patch)
tree5385f00bb9c073d59cd19a4b449ad9f0f12b62df /packages/udev/files
parenta3bfe2c3af2d8d6ab64b5d815f2e33b3b455bbaf (diff)
udev: Add rules for PCMCIA NICs. Only used when pcmciautils is installed.
Diffstat (limited to 'packages/udev/files')
-rw-r--r--packages/udev/files/local.rules2
-rw-r--r--packages/udev/files/network.sh26
2 files changed, 28 insertions, 0 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