File 0201-fix_nfs_with_ip_instead_of_hostname.patch of Package dracut.12460
From 7b4b832aded41e25cebbb8807b8e60bf58fd122e Mon Sep 17 00:00:00 2001
From: Thomas Renninger <trenn@suse.com>
Date: Wed, 4 May 2016 13:33:43 +0200
Subject: 95nfs: Fix mount if IPv4 address is used in /etc/fstab
Signed-off-by: Thomas Renninger <trenn@suse.com>
---
modules.d/95nfs/module-setup.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index dc97aba..6644c07 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -51,9 +51,9 @@ cmdline() {
### ip= ###
if [[ $nfs_device = [0-9]*\.[0-9]*\.[0-9]*.[0-9]* ]] || [[ $nfs_device = \[.*\] ]]; then
- nfs_address="$nfs_device"
+ nfs_address="${nfs_device%%:*}"
else
- lookup=$(host $(echo ${nfs_device%%:*})| head -n1)
+ lookup=$(host "${nfs_device%%:*}"| head -n1)
nfs_address=${lookup##* }
fi
ifname=$(ip -o route get to $nfs_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
--
2.6.6