[kexec-tools/f17] get ip addr with getent

Cong Wang wangcong at fedoraproject.org
Fri Mar 30 03:42:24 UTC 2012


commit 985fcae6ec96e7a97c76923d185bbe8963f3ca14
Author: Dave Young <dyoung at redhat.com>
Date:   Thu Mar 29 14:56:06 2012 +0800

    get ip addr with getent
    
    Build kdump image will fail when kdump.conf has net option with a host name
    instead of ip address.
    
    Handle this just as what we do in rhel6: use getent to get the ip addr.
    
    Signed-off-by: Dave Young <dyoung at redhat.com>

 kdump_dracut_modules/99kdumpbase/module-setup.sh |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/kdump_dracut_modules/99kdumpbase/module-setup.sh b/kdump_dracut_modules/99kdumpbase/module-setup.sh
index 09b76f4..d891110 100755
--- a/kdump_dracut_modules/99kdumpbase/module-setup.sh
+++ b/kdump_dracut_modules/99kdumpbase/module-setup.sh
@@ -57,6 +57,9 @@ install() {
                 _server=$(echo $config_val | sed -e 's#\(.*\):.*#\1#')
             fi
 
+            _need_dns=`echo $_server|grep "[a-zA-Z]"`
+            [ -n $need_dns ] && _server=`getent hosts $_server|cut -d' ' -f1`
+
             _netdev=`/sbin/ip route get to $_server 2>&1`
             [ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1
             #the field in the ip output changes if we go to another subnet


More information about the scm-commits mailing list