diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh index 8b42d3e1..5d2a39b0 100755 --- a/modules.d/95iscsi/module-setup.sh +++ b/modules.d/95iscsi/module-setup.sh @@ -28,6 +28,21 @@ check() { return 0 } +install_ibft() { + # When iBFT / iscsi_boot is detected: + # - Use 'ip=ibft' to set up iBFT network interface + # - specify firmware booting cmdline parameter + + for d in /sys/firmware/* ; do + if [ -d ${d}/initiator ] ; then + if [ ${d##*/} = "ibft" ] ; then + echo -n "ip=ibft " + fi + echo -n "rd.iscsi.firmware=1" + fi + done +} + # called by dracut depends() { echo network rootfs-block @@ -37,6 +52,12 @@ depends() { installkernel() { local _arch=$(uname -m) + # Detect iBFT and perform mandatory steps + if [[ $hostonly_cmdline == "yes" ]] ; then + install_ibft > "${initdir}/etc/cmdline.d/95iscsi.conf" + echo >> "${initdir}/etc/cmdline.d/95iscsi.conf" + fi + instmods bnx2i qla4xxx cxgb3i cxgb4i be2iscsi hostonly="" instmods iscsi_tcp iscsi_ibft crc32c iscsi_boot_sysfs iscsi_module_filter() { @@ -76,6 +97,11 @@ installkernel() { | iscsi_module_filter | instmods } +# called by dracut +cmdline() { + install_ibft +} + # called by dracut install() { inst_multiple umount iscsistart hostname iscsi-iname