diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-27 15:14:24 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-27 15:29:45 +0100 |
commit | 29d6678fd546377459ef75cf54abeef5b969b5cf (patch) | |
tree | 8edd65790e37a00d01c3f203f773fe4b5012db18 /meta/recipes-core/udev/files/network.sh | |
parent | da49de6885ee1bc424e70bc02f21f6ab920efb55 (diff) | |
download | poky-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.sh | 55 |
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 | ||
4 | test -x /sbin/cardctl && exit 0 | ||
5 | |||
6 | # We get two "add" events for hostap cards due to wifi0 | ||
7 | echo "$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 | |||
20 | spoofp="`grep ^spoofprotect /etc/network/options`" | ||
21 | if test -z "$spoofp" | ||
22 | then | ||
23 | # This is the default from /etc/init.d/network | ||
24 | spoofp_val=yes | ||
25 | else | ||
26 | spoofp_val=${spoofp#spoofprotect=} | ||
27 | fi | ||
28 | |||
29 | test "$spoofp_val" = yes && spoofp_val=1 || spoofp_val=0 | ||
30 | |||
31 | # I think it is safe to assume that "lo" will always be there ;) | ||
32 | if test "`cat /proc/sys/net/ipv4/conf/lo/rp_filter`" != "$spoofp_val" -a -n "$spoofp_val" | ||
33 | then | ||
34 | echo "$INTERFACE" >> /dev/udev_network_queue | ||
35 | exit 0 | ||
36 | fi | ||
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 | ||
44 | if 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 | ||
55 | fi | ||