diff options
author | Chad Huneycutt <chadh@gentoo.org> | 2002-12-17 17:10:32 +0000 |
---|---|---|
committer | Chad Huneycutt <chadh@gentoo.org> | 2002-12-17 17:10:32 +0000 |
commit | c839d5a0471992c34138f6447f51016fe7fe47e4 (patch) | |
tree | 5689b2eebf152fcdc5b457725566d9603c434372 /sys-apps/pcmcia-cs | |
parent | removed baekmuk-fonts-2.0.ebuild (diff) | |
download | gentoo-2-c839d5a0471992c34138f6447f51016fe7fe47e4.tar.gz gentoo-2-c839d5a0471992c34138f6447f51016fe7fe47e4.tar.bz2 gentoo-2-c839d5a0471992c34138f6447f51016fe7fe47e4.zip |
Oops! Forgot to add the new init file
Diffstat (limited to 'sys-apps/pcmcia-cs')
-rw-r--r-- | sys-apps/pcmcia-cs/files/pcmcia.rc | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/sys-apps/pcmcia-cs/files/pcmcia.rc b/sys-apps/pcmcia-cs/files/pcmcia.rc new file mode 100644 index 000000000000..1baf8d3d2edb --- /dev/null +++ b/sys-apps/pcmcia-cs/files/pcmcia.rc @@ -0,0 +1,69 @@ +#!/sbin/runscript +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/pcmcia-cs/files/pcmcia.rc,v 1.1 2002/12/17 17:10:32 chadh Exp $ + +RUN=/var/run +SC=${RUN}/pcmcia-scheme + +cleanup() +{ + while read SN CLASS MOD INST DEV EXTRA ; do + if [ "x${SN}" != "xSocket" ] ; then + /etc/pcmcia/${CLASS} stop ${DEV} 2> /dev/null + fi + done +} + +start() { + local code + # Scheme is set for the /etc/pcmcia/shared script + if [ -n "${SCHEME}" ] ; then umask 022 ; echo $SCHEME > ${SC} + else umask 022 ; touch ${SC} + fi + + # clean up any old interfaces + if [ -r ${RUN}/stab ] ; then + cat ${RUN}/stab | cleanup + fi + # if /var/lib/pcmcia exists (and sometimes it gets created accidentally + # if you run pcmcia-cs apps w/out the proper flags), then it will really + # confuse the process + if [ -d /var/lib/pcmcia ] ; then + rm -rf /var/lib/pcmcia + fi + + if [ -z `fgrep "ds " /proc/modules` ] ; then + /sbin/modprobe pcmcia_core $CORE_OPTS 2> /dev/null + /sbin/modprobe $PCIC $PCIC_OPTS 2> /dev/null + /sbin/modprobe ds + fi + + ebegin "Starting pcmcia" + start-stop-daemon --start --quiet --exec /sbin/cardmgr -- -s ${RUN}/stab ${CARDMGR_OPTS} + code=$? + if [ $code -gt 0 ] ; then + einfo "cardmgr failed to start. Make sure that you have PCMCIA" + einfo "modules built or support compiled into the kernel" + fi + eend $code +} + +stop() { + local code + + if [ -w ${SC} ] ; then rm -f ${SC} ; fi + + ebegin "Stopping pcmcia" + start-stop-daemon --stop --quiet --pidfile /var/run/cardmgr.pid --retry 5 + code=$? + + if [ -z `fgrep -q "ds " /proc/modules` ]; then + /sbin/rmmod ds 2> /dev/null + /sbin/rmmod $PCIC 2> /dev/null + /sbin/rmmod pcmcia_core 2> /dev/null + fi + + eend $code +} + |