|
|
@ -52,10 +52,9 @@ fi |
|
|
|
|
|
|
|
|
|
|
|
# Count ip= lines to decide whether we need bootdev= or not |
|
|
|
# Count ip= lines to decide whether we need bootdev= or not |
|
|
|
if [ -z "$NEEDBOOTDEV" ] ; then |
|
|
|
if [ -z "$NEEDBOOTDEV" ] ; then |
|
|
|
[ "$CMDLINE" ] || read CMDLINE < /proc/cmdline |
|
|
|
|
|
|
|
local count=0 |
|
|
|
local count=0 |
|
|
|
for p in $CMDLINE; do |
|
|
|
for p in $(getargs ip=); do |
|
|
|
[ "${p%%=*}" = "ip" ] && count=$(( $count + 1 )) |
|
|
|
count=$(( $count + 1 )) |
|
|
|
done |
|
|
|
done |
|
|
|
[ $count -gt 1 ] && NEEDBOOTDEV=1 |
|
|
|
[ $count -gt 1 ] && NEEDBOOTDEV=1 |
|
|
|
fi |
|
|
|
fi |
|
|
@ -68,11 +67,8 @@ fi |
|
|
|
|
|
|
|
|
|
|
|
# Check ip= lines |
|
|
|
# Check ip= lines |
|
|
|
# XXX Would be nice if we could errorcheck ip addresses here as well |
|
|
|
# XXX Would be nice if we could errorcheck ip addresses here as well |
|
|
|
[ "$CMDLINE" ] || read CMDLINE < /proc/cmdline |
|
|
|
for p in $(getargs ip=); do |
|
|
|
for p in $CMDLINE; do |
|
|
|
ip_to_var $p |
|
|
|
[ -n "${p%ip=*}" ] && continue |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ip_to_var ${p#ip=} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# We need to have an ip= line for the specified bootdev |
|
|
|
# We need to have an ip= line for the specified bootdev |
|
|
|
[ -n "$NEEDBOOTDEV" ] && [ "$dev" = "$BOOTDEV" ] && BOOTDEVOK=1 |
|
|
|
[ -n "$NEEDBOOTDEV" ] && [ "$dev" = "$BOOTDEV" ] && BOOTDEVOK=1 |
|
|
@ -85,28 +81,28 @@ for p in $CMDLINE; do |
|
|
|
|
|
|
|
|
|
|
|
# Error checking for autoconf in combination with other values |
|
|
|
# Error checking for autoconf in combination with other values |
|
|
|
case $autoconf in |
|
|
|
case $autoconf in |
|
|
|
error) die "Error parsing option '$p'";; |
|
|
|
error) die "Error parsing option 'ip=$p'";; |
|
|
|
bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";; |
|
|
|
bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";; |
|
|
|
none|off) \ |
|
|
|
none|off) \ |
|
|
|
[ -z "$ip" ] && \ |
|
|
|
[ -z "$ip" ] && \ |
|
|
|
die "For argument '$p'\nValue '$autoconf' without static configuration does not make sense" |
|
|
|
die "For argument 'ip=$p'\nValue '$autoconf' without static configuration does not make sense" |
|
|
|
[ -z "$mask" ] && \ |
|
|
|
[ -z "$mask" ] && \ |
|
|
|
die "Sorry, automatic calculation of netmask is not yet supported" |
|
|
|
die "Sorry, automatic calculation of netmask is not yet supported" |
|
|
|
;; |
|
|
|
;; |
|
|
|
dhcp|on|any) \ |
|
|
|
dhcp|on|any) \ |
|
|
|
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \ |
|
|
|
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \ |
|
|
|
die "Sorry, '$p' does not make sense for multiple interface configurations" |
|
|
|
die "Sorry, 'ip=$p' does not make sense for multiple interface configurations" |
|
|
|
[ -n "$ip" ] && \ |
|
|
|
[ -n "$ip" ] && \ |
|
|
|
die "For argument '$p'\nSorry, setting client-ip does not make sense for '$autoconf'" |
|
|
|
die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoconf'" |
|
|
|
;; |
|
|
|
;; |
|
|
|
*) die "For argument '$p'\nSorry, unknown value '$autoconf'";; |
|
|
|
*) die "For argument 'ip=$p'\nSorry, unknown value '$autoconf'";; |
|
|
|
esac |
|
|
|
esac |
|
|
|
|
|
|
|
|
|
|
|
if [ -n "$dev" ] ; then |
|
|
|
if [ -n "$dev" ] ; then |
|
|
|
# We don't like duplicate device configs |
|
|
|
# We don't like duplicate device configs |
|
|
|
if [ -n "$IFACES" ] ; then |
|
|
|
if [ -n "$IFACES" ] ; then |
|
|
|
for i in $IFACES ; do |
|
|
|
for i in $IFACES ; do |
|
|
|
[ "$dev" = "$i" ] && die "For argument '$p'\nDuplication configurations for '$dev'" |
|
|
|
[ "$dev" = "$i" ] && die "For argument 'ip=$p'\nDuplication configurations for '$dev'" |
|
|
|
done |
|
|
|
done |
|
|
|
fi |
|
|
|
fi |
|
|
|
# IFACES list for later use |
|
|
|
# IFACES list for later use |
|
|
|