kexec-tools/dracut-kdump-wait-for-target.sh
Kairui Song cee618593c Add a hook to wait for kdump target in initqueue
The dracut initqueue may quit immediately and won't trigger any hook if
there is no "finished" hook still pending (finished hook will be deleted
once it return 0).

This issue start to appear with latest dracut, latest dracut use
network-manager to configure the network,
network-manager module only install "settled" hook, and we didn't
install any other hook. So NFS/SSH dump will fail. iSCSI dump works
because dracut iscsi module will install a "finished" hook to detect if
the iscsi target is up.

So for NFS/SSH we keep initqueue running until the host successfully get
a valid IP address, which means the network is ready.

Signed-off-by: Kairui Song <kasong@redhat.com>
Acked-by: Pingfan Liu <piliu@redhat.com>
2020-01-29 08:12:45 +08:00

24 lines
421 B
Bash
Executable File

#!/bin/sh
# only wait if it's kdump kernel
if [ -f /etc/fadump.initramfs ] && [ ! -f /proc/device-tree/rtas/ibm,kernel-dump ]; then
exit 0
fi
. /lib/dracut-lib.sh
. /lib/kdump-lib-initramfs.sh
# For SSH/NFS target, need to wait for the network to setup
if is_nfs_dump_target; then
get_host_ip
exit $?
fi
if is_ssh_dump_target; then
get_host_ip
exit $?
fi
# No need to wait for dump target
exit 0