- if [ -z "${NETBOOT}" ]; then
- # default, dhcp assigned
- method="dhcp"
- else
- # make sure that the preconfigured interface would not get reassigned by dhcp
- # on startup by ifup script - otherwise our root fs might be disconnected!
- method="manual"
- fi
- # iterate the physical interfaces and add them to the interfaces list
- for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*; do
- [ -e $interface ] || continue
- i="$(basename $interface)"
- cat >> "$IFFILE" <<EOF
-auto $i
-iface $i inet $method
+ if [ -z "${NETBOOT}" ] || [ -n "${DHCP}" ]
+ then
+ # default, dhcp assigned
+ method="dhcp"
+ else
+ # make sure that the preconfigured interface would not get reassigned by dhcp
+ # on startup by ifup script - otherwise our root fs might be disconnected!
+ method="manual"
+ fi
+
+ # iterate the physical interfaces and add them to the interfaces list and also add when ethdevice= called on cmdline
+ if [ "${method}" != dhcp ] || ([ ! -x /root/usr/sbin/NetworkManager ] && [ ! -x /root/usr/sbin/wicd ]) || [ ! -z "${ETHDEVICE}" ]
+ then
+ for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*
+ do
+ [ -e ${interface} ] || continue
+ i="$(basename ${interface})"
+
+cat >> "${IFFILE}" << EOF
+allow-hotplug ${i}
+iface ${i} inet ${method}