[Libguestfs] [PATCH 1/2] appliance init: find NIC name for dhcpcd

Cédric Bosdonnat cbosdonnat at suse.com
Tue Jul 28 13:21:37 UTC 2015


dhcpcd requires an interface name as parameter to work. We are now
getting it from /proc/sys/net/ipv4/conf/ folder children.
---
 appliance/init | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/appliance/init b/appliance/init
index cca62e7..ef18959 100755
--- a/appliance/init
+++ b/appliance/init
@@ -111,7 +111,8 @@ if test "$guestfs_network" = 1; then
     if dhclient --version >/dev/null 2>&1; then
         dhclient
     else
-        dhcpcd
+        iface=$(ls -I all -I default -I lo /proc/sys/net/ipv4/conf)
+        dhcpcd $iface
     fi
 fi
 
-- 
2.1.4




More information about the Libguestfs mailing list