The cmdline hook of iscsi module will force check if iscsi_tcp module
is available, and abort the boot progress is not. But actually iscsi
module shouldn't be allowed to be installed in the first place if the
corresponding kernel doesn't support it.
So print an warning and refuse to install the iscsi dracut module
in such case, instead of dying on reboot.
Signed-off-by: Kairui Song <kasong@tencent.com>
check() {
# If our prerequisites are not met, fail anyways.
require_binaries iscsi-iname iscsiadm iscsid || return 1
+ require_kernel_modules iscsi_tcp || return 1
# If hostonly was requested, fail the check if we are not actually
# booting from root.
-
[[ $hostonly ]] || [[ $mount_needs ]] && {
pushd . > /dev/null
for_each_host_dev_and_slaves block_is_iscsi