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