]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
NFS: Support host being a DNS ALIAS 327/head
authorFabian Vogt <fvogt@suse.com>
Fri, 3 Feb 2017 15:02:33 +0000 (16:02 +0100)
committerDaniel Molkentin <dmolkentin@suse.com>
Fri, 15 Dec 2017 20:52:59 +0000 (21:52 +0100)
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

index 6ef9cf321ac065157932a0316dc127096a6e7e5d..8592e0f0116596b150d88fa0e4ae556d336ef2da 100755 (executable)
@@ -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')