setup.9fat 546 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/rc
  2. rfork e
  3. if(! ~ $#* 2) {
  4. echo 'usage: setup.9fat /dev/sdC0/9fat plan9.ini' >[1=2]
  5. exit usage
  6. }
  7. . /rc/bin/pc/defs
  8. fat=$1
  9. ini=$2
  10. if(! test -f $fat) {
  11. echo fat partition not found >[1=2]
  12. exit fat
  13. }
  14. if(! test -f $ini) {
  15. echo plan9.ini not found >[1=2]
  16. exit ini
  17. }
  18. if(pc/isfat $fat) {
  19. echo 'Already a FAT partition in '^$fat^'; ream it?'
  20. prompt 'ream 9fat' y n
  21. switch($rd) {
  22. case n
  23. exit
  24. }
  25. }
  26. disk/format -r 2 -d -b /386/pbs $fat /386/9load /386/9pcdisk
  27. mount -c /srv/dos /n/9fat $fat
  28. cp $ini /n/9fat/plan9.ini
  29. unmount /n/9fat