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