From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 23:29:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BADE106564A; Tue, 6 Jul 2010 23:29:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 399DE8FC14; Tue, 6 Jul 2010 23:29:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66NTt3N015992; Tue, 6 Jul 2010 23:29:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66NTt2o015985; Tue, 6 Jul 2010 23:29:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201007062329.o66NTt2o015985@svn.freebsd.org> From: Warner Losh Date: Tue, 6 Jul 2010 23:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209751 - in head/usr.sbin/pc-sysinstall: backend-query doc pc-sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 23:29:56 -0000 Author: imp Date: Tue Jul 6 23:29:55 2010 New Revision: 209751 URL: http://svn.freebsd.org/changeset/base/209751 Log: A few patches from Ed Maste by way of Kris Moore 1. Change detect-vmware to detect-emulation 2. improve laptop detection 3. better, network descriptions Modified: head/usr.sbin/pc-sysinstall/backend-query/Makefile head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh head/usr.sbin/pc-sysinstall/backend-query/detect-nics.sh head/usr.sbin/pc-sysinstall/doc/help-index head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh Modified: head/usr.sbin/pc-sysinstall/backend-query/Makefile ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/Makefile Tue Jul 6 23:20:43 2010 (r209750) +++ head/usr.sbin/pc-sysinstall/backend-query/Makefile Tue Jul 6 23:29:55 2010 (r209751) @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= detect-laptop.sh detect-nics.sh detect-vmware.sh disk-info.sh \ +FILES= detect-laptop.sh detect-nics.sh detect-emulation.sh disk-info.sh \ disk-list.sh disk-part.sh enable-net.sh list-config.sh list-components.sh \ list-mirrors.sh list-rsync-backups.sh list-tzones.sh query-langs.sh \ send-logs.sh setup-ssh-keys.sh sys-mem.sh test-live.sh test-netup.sh \ Modified: head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh Tue Jul 6 23:20:43 2010 (r209750) +++ head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh Tue Jul 6 23:29:55 2010 (r209751) @@ -25,9 +25,8 @@ # # $FreeBSD$ -dmesgLine=`dmesg | grep "acpi_acad0"` -if test "${dmesgLine}" = ""; then - echo "laptop: NO" -else +if devinfo | grep 'acpi_acad0' >/dev/null 2>/dev/null; then echo "laptop: YES" -fi +else + echo "laptop: NO" +fi Modified: head/usr.sbin/pc-sysinstall/backend-query/detect-nics.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/detect-nics.sh Tue Jul 6 23:20:43 2010 (r209750) +++ head/usr.sbin/pc-sysinstall/backend-query/detect-nics.sh Tue Jul 6 23:29:55 2010 (r209751) @@ -25,17 +25,12 @@ # # $FreeBSD$ -rm /tmp/netCards 2>/dev/null -touch /tmp/netCards - -config="`ifconfig -l`" - -for i in $config -do - echo "${i}" | grep -e "lo0" -e "^fwe" -e "^fwip" -e "lo1" -e "^plip" -e "^pfsync" -e "^pflog" -e "^tun" >/dev/null 2>/dev/null - if [ "$?" != "0" ] - then - IDENT="<`dmesg | grep ^${i} | grep -v "miibus" | grep '<' | cut -d '<' -f 2 | cut -d '>' -f 1 | head -1`>" - echo "${i}: $IDENT" - fi +for i in $(ifconfig -l); do + case "${i%%[0-9]*}" in + lo|fwe|fwip|plip|pfsync|pflog|tun) + continue + ;; + esac + IDENT=$(dmesg | sed -n "s/^$i: <\(.*\)>.*$/\1/p" | head -1) + echo "${i}: <$IDENT>" done Modified: head/usr.sbin/pc-sysinstall/doc/help-index ============================================================================== --- head/usr.sbin/pc-sysinstall/doc/help-index Tue Jul 6 23:20:43 2010 (r209750) +++ head/usr.sbin/pc-sysinstall/doc/help-index Tue Jul 6 23:29:55 2010 (r209751) @@ -22,8 +22,8 @@ System Query Commands detect-laptop Tests to see if this system is a laptop or desktop - detect-vmware - Tests to see if this system is actually a vmware session + detect-emulation + Tests to see if this system is actually running in an emulator such as VirtualBox detect-nics Returns a listing of the detected network cards on this system Modified: head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 ============================================================================== --- head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 Tue Jul 6 23:20:43 2010 (r209750) +++ head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 Tue Jul 6 23:29:55 2010 (r209751) @@ -69,8 +69,8 @@ Returns information about a storage devi sectors. .It detect-laptop Tests to see if this system is a laptop or desktop. -.It detect-vmware -Tests to see if this system is a vmware session. +.It detect-emulation +Tests to see if this system is running in an emulator .It detect-nics Returns a listing of the detected network cards on this system. .It list-components Modified: head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh Tue Jul 6 23:20:43 2010 (r209750) +++ head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh Tue Jul 6 23:29:55 2010 (r209751) @@ -124,8 +124,8 @@ case $1 in detect-nics) ${QUERYDIR}/detect-nics.sh ;; - # The user is wanting to check if we are in vmware - detect-vmware) ${QUERYDIR}/detect-vmware.sh + # The user is wanting to check if we are in emulation + detect-emulation) ${QUERYDIR}/detect-emulation.sh ;; # The user is wanting to query a disk's information