home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / boot / i386 / root / etc / sysconfig / hardware / scripts / functions.pcmcia_socket < prev   
Text File  |  2006-11-29  |  1KB  |  45 lines

  1.  
  2. if [ -r /dev/shm/nopcmcia ] ; then
  3.     mesg "Won't initialize pcmcia_socket due to boot parameter" \
  4.          "`cat /dev/shm/nopcmcia`"
  5.     exit 0
  6. fi
  7.  
  8. test -r /etc/sysconfig/pcmcia && . /etc/sysconfig/pcmcia
  9.  
  10. MODALIAS=pcmcia
  11.  
  12. # Overwrite this function to avoid useless getcfg call.
  13. # This may be removed if we restrict getcfg calls or remove them completely.
  14. get_config_getcfg() {
  15.     get_config_fast
  16. }
  17.  
  18. get_pcmcia_socket_information() {
  19.     if [ -z "$SOCKET_NO" ] ; then
  20.         SOCKET_NO=${HWD_DEVICEPATH##*pcmcia_socket}
  21.     fi
  22. }
  23.  
  24. post_init_pcmcia_socket() {
  25.     info_mesg "Assinging ressources to socket '$SOCKET_NO'"
  26.     pcmcia-socket-startup $SOCKET_NO
  27.     DONE_FILE=$HWD_DEVICEPATH/available_resources_setup_done
  28.     if [ -f  $DONE_FILE ]; then
  29.         if [ -w $DONE_FILE ]; then
  30.             echo -n "42" > $DONE_FILE
  31.         fi;
  32.     fi;
  33.     if [ "$PCMCIA_COLDPLUG_REINSERT" == yes ] ; then
  34.         sleep 1
  35.         info_mesg "ejecting card in socket '$SOCKET_NO'"
  36.         echo 42 > $HWD_DEVICEPATH/card_eject
  37.         info_mesg "inserting card in socket '$SOCKET_NO'"
  38.         echo 42 > $HWD_DEVICEPATH/card_insert
  39.     fi
  40. }
  41.  
  42. show_pcmcia_socket_information() {
  43.     info_mesg "SOCKET_NO=$SOCKET_NO"
  44. }
  45.