summaryrefslogtreecommitdiffstats
path: root/meta/packages/busybox/busybox-1.15.3/udhcpc-fix-nfsroot.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/busybox/busybox-1.15.3/udhcpc-fix-nfsroot.patch')
-rw-r--r--meta/packages/busybox/busybox-1.15.3/udhcpc-fix-nfsroot.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/meta/packages/busybox/busybox-1.15.3/udhcpc-fix-nfsroot.patch b/meta/packages/busybox/busybox-1.15.3/udhcpc-fix-nfsroot.patch
new file mode 100644
index 0000000000..3b975b63f9
--- /dev/null
+++ b/meta/packages/busybox/busybox-1.15.3/udhcpc-fix-nfsroot.patch
@@ -0,0 +1,47 @@
1Index: busybox-1.15.1/examples/udhcp/simple.script
2===================================================================
3--- busybox-1.15.1.orig/examples/udhcp/simple.script 2009-09-16 22:52:09.000000000 +0200
4+++ busybox-1.15.1/examples/udhcp/simple.script 2009-09-16 22:57:11.424608476 +0200
5@@ -10,10 +10,17 @@ NETMASK=""
6 BROADCAST="broadcast +"
7 [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
8
9+# return 0 if root is mounted on a network filesystem
10+root_is_nfs() {
11+ grep -qe '^/dev/root.*\(nfs\|smbfs\|ncp\|coda\) .*' /proc/mounts
12+}
13+
14 case "$1" in
15 deconfig)
16+ if ! root_is_nfs ; then
17 echo "Setting IP address 0.0.0.0 on $interface"
18- ifconfig $interface 0.0.0.0
19+ ifconfig $interface 0.0.0.0
20+ fi
21 ;;
22
23 renew|bound)
24@@ -21,15 +28,18 @@ case "$1" in
25 ifconfig $interface $ip $NETMASK $BROADCAST
26
27 if [ -n "$router" ] ; then
28- echo "Deleting routers"
29- while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
30- :
31- done
32+ if ! root_is_nfs ; then
33+ echo "Deleting routers"
34+ while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
35+ :
36+ done
37+ :
38+ done
39
40 metric=0
41 for i in $router ; do
42 echo "Adding router $i"
43- route add default gw $i dev $interface metric $((metric++))
44+ route add default gw $i dev $interface metric $((metric++)) 2>/dev/null
45 done
46 fi
47