]>
Commit | Line | Data |
---|---|---|
35043b20 ER |
1 | #!/bin/sh |
2 | # | |
3 | # geninitrd mod: scsi | |
4 | ||
5 | # it should be safe to remove scsi_mod from here, but I'm not sure... | |
6 | PRESCSIMODS="-scsi_mod unknown -sd_mod" | |
7 | ||
8 | # ??? | |
9 | ide_only_root=${ide_only_root:-no} | |
10 | ||
11 | # allow forcing loading IDE modules, likely from sysconfig/geninitrd | |
12 | ADDIDE=${ADDIDE:-no} | |
13 | ||
14 | # return true if node is scsi device | |
15 | # @param string $node device node to be examined | |
16 | # @access public | |
17 | is_scsi() { | |
18 | local node="$1" | |
19 | if [ ! -e "$node" ]; then | |
20 | warn "is_scsi(): node $node doesn't exist!" | |
21 | return 1 | |
22 | fi | |
23 | ||
24 | # TODO: more sophisticated check, not just pathname check | |
25 | if is_yes "$(echo "$node" | awk '/^\/dev\/(sd|scsi)/ { print "yes"; }')"; then | |
26 | return 0 | |
27 | fi | |
28 | ||
29 | return 1 | |
30 | } | |
31 | ||
32 | # find modules for $devpath | |
33 | # @param $devpath device to be examined | |
34 | # @access public | |
35 | find_modules_scsi() { | |
36 | local devpath=$1 | |
37 | ||
38 | local n | |
39 | for n in $PRESCSIMODS; do | |
40 | if [ "X$n" = "Xunknown" ]; then | |
41 | debug "Finding SCSI modules using scsi_hostadapter" | |
42 | local mod scsimodules=$(modprobe_conf | awk '/scsi_hostadapter/ && ! /^[\t ]*#/ { print $3; }') | |
43 | for mod in $scsimodules; do | |
44 | # for now allow scsi modules to come from anywhere. There are some | |
45 | # RAID controllers with drivers in block | |
46 | find_module "$mod" | |
47 | done | |
48 | else | |
49 | find_module "$n" | |
50 | fi | |
51 | done | |
52 | find_module "-scsi_wait_scan" | |
53 | } | |
54 | ||
55 | ||
56 | # generate initrd fragment for ide device init | |
57 | # @access public | |
58 | initrd_gen_scsi() { | |
59 | # nothing to do here | |
60 | return 0 | |
61 | } |