summaryrefslogtreecommitdiff
path: root/source/a/pcmciautils/config/rc.pcmcia
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/pcmciautils/config/rc.pcmcia')
-rwxr-xr-xsource/a/pcmciautils/config/rc.pcmcia65
1 files changed, 65 insertions, 0 deletions
diff --git a/source/a/pcmciautils/config/rc.pcmcia b/source/a/pcmciautils/config/rc.pcmcia
new file mode 100755
index 00000000..1f21be84
--- /dev/null
+++ b/source/a/pcmciautils/config/rc.pcmcia
@@ -0,0 +1,65 @@
+#!/bin/sh
+#
+# rc.pcmcia: Script to initialize PCMCIA subsystem.
+# Based in an example found in cardmgr-to-pcmciautils.txt
+# and in Slackware rc.pcmcia found in pcmcia-cs package.
+#
+
+# Set this to the driver to use, one of:
+# probe, yenta_socket, i82365, i82092, pd6729, tcic, etc.
+#
+DRIVER=probe
+DRIVER_OPTS=
+
+case "$1" in
+ start)
+ echo "Starting PCMCIA services:"
+ fgrep -q pcmcia /proc/devices
+ if [ $? -ne 0 ] ; then
+ if [ "$DRIVER" = "probe" ]; then
+ echo " <Probing for PCIC: edit /etc/rc.d/rc.pcmcia>"
+ for DRV in yenta_socket i82365 tcic ; do
+ /sbin/modprobe $DRV > /dev/null 2>&1
+ /sbin/pccardctl status | grep -q Socket && break
+ /sbin/modprobe -r $DRV > /dev/null 2>&1
+ done
+ else
+ echo " <Loading PCIC: $DRIVER>"
+ /sbin/modprobe $DRIVER $DRIVER_OPTS > /dev/null 2>&1
+ fi
+ /sbin/modprobe pcmcia > /dev/null 2>&1 # just in case it's not auto-loaded
+ else
+ echo " <PCIC already loaded>"
+ fi
+ ;;
+
+ stop)
+ echo -n "Shutting down PCMCIA services: "
+ echo -n "cards "
+ /sbin/pccardctl eject
+ MODULES=`/sbin/lsmod | grep "pcmcia " | awk '{print $4}' | tr , ' '`
+ for i in $MODULES ; do
+ echo -n "$i "
+ /sbin/modprobe -r $i > /dev/null 2>&1
+ done
+ echo -n "pcmcia "
+ /sbin/modprobe -r pcmcia > /dev/null 2>&1
+ if [ "$DRIVER" = "probe" ]; then
+ for DRV in yenta_socket i82365 tcic ; do
+ grep -qw $DRV /proc/modules && modprobe -r $DRV && \
+ echo -n "$DRV " && break
+ done
+ else
+ /sbin/modprobe -r $DRIVER > /dev/null 2>&1
+ fi
+ echo -n "rsrc_nonstatic "
+ /sbin/modprobe -r rsrc_nonstatic > /dev/null 2>&1
+ echo "pcmcia_core"
+ /sbin/modprobe -r pcmcia_core > /dev/null 2>&1
+ ;;
+
+ restart)
+ $0 stop
+ $0 start
+ ;;
+esac