setup.disk 579 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/rc
  2. rfork e
  3. if(! ~ $#* 2) {
  4. echo 'usage: setup.disk /dev/sdC0 plan9.ini' >[1=2]
  5. exit usage
  6. }
  7. disk=$1
  8. ini=$2
  9. if(! test -d $disk) {
  10. echo disk directory not found >[1=2]
  11. exit fat
  12. }
  13. if(! test -f $ini) {
  14. echo plan9.ini not found >[1=2]
  15. exit ini
  16. }
  17. disk/fdisk -wa $disk/data
  18. if(! test -f $disk/plan9) {
  19. echo could not create plan 9 partition >[1=2]
  20. exit noplan9
  21. }
  22. disk/prep -cwa $disk/plan9
  23. if(! test -f $disk/fs) {
  24. echo did not create fs partition '(weird)' >[1=2]
  25. exit nofs
  26. }
  27. disk/kfs -rb4096 -f $disk/fs
  28. pc/setup.9fat $disk/9fat $ini
  29. pc/update
  30. pc/personalize