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