home *** CD-ROM | disk | FTP | other *** search
/ Caldera Network Desktop 1.0 / caldera-network-desktop-1.0.bin / images / ramdisk2-beta.img / etc / pcmcia / pcmem < prev    next >
Text File  |  1995-08-02  |  984b  |  35 lines

  1. #!/bin/sh
  2. #
  3. # pcmem.sample $Revision: 1.1 $ $Date: 1995/05/25 04:30:06 $ (David Hinds)
  4. #
  5. # Initialize or shutdown a PCMCIA memory device
  6. #
  7. # The first argument should be either 'start' or 'stop'.  The second
  8. # argument is the base name for the device.  When starting a device,
  9. # there should be two additional arguments, the major and minor device
  10. # numbers.
  11. #
  12. # Three devices will be created:
  13. #
  14. #    /dev/{name}a    - character device, attribute memory
  15. #    /dev/{name}b    - block device, common memory
  16. #    /dev/{name}c    - character device, common memory
  17.  
  18. action=$1
  19. name=$2
  20.  
  21. case "${action:?}" in
  22. 'start')
  23.     major=$3
  24.     minor=$4
  25.     rm -f /dev/${name:?}a /dev/${name:?}b /dev/${name:?}c
  26.     mknod /dev/${name:?}c c ${major:?} ${minor:?}
  27.     mknod /dev/${name:?}a c ${major:?} `expr ${minor:?} + 1`
  28.     mknod /dev/${name:?}b b ${major:?} ${minor:?}
  29.     ;;
  30. 'stop')
  31.     fuser -k /dev/${name:?}a /dev/${name:?}b /dev/${name:?}c
  32.     rm -f /dev/${name:?}a /dev/${name:?}b /dev/${name:?}c
  33.     ;;
  34. esac
  35.