]> git.ipfire.org Git - thirdparty/dracut.git/blame - modules.d/95iscsi/module-info.sh
replaced check,install,installkernel with module-info.sh
[thirdparty/dracut.git] / modules.d / 95iscsi / module-info.sh
CommitLineData
95d2dabc
HH
1#!/bin/bash
2# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3# ex: ts=8 sw=4 sts=4 et filetype=sh
4
5check() {
6 # If our prerequisites are not met, fail anyways.
7 type -P iscsistart hostname iscsi-iname >/dev/null || return 1
8
9 # If hostonly was requested, fail the check if we are not actually
10 # booting from root.
11
12 . $dracutfunctions
13
14 [[ $debug ]] && set -x
15
16 is_iscsi() (
17 [[ -L /sys/dev/block/$1 ]] || return
18 cd "$(readlink -f /sys/dev/block/$1)"
19 until [[ -d sys || -d iscsi_session ]]; do
20 cd ..
21 done
22 [[ -d iscsi_session ]]
23 )
24
25 [[ $hostonly ]] && {
26 rootdev=$(find_root_block_device)
27 if [[ $rootdev ]]; then
28 # root lives on a block device, so we can be more precise about
29 # hostonly checking
30 check_block_and_slaves is_iscsi "$rootdev" || return 1
31 else
32 return 1
33 fi
34 }
35 return 0
36}
37
38depends() {
39 echo network rootfs-block
40}
41
42installkernel() {
43 instmods iscsi_tcp crc32c iscsi_ibft
44}
45
46install() {
47 dracut_install umount
48 inst iscsistart
49 inst hostname
50 inst iscsi-iname
51 inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh"
52 inst "$moddir/iscsiroot" "/sbin/iscsiroot"
53 inst "$moddir/mount-lun.sh" "/bin/mount-lun.sh"
54}