summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev/files/network.sh
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:14:24 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:29:45 +0100
commit29d6678fd546377459ef75cf54abeef5b969b5cf (patch)
tree8edd65790e37a00d01c3f203f773fe4b5012db18 /meta/recipes-core/udev/files/network.sh
parentda49de6885ee1bc424e70bc02f21f6ab920efb55 (diff)
downloadpoky-29d6678fd546377459ef75cf54abeef5b969b5cf.tar.gz
Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things and is generally overwhelming. This commit splits it into several logical sections roughly based on function, recipes.txt gives more information about the classifications used. The opportunity is also used to switch from "packages" to "recipes" as used in OpenEmbedded as the term "packages" can be confusing to people and has many different meanings. Not all recipes have been classified yet, this is just a first pass at separating things out. Some packages are moved to meta-extras as they're no longer actively used or maintained. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-core/udev/files/network.sh')
-rw-r--r--meta/recipes-core/udev/files/network.sh55
1 files changed, 55 insertions, 0 deletions
diff --git a/meta/recipes-core/udev/files/network.sh b/meta/recipes-core/udev/files/network.sh
new file mode 100644
index 0000000000..5016328df4
--- /dev/null
+++ b/meta/recipes-core/udev/files/network.sh
@@ -0,0 +1,55 @@
1#!/bin/sh
2
3# Do not run when pcmcia-cs is installed
4test -x /sbin/cardctl && exit 0
5
6# We get two "add" events for hostap cards due to wifi0
7echo "$INTERFACE" | grep -q wifi && exit 0
8
9
10# Check if /etc/init.d/network has been run yet to see if we are
11# called by starting /etc/rcS.d/S03udev and not by hotplugging a device
12#
13# At this stage, network interfaces should not be brought up
14# automatically because:
15# a) /etc/init.d/network has not been run yet (security issue)
16# b) /var has not been populated yet so /etc/resolv,conf points to
17# oblivion, making the network unusable
18#
19
20spoofp="`grep ^spoofprotect /etc/network/options`"
21if test -z "$spoofp"
22then
23 # This is the default from /etc/init.d/network
24 spoofp_val=yes
25else
26 spoofp_val=${spoofp#spoofprotect=}
27fi
28
29test "$spoofp_val" = yes && spoofp_val=1 || spoofp_val=0
30
31# I think it is safe to assume that "lo" will always be there ;)
32if test "`cat /proc/sys/net/ipv4/conf/lo/rp_filter`" != "$spoofp_val" -a -n "$spoofp_val"
33then
34 echo "$INTERFACE" >> /dev/udev_network_queue
35 exit 0
36fi
37
38#
39# Code taken from pcmcia-cs:/etc/pcmcia/network
40#
41
42# if this interface has an entry in /etc/network/interfaces, let ifupdown
43# handle it
44if grep -q "iface \+$INTERFACE" /etc/network/interfaces; then
45 case $ACTION in
46 add)
47 ifconfig | grep -q "^$INTERFACE" || ifup $INTERFACE
48 ;;
49 remove)
50 ifdown $INTERFACE
51 ;;
52 esac
53
54 exit 0
55fi