From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 622DD138334 for ; Thu, 18 Jul 2019 17:32:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8B15DE07F6; Thu, 18 Jul 2019 17:32:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5F9F8E07F6 for ; Thu, 18 Jul 2019 17:32:24 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 12ED7347FCE for ; Thu, 18 Jul 2019 17:32:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id ED7586F2 for ; Thu, 18 Jul 2019 17:32:20 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1563470616.057ede0d95124961692e5b67cd30eef5d305724b.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/ X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/initrd.scripts X-VCS-Directories: defaults/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 057ede0d95124961692e5b67cd30eef5d305724b X-VCS-Branch: master Date: Thu, 18 Jul 2019 17:32:20 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 52edb3d4-8b0b-4f8a-a6d0-c7fc97515443 X-Archives-Hash: 448f36cae516679977438fafabc09819 commit: 057ede0d95124961692e5b67cd30eef5d305724b Author: Thomas Deutschmann gentoo org> AuthorDate: Thu Jul 18 17:23:36 2019 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Thu Jul 18 17:23:36 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=057ede0d initrd.scripts: start_network(): Don't try to start network when interface is missing In addition, try to detect when udhcpc failed. Signed-off-by: Thomas Deutschmann gentoo.org> defaults/initrd.scripts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index e93a5ad..9e70c00 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -1664,10 +1664,21 @@ start_network() { esac done + if [ ! -d "/sys/class/net/${GK_NET_IFACE}" ] + then + warn_msg "Interface ${GK_NET_IFACE} not found; Will not try to start network ..." + return + fi + if [ -z "${IP}" -o "${IP}" = 'dhcp' ] then good_msg "Bringing up interface ${GK_NET_IFACE} using dhcp ..." ${QUIET} busybox udhcpc -i "${GK_NET_IFACE}" -n -t ${GK_NET_DHCP_RETRIES} -T ${GK_NET_TIMEOUT_DHCP} -R -p "${GK_NET_DHCP_PIDFILE}" + if [ $? -ne 0 ] + then + bad_msg "Failed to start udhcpc for interface ${GK_NET_IFACE}!" + return + fi else good_msg "Bringing up interface ${GK_NET_IFACE} ..." ${QUIET} ip link set "${GK_NET_IFACE}" up