summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox
diff options
context:
space:
mode:
authorAndreas Oberritter <obi@opendreambox.org>2012-05-04 15:09:38 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-04 16:44:59 +0100
commitf60cdd4d564444ff6af24a0013a7fbe9823baf1a (patch)
tree330349ebb3842b0569a3727b49239868ef55ac76 /meta/recipes-core/busybox
parent84eb62d8b28416a29c3f0bc299c0e9adf6de7e52 (diff)
downloadpoky-f60cdd4d564444ff6af24a0013a7fbe9823baf1a.tar.gz
busybox: port improvements to simple.script from Debian (udhcpc)
* Support resolvconf * Avoid bashism $((metric++)) * Use 'domain' instead of 'search' for domain parameter (From OE-Core rev: 3d4ccf98b83fe662f375cd5b029fdd602824c0e8) Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/busybox')
-rw-r--r--meta/recipes-core/busybox/busybox_1.19.4.bb2
-rw-r--r--meta/recipes-core/busybox/files/simple.script27
2 files changed, 21 insertions, 8 deletions
diff --git a/meta/recipes-core/busybox/busybox_1.19.4.bb b/meta/recipes-core/busybox/busybox_1.19.4.bb
index 0b1e78746a..a797ac9392 100644
--- a/meta/recipes-core/busybox/busybox_1.19.4.bb
+++ b/meta/recipes-core/busybox/busybox_1.19.4.bb
@@ -1,5 +1,5 @@
1require busybox.inc 1require busybox.inc
2PR = "r4" 2PR = "r5"
3 3
4SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ 4SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
5 file://B921600.patch \ 5 file://B921600.patch \
diff --git a/meta/recipes-core/busybox/files/simple.script b/meta/recipes-core/busybox/files/simple.script
index 5cc21b9de2..27368f0ee5 100644
--- a/meta/recipes-core/busybox/files/simple.script
+++ b/meta/recipes-core/busybox/files/simple.script
@@ -20,6 +20,9 @@ fi
20 20
21case "$1" in 21case "$1" in
22 deconfig) 22 deconfig)
23 if [ -x /sbin/resolvconf ]; then
24 /sbin/resolvconf -d "${interface}.udhcpc"
25 fi
23 if ! root_is_nfs ; then 26 if ! root_is_nfs ; then
24 if [ $have_bin_ip -eq 1 ]; then 27 if [ $have_bin_ip -eq 1 ]; then
25 ip addr flush dev $interface 28 ip addr flush dev $interface
@@ -53,19 +56,29 @@ case "$1" in
53 metric=0 56 metric=0
54 for i in $router ; do 57 for i in $router ; do
55 if [ $have_bin_ip -eq 1 ]; then 58 if [ $have_bin_ip -eq 1 ]; then
56 ip route add default via $i metric $((metric++)) 59 ip route add default via $i metric $metric
57 else 60 else
58 route add default gw $i dev $interface metric $((metric++)) 2>/dev/null 61 route add default gw $i dev $interface metric $metric 2>/dev/null
59 fi 62 fi
63 metric=$(($metric + 1))
60 done 64 done
61 fi 65 fi
62 66
63 echo -n > $RESOLV_CONF 67 # Update resolver configuration file
64 [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF 68 R=""
65 for i in $dns ; do 69 [ -n "$domain" ] && R="domain $domain
66 echo adding dns $i 70"
67 echo nameserver $i >> $RESOLV_CONF 71 for i in $dns; do
72 echo "$0: Adding DNS $i"
73 R="${R}nameserver $i
74"
68 done 75 done
76
77 if [ -x /sbin/resolvconf ]; then
78 echo -n "$R" | /sbin/resolvconf -a "${interface}.udhcpc"
79 else
80 echo -n "$R" > "$RESOLV_CONF"
81 fi
69 ;; 82 ;;
70esac 83esac
71 84