2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
7 # If our prerequisites are not met, fail anyways.
8 type -P iscsistart hostname iscsi-iname
>/dev
/null ||
return 1
10 # If hostonly was requested, fail the check if we are not actually
16 [[ -L /sys
/dev
/block
/$_dev ]] ||
return
17 cd "$(readlink -f /sys/dev/block/$_dev)"
18 until [[ -d sys ||
-d iscsi_session
]]; do
21 [[ -d iscsi_session
]]
24 [[ $hostonly ]] ||
[[ $mount_needs ]] && {
25 for_each_host_dev_and_slaves is_iscsi ||
return 1
31 echo network rootfs-block
35 local _arch
=$
(uname
-m)
37 instmods iscsi_tcp iscsi_ibft crc32c bnx2i iscsi_boot_sysfs qla4xxx cxgb3i cxgb4i be2iscsi
38 iscsi_module_filter
() {
39 local _funcs
='iscsi_register_transport'
40 # subfunctions inherit following FDs
41 local _merge
=8 _side2
=9
46 *.ko
) [[ $
(< $_f) =~
$_funcs ]] && echo "$_f" ;;
47 *.ko.gz
) [[ $
(gzip -dc <$_f) =~
$_funcs ]] && echo "$_f" ;;
48 *.ko.xz
) [[ $
(xz
-dc <$_f) =~
$_funcs ]] && echo "$_f" ;;
59 echo "$_f2" 1>&${_side2}
61 done | bmf1
1>&${_merge}
64 # Use two parallel streams to filter alternating modules.
66 eval "( ( rotor ) ${_side2}>&1 | bmf1 ) ${_merge}>&1"
67 [[ $debug ]] && set -x
71 { find_kernel_modules_by_path drivers
/scsi
; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers
/s390
/scsi
; fi;} \
72 | iscsi_module_filter | instmods
76 dracut_install umount iscsistart hostname iscsi-iname
77 dracut_install
-o iscsiuio
78 inst_hook cmdline
90 "$moddir/parse-iscsiroot.sh"
79 inst_hook cleanup
90 "$moddir/cleanup-iscsi.sh"
80 inst
"$moddir/iscsiroot.sh" "/sbin/iscsiroot"
81 if ! dracut_module_included
"systemd"; then
82 inst
"$moddir/mount-lun.sh" "/bin/mount-lun.sh"