Subversion Repositories planix.SVN

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#!/bin/rc
2
 
3
rfork e
4
 
5
echo
6
echo 'Insert a disk other than your installation boot disk'
7
echo 'into your floppy drive; it will be erased to create'
8
echo 'the boot floppy.'
9
echo
10
echo -n 'Press enter when ready.'
11
read >/dev/null >[2]/dev/null
12
 
13
if(~ $#adisk 1)
14
	;	# do nothing
15
if not if(~ $#bootfile 0)
16
	adisk=/dev/fd0disk
17
if 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
 
29
if(! ~ `{ls -l $adisk | awk '{print $6}'} 1474560){
30
	echo 'Will not format non-floppy disk '^$"adisk. >[1=2]
31
	exit 'bad adisk'
32
}
33
 
34
log Formatting boot floppy
35
if (test -e  /n/newfs/386/9loadnousb)
36
	bind /n/newfs/386/9loadnousb /n/newfs/386/9load	# cater to old bioses
37
disk/format -b /386/pbs \
38
	-fd $adisk /n/newfs/386/9load /n/newfs/386/9pcdisk.gz \
39
	/tmp/plan9ini.bak
40
x=$status
41
 
42
if(~ $x ''){
43
	echo 
44
	echo 'Done!'
45
	echo
46
}
47
exit $x