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