bootfloppy 903 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/rc
  2. rfork e
  3. echo
  4. echo 'Insert a disk other than your installation boot disk'
  5. echo 'into your floppy drive; it will be erased to create'
  6. echo 'the boot floppy.'
  7. echo
  8. echo -n 'Press enter when ready.'
  9. read >/dev/null >[2]/dev/null
  10. if(~ $#adisk 1)
  11. ; # do nothing
  12. if not if(~ $#bootfile 0)
  13. adisk=/dev/fd0disk
  14. if not {
  15. switch($bootfile) {
  16. case sd*
  17. adisk=`{echo $bootfile | sed 's#(sd..).*#/dev/\1/data#'}
  18. case fd*
  19. adisk=`{echo $bootfile | sed 's#(fd.).*#/dev/\1disk#'}
  20. case *
  21. echo 'unknown bootfile '^$bootfile^'; mail 9trouble@plan9.bell-labs.com'
  22. exit oops
  23. }
  24. }
  25. if(! ~ `{ls -l $adisk | awk '{print $6}'} 1474560){
  26. echo 'Will not format non-floppy disk '^$"adisk. >[1=2]
  27. exit 'bad adisk'
  28. }
  29. log Formatting boot floppy
  30. disk/format -b /386/pbs \
  31. -fd $adisk /n/newfs/386/9load /n/newfs/386/9pcdisk.gz \
  32. /tmp/plan9ini.bak
  33. x=$status
  34. if(~ $x ''){
  35. echo
  36. echo 'Done!'
  37. echo
  38. }
  39. exit $x