summaryrefslogtreecommitdiff
path: root/packages/busybox/busybox-1.13.2/udhcpc-fix-nfsroot.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2009-02-04 12:44:25 -0800
committerKhem Raj <raj.khem@gmail.com>2009-02-04 12:44:25 -0800
commit0cdc6688f3c131ee99d1c8047e811cd874f90a45 (patch)
tree0154a47c765ad67ff87a506c60a0df310dacbc17 /packages/busybox/busybox-1.13.2/udhcpc-fix-nfsroot.patch
parent26801938ec1a7009ca120af97c6f9e3f1edcf853 (diff)
parentd81d91547bc3a29e717b6156f35e425804d432a8 (diff)
Merge branch 'org.openembedded.dev' of git@git.openembedded.net:openembedded into org.openembedded.dev
Diffstat (limited to 'packages/busybox/busybox-1.13.2/udhcpc-fix-nfsroot.patch')
-rw-r--r--packages/busybox/busybox-1.13.2/udhcpc-fix-nfsroot.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/packages/busybox/busybox-1.13.2/udhcpc-fix-nfsroot.patch b/packages/busybox/busybox-1.13.2/udhcpc-fix-nfsroot.patch
new file mode 100644
index 0000000000..39716ec14b
--- /dev/null
+++ b/packages/busybox/busybox-1.13.2/udhcpc-fix-nfsroot.patch
@@ -0,0 +1,40 @@
+diff -uNr busybox-1.13.2-orig/examples/udhcp/simple.script busybox-1.13.2/examples/udhcp/simple.script
+--- busybox-1.13.2-orig/examples/udhcp/simple.script 2009-02-04 11:08:13.000000000 -0500
++++ busybox-1.13.2/examples/udhcp/simple.script 2009-02-04 11:24:51.000000000 -0500
+@@ -8,22 +8,31 @@
+ [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
+ [ -n "$subnet" ] && NETMASK="netmask $subnet"
+
++# return 0 if root is mounted on a network filesystem
++root_is_nfs() {
++ grep -qe '^/dev/root.*\(nfs\|smbfs\|ncp\|coda\) .*' /proc/mounts
++}
++
+ case "$1" in
+ deconfig)
+- /sbin/ifconfig $interface 0.0.0.0
++ if ! root_is_nfs ; then
++ /sbin/ifconfig $interface 0.0.0.0
++ fi
+ ;;
+
+ renew|bound)
+ /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
+
+ if [ -n "$router" ] ; then
+- while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
+- :
+- done
++ if ! root_is_nfs ; then
++ while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
++ :
++ done
++ fi
+
+ metric=0
+ for i in $router ; do
+- route add default gw $i dev $interface metric $((metric++))
++ route add default gw $i dev $interface metric $((metric++)) 2>/dev/null
+ done
+ fi
+