[PATCH] module-setup: Add permanent option to detect static ip address or not

Minfei Huang mhuang at redhat.com
Thu Aug 6 03:59:35 UTC 2015


Dracut will die in the situation that dracut detects to use dhcp to get
ip address, but kdump passes the ip address to it.

The command "ip addr show dev $dev permanent" will only show the static
ip. Thues kdump cannot get the ip address in kdump_static_ip, if we use
dhcp to setup the network.

Signed-off-by: Minfei Huang <mhuang at redhat.com>
---
 dracut-module-setup.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index c37f7c0..dbe9b10 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -92,7 +92,7 @@ kdump_static_ip() {
     local _netdev="$1" _srcaddr="$2" _ipv6_flag
     local _netmask _gateway _ipaddr _target _nexthop
 
-    _ipaddr=$(ip addr show dev $_netdev | awk "/ $_srcaddr\/.* /{print \$2}")
+    _ipaddr=$(ip addr show dev $_netdev permanent | awk "/ $_srcaddr\/.* /{print \$2}")
 
     if is_ipv6_address $_srcaddr; then
         _ipv6_flag="-6"
-- 
2.1.0



More information about the kexec mailing list