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
15 [[ $debug ]] && set -x
19 _dev
=$
(get_maj_min
$1)
21 [[ -L /sys
/dev
/block
/$_dev ]] ||
return
22 cd "$(readlink -f /sys/dev/block/$_dev)"
23 until [[ -d sys ||
-d iscsi_session
]]; do
26 [[ -d iscsi_session
]]
29 [[ $hostonly ]] ||
[[ $mount_needs ]] && {
30 for_each_host_dev_fs is_iscsi ||
return 1
36 echo network rootfs-block
40 instmods iscsi_tcp iscsi_ibft crc32c bnx2i iscsi_boot_sysfs qla4xxx cxgb3i cxgb4i be2iscsi
41 iscsi_module_filter
() {
42 local _iscsifuncs
='iscsi_register_transport'
44 while read _f
; do case "$_f" in
45 *.ko
) [[ $
(< $_f) =~
$_iscsifuncs ]] && echo "$_f" ;;
46 *.ko.gz
) [[ $
(gzip -dc <$_f) =~
$_iscsifuncs ]] && echo "$_f" ;;
47 *.ko.xz
) [[ $
(xz
-dc <$_f) =~
$_iscsifuncs ]] && echo "$_f" ;;
51 { find_kernel_modules_by_path drivers
/scsi
; find_kernel_modules_by_path drivers
/s390
/scsi
; } \
52 | iscsi_module_filter | instmods
57 dracut_install
-o iscsiuio
61 inst_hook cmdline
90 "$moddir/parse-iscsiroot.sh"
62 inst_hook cleanup
90 "$moddir/cleanup-iscsi.sh"
63 inst
"$moddir/iscsiroot.sh" "/sbin/iscsiroot"
64 inst
"$moddir/mount-lun.sh" "/bin/mount-lun.sh"