]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(iscsi): don't install the module if kernel doesn't support iscsi
authorKairui Song <kasong@tencent.com>
Tue, 6 Dec 2022 16:06:34 +0000 (00:06 +0800)
committerAntonio Álvarez Feijoo <antonio.feijoo@suse.com>
Wed, 21 Dec 2022 16:07:46 +0000 (17:07 +0100)
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>
modules.d/95iscsi/module-setup.sh

index 051a284e5e039aabb87c566c035b5b3012d3f95d..e7d74fe333401d034b8d7b646014282b8ff6404e 100755 (executable)
@@ -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