From: Kairui Song Date: Tue, 6 Dec 2022 16:06:34 +0000 (+0800) Subject: fix(iscsi): don't install the module if kernel doesn't support iscsi X-Git-Tag: 058~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7917d7976ded6384433ef8fb2ce1905f0a76358e;p=thirdparty%2Fdracut.git fix(iscsi): don't install the module if kernel doesn't support iscsi 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 --- diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh index 051a284e5..e7d74fe33 100755 --- a/modules.d/95iscsi/module-setup.sh +++ b/modules.d/95iscsi/module-setup.sh @@ -4,10 +4,10 @@ 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