From owner-freebsd-bugs@FreeBSD.ORG Thu Oct 13 16:10:11 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08621106566C for ; Thu, 13 Oct 2011 16:10:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id DA1878FC16 for ; Thu, 13 Oct 2011 16:10:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p9DGAAfT025529 for ; Thu, 13 Oct 2011 16:10:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p9DGAAbQ025527; Thu, 13 Oct 2011 16:10:10 GMT (envelope-from gnats) Resent-Date: Thu, 13 Oct 2011 16:10:10 GMT Resent-Message-Id: <201110131610.p9DGAAbQ025527@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Warren Block Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F031F106564A for ; Thu, 13 Oct 2011 16:02:01 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id C70448FC14 for ; Thu, 13 Oct 2011 16:02:01 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p9DG21Hp067070 for ; Thu, 13 Oct 2011 16:02:01 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p9DG21OZ067069; Thu, 13 Oct 2011 16:02:01 GMT (envelope-from nobody) Message-Id: <201110131602.p9DG21OZ067069@red.freebsd.org> Date: Thu, 13 Oct 2011 16:02:01 GMT From: Warren Block To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/161547: [patch]bsdinstall should identify wireless network interfaces X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2011 16:10:11 -0000 >Number: 161547 >Category: misc >Synopsis: [patch]bsdinstall should identify wireless network interfaces >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Oct 13 16:10:10 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Warren Block >Release: 9.0-BETA3 >Organization: >Environment: FreeBSD machine3.example.com 9.0-BETA3 FreeBSD 9.0-BETA3 #0: Sat Sep 24 21:31:28 UTC 2011 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: bsdinstall's netconfig script shows a list of interfaces, but does not explicitly identify which are wireless. The description does not always show that, either. >How-To-Repeat: # bsdinstall netconfig Note that wireless interfaces are included in the list but not identified as such. >Fix: Apply attached patch. The patch factors out the existing wireless detection into a function. If a card is wireless but the existing description does not contain "wireless" (case-insensitive because manufacturers are not consistent), prefix the description with "Wireless ". The previous wireless check is replaced with a call to the function. Not extensively tested, but works on an Acer netbook with re0 and ath0 interfaces. Patch attached with submission follows: --- netconfig.orig 2011-10-13 08:14:01.000000000 -0600 +++ netconfig 2011-10-13 09:44:19.000000000 -0600 @@ -41,11 +41,18 @@ : ${DIALOG_ITEM_HELP=4} : ${DIALOG_ESC=255} +# Do a dirty check to see if this a wireless interface -- there +# should be a better way +IsWireless() { + ifconfig $1 | grep -q 'media: IEEE 802.11 Wireless' +} + for IF in `ifconfig -l`; do test "$IF" = "lo0" && continue (ifconfig -g wlan | egrep -wq $IF) && continue INTERFACES="$INTERFACES $IF" DESC=`sysctl -n dev.$(echo $IF | sed -E 's/([[:alpha:]]*)([[:digit:]]*)/\1.\2/g').%desc` + IsWireless $IF && echo $DESC | grep -iqv wireless && DESC="Wireless $DESC" DIALOG_TAGS="$DIALOG_TAGS $IF \"$DESC\"" done @@ -56,10 +63,9 @@ : > $BSDINSTALL_TMPETC/._rc.conf.net -# Do a dirty check to see if this a wireless interface -- there should be a -# better way IFCONFIG_PREFIX="" -if ifconfig $INTERFACE | grep -q 'media: IEEE 802.11 Wireless'; then +IsWireless $INTERFACE +if [ $? -eq 0 ]; then NEXT_WLAN_IFACE=wlan0 # XXX echo wlans_$INTERFACE=\"$NEXT_WLAN_IFACE\" >> $BSDINSTALL_TMPETC/._rc.conf.net IFCONFIG_PREFIX="WPA " >Release-Note: >Audit-Trail: >Unformatted: