iscsi configuration can be exposed in /sys/firmware/ibft or /sys/firmware/iscsi_bootX by iBFT or vendor specific driver (iBFT-like). With "rd.iscsi.firmware" set in cmdline, dracut can bring up the iscsi session regarding these exposed configurations. That means in this case, it's not necessary to pass these configurations to 2nd kernel, because dracut can directly use the exposed ones under sysfs.
If an iscsi session is based on firmware's configuration, then its node.discovery_type will be "fw". If that's the case, we tell dracut "rd.iscsi.firmware", and in 2nd kernel it will run "iscsistart -b" to bring up the session regarding the firmware's exposed configurations.
Signed-off-by: WANG Chao chaowang@redhat.com --- dracut-module-setup.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index b6218b3..c6ec035 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -411,7 +411,19 @@ kdump_get_iscsi_initiator() { return 1 }
-# No ibft handling yet. +# Figure out if the iscsi session is based on iBFT or firmware +kdump_handle_fw_iscsi() { + local netroot_conf="${initdir}/etc/cmdline.d/50iscsi.conf" + + if [ "$(kdump_iscsi_get_rec_val $1 "node.discovery_type")" = fw ]; then + # dracut will bring up the iscsi device from firmware's configuration + echo "rd.iscsi.firmware" >> $netroot_conf + return 0 + fi + + return 1 +} + kdump_setup_iscsi_device() { local path=$1 local tgt_name; local tgt_ipaddr; @@ -442,6 +454,10 @@ kdump_setup_iscsi_device() {
kdump_setup_netdev $netdev $srcaddr $tgt_ipaddr
+ if kdump_handle_fw_iscsi ${path}; then + return 0 + fi + tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name")
# get and set username and password details