Browse Source

make root=dhcp work

master
Harald Hoyer 16 years ago
parent
commit
28df9479e1
  1. 39
      modules.d/40network/ifup

39
modules.d/40network/ifup

@ -93,20 +93,27 @@ ip_to_var() {
[ -n "$autoconf" ] || autoconf=off [ -n "$autoconf" ] || autoconf=off
} }


# spin through the kernel command line, looking for ip= lines root=$(getarg root)
for p in $(cat /proc/cmdline); do ip=$(getarg ip)
[ -n "${p%ip=*}" ] && continue
ip_to_var ${p#ip=} if [ "$root" = "dhcp" -a -z "$ip" ]; then

do_dhcp;
# If this option isn't directed at our interface, skip it else
[ "$dev" = "$netif" ] || continue # spin through the kernel command line, looking for ip= lines

for p in $(cat /proc/cmdline); do
case $autoconf in [ -n "${p%ip=*}" ] && continue
static) do_static ;; ip_to_var ${p#ip=}
dhcp|on|any) do_dhcp ;;
bootp|rarp|both) die "autoconfig type $autoconf is not supported" ;; # If this option isn't directed at our interface, skip it
''|none|off) ;; [ "$dev" = "$netif" ] || continue
esac
break case $autoconf in
done static) do_static ;;
dhcp|on|any) do_dhcp ;;
bootp|rarp|both) die "autoconfig type $autoconf is not supported" ;;
''|none|off) ;;
esac
break
done
fi
exit 0 exit 0

Loading…
Cancel
Save