summaryrefslogtreecommitdiffstats
path: root/source/installer/sources/initrd/etc/rc.d/rc.ieee1394
blob: 2701229dca5a802bd81a577e381c3e95dd54d596 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
# rc.ieee1394:  search for IEEE1394 (firewire) devices needed for installation.

# This is a function to unload the IEEE1394 (firewire) modules:
ieee1394_stop() {
  modprobe -r sbp2 ohci1394
  modprobe -r ieee1394
}

# This is a function to attempt to enable a IEEE1394 storage device.
# If this causes problems for you, use "noieee1394" as a kernel
# command line option at boot time.
ieee1394_start() {
  # If noieee1394 was given at boot, skip.
  if ! cat /proc/cmdline | grep noieee1394 1> /dev/null 2> /dev/null ; then
    # If there aren't even any modules for this kernel, skip.
    if [ -d /lib/modules/`uname -r` ]; then
      # If ieee1394 is already loaded, skip.
      if ! grep ieee1394 /proc/modules 1> /dev/null 2> /dev/null ; then
        echo "Probing for IEEE1394 (Firewire) controllers."
        echo "(to skip, give a 'noieee1394' kernel option at boot)"
        #sleep 5
        modprobe -q ieee1394 >/dev/null 2>&1
        # Try to load hub module:
        modprobe -q ohci1394 >/dev/null 2>&1
        # Attempt to load storage support.
        modprobe -q sbp2 >/dev/null 2>&1
      fi
    fi
  fi
}

case "$1" in
'start')
  ieee1394_start
  ;;
'stop')
  ieee1394_stop
  ;;
'restart')
  ieee1394_stop
  sleep 5
  ieee1394_start
  ;;
*)
  echo "usage $0 start|stop|restart"
esac