Skip to content

Commit

Permalink
fix(iscsi): don't install the module if kernel doesn't support iscsi
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ryncsn authored and aafeijoo-suse committed Dec 21, 2022
1 parent d4a9d6b commit 7917d79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules.d/95iscsi/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7917d79

Please sign in to comment.