On 10/28/14 at 02:15pm, Baoquan He wrote:
On 10/23/14 at 10:47am, Minfei Huang wrote:
kdump_setup_netdev "${_netdev}" "${_srcaddr}"
@@ -583,6 +612,8 @@ install() { inst "/bin/date" "/bin/date" inst "/bin/sync" "/bin/sync" inst "/bin/cut" "/bin/cut"
- inst "/bin/getent" "/bin/getent"
In dracut-module-setup.sh there has been a getent calling, do we have to include it again?
Sorry, please ignore this. Since dracut-module-setup.sh is called in 1st kernel.
- inst "/bin/head" "/bin/head" inst "/sbin/makedumpfile" "/sbin/makedumpfile" inst "/sbin/vmcore-dmesg" "/sbin/vmcore-dmesg" inst "/lib/kdump/kdump-lib.sh" "/lib/kdump-lib.sh"
diff --git a/kdump-lib.sh b/kdump-lib.sh index a20c6e8..5053fdd 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -138,3 +138,36 @@ check_save_path_fs() fi }
+# get ip address or hostname from nfs/ssh config value +get_remote_host() +{
- local _config_val=$1
- # in ipv6, the _config_val format is [xxxx:xxxx::xxxx%eth0]:/mnt/nfs or
- # username at xxxx:xxxx::xxxx%eth0. what we need is just xxxx:xxxx::xxxx
- _config_val=${_config_val#*@}
- _config_val=${_config_val%:/*}
- _config_val=${_config_val#[}
- _config_val=${_config_val%]}
- _config_val=${_config_val%%*}
- echo $_config_val
+}
+# check the remote server ip address tpye +is_ipv6_target() +{
- local _server _server_tmp
- if is_ssh_dump_target; then
_server=`get_option_value ssh`
- elif is_nfs_dump_target; then
_server=`get_option_value nfs`
- fi
- [ -z "$_server" ] && return 1
- _server=`get_remote_host $_server`
- _server_tmp=$_server
- _server=`getent hosts $_server | head -n 1 | cut -d' ' -f1`
- _server=${_server:-$_server_tmp}
- echo $_server | grep -q ":"
+}
1.8.3.1
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec