diff options
Diffstat (limited to 'meta/recipes-core/busybox/busybox-1.19.4/udhcpc-fix-nfsroot.patch')
-rw-r--r-- | meta/recipes-core/busybox/busybox-1.19.4/udhcpc-fix-nfsroot.patch | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox-1.19.4/udhcpc-fix-nfsroot.patch b/meta/recipes-core/busybox/busybox-1.19.4/udhcpc-fix-nfsroot.patch new file mode 100644 index 0000000000..d2eab8bd1b --- /dev/null +++ b/meta/recipes-core/busybox/busybox-1.19.4/udhcpc-fix-nfsroot.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | # copy commit message from OE as the patch comment: | ||
4 | # commit ec4da6df3ad5b8b03446d0dda9c50a2439ae325a | ||
5 | # Author: Denys Dmytriyenko <denis@denix.org> | ||
6 | # Date: Wed Feb 4 11:43:18 2009 -0500 | ||
7 | # | ||
8 | # busybox: fix nfsroot issues with resetting IP and deleting routes | ||
9 | # | ||
10 | # above comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-06 | ||
11 | Index: busybox-1.15.3/examples/udhcp/simple.script | ||
12 | =================================================================== | ||
13 | --- busybox-1.15.3.orig/examples/udhcp/simple.script 2010-06-27 12:17:14.116876946 +0200 | ||
14 | +++ busybox-1.15.3/examples/udhcp/simple.script 2010-06-27 12:18:38.607868533 +0200 | ||
15 | @@ -10,10 +10,17 @@ | ||
16 | BROADCAST="broadcast +" | ||
17 | [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" | ||
18 | |||
19 | +# return 0 if root is mounted on a network filesystem | ||
20 | +root_is_nfs() { | ||
21 | + grep -qe '^/dev/root.*\(nfs\|smbfs\|ncp\|coda\) .*' /proc/mounts | ||
22 | +} | ||
23 | + | ||
24 | case "$1" in | ||
25 | deconfig) | ||
26 | + if ! root_is_nfs ; then | ||
27 | echo "Setting IP address 0.0.0.0 on $interface" | ||
28 | - ifconfig $interface 0.0.0.0 | ||
29 | + ifconfig $interface 0.0.0.0 | ||
30 | + fi | ||
31 | ;; | ||
32 | |||
33 | renew|bound) | ||
34 | @@ -21,15 +28,17 @@ | ||
35 | ifconfig $interface $ip $NETMASK $BROADCAST | ||
36 | |||
37 | if [ -n "$router" ] ; then | ||
38 | - echo "Deleting routers" | ||
39 | - while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do | ||
40 | - : | ||
41 | - done | ||
42 | + if ! root_is_nfs ; then | ||
43 | + echo "Deleting routers" | ||
44 | + while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do | ||
45 | + : | ||
46 | + done | ||
47 | + fi | ||
48 | |||
49 | metric=0 | ||
50 | for i in $router ; do | ||
51 | echo "Adding router $i" | ||
52 | - route add default gw $i dev $interface metric $((metric++)) | ||
53 | + route add default gw $i dev $interface metric $((metric++)) 2>/dev/null | ||
54 | done | ||
55 | fi | ||
56 | |||