From 510084134f162ce991e8a8343192fbd7f12d2cb7 Mon Sep 17 00:00:00 2001 From: Baoquan He Date: Fri, 1 Jul 2016 10:34:22 +0800 Subject: [PATCH] module-setup: Don't handle iBFT in kdump There are several kinds of iSCSI mode rhel support currently. - Pure hardware iSCSI - iBFT iSCSI - Pure software iSCSI Except for the 1st one that firmware takes care of everything to make it behave like a local disk, both iBFT and pure software iSCSI mode need pass information to kdump kernel for configuring them correctly. Currently kdump takes iBFT mode as a software iSCSI and collects the related information to set up software iSCSI in 2nd kernel, though dracut can detect and collect information to set up iBFT iSCSI of 2nd kernel. This brings up 2 problems: 1) Redundent information about the related iSCSI is collected. One is done by kdump, the other is from dracut. 2) These 2 sessions of 2nd kernel for a certain session of 1st kernel could contain two "ip=xxx" cmdline option. This will cause cmdline handling error in dracut. The 1st one is not critical while the 2nd is. In order to avoid above 2 problems, kdump need detect iBFT mode iSCSI and leave it to dracut. This is what is done in this patch. Signed-off-by: Baoquan He Acked-by: Xunlei Pang Acked-by: Dave Young --- dracut-module-setup.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index ecf7d3f..aa204f8 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -511,7 +511,11 @@ kdump_get_iscsi_initiator() { return 1 } -# No ibft handling yet. +# Figure out iBFT session according to session type +is_ibft() { + [ "$(kdump_iscsi_get_rec_val $1 "node.discovery_type")" = fw ] +} + kdump_setup_iscsi_device() { local path=$1 local tgt_name; local tgt_ipaddr; @@ -534,6 +538,10 @@ kdump_setup_iscsi_device() { return 1 fi + if is_ibft ${path}; then + return + fi + tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name") tgt_ipaddr=$(kdump_iscsi_get_rec_val ${path} "node.conn\[0\].address")