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 A96C3138334 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 934D2E07F9; Thu, 18 Jul 2019 17:32:24 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 62693E07F9 for ; Thu, 18 Jul 2019 17:32:24 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 21DF1347FD2 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 0D83F6FF for ; Thu, 18 Jul 2019 17:32:21 +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: <1563470718.2210b434bdf7bc04af91582c0e306b480f530560.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: 2210b434bdf7bc04af91582c0e306b480f530560 X-VCS-Branch: master Date: Thu, 18 Jul 2019 17:32:21 +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: 006db4db-18e2-45bb-ab0b-3326b095d5f4 X-Archives-Hash: 422b211564957396bd4235f3e05410a2 commit: 2210b434bdf7bc04af91582c0e306b480f530560 Author: Thomas Deutschmann gentoo org> AuthorDate: Thu Jul 18 17:25:18 2019 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Thu Jul 18 17:25:18 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=2210b434 initrd.scripts: kill_network(): Don't try to kill network when interfacec is missing Signed-off-by: Thomas Deutschmann gentoo.org> defaults/initrd.scripts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 9e70c00..5e1029c 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -1713,6 +1713,12 @@ kill_network() { kill $(cat "${GK_NET_DHCP_PIDFILE}") fi + if [ ! -d "/sys/class/net/${GK_NET_IFACE}" ] + then + warn_msg "Interface ${GK_NET_IFACE} not found. Already down?" + return + fi + # If we are too quick and interface is still configuring IPv6 # waiting for DAD to complete due to received IPv6 RA, we have to # wait. @@ -1752,7 +1758,7 @@ kill_network() { ip addr flush dev "${GK_NET_IFACE}" ip route flush dev "${GK_NET_IFACE}" ip link set "${GK_NET_IFACE}" down - if grep -q "down" "/sys/class/net/${GK_NET_IFACE}/operstate" + if grep -q "down" "/sys/class/net/${GK_NET_IFACE}/operstate" 2>/dev/null then break fi