From 50551644d355edeb132c34a18c36abd7408c3ee1 Mon Sep 17 00:00:00 2001 From: Matthias Hentges Date: Tue, 24 Jan 2006 19:36:24 +0000 Subject: udev: Add rules for PCMCIA NICs. Only used when pcmciautils is installed. --- packages/udev/files/local.rules | 2 ++ packages/udev/files/network.sh | 26 ++++++++++++++++++++++++++ packages/udev/udev.inc | 2 ++ packages/udev/udev_071.bb | 2 +- 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 packages/udev/files/network.sh (limited to 'packages/udev') 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/" -- cgit v1.2.3