make root=dhcp work
parent
9faf9b0690
commit
28df9479e1
|
@ -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 this option isn't directed at our interface, skip it
|
if [ "$root" = "dhcp" -a -z "$ip" ]; then
|
||||||
[ "$dev" = "$netif" ] || continue
|
do_dhcp;
|
||||||
|
else
|
||||||
|
# spin through the kernel command line, looking for ip= lines
|
||||||
|
for p in $(cat /proc/cmdline); do
|
||||||
|
[ -n "${p%ip=*}" ] && continue
|
||||||
|
ip_to_var ${p#ip=}
|
||||||
|
|
||||||
|
# If this option isn't directed at our interface, skip it
|
||||||
|
[ "$dev" = "$netif" ] || continue
|
||||||
|
|
||||||
case $autoconf in
|
case $autoconf in
|
||||||
static) do_static ;;
|
static) do_static ;;
|
||||||
dhcp|on|any) do_dhcp ;;
|
dhcp|on|any) do_dhcp ;;
|
||||||
bootp|rarp|both) die "autoconfig type $autoconf is not supported" ;;
|
bootp|rarp|both) die "autoconfig type $autoconf is not supported" ;;
|
||||||
''|none|off) ;;
|
''|none|off) ;;
|
||||||
esac
|
esac
|
||||||
break
|
break
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue