dracut/0206-nfs_dns_alias.patch
Thomas Renninger e887e9bfb4 Accepting request 346073 from home:favogt:branches:Base:System
Add 0206-nfs_dns_alias.patch to fix boo#955592:
  - Fix dracut run on nfs root where NFS host is a DNS ALIAS
Require bind-utils. host is used in some lines

OBS-URL: https://build.opensuse.org/request/show/346073
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=242
2015-11-24 15:25:43 +00:00

28 lines
1.0 KiB
Diff

From: Fabian Vogt <fvogt@suse.com>
Subject: NFS: Support host being a DNS ALIAS
The "host" command may also print something else than
"asdf.local.lan has address 1.2.3.4", like:
"rootserver.local.net is an alias for rainbow.local.net.".
So "head -n1" is not enough.
Fixes boo#955592
---
modules.d/95nfs/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: dracut-043/modules.d/95nfs/module-setup.sh
===================================================================
--- dracut-043.orig/modules.d/95nfs/module-setup.sh
+++ dracut-043/modules.d/95nfs/module-setup.sh
@@ -53,7 +53,7 @@ cmdline() {
if [[ $nfs_device = [0-9]*\.[0-9]*\.[0-9]*.[0-9]* ]] || [[ $nfs_device = \[.*\] ]]; then
nfs_address="${nfs_device%%:*}"
else
- lookup=$(host "${nfs_device%%:*}"| head -n1)
+ lookup=$(host "${nfs_device%%:*}"| grep " address " | head -n1)
nfs_address=${lookup##* }
fi
ifname=$(ip -o route get to $nfs_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')