From: Will Woods Date: Tue, 22 May 2012 22:31:07 +0000 (-0400) Subject: add anaconda-style option parsing to ip_to_var X-Git-Tag: 019~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f629355b2fbd0ec99960609212e2b34e62c55d84;p=platform%2Fupstream%2Fdracut.git add anaconda-style option parsing to ip_to_var Anaconda used arguments of the form: ip= gateway= netmask= for static IP configuration. So if we get a value for "ip" that's an IP address, look for gateway= and netmask= and related args to fill in the ip config vars. --- diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh index d6adda9..75ad5e3 100644 --- a/modules.d/40network/net-lib.sh +++ b/modules.d/40network/net-lib.sh @@ -266,4 +266,18 @@ ip_to_var() { 4) dev=$1; autoconf=$2; mtu=$3; macaddr=$4 ;; *) ip=$1; srv=$2; gw=$3; mask=$4; hostname=$5; dev=$6; autoconf=$7; mtu=$8; macaddr=$9 ;; esac + # anaconda-style argument cluster + if strstr "$autoconf" "*.*.*.*"; then + ip="$autoconf" + gw=$(getarg gateway=) + mask=$(getarg netmask=) + hostname=$(getarg hostname=) + dev=$(getarg ksdevice=) + autoconf="none" + mtu=$(getarg mtu=) + case "$dev" in + # ignore fancy values for ksdevice=XXX + link|bootif|BOOTIF|ibft|*:*:*:*:*:*) dev="" ;; + esac + fi }