2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
8 # If our prerequisites are not met, fail anyways.
9 type -P iscsistart hostname iscsi-iname
>/dev
/null ||
return 1
11 # If hostonly was requested, fail the check if we are not actually
17 [[ -L "/sys/dev/block/$_dev" ]] ||
return
18 cd "$(readlink -f "/sys
/dev
/block
/$_dev")"
19 until [[ -d sys ||
-d iscsi_session
]]; do
22 [[ -d iscsi_session
]]
25 [[ $hostonly ]] ||
[[ $mount_needs ]] && {
27 for_each_host_dev_and_slaves is_iscsi ||
return 255
35 echo network rootfs-block
40 local _arch
=$
(uname
-m)
42 instmods bnx2i qla4xxx cxgb3i cxgb4i be2iscsi
43 hostonly
="" instmods iscsi_tcp iscsi_ibft crc32c iscsi_boot_sysfs
44 iscsi_module_filter
() {
45 local _funcs
='iscsi_register_transport'
46 # subfunctions inherit following FDs
47 local _merge
=8 _side2
=9
52 *.ko
) [[ $
(< $_f) =~
$_funcs ]] && echo "$_f" ;;
53 *.ko.gz
) [[ $
(gzip -dc <$_f) =~
$_funcs ]] && echo "$_f" ;;
54 *.ko.xz
) [[ $
(xz
-dc <$_f) =~
$_funcs ]] && echo "$_f" ;;
65 echo "$_f2" 1>&${_side2}
67 done | bmf1
1>&${_merge}
70 # Use two parallel streams to filter alternating modules.
72 eval "( ( rotor ) ${_side2}>&1 | bmf1 ) ${_merge}>&1"
73 [[ $debug ]] && set -x
77 { find_kernel_modules_by_path drivers
/scsi
; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers
/s390
/scsi
; fi;} \
78 | iscsi_module_filter | instmods
83 inst_multiple umount iscsistart hostname iscsi-iname
84 inst_multiple
-o iscsiuio
85 inst_hook cmdline
90 "$moddir/parse-iscsiroot.sh"
86 inst_hook cleanup
90 "$moddir/cleanup-iscsi.sh"
87 inst
"$moddir/iscsiroot.sh" "/sbin/iscsiroot"
88 if ! dracut_module_included
"systemd"; then
89 inst
"$moddir/mount-lun.sh" "/bin/mount-lun.sh"