slackware-current/source/a/pcmciautils/config/rc.pcmcia
Patrick J Volkerding 5a12e7c134 Slackware 13.0
Wed Aug 26 10:00:38 CDT 2009
Slackware 13.0 x86_64 is released as stable!  Thanks to everyone who
helped make this release possible -- see the RELEASE_NOTES for the
credits.  The ISOs are off to the replicator.  This time it will be a
6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD.
We're taking pre-orders now at store.slackware.com.  Please consider
picking up a copy to help support the project.  Once again, thanks to
the entire Slackware community for all the help testing and fixing
things and offering suggestions during this development cycle.
As always, have fun and enjoy!  -P.
2018-05-31 22:41:17 +02:00

65 lines
1.7 KiB
Bash
Executable file

#!/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