summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox/files/simple.script
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/busybox/files/simple.script
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/busybox/files/simple.script')
-rw-r--r--meta/recipes-core/busybox/files/simple.script72
1 files changed, 72 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/files/simple.script b/meta/recipes-core/busybox/files/simple.script
new file mode 100644
index 0000000000..5cc21b9de2
--- /dev/null
+++ b/meta/recipes-core/busybox/files/simple.script
@@ -0,0 +1,72 @@
1#!/bin/sh
2
3# udhcpc script edited by Tim Riker <Tim@Rikers.org>
4
5[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
6
7RESOLV_CONF="/etc/resolv.conf"
8[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
9[ -n "$subnet" ] && NETMASK="netmask $subnet"
10
11# return 0 if root is mounted on a network filesystem
12root_is_nfs() {
13 grep -qe '^/dev/root.*\(nfs\|smbfs\|ncp\|coda\) .*' /proc/mounts
14}
15
16have_bin_ip=0
17if [ -x /bin/ip ]; then
18 have_bin_ip=1
19fi
20
21case "$1" in
22 deconfig)
23 if ! root_is_nfs ; then
24 if [ $have_bin_ip -eq 1 ]; then
25 ip addr flush dev $interface
26 ip link set dev $interface up
27 else
28 /sbin/ifconfig $interface 0.0.0.0
29 fi
30 fi
31 ;;
32
33 renew|bound)
34 if [ $have_bin_ip -eq 1 ]; then
35 ip addr add dev $interface local $ip/$mask $BROADCAST
36 else
37 /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
38 fi
39
40 if [ -n "$router" ] ; then
41 if ! root_is_nfs ; then
42 if [ $have_bin_ip -eq 1 ]; then
43 while ip route del default 2>/dev/null ; do
44 :
45 done
46 else
47 while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
48 :
49 done
50 fi
51 fi
52
53 metric=0
54 for i in $router ; do
55 if [ $have_bin_ip -eq 1 ]; then
56 ip route add default via $i metric $((metric++))
57 else
58 route add default gw $i dev $interface metric $((metric++)) 2>/dev/null
59 fi
60 done
61 fi
62
63 echo -n > $RESOLV_CONF
64 [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
65 for i in $dns ; do
66 echo adding dns $i
67 echo nameserver $i >> $RESOLV_CONF
68 done
69 ;;
70esac
71
72exit 0