From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 8559B1381F3 for ; Fri, 5 Jul 2013 21:47:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5E479E0A5A; Fri, 5 Jul 2013 21:47:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F149FE0A5A for ; Fri, 5 Jul 2013 21:46:56 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D1ACA33E8C5 for ; Fri, 5 Jul 2013 21:46:48 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 589EBE468F for ; Fri, 5 Jul 2013 21:46:22 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1371655058.104e9c65b1e1aadcb375debaa259589702fc08f3.WilliamH@gentoo> Subject: [gentoo-commits] proj/livecd-tools:master commit in: init.d/ X-VCS-Repository: proj/livecd-tools X-VCS-Files: init.d/autoconfig X-VCS-Directories: init.d/ X-VCS-Committer: WilliamH X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 104e9c65b1e1aadcb375debaa259589702fc08f3 X-VCS-Branch: master Date: Fri, 5 Jul 2013 21:46:22 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: fa49c3f4-d6b0-4f92-a49a-7fe3b7392e94 X-Archives-Hash: bae673fec3c52003f7ca50eae5bfd330 commit: 104e9c65b1e1aadcb375debaa259589702fc08f3 Author: William Hubbs gentoo org> AuthorDate: Wed Jun 19 15:07:55 2013 +0000 Commit: William Hubbs gentoo org> CommitDate: Wed Jun 19 15:17:38 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/livecd-tools.git;a=commit;h=104e9c65 autoconfig: update network device name recognission The previous code assumed the old style network names such as eth* were the names of interfaces. With the new udev, this is not always the case, so this updates autoconfig to ignore lo and sit0 and assume that the rest are valid network interfaces. Also we now use /sys/class/net/* to detect interfaces instead of /proc/dev/net. Reported-by: alexeyk13 yandex.ru X-Gentoo-Bug: 471054 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=471054 --- init.d/autoconfig | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/init.d/autoconfig b/init.d/autoconfig index 8f5c5db..10a60b7 100755 --- a/init.d/autoconfig +++ b/init.d/autoconfig @@ -375,6 +375,17 @@ detect_sparc() { PC="Detected ${numcpu} active ${cpuinfo} CPU(s) of ${numprobed} total" } +detect_netdevices() { + for dev in /sys/class/net/*; do + n="$(basename $dev)" + case "$n" in + lo|sit0) continue ;; + *) echo $n + esac + done + return 0 +} + start() { ebegin "Starting autoconfig" echo "0" > /proc/sys/kernel/printk @@ -501,7 +512,7 @@ start() { if yesno "${DETECT}" then - NETDEVICES="$(awk -F: '/eth.:|tr.:|ath.:|wlan.:/{print $1}' /proc/net/dev 2>/dev/null)" + NETDEVICES="$(detect_netdevices)" else DHCP="no" fi