From owner-svn-soc-all@FreeBSD.ORG Mon Aug 11 19:59:21 2014 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 843923D9 for ; Mon, 11 Aug 2014 19:59:21 +0000 (UTC) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 646812B29 for ; Mon, 11 Aug 2014 19:59:21 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7BJxL2X008680 for ; Mon, 11 Aug 2014 19:59:21 GMT (envelope-from kczekirda@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id s7BJxK8W008673 for svn-soc-all@FreeBSD.org; Mon, 11 Aug 2014 19:59:20 GMT (envelope-from kczekirda@FreeBSD.org) Date: Mon, 11 Aug 2014 19:59:20 GMT Message-Id: <201408111959.s7BJxK8W008673@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to kczekirda@FreeBSD.org using -f From: kczekirda@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r272231 - soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2014 19:59:21 -0000 Author: kczekirda Date: Mon Aug 11 19:59:19 2014 New Revision: 272231 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=272231 Log: network tofile with problems Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig_ipv6 Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig ============================================================================== --- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig Mon Aug 11 19:59:13 2014 (r272230) +++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig Mon Aug 11 19:59:19 2014 (r272231) @@ -107,6 +107,7 @@ exec $0 else IPV4_AVAIL=0 + [ ! -z "$TOFILE" ] && echo IPV4=\"NO\" >> "$TOFILE" fi fi # In case wlanconfig left an option and we do not support IPv4 we need to write @@ -121,6 +122,7 @@ bsdinstall netconfig_ipv6 ${INTERFACE} || exec $0 else IPV6_AVAIL=0 + [ ! -z "$TOFILE" ] && echo IPV6=\"NO\" >> "$TOFILE" fi fi @@ -187,30 +189,60 @@ if [ $? -eq $DIALOG_CANCEL ]; then exec $0; fi exec 3>&- -echo ${RESOLV} | tr ' ' '\n' | \ -awk ' +if [ -z "$TOFILE" ]; then + echo ${RESOLV} | tr ' ' '\n' | \ + awk ' + BEGIN { + search=-1; + } + { + if (/^[[:space:]]+$/) { + next; + } + if (/^Nameserver$/) { + printf "\n"; + search=0; + next; + } + if (search == -1) { + printf "search "; + search=1; + } + if (search > 0) { + printf "%s%s", (search > 1) ? " " : "", $1; + search++; + next; + } + printf "nameserver %s\n", $1; + }' > ${BSDINSTALL_TMPETC}/resolv.conf + mv $BSDINSTALL_TMPETC/._rc.conf.net $BSDINSTALL_TMPETC/rc.conf.net +else + echo ${RESOLV} >> "$TOFILE" + echo resolv >> "$TOFILE" + echo ${RESOLV} | tr ' ' '\n' | \ + awk ' BEGIN { - search=-1; +>---search=-1; } { - if (/^[[:space:]]+$/) { - next; - } - if (/^Nameserver$/) { - printf "\n"; - search=0; - next; - } - if (search == -1) { - printf "search "; - search=1; - } - if (search > 0) { - printf "%s%s", (search > 1) ? " " : "", $1; - search++; - next; - } - printf "nameserver %s\n", $1; -}' > ${BSDINSTALL_TMPETC}/resolv.conf - -mv $BSDINSTALL_TMPETC/._rc.conf.net $BSDINSTALL_TMPETC/rc.conf.net +>---if (/^[[:space:]]+$/) { +>--->---next; +>---} +>---if (/^Nameserver$/) { +>--->---printf "\n"; +>--->---search=0; +>--->---next; +>---} +>---if (search == -1) { +>--->---printf "search "; +>--->---search=1; +>---} +>---if (search > 0) { +printf "DOMAIN=\""; +>--->---printf "%s%s", (search > 1) ? " " : "", $1; +>--->---search++; +>--->---next; +>---} +>---printf "DNS=\"%s\n\"", $1; +}' >> "$TOFILE" +fi Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 ============================================================================== --- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Mon Aug 11 19:59:13 2014 (r272230) +++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Mon Aug 11 19:59:19 2014 (r272231) @@ -66,6 +66,8 @@ exit 0 fi +[ -z "$TOFILE" ] && echo DHCP=\"NO\" >> "$TOFILE" + IP_ADDRESS=`ifconfig $INTERFACE inet | awk '/inet/ {printf("%s\n", $2); }'` NETMASK=`ifconfig $INTERFACE inet | awk '/inet/ {printf("%s\n", $4); }'` ROUTER=`netstat -rn -f inet | awk '/default/ {printf("%s\n", $2);}'` Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig_ipv6 ============================================================================== --- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig_ipv6 Mon Aug 11 19:59:13 2014 (r272230) +++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig_ipv6 Mon Aug 11 19:59:19 2014 (r272231) @@ -150,8 +150,34 @@ printf("ifconfig_%s_ipv6=\"inet6 %s\"\n", iface, $1); }' >> $BSDINSTALL_TMPETC/._rc.conf.net else - echo $IF_CONFIG - echo "static ip6" >> "$TOFILE" + echo ${IF_CONFIG} | tr ' ' '\n' | \ + awk -v iface="${INTERFACE}" ' + BEGIN { + >---dfr=0; + >---count=0; + } + { + >---if (/^[[:space:]]+$/) { + >--->---next; + >---} + >---if (/DefaultRouter/) { + >--->---dfr=1; + >--->---next; + >---} + >---if (dfr == 1) { + >--->---printf("ipv6_defaultrouter=\"%s\"\n", $1); + >--->---next; + >---} + >---if (count > 0) { + >--->---# Ignore all but the first IP address for now. + >--->---next; + >---} + >---count++; + >---if (!match($1, "/")) { + >--->---sub("$", "/64", $1); + >---} + >---printf("ifconfig_%s_ipv6=\"inet6 %s\"\n", iface, $1); + }' >> "$TOFILE" fi if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then