diff options
| author | cinap_lenrek <cinap_lenrek@localhost> | 2011-04-12 15:53:55 +0000 |
|---|---|---|
| committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-04-12 15:53:55 +0000 |
| commit | 67e93d6a0a4f15192638e131413b9d64c4269c76 (patch) | |
| tree | 88fd1d17c4be283683a96ced44159e3ce6b6f2f7 /rc/bin/inst/bootfloppy | |
| parent | 7208d528bd42f981f2535403f72e4c0d7d8df643 (diff) | |
| download | plan9front-67e93d6a0a4f15192638e131413b9d64c4269c76.tar.xz | |
updating cwfs and moving installer in /rc/bin
Diffstat (limited to 'rc/bin/inst/bootfloppy')
| -rwxr-xr-x | rc/bin/inst/bootfloppy | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/rc/bin/inst/bootfloppy b/rc/bin/inst/bootfloppy new file mode 100755 index 000000000..c9aebbc51 --- /dev/null +++ b/rc/bin/inst/bootfloppy @@ -0,0 +1,47 @@ +#!/bin/rc + +rfork e + +echo +echo 'Insert a disk other than your installation boot disk' +echo 'into your floppy drive; it will be erased to create' +echo 'the boot floppy.' +echo +echo -n 'Press enter when ready.' +read >/dev/null >[2]/dev/null + +if(~ $#adisk 1) + ; # do nothing +if not if(~ $#bootfile 0) + adisk=/dev/fd0disk +if not { + switch($bootfile) { + case sd* + adisk=`{echo $bootfile | sed 's#(sd..).*#/dev/\1/data#'} + case fd* + adisk=`{echo $bootfile | sed 's#(fd.).*#/dev/\1disk#'} + case * + echo 'unknown bootfile '^$bootfile^'; mail 9trouble@plan9.bell-labs.com' + exit oops + } +} + +if(! ~ `{ls -l $adisk | awk '{print $6}'} 1474560){ + echo 'Will not format non-floppy disk '^$"adisk. >[1=2] + exit 'bad adisk' +} + +log Formatting boot floppy +if (test -e /n/newfs/386/9loadnousb) + bind /n/newfs/386/9loadnousb /n/newfs/386/9load # cater to old bioses +disk/format -b /386/pbs \ + -fd $adisk /n/newfs/386/9load /n/newfs/386/9pcdisk.gz \ + /tmp/plan9ini.bak +x=$status + +if(~ $x ''){ + echo + echo 'Done!' + echo +} +exit $x |
