libguestfs/0002-appliance-only-wait-for-resolv.conf-update-if-dhcpcd.patch

35 lines
1.1 KiB
Diff
Raw Normal View History

From 0572a675c9ba5d2bb4e31bc5844fcfd9bc3538cf Mon Sep 17 00:00:00 2001
From: Olaf Hering <olaf@aepfle.de>
Date: Wed, 15 May 2024 09:11:49 +0200
Subject: [PATCH] appliance: only wait for resolv.conf update if dhcpcd
succeeded
In case network was requested, but the host lacks both dhclient and
dhcpcd, skip the loop which waits for a resolv.conf update.
This reduces boot time by 10 seconds.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
(cherry picked from commit 4ef645778a563759406cee597b9ff37c99da33fe)
---
appliance/init | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/appliance/init b/appliance/init
index cb200d5bf..128a3c20e 100755
--- a/appliance/init
+++ b/appliance/init
@@ -119,8 +119,7 @@ if test "$guestfs_network" = 1; then
rm -f /etc/dhcp/dhclient-enter-hooks.d/resolved
if dhclient --version >/dev/null 2>&1; then
dhclient $iface
- else
- dhcpcd $iface
+ elif dhcpcd $iface; then
# https://github.com/NetworkConfiguration/dhcpcd/issues/258
for i in `seq 0 10`; do
if grep nameserver /etc/resolv.conf; then break; fi
--
2.43.0