712866
From 3d47b5124c9539740a4b3cfd587765879b3226cc Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Thu, 30 Jan 2014 17:11:43 +0100
712866
Subject: [PATCH] network/net-lib.sh: parse ibft nameserver settings
712866
712866
---
712866
 modules.d/40network/net-lib.sh | 5 ++++-
712866
 1 file changed, 4 insertions(+), 1 deletion(-)
712866
712866
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
5c6c2a
index 36fad122..1b51c856 100755
712866
--- a/modules.d/40network/net-lib.sh
712866
+++ b/modules.d/40network/net-lib.sh
712866
@@ -185,6 +185,7 @@ ibft_to_cmdline() {
712866
         for iface in /sys/firmware/ibft/ethernet*; do
712866
             local mac="" dev=""
712866
             local dhcp="" ip="" gw="" mask="" hostname=""
712866
+            local dns1 dns2
712866
 
712866
             [ -e ${iface}/mac ] || continue
712866
             mac=$(read a < ${iface}/mac; echo $a)
712866
@@ -203,9 +204,11 @@ ibft_to_cmdline() {
712866
                 [ "$ip" = "0.0.0.0" ] && continue
712866
                 [ -e ${iface}/gateway ] && gw=$(read a < ${iface}/gateway; echo $a)
712866
                 [ -e ${iface}/subnet-mask ] && mask=$(read a < ${iface}/subnet-mask; echo $a)
712866
+                [ -e ${iface}/primary-dns ] && dns1=$(read a < ${iface}/primary-dns; echo $a)
712866
+                [ -e ${iface}/secondary-dns ] && dns2=$(read a < ${iface}/secondary-dns; echo $a)
712866
                 [ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a)
712866
                 if [ -n "$ip" ] && [ -n "$mask" ]; then
712866
-                    echo "ip=$ip::$gw:$mask:$hostname:$dev:none"
712866
+                    echo "ip=$ip::$gw:$mask:$hostname:$dev:none${dns1:+:$dns1}${dns2:+:$dns2}"
712866
                 else
712866
                     warn "${iface} does not contain a valid iBFT configuration"
712866
                     warn "ip-addr=$ip"