summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2007-08-15 06:18:09 +0000
committerSascha Hauer <s.hauer@pengutronix.de>2007-08-15 06:18:09 +0000
commit67ebf215f155a4393f05c8a320d484dc9e4e0809 (patch)
tree8b5fcb7dff0814b2f22d1b213d41f03d3d648b10 /generic
parent05fed93d0fe989f68a8824e54786cb3e0d94f5cf (diff)
downloadptxdist-67ebf215f155a4393f05c8a320d484dc9e4e0809.tar.gz
ptxdist-67ebf215f155a4393f05c8a320d484dc9e4e0809.tar.xz
- generic networking start script:
When doing nfsroot do not want to reconfigure the network interface we're doing nfsroot on, so only configure all other interfaces. git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-trunk@7261 33e552b5-05e3-0310-8538-816dae2090ed
Diffstat (limited to 'generic')
-rw-r--r--generic/etc/init.d/networking30
1 files changed, 29 insertions, 1 deletions
diff --git a/generic/etc/init.d/networking b/generic/etc/init.d/networking
index ad8617f16..57e88c8f3 100644
--- a/generic/etc/init.d/networking
+++ b/generic/etc/init.d/networking
@@ -1,7 +1,35 @@
#!/bin/sh
echo "starting network interfaces..."
-ifup -a
+
+cat /proc/cmdline | grep nfsroot > /dev/null
+
+if [ $? != 0 ]; then
+ ifup -a
+else
+ # We are doing nfsroot. We cannot simply call ifup -a
+ # here because we will run into trouble with dhcp.
+ # So we call ifup for every interface except the one
+ # we are doing nfsroot on.
+ #
+ if [ ! -f /etc/network/interfaces ]; then
+ exit 0
+ fi
+
+ ifaces=$(cat /etc/network/interfaces | grep "^auto")
+
+ for i in $ifaces; do
+ if [ "$i" = auto ]; then
+ continue
+ fi
+
+ ifconfig | grep "^$i"
+
+ if [ $? != 0 ]; then
+ ifup "$i"
+ fi
+ done
+fi
exit 0