Skip to content

Commit

Permalink
95fcoe: don't install if there is no FCoE hostonly devices
Browse files Browse the repository at this point in the history
When in hostonly mode, 95fcoe module will still be installed even there
is no FCoE hostonly device. So use the new block_is_fcoe helper to check
for hostonly device in hostonly mode, avoid installing unneccessary module.

Signed-off-by: Kairui Song <kasong@redhat.com>
  • Loading branch information
ryncsn authored and danimo committed Nov 23, 2020
1 parent 4339d47 commit 8c8af8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
17 changes: 5 additions & 12 deletions modules.d/95fcoe-uefi/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,15 @@

# called by dracut
check() {
local _fcoe_ctlr
[[ $hostonly ]] || [[ $mount_needs ]] && {
for c in /sys/bus/fcoe/devices/ctlr_* ; do
[ -L $c ] || continue
_fcoe_ctlr=$c
done
[ -z "$_fcoe_ctlr" ] && return 255
is_fcoe() {
block_is_fcoe $1 || return 1
}

[[ $hostonly ]] || [[ $mount_needs ]] && {
for_each_host_dev_and_slaves is_fcoe || return 255
[ -d /sys/firmware/efi ] || return 255
for c in /sys/bus/fcoe/devices/ctlr_* ; do
[ -L $c ] || continue
fcoe_ctlr=$c
done
[ -z "$fcoe_ctlr" ] && return 255
}

require_binaries dcbtool fipvlan lldpad ip readlink || return 1
return 0
}
Expand Down
11 changes: 5 additions & 6 deletions modules.d/95fcoe/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

# called by dracut
check() {
local _fcoe_ctlr
is_fcoe() {
block_is_fcoe $1 || return 1
}

[[ $hostonly ]] || [[ $mount_needs ]] && {
for c in /sys/bus/fcoe/devices/ctlr_* ; do
[ -L $c ] || continue
_fcoe_ctlr=$c
done
[ -z "$_fcoe_ctlr" ] && return 255
for_each_host_dev_and_slaves is_fcoe || return 255
}

require_binaries dcbtool fipvlan lldpad ip readlink fcoemon fcoeadm || return 1
Expand Down

0 comments on commit 8c8af8a

Please sign in to comment.