aoe-mkshelf.in 587 B

123456789101112131415161718192021222324252627282930
  1. #! /bin/sh
  2. zero=`basename $0`
  3. if test "$#" != "2"; then
  4. echo "Usage: $zero {dir} {shelfaddress}" 1>&2
  5. echo " n_partitions=16 $zero {dir} {shelfaddress}" 1>&2
  6. exit 1
  7. fi
  8. n_partitions=${n_partitions:-16}
  9. dir=$1
  10. shelf=$2
  11. nslots=@npershelf@
  12. maxslot=$((nslots - 1))
  13. MAJOR=152
  14. set -e
  15. minor=$((nslots * shelf * n_partitions))
  16. endp=$((n_partitions - 1))
  17. for slot in `seq 0 $maxslot`; do
  18. for part in `seq 0 $endp`; do
  19. name=e$shelf.$slot
  20. test "$part" != "0" && name=${name}p$part
  21. rm -f $dir/$name
  22. mknod -m 0660 $dir/$name b $MAJOR $minor
  23. minor=`expr $minor + 1`
  24. done
  25. done