From 7917d7976ded6384433ef8fb2ce1905f0a76358e Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Wed, 7 Dec 2022 00:06:34 +0800 Subject: [PATCH] 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 --- modules.d/95iscsi/module-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.47.3