diff options
author | Mark O'Donovan <shiftee@eircom.net> | 2016-02-10 09:23:53 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-11 12:27:49 +0000 |
commit | 691277f8895643992945ad9315927a5b781968e3 (patch) | |
tree | 9c4f0057195597fea5c2a33866d6d045344c5308 /meta/recipes-core | |
parent | f141f0b333b6a2d94fa32e4aeefe77864c3fd021 (diff) | |
download | poky-691277f8895643992945ad9315927a5b781968e3.tar.gz |
udhcpc: specify full path for ip command calls
(From OE-Core rev: 97dd53468537968422569797122ddef4b779a488)
Signed-off-by: Mark O'Donovan <modonovan@biotector.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/busybox/busybox.inc | 3 | ||||
-rw-r--r-- | meta/recipes-core/busybox/files/simple.script | 28 |
2 files changed, 16 insertions, 15 deletions
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc index f74d1a4565..4827d08215 100644 --- a/meta/recipes-core/busybox/busybox.inc +++ b/meta/recipes-core/busybox/busybox.inc | |||
@@ -258,7 +258,8 @@ do_install () { | |||
258 | if grep "CONFIG_UDHCPC=y" ${B}/.config; then | 258 | if grep "CONFIG_UDHCPC=y" ${B}/.config; then |
259 | install -d ${D}${sysconfdir}/udhcpc.d | 259 | install -d ${D}${sysconfdir}/udhcpc.d |
260 | install -d ${D}${datadir}/udhcpc | 260 | install -d ${D}${datadir}/udhcpc |
261 | install -m 0755 ${WORKDIR}/simple.script ${D}${sysconfdir}/udhcpc.d/50default | 261 | install -m 0755 ${WORKDIR}/simple.script ${D}${sysconfdir}/udhcpc.d/50default |
262 | sed -i "s:/SBIN_DIR/:${base_sbindir}/:" ${D}${sysconfdir}/udhcpc.d/50default | ||
262 | install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script | 263 | install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script |
263 | fi | 264 | fi |
264 | if grep "CONFIG_INETD=y" ${B}/.config; then | 265 | if grep "CONFIG_INETD=y" ${B}/.config; then |
diff --git a/meta/recipes-core/busybox/files/simple.script b/meta/recipes-core/busybox/files/simple.script index 22168b07e6..6ed0293525 100644 --- a/meta/recipes-core/busybox/files/simple.script +++ b/meta/recipes-core/busybox/files/simple.script | |||
@@ -14,7 +14,7 @@ root_is_nfs() { | |||
14 | } | 14 | } |
15 | 15 | ||
16 | have_bin_ip=0 | 16 | have_bin_ip=0 |
17 | if [ -x /sbin/ip ]; then | 17 | if [ -x /SBIN_DIR/ip ]; then |
18 | have_bin_ip=1 | 18 | have_bin_ip=1 |
19 | BROADCAST="broadcast +" | 19 | BROADCAST="broadcast +" |
20 | fi | 20 | fi |
@@ -23,34 +23,34 @@ fi | |||
23 | 23 | ||
24 | case "$1" in | 24 | case "$1" in |
25 | deconfig) | 25 | deconfig) |
26 | if [ -x /sbin/resolvconf ]; then | 26 | if [ -x /SBIN_DIR/resolvconf ]; then |
27 | /sbin/resolvconf -d "${interface}.udhcpc" | 27 | /SBIN_DIR/resolvconf -d "${interface}.udhcpc" |
28 | fi | 28 | fi |
29 | if ! root_is_nfs ; then | 29 | if ! root_is_nfs ; then |
30 | if [ $have_bin_ip -eq 1 ]; then | 30 | if [ $have_bin_ip -eq 1 ]; then |
31 | ip addr flush dev $interface | 31 | /SBIN_DIR/ip addr flush dev $interface |
32 | ip link set dev $interface up | 32 | /SBIN_DIR/ip link set dev $interface up |
33 | else | 33 | else |
34 | /sbin/ifconfig $interface 0.0.0.0 | 34 | /SBIN_DIR/ifconfig $interface 0.0.0.0 |
35 | fi | 35 | fi |
36 | fi | 36 | fi |
37 | ;; | 37 | ;; |
38 | 38 | ||
39 | renew|bound) | 39 | renew|bound) |
40 | if [ $have_bin_ip -eq 1 ]; then | 40 | if [ $have_bin_ip -eq 1 ]; then |
41 | ip addr add dev $interface local $ip/$mask $BROADCAST | 41 | /SBIN_DIR/ip addr add dev $interface local $ip/$mask $BROADCAST |
42 | else | 42 | else |
43 | /sbin/ifconfig $interface $ip $BROADCAST $NETMASK | 43 | /SBIN_DIR/ifconfig $interface $ip $BROADCAST $NETMASK |
44 | fi | 44 | fi |
45 | 45 | ||
46 | if [ -n "$router" ] ; then | 46 | if [ -n "$router" ] ; then |
47 | if ! root_is_nfs ; then | 47 | if ! root_is_nfs ; then |
48 | if [ $have_bin_ip -eq 1 ]; then | 48 | if [ $have_bin_ip -eq 1 ]; then |
49 | while ip route del default dev $interface 2>/dev/null ; do | 49 | while /SBIN_DIR/ip route del default dev $interface 2>/dev/null ; do |
50 | : | 50 | : |
51 | done | 51 | done |
52 | else | 52 | else |
53 | while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do | 53 | while /SBIN_DIR/route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do |
54 | : | 54 | : |
55 | done | 55 | done |
56 | fi | 56 | fi |
@@ -59,9 +59,9 @@ case "$1" in | |||
59 | metric=10 | 59 | metric=10 |
60 | for i in $router ; do | 60 | for i in $router ; do |
61 | if [ $have_bin_ip -eq 1 ]; then | 61 | if [ $have_bin_ip -eq 1 ]; then |
62 | ip route add default via $i metric $metric | 62 | /SBIN_DIR/ip route add default via $i metric $metric |
63 | else | 63 | else |
64 | route add default gw $i dev $interface metric $metric 2>/dev/null | 64 | /SBIN_DIR/route add default gw $i dev $interface metric $metric 2>/dev/null |
65 | fi | 65 | fi |
66 | metric=$(($metric + 1)) | 66 | metric=$(($metric + 1)) |
67 | done | 67 | done |
@@ -77,8 +77,8 @@ case "$1" in | |||
77 | " | 77 | " |
78 | done | 78 | done |
79 | 79 | ||
80 | if [ -x /sbin/resolvconf ]; then | 80 | if [ -x /SBIN_DIR/resolvconf ]; then |
81 | echo -n "$R" | /sbin/resolvconf -a "${interface}.udhcpc" | 81 | echo -n "$R" | /SBIN_DIR/resolvconf -a "${interface}.udhcpc" |
82 | else | 82 | else |
83 | echo -n "$R" > "$RESOLV_CONF" | 83 | echo -n "$R" > "$RESOLV_CONF" |
84 | fi | 84 | fi |