ftl 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/sh
  2. #
  3. # ftl 1.26 2001/01/01 21:13:39 (David Hinds)
  4. #
  5. # Initialize or shutdown an FTL memory device
  6. #
  7. # The first argument should be the action to be performed, and the
  8. # second, the base name for the device.
  9. #
  10. # The script passes an extended device address to 'ftl.opts' in the
  11. # ADDRESS variable, to retrieve device-specific configuration options.
  12. # The address format is "scheme,socket,instance" where "scheme" is the
  13. # current PCMCIA configuration scheme, "socket" is the socket number,
  14. # and "instance" is used to number multiple FTL regions on a single
  15. # card.
  16. #
  17. if [ -r ./shared ] ; then . ./shared ; else . /etc/pcmcia/shared ; fi
  18. # Get device attributes
  19. get_info $DEVICE
  20. # Load site-specific settings
  21. ADDRESS="$SCHEME,$SOCKET,$INSTANCE"
  22. . $0.opts
  23. case "$ACTION" in
  24. 'start')
  25. [ -n "$VERBOSE" -a -n "$INFO" ] && echo "$INFO"
  26. rm -f /dev/$DEVICE
  27. log mknod /dev/$DEVICE b $MAJOR $MINOR
  28. log mknod /dev/${DEVICE}p1 b $MAJOR `expr $MINOR + 1`
  29. log mknod /dev/${DEVICE}p2 b $MAJOR `expr $MINOR + 2`
  30. log mknod /dev/${DEVICE}p3 b $MAJOR `expr $MINOR + 3`
  31. log mknod /dev/${DEVICE}p4 b $MAJOR `expr $MINOR + 4`
  32. add_parts /dev/$DEVICE "$PARTS" || exit 1
  33. ;;
  34. 'check')
  35. is_true $NO_CHECK && exit 0
  36. do_fuser -s -m /dev/${DEVICE}* && exit 1
  37. ;;
  38. 'stop')
  39. rm_parts /dev/$DEVICE "$PARTS"
  40. rm -f /dev/$DEVICE /dev/${DEVICE}p[1-4]
  41. ;;
  42. 'cksum')
  43. chk_parts "$NEW_SCHEME,$SOCKET,$INSTANCE" || exit 1
  44. ;;
  45. 'suspend'|'resume')
  46. ;;
  47. *)
  48. usage
  49. ;;
  50. esac
  51. exit 0